@feedmepos/mf-inventory-portal 1.7.0-dev.0 → 1.7.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-DaAOxELy.js → App-BJilVJ6h.js} +6 -6
- package/dist/{ApprovalView-CxJ79rW7.js → ApprovalView-BFIyc3SS.js} +15 -15
- package/dist/{BindingsDialog-CZhCQoLO.js → BindingsDialog-C1HM5tIJ.js} +3 -3
- package/dist/{BindingsPicker-BWRMxgYR.js → BindingsPicker-2mJvKG0k.js} +6 -6
- package/dist/{BindingsTable-fvBa1dHb.js → BindingsTable-D3au8Csm.js} +5 -5
- package/dist/{BulkReceiveRequestView-Bq7_r-qY.js → BulkReceiveRequestView-DGCRmzzH.js} +36 -36
- package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-CKM48Ktp.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-D937HMIP.js} +9 -9
- package/dist/{ClosingDraftView-DdMr571D.js → ClosingDraftView-ex1eBo9N.js} +31 -31
- package/dist/{ClosingHistoryView-BIpPvvzQ.js → ClosingHistoryView-v2bOWHYJ.js} +8 -8
- package/dist/{ClosingTemplateView-IlV4hRZ7.js → ClosingTemplateView-CHLcLd_s.js} +18 -18
- package/dist/{DefaultView-TKUUG9_5.js → DefaultView-DlF-ZqYm.js} +4 -4
- package/dist/{DeliveryOrderPrintPreview-DTjC7-Op.js → DeliveryOrderPrintPreview-DsEYc7I7.js} +19 -19
- package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-DeFiuGtR.js → EmailDialog.vue_vue_type_script_setup_true_lang-3yiwiUFW.js} +9313 -9301
- package/dist/{FmAdminBadge-DjnBAgyv.js → FmAdminBadge-DlplQOHb.js} +6 -6
- package/dist/{FmConfirmationButton.vue_vue_type_script_setup_true_lang-DLrMEGFR.js → FmConfirmationButton.vue_vue_type_script_setup_true_lang-Vg8U7WMZ.js} +5 -5
- package/dist/{FmCustomAttribute.vue_vue_type_script_setup_true_lang-D-IWRjRD.js → FmCustomAttribute.vue_vue_type_script_setup_true_lang-CG1m-B2p.js} +6 -6
- package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-NtqJm53P.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-D6KJIhNi.js} +3 -3
- package/dist/{FmDroppableField-J0xUsOTV.js → FmDroppableField-J0tG_U3w.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CzHFzHXg.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DVPdMDAf.js} +3 -3
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CiMEAtPb.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DmcdM6Fz.js} +6 -6
- package/dist/{FmMultiselectDialog-D_4f9sXH.js → FmMultiselectDialog-BdWXuvmR.js} +1 -1
- package/dist/{FmMultiselectDialog-BdXOoS6z.js → FmMultiselectDialog-igkyqMtb.js} +4 -4
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-D_MOm5kW.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BKZHxVbh.js} +9 -9
- package/dist/{ImportView-BnL6y68X.js → ImportView-BuWkEOOe.js} +11 -11
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-g-g6qaNU.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DVRoTZJg.js} +5 -5
- package/dist/{IngredientGroupView-Du0iICme.js → IngredientGroupView-Cuy1-Poq.js} +9 -9
- package/dist/{IngredientsView-m2Rtn_F_.js → IngredientsView-Brp6bESK.js} +26 -26
- package/dist/{IntegrationExplorerView-J5BtpWN_.js → IntegrationExplorerView-_hzmZJ8r.js} +3897 -3898
- package/dist/{IntegrationView-BMQj8wg-.js → IntegrationView-CNg9vmQy.js} +18 -18
- package/dist/{InventoryBindingForm-D_KFXokV.js → InventoryBindingForm-C0idDplf.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-B7GjOoZh.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-Duka71_1.js} +6 -6
- package/dist/{InventoryBindingSummary-9TWMG5bm.js → InventoryBindingSummary-UeTZqaed.js} +3 -3
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DYXtIoll.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CuPeixvo.js} +3 -3
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CGJ_uWzF.js → PremiumBadge.vue_vue_type_script_setup_true_lang-B2p6aGk3.js} +3 -3
- package/dist/{PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js → PreviewBadge.vue_vue_type_script_setup_true_lang-DX2MJqL4.js} +2 -2
- package/dist/{ProductionView-CI07S6oW.js → ProductionView-DUBl0109.js} +9 -9
- package/dist/{PublishView-CWMdUnaY.js → PublishView-DCMY9XyK.js} +7 -7
- package/dist/{PurchaseOrderPrintPreview-B5XJcf8G.js → PurchaseOrderPrintPreview-CXGmmtS1.js} +17 -17
- package/dist/{ReceiveRequestView-st3jdG9W.js → ReceiveRequestView-iHlIjUjd.js} +19 -19
- package/dist/{RecipeView-D9ZVbmtm.js → RecipeView-fjgD8jQU.js} +23 -23
- package/dist/{SettingsView-CUS0aMbf.js → SettingsView-CL4-N_xx.js} +9 -9
- package/dist/{SingleColumnLayout.vue_vue_type_script_setup_true_lang-DGlWE5I8.js → SingleColumnLayout.vue_vue_type_script_setup_true_lang-DwrLsWX_.js} +2 -2
- package/dist/{StockView-Co4DOixF.js → StockView-gIhHMfMp.js} +27 -27
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Dt6XECIc.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-1ZKwSPHJ.js} +8 -8
- package/dist/{SupplierView-DXw6V-uS.js → SupplierView-KxEVuBPZ.js} +201 -205
- package/dist/{SurchargeView-C-Bg7UsR.js → SurchargeView-Cd7pbFt9.js} +11 -11
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-D6_M-pbk.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-B-OuEWRl.js} +4 -4
- package/dist/{TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js → TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js} +7 -7
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-D7NrX7HR.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-B4-8JOtV.js} +4 -4
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang--gKHVU0B.js +4607 -0
- package/dist/{TransferTemplateView-CP7ia82t.js → TransferTemplateView-DfJ4A3hN.js} +24 -24
- package/dist/{UnitCostHistoryView-xe5q6105.js → UnitCostHistoryView-43d2wfCn.js} +8 -8
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-_Eax2wkO.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-Du7-c6nt.js} +9 -9
- package/dist/{UnitView-1e6MQ-Vu.js → UnitView-BF33MXY_.js} +11 -11
- package/dist/{WarehouseView-DXB6Ygwb.js → WarehouseView-CDwyNo0S.js} +9 -9
- package/dist/{WastageTemplateView-CWGNtaZJ.js → WastageTemplateView-CMNT3MWM.js} +18 -18
- package/dist/{app-DXqwG4b3.js → app-BB7awVIO.js} +6920 -6786
- package/dist/{app-DiX-EfV6.js → app-C39bYJmq.js} +283 -283
- package/dist/app.js +1 -1
- package/dist/{closing-template-CCY6fg4v.js → closing-template-BjZWpNvD.js} +1 -1
- package/dist/{date2-BWfUJajP.js → date2-CEoGS9UZ.js} +1 -1
- package/dist/{dayjs.min-BqAOh_2L.js → dayjs.min-BVhDPC6x.js} +3 -3
- package/dist/{decimal-DmkQg2_J.js → decimal-DfbkUdYf.js} +2 -2
- package/dist/{defineDeepModel-D9smHIGg.js → defineDeepModel-DUgtruT9.js} +1 -1
- package/dist/{duplicate-template-Ebdaehmw.js → duplicate-template-CZJdIDFH.js} +1 -1
- package/dist/{feature-CD2ndvWN.js → feature-DBMkQQTb.js} +209 -206
- package/dist/{format-time-from-id-BtUh8UMO.js → format-time-from-id-DkU2ePWj.js} +1 -1
- package/dist/{format-unit-display-DLoTr1Hz.js → format-unit-display-BgQ-6M12.js} +24 -25
- package/dist/{import-export.helper-DYgr7Lvo.js → import-export.helper-BtWxCT6b.js} +6 -6
- package/dist/{index-CnuWmvgF.js → index-BAxOInk9.js} +1 -1
- package/dist/{index-z_cku6cd.js → index-BWQ8NB8N.js} +11 -15
- package/dist/{index-DmdqVO9N.js → index-Cloa6kzu.js} +3 -3
- package/dist/{inventory-core-dart.default-CEnDozvp.js → inventory-core-dart.default-DaFglZqk.js} +4049 -1741
- package/dist/{jszip.min-DKMvkIMM.js → jszip.min-Z2D3xvD5.js} +6 -6
- package/dist/{lz-string-BH6J5xxX.js → lz-string-DnBkKC8g.js} +33 -34
- package/dist/{menu-usage-module-D7cxkbEk.js → menu-usage-module-BdjYEk3s.js} +5 -5
- package/dist/{netsuite-kR1AFzO9.js → netsuite-D36Elkhq.js} +145 -145
- package/dist/{number-CRrcUtSg.js → number-BSIHQzsE.js} +3 -3
- package/dist/{predefined-templates-DbAHazbJ.js → predefined-templates-C-kyAGru.js} +4 -13
- package/dist/{purchase-order-template-DoEJEwqG.js → purchase-order-template-RYyeW23k.js} +1 -1
- package/dist/{recalculationUtils-hk2PE0q1.js → recalculationUtils-BjZoDT6Q.js} +1 -1
- package/dist/{rules-BPXgi6ZE.js → rules-DOAV9M_O.js} +2 -2
- package/dist/{stock-qAhTEKrH.js → stock-Benafybl.js} +1 -1
- package/dist/{stock-CJAv4fTu.js → stock-D0y6PGGf.js} +6 -6
- package/dist/stores/feature.d.ts +2 -0
- package/dist/{supplier-BvzIGpwW.js → supplier-DwlZEe13.js} +2 -2
- package/dist/{surcharge-BhLHJ3gK.js → surcharge-BtxMy1qW.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-B1s74P9M.js → uom-rules-B_xfjjcG.js} +1 -1
- package/dist/{use-ingredient-select-dialog-aAPbd5cS.js → use-ingredient-select-dialog-DyHBqVJY.js} +2 -2
- package/dist/{use-inventory-binding-dialog-CTjQzuV7.js → use-inventory-binding-dialog-B5yt-QSn.js} +2 -2
- package/dist/{use-template-enabled-locations-Brw80-tj.js → use-template-enabled-locations-iUZkCklL.js} +2 -2
- package/dist/{use-transfer-locations-BF7CKYpr.js → use-transfer-locations-ysstFC-U.js} +2 -2
- package/dist/{useHrmPermission-Csjov-cy.js → useHrmPermission-DGarJPGU.js} +1 -1
- package/dist/{useNavigationMenu-D8BERWXB.js → useNavigationMenu-59ksBzue.js} +4 -4
- package/dist/{useSseClient-Cen-cw5C.js → useSseClient-CfHMj54d.js} +1 -1
- package/dist/views/receive-request/components/price-adjustment/PriceAdjustmentEditForm.vue.d.ts +19 -0
- package/dist/views/receive-request/components/price-adjustment/PriceAdjustmentEditor.vue.d.ts +18 -0
- package/dist/views/receive-request/components/price-adjustment/PriceAdjustmentList.vue.d.ts +33 -0
- package/dist/views/receive-request/components/price-adjustment/use-price-adjustment-form-controller.d.ts +9 -0
- package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +10 -0
- package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +20 -0
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +120 -0
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +140 -0
- package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.d.ts +100 -0
- package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-table.d.ts +20 -0
- package/dist/vue-i18n-1OYA26Pg.js +2351 -0
- package/dist/{xlsx.util-DxgWqaTd.js → xlsx.util-J9LqmOSi.js} +3712 -3722
- package/package.json +2 -2
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-D9Fl_xAx.js +0 -4360
- package/dist/vue-i18n-lC_mdXT4.js +0 -2365
|
@@ -1,4360 +0,0 @@
|
|
|
1
|
-
import { defineComponent as qe, ref as Z, watch as Ge, nextTick as us, openBlock as l, createBlock as me, Teleport as ds, createElementBlock as h, withModifiers as ms, createElementVNode as e, normalizeClass as Ue, toDisplayString as x, createCommentVNode as I, unref as _, withDirectives as ps, vModelText as fs, toRaw as vs, shallowRef as Vt, onUnmounted as ys, triggerRef as bs, computed as j, readonly as hs, h as Y, reactive as gs, onMounted as Wt, resolveComponent as re, withCtx as ce, createVNode as L, Fragment as Ce, renderList as Ee, createTextVNode as ze, renderSlot as _s, isRef as Ss, resolveDynamicComponent as xs } from "vue";
|
|
2
|
-
import { f as ks, h as Os, r as ws, s as Qt } from "./predefined-templates-DbAHazbJ.js";
|
|
3
|
-
import { f as st, p as $s } from "./format-time-from-id-BtUh8UMO.js";
|
|
4
|
-
import { c as Lt } from "./component-kqxARxvM.js";
|
|
5
|
-
import { D as Pe, R as Se } from "./row-action.enum-DQ9bJ_uv.js";
|
|
6
|
-
import { G as Je, m as Cs, u as Me, U as V, _ as ut, V as ve, a as kt, $ as Ut, a0 as Ds, a1 as Rs, E as Ns, c as Yt, s as Ot, q as De, L as Mt, a2 as Jt, r as et, C as Fe, w as Ae, B as at } from "./app-DXqwG4b3.js";
|
|
7
|
-
import { h as wt, t as As, d as Ts, a as tt } from "./date2-BWfUJajP.js";
|
|
8
|
-
import { j as Ps, c as Is, a as xe, t as Ke, d as ot } from "./number-CRrcUtSg.js";
|
|
9
|
-
import { F as Ze, a as Fs, b as vt } from "./inventory-core-dart.default-CEnDozvp.js";
|
|
10
|
-
import { L as Es } from "./lz-string-BH6J5xxX.js";
|
|
11
|
-
import { useI18n as dt, useCoreStore as mt } from "@feedmepos/mf-common";
|
|
12
|
-
import { u as pt, a as $t, S as Le } from "./netsuite-kR1AFzO9.js";
|
|
13
|
-
import { useDialog as ft, useSnackbar as Qe, components as lt, FmButtonVariant as Ve, useProxiedModel as qs } from "@feedmepos/ui-library";
|
|
14
|
-
import { F as We } from "./FmAdminBadge-DjnBAgyv.js";
|
|
15
|
-
import { u as He } from "./feature-CD2ndvWN.js";
|
|
16
|
-
import { _ as Vs } from "./empty-placeholder-B0QU467o.js";
|
|
17
|
-
import { a as Ls, b as Us, f as it } from "./format-unit-display-DLoTr1Hz.js";
|
|
18
|
-
import { u as Ye, _ as Ms } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-D6_M-pbk.js";
|
|
19
|
-
import { _ as js, a as Bs, b as zs } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-D_MOm5kW.js";
|
|
20
|
-
import { u as Ks, R as jt } from "./usePromise-CbVUCxhj.js";
|
|
21
|
-
import { d as Hs } from "./index-DmdqVO9N.js";
|
|
22
|
-
import { i as Gs } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-NtqJm53P.js";
|
|
23
|
-
import { F as Bt } from "./form-mode.enum-BKiNVH6A.js";
|
|
24
|
-
import { u as Xt } from "./supplier-BvzIGpwW.js";
|
|
25
|
-
import { u as Ws } from "./surcharge-BhLHJ3gK.js";
|
|
26
|
-
import { F as Qs } from "./decimal-DmkQg2_J.js";
|
|
27
|
-
import { d as Zt } from "./defineDeepModel-D9smHIGg.js";
|
|
28
|
-
import { u as Ys } from "./vue-i18n-lC_mdXT4.js";
|
|
29
|
-
import { u as Js } from "./useHrmPermission-Csjov-cy.js";
|
|
30
|
-
function es(b, s) {
|
|
31
|
-
return s.reduce(
|
|
32
|
-
(c, v) => {
|
|
33
|
-
const d = v.received.find((p) => p.sku._id === b._id);
|
|
34
|
-
return d && (c = Ps(c, d.amount)), c;
|
|
35
|
-
},
|
|
36
|
-
Qs.toPrecision(Is(0), b.unit.precision)
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
function Xs(b) {
|
|
40
|
-
var ge, H, R, ne, P, C, K;
|
|
41
|
-
const { po: s, currentLocation: n, business: c, fulfilling: v, por: d } = b, p = n.doc.profile || {}, { name: t, address: o, regNo: u, legalName: k } = p, $ = {
|
|
42
|
-
name: t || n.name || "",
|
|
43
|
-
legalName: k || void 0,
|
|
44
|
-
registrationNumber: u || void 0,
|
|
45
|
-
line1: (o == null ? void 0 : o.line1) || "",
|
|
46
|
-
line2: (o == null ? void 0 : o.line2) || void 0,
|
|
47
|
-
postcode: (o == null ? void 0 : o.postcode) || "",
|
|
48
|
-
city: (o == null ? void 0 : o.city) || "",
|
|
49
|
-
state: (o == null ? void 0 : o.state) || "",
|
|
50
|
-
country: (o == null ? void 0 : o.country) || ""
|
|
51
|
-
}, D = {
|
|
52
|
-
name: s.supplier.name,
|
|
53
|
-
phoneNumber: s.supplier.phoneNumber || void 0,
|
|
54
|
-
registrationNumber: s.supplier.registrationNumber || void 0,
|
|
55
|
-
line1: ((ge = s.supplier.address) == null ? void 0 : ge.line1) || "",
|
|
56
|
-
line2: ((H = s.supplier.address) == null ? void 0 : H.line2) || void 0,
|
|
57
|
-
postcode: ((R = s.supplier.address) == null ? void 0 : R.postcode) || "",
|
|
58
|
-
city: ((ne = s.supplier.address) == null ? void 0 : ne.city) || "",
|
|
59
|
-
state: ((P = s.supplier.address) == null ? void 0 : P.state) || "",
|
|
60
|
-
country: ((C = s.supplier.address) == null ? void 0 : C.country) || ""
|
|
61
|
-
}, T = s.items.filter((N) => N.sku).map((N) => {
|
|
62
|
-
var pe;
|
|
63
|
-
const { sku: X, measurement: be } = N, ye = xe(
|
|
64
|
-
es(N.sku, s.deliveryOrder || []),
|
|
65
|
-
!1
|
|
66
|
-
);
|
|
67
|
-
return {
|
|
68
|
-
code: X.code,
|
|
69
|
-
description: X.name,
|
|
70
|
-
quantity: xe(N.quantity, !1),
|
|
71
|
-
unit: (be == null ? void 0 : be.abbrev) || ((pe = X.unit) == null ? void 0 : pe.abbrev) || "",
|
|
72
|
-
received: ye,
|
|
73
|
-
unitCost: N.totalCost ? `${N.totalCost.currency} ${Ze.toFormatString({
|
|
74
|
-
value: N.quantity.amount === 0 ? Ze.fromNumber(0) : Ze.divide([N.totalCost, N.quantity])
|
|
75
|
-
})}` : void 0,
|
|
76
|
-
cost: N.totalCost ? `${N.totalCost.currency} ${Ze.toFormatString({
|
|
77
|
-
value: N.totalCost
|
|
78
|
-
})}` : void 0
|
|
79
|
-
};
|
|
80
|
-
}), S = (s.deliveryOrder || []).map((N) => ({
|
|
81
|
-
createdAt: wt(new Date(N.createdAt)),
|
|
82
|
-
ref: N.deliveryOrderNumber,
|
|
83
|
-
remark: N.remark || "",
|
|
84
|
-
items: (N.received || []).map((X) => {
|
|
85
|
-
var be, ye, pe, fe, f;
|
|
86
|
-
return {
|
|
87
|
-
code: ((be = X.sku) == null ? void 0 : be.code) || "",
|
|
88
|
-
description: ((ye = X.sku) == null ? void 0 : ye.name) || "",
|
|
89
|
-
quantity: xe(X.amount),
|
|
90
|
-
unit: ((pe = X.measurement) == null ? void 0 : pe.abbrev) || ((f = (fe = X.sku) == null ? void 0 : fe.unit) == null ? void 0 : f.abbrev) || ""
|
|
91
|
-
};
|
|
92
|
-
})
|
|
93
|
-
}));
|
|
94
|
-
let F = Je.Enum.purchaseOrder, E = "Inventory Receive Note";
|
|
95
|
-
if (s.supplier.internal ? (E = "Inventory Transfer Note", F = Je.Enum.transferOrder) : (E = "Purchase Order", F = Je.Enum.purchaseOrder), (K = d == null ? void 0 : d.from) != null && K.dbName) {
|
|
96
|
-
const N = d.from.dbName;
|
|
97
|
-
n.dbName === N || (E = "Inventory Receive Note", F = Je.Enum.goodsReceivedNote);
|
|
98
|
-
}
|
|
99
|
-
const z = {
|
|
100
|
-
title: E,
|
|
101
|
-
businessName: c == null ? void 0 : c.name,
|
|
102
|
-
logo: c == null ? void 0 : c.thumbnail,
|
|
103
|
-
orderNumber: s.seqNumber.toString(),
|
|
104
|
-
createdAt: st(s._id),
|
|
105
|
-
ref: s.ref || "",
|
|
106
|
-
remark: s.remark || "",
|
|
107
|
-
buyer: $,
|
|
108
|
-
supplier: D,
|
|
109
|
-
items: T,
|
|
110
|
-
status: s.status,
|
|
111
|
-
deliveryOrders: S
|
|
112
|
-
}, ae = v && (s.deliveryFullfillment || []).length > 0;
|
|
113
|
-
return ae && (F = Je.Enum.deliveryOrder), { printData: z, templateType: F, isDeliveryPrint: ae };
|
|
114
|
-
}
|
|
115
|
-
function ts(b) {
|
|
116
|
-
var k;
|
|
117
|
-
const { printData: s, templateType: n } = Xs(b), v = ks().getTemplateByType(n), d = !!((k = v == null ? void 0 : v.blocks) != null && k.length), p = Os(n), t = d ? v.blocks : p.blocks, o = d ? v.name : p.name, u = !d;
|
|
118
|
-
try {
|
|
119
|
-
const $ = ws(t, s), D = $.match(/<style>([\s\S]*?)<\/style>/), T = D ? `<style>${D[1]}</style>` : "", S = $.replace(/<style>[\s\S]*?<\/style>/, "");
|
|
120
|
-
return {
|
|
121
|
-
html: `<!DOCTYPE html>
|
|
122
|
-
<html>
|
|
123
|
-
<head>
|
|
124
|
-
<meta charset="utf-8">
|
|
125
|
-
<title>Print Preview</title>
|
|
126
|
-
<style>
|
|
127
|
-
@page { margin: 0; }
|
|
128
|
-
@media print {
|
|
129
|
-
body { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
|
|
130
|
-
}
|
|
131
|
-
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
132
|
-
</style>
|
|
133
|
-
${T}
|
|
134
|
-
</head>
|
|
135
|
-
<body>${S}</body>
|
|
136
|
-
</html>`,
|
|
137
|
-
templateName: o,
|
|
138
|
-
isDefault: u
|
|
139
|
-
};
|
|
140
|
-
} catch {
|
|
141
|
-
return alert("Failed to render print template. Please try recreating the template."), null;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
const Zs = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-2xl overflow-hidden" }, er = { class: "flex justify-between items-center px-16 py-3 border-b border-gray-200 bg-gray-50" }, tr = { class: "flex items-center gap-2.5" }, sr = {
|
|
145
|
-
key: 1,
|
|
146
|
-
class: "text-xs text-gray-100 bg-gray-500 px-2 py-0.5 rounded font-medium"
|
|
147
|
-
}, rr = { class: "flex-1 overflow-auto bg-gray-100" }, Bl = /* @__PURE__ */ qe({
|
|
148
|
-
__name: "CustomPrintTemplatePreview",
|
|
149
|
-
props: {
|
|
150
|
-
html: {},
|
|
151
|
-
modelValue: { type: Boolean },
|
|
152
|
-
templateName: {},
|
|
153
|
-
isDefault: { type: Boolean }
|
|
154
|
-
},
|
|
155
|
-
emits: ["update:modelValue"],
|
|
156
|
-
setup(b, { emit: s }) {
|
|
157
|
-
const n = b, c = s, v = Z(null);
|
|
158
|
-
function d() {
|
|
159
|
-
c("update:modelValue", !1);
|
|
160
|
-
}
|
|
161
|
-
function p() {
|
|
162
|
-
var o, u;
|
|
163
|
-
try {
|
|
164
|
-
(u = (o = v.value) == null ? void 0 : o.contentWindow) == null || u.print();
|
|
165
|
-
} catch {
|
|
166
|
-
alert("Failed to trigger print.");
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
Ge(
|
|
170
|
-
() => n.modelValue,
|
|
171
|
-
async (o) => {
|
|
172
|
-
o && (await us(), t(), setTimeout(() => {
|
|
173
|
-
p();
|
|
174
|
-
}, 300));
|
|
175
|
-
}
|
|
176
|
-
);
|
|
177
|
-
function t() {
|
|
178
|
-
var $;
|
|
179
|
-
const o = v.value;
|
|
180
|
-
if (!o) return;
|
|
181
|
-
const u = Qt(n.html), k = o.contentDocument || (($ = o.contentWindow) == null ? void 0 : $.document);
|
|
182
|
-
k && (k.open(), k.write(`
|
|
183
|
-
<!DOCTYPE html>
|
|
184
|
-
<html>
|
|
185
|
-
<head>
|
|
186
|
-
<meta charset="utf-8">
|
|
187
|
-
<meta http-equiv="Content-Security-Policy" content="
|
|
188
|
-
default-src 'none';
|
|
189
|
-
style-src 'unsafe-inline';
|
|
190
|
-
img-src 'self' data: https:;
|
|
191
|
-
font-src 'self' data:;
|
|
192
|
-
script-src 'none';
|
|
193
|
-
object-src 'none';
|
|
194
|
-
frame-src 'none';
|
|
195
|
-
base-uri 'none';
|
|
196
|
-
form-action 'none';
|
|
197
|
-
">
|
|
198
|
-
<style>
|
|
199
|
-
* {
|
|
200
|
-
box-sizing: border-box;
|
|
201
|
-
}
|
|
202
|
-
body {
|
|
203
|
-
margin: 0;
|
|
204
|
-
padding: 40px 20px;
|
|
205
|
-
background: #f0f0f0;
|
|
206
|
-
min-height: 100vh;
|
|
207
|
-
}
|
|
208
|
-
.print-container {
|
|
209
|
-
max-width: 800px;
|
|
210
|
-
margin: 0 auto;
|
|
211
|
-
padding: 30px;
|
|
212
|
-
border: 1px solid #ddd;
|
|
213
|
-
box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
|
|
214
|
-
background: #ffffff;
|
|
215
|
-
font-size: 16px;
|
|
216
|
-
line-height: 1.5;
|
|
217
|
-
font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;
|
|
218
|
-
color: #555;
|
|
219
|
-
}
|
|
220
|
-
@media print {
|
|
221
|
-
body {
|
|
222
|
-
background: white !important;
|
|
223
|
-
padding: 0 !important;
|
|
224
|
-
margin: 0 !important;
|
|
225
|
-
}
|
|
226
|
-
.print-container {
|
|
227
|
-
border: none !important;
|
|
228
|
-
box-shadow: none !important;
|
|
229
|
-
padding: 0 !important;
|
|
230
|
-
margin: 0 !important;
|
|
231
|
-
max-width: none !important;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
</style>
|
|
235
|
-
</head>
|
|
236
|
-
<body>
|
|
237
|
-
<div class="print-container">
|
|
238
|
-
${u}
|
|
239
|
-
</div>
|
|
240
|
-
</body>
|
|
241
|
-
</html>
|
|
242
|
-
`), k.close());
|
|
243
|
-
}
|
|
244
|
-
return (o, u) => (l(), me(ds, { to: "body" }, [
|
|
245
|
-
o.modelValue ? (l(), h("div", {
|
|
246
|
-
key: 0,
|
|
247
|
-
class: "fixed inset-0 z-[9999] bg-black/50 flex justify-center items-center",
|
|
248
|
-
onClick: ms(d, ["self"])
|
|
249
|
-
}, [
|
|
250
|
-
e("div", Zs, [
|
|
251
|
-
e("div", er, [
|
|
252
|
-
e("div", tr, [
|
|
253
|
-
u[0] || (u[0] = e("span", { class: "text-base font-semibold text-gray-700" }, "Print Preview", -1)),
|
|
254
|
-
o.templateName ? (l(), h("span", {
|
|
255
|
-
key: 0,
|
|
256
|
-
class: Ue(["text-xs font-medium px-2 py-0.5 rounded", o.isDefault ? "text-gray-500 bg-gray-100" : "text-blue-700 bg-blue-50"])
|
|
257
|
-
}, x(o.templateName), 3)) : I("", !0),
|
|
258
|
-
o.isDefault ? (l(), h("span", sr, "Default")) : I("", !0)
|
|
259
|
-
]),
|
|
260
|
-
e("div", { class: "flex gap-2 items-center" }, [
|
|
261
|
-
e("button", {
|
|
262
|
-
class: "px-8 py-1.5 bg-blue-500 text-white border-none rounded text-sm cursor-pointer hover:bg-blue-700",
|
|
263
|
-
onClick: p
|
|
264
|
-
}, " Print "),
|
|
265
|
-
e("button", {
|
|
266
|
-
class: "px-2.5 py-1 bg-transparent border border-gray-300 rounded text-xl leading-none cursor-pointer text-gray-500 hover:bg-gray-100",
|
|
267
|
-
onClick: d
|
|
268
|
-
}, " × ")
|
|
269
|
-
])
|
|
270
|
-
]),
|
|
271
|
-
e("div", rr, [
|
|
272
|
-
e("iframe", {
|
|
273
|
-
ref_key: "iframeRef",
|
|
274
|
-
ref: v,
|
|
275
|
-
class: "w-full h-full border-none",
|
|
276
|
-
sandbox: "allow-same-origin allow-modals"
|
|
277
|
-
}, null, 512)
|
|
278
|
-
])
|
|
279
|
-
])
|
|
280
|
-
])) : I("", !0)
|
|
281
|
-
]));
|
|
282
|
-
}
|
|
283
|
-
}), or = Cs((b, s) => {
|
|
284
|
-
const n = Me();
|
|
285
|
-
return {
|
|
286
|
-
async getShipments({
|
|
287
|
-
start: c,
|
|
288
|
-
end: v
|
|
289
|
-
}) {
|
|
290
|
-
const d = n.currentLocationDBName, p = `${b.inventoryBackendUrl}/${d}/shipments`;
|
|
291
|
-
return await s.get(`${p}?start=${c}&end=${v}`);
|
|
292
|
-
},
|
|
293
|
-
async getShipmentsByIds(c) {
|
|
294
|
-
if (c.length === 0)
|
|
295
|
-
return [];
|
|
296
|
-
const v = n.currentLocationDBName, d = `${b.inventoryBackendUrl}/${v}/shipments/get`;
|
|
297
|
-
return await s.post(d, { shipmentIds: c });
|
|
298
|
-
}
|
|
299
|
-
};
|
|
300
|
-
}), ss = {
|
|
301
|
-
[V.enum.confirmDraft]: {
|
|
302
|
-
primaryActions: {
|
|
303
|
-
text: "Confirm draft",
|
|
304
|
-
close: !0
|
|
305
|
-
},
|
|
306
|
-
title: "Confirm draft?",
|
|
307
|
-
message: "Purchase order cannot be changed after confirm draft.",
|
|
308
|
-
successMessage: "Purchase order draft has been confirmed"
|
|
309
|
-
},
|
|
310
|
-
[V.enum.cancelDraft]: {
|
|
311
|
-
primaryActions: {
|
|
312
|
-
text: "Cancel draft",
|
|
313
|
-
close: !0,
|
|
314
|
-
variant: "destructive"
|
|
315
|
-
},
|
|
316
|
-
title: "Cancel draft?",
|
|
317
|
-
message: "Purchase order cannot be changed after cancelled draft.",
|
|
318
|
-
successMessage: "Purchase order draft has been cancelled"
|
|
319
|
-
},
|
|
320
|
-
[V.enum.approveDraft]: {
|
|
321
|
-
primaryActions: {
|
|
322
|
-
text: "Approve draft",
|
|
323
|
-
close: !0
|
|
324
|
-
},
|
|
325
|
-
title: "Approve draft?",
|
|
326
|
-
message: "Purchase order request will be accepted.",
|
|
327
|
-
successMessage: "Purchase order has been approved"
|
|
328
|
-
},
|
|
329
|
-
[V.enum.rejectDraft]: {
|
|
330
|
-
primaryActions: {
|
|
331
|
-
text: "Reject draft",
|
|
332
|
-
close: !0
|
|
333
|
-
},
|
|
334
|
-
title: "Reject draft?",
|
|
335
|
-
message: "Purchase order request will be rejected. You may provide an optional reason for rejection.",
|
|
336
|
-
successMessage: "Purchase order has been rejected"
|
|
337
|
-
},
|
|
338
|
-
[V.enum.submitRequest]: {
|
|
339
|
-
primaryActions: {
|
|
340
|
-
text: "Submit request",
|
|
341
|
-
close: !0
|
|
342
|
-
},
|
|
343
|
-
title: "Confirm draft?",
|
|
344
|
-
message: "Purchase order cannot be changed after confirm draft.",
|
|
345
|
-
successMessage: "Purchase order draft has been submitted"
|
|
346
|
-
},
|
|
347
|
-
[V.enum.completeReceive]: {
|
|
348
|
-
primaryActions: {
|
|
349
|
-
text: "Mark received",
|
|
350
|
-
close: !0
|
|
351
|
-
},
|
|
352
|
-
title: "Mark as received",
|
|
353
|
-
message: "Purchase order cannot be changed after it has complete receiving.",
|
|
354
|
-
successMessage: "Purchase order has been marked as received"
|
|
355
|
-
},
|
|
356
|
-
[V.enum.approveRequest]: {
|
|
357
|
-
primaryActions: {
|
|
358
|
-
text: "Accept request",
|
|
359
|
-
close: !0
|
|
360
|
-
},
|
|
361
|
-
title: "Accept request?",
|
|
362
|
-
message: "Transfer out request will be accepted.",
|
|
363
|
-
successMessage: "Transfer out request has been approved"
|
|
364
|
-
},
|
|
365
|
-
[V.enum.rejectRequest]: {
|
|
366
|
-
primaryActions: {
|
|
367
|
-
text: "Reject request",
|
|
368
|
-
close: !0,
|
|
369
|
-
variant: "destructive"
|
|
370
|
-
},
|
|
371
|
-
title: "Reject request?",
|
|
372
|
-
message: "Purchase order will be rejected.",
|
|
373
|
-
successMessage: "Purchase order has been rejected"
|
|
374
|
-
},
|
|
375
|
-
[V.enum.processRequest]: {
|
|
376
|
-
primaryActions: {
|
|
377
|
-
text: "Process request",
|
|
378
|
-
close: !0,
|
|
379
|
-
variant: "destructive"
|
|
380
|
-
},
|
|
381
|
-
title: "Process request?",
|
|
382
|
-
message: "Purchase order will be processed.",
|
|
383
|
-
successMessage: "Purchase order has been processed"
|
|
384
|
-
}
|
|
385
|
-
}, nr = { class: "p-4" }, ar = {
|
|
386
|
-
key: 0,
|
|
387
|
-
class: "fm-typo-en-body-md-400 mb-3"
|
|
388
|
-
}, lr = { class: "fm-typo-en-body-md-400" }, rs = /* @__PURE__ */ qe({
|
|
389
|
-
__name: "RejectDraftForm",
|
|
390
|
-
props: {
|
|
391
|
-
message: {},
|
|
392
|
-
confirm: { type: Function },
|
|
393
|
-
onChange: { type: Function }
|
|
394
|
-
},
|
|
395
|
-
setup(b) {
|
|
396
|
-
const s = b, { t: n } = dt(), c = Z("");
|
|
397
|
-
Ge(c, (d) => {
|
|
398
|
-
var p;
|
|
399
|
-
(p = s.onChange) == null || p.call(s, d ?? "");
|
|
400
|
-
});
|
|
401
|
-
function v() {
|
|
402
|
-
c.value = "";
|
|
403
|
-
}
|
|
404
|
-
return (d, p) => (l(), h("div", nr, [
|
|
405
|
-
s.message ? (l(), h("div", ar, x(s.message), 1)) : I("", !0),
|
|
406
|
-
e("label", lr, x(_(n)("inventory.transfer.receiveRequest.details.rejectionReason")) + " (" + x(_(n)("inventory.common.optional")) + ")", 1),
|
|
407
|
-
ps(e("textarea", {
|
|
408
|
-
"onUpdate:modelValue": p[0] || (p[0] = (t) => c.value = t),
|
|
409
|
-
rows: "4",
|
|
410
|
-
class: "w-full mt-2 p-2 border rounded"
|
|
411
|
-
}, null, 512), [
|
|
412
|
-
[fs, c.value]
|
|
413
|
-
]),
|
|
414
|
-
e("div", { class: "mt-3 flex gap-2" }, [
|
|
415
|
-
e("button", {
|
|
416
|
-
type: "button",
|
|
417
|
-
class: "fm-btn fm-btn-tertiary",
|
|
418
|
-
onClick: v
|
|
419
|
-
}, "Clear")
|
|
420
|
-
])
|
|
421
|
-
]));
|
|
422
|
-
}
|
|
423
|
-
});
|
|
424
|
-
function ct(b) {
|
|
425
|
-
return ut.generatedPOReceivedMap({
|
|
426
|
-
purchaseOrder: b
|
|
427
|
-
});
|
|
428
|
-
}
|
|
429
|
-
function ir(b) {
|
|
430
|
-
return ut.validatePOItemReceivedStatus({
|
|
431
|
-
dto: b
|
|
432
|
-
});
|
|
433
|
-
}
|
|
434
|
-
function _t(b) {
|
|
435
|
-
return ut.validatePOReceivedStatus({
|
|
436
|
-
receivedMap: b
|
|
437
|
-
});
|
|
438
|
-
}
|
|
439
|
-
function St(b, s, n) {
|
|
440
|
-
if (!ve.safeParse(b).success)
|
|
441
|
-
throw new Error(`Invalid purchase order status: ${b}`);
|
|
442
|
-
const c = ve.parse(b);
|
|
443
|
-
return ut.orderStatusCombination({
|
|
444
|
-
status: c,
|
|
445
|
-
isPOPartialReceive: s,
|
|
446
|
-
isPOOverReceive: n
|
|
447
|
-
});
|
|
448
|
-
}
|
|
449
|
-
function os() {
|
|
450
|
-
const b = Me(), s = Ye(), n = He();
|
|
451
|
-
async function c(d, p) {
|
|
452
|
-
const t = b.currentLocationDBName;
|
|
453
|
-
return d.doc.supplier.internal && d.operation === V.enum.confirmDraft && (d.operation = V.enum.submitRequest), await s.processPurchaseOrder(d, p || t);
|
|
454
|
-
}
|
|
455
|
-
async function v(d, p) {
|
|
456
|
-
const t = b.currentLocationDBName;
|
|
457
|
-
return await s.processPurchaseOrderV2(d, p || t);
|
|
458
|
-
}
|
|
459
|
-
return (d) => n.useOperatePurchaseOrderV2 ? v(d.operateV2, d.transferTo) : c(d.operate, d.transferTo);
|
|
460
|
-
}
|
|
461
|
-
function Be(b) {
|
|
462
|
-
const s = vs(b);
|
|
463
|
-
if (Array.isArray(s))
|
|
464
|
-
return s.map(Be);
|
|
465
|
-
if (s !== null && typeof s == "object") {
|
|
466
|
-
const n = {};
|
|
467
|
-
for (const c in s)
|
|
468
|
-
Object.prototype.hasOwnProperty.call(s, c) && (n[c] = Be(s[c]));
|
|
469
|
-
return n;
|
|
470
|
-
}
|
|
471
|
-
return s;
|
|
472
|
-
}
|
|
473
|
-
const yt = {
|
|
474
|
-
set: "set",
|
|
475
|
-
add: "add",
|
|
476
|
-
delete: "delete"
|
|
477
|
-
};
|
|
478
|
-
function zt(b) {
|
|
479
|
-
return {
|
|
480
|
-
dbName: b.dbName,
|
|
481
|
-
type: b.type,
|
|
482
|
-
name: b.name,
|
|
483
|
-
acceptRequest: b.acceptRequest ?? !1,
|
|
484
|
-
doc: b.doc
|
|
485
|
-
};
|
|
486
|
-
}
|
|
487
|
-
function Kt(b, s, n, c, v) {
|
|
488
|
-
const d = Be(b.suppliers ?? []), p = Be(s.allLocations ?? []).map(zt), t = s._currentLocation ? zt(Be(s._currentLocation)) : null, o = n.inventory ? [Be(n.inventory)] : [], u = c.state.setting ? Be(c.state.setting) : null, k = Be(v.surcharges ?? []);
|
|
489
|
-
return {
|
|
490
|
-
suppliers: d,
|
|
491
|
-
locations: p,
|
|
492
|
-
currentLocation: t,
|
|
493
|
-
inventoryDoc: o,
|
|
494
|
-
netSuiteSetting: u,
|
|
495
|
-
surcharges: k
|
|
496
|
-
};
|
|
497
|
-
}
|
|
498
|
-
function ns() {
|
|
499
|
-
const b = Xt(), s = Me(), n = kt(), c = pt(), v = Ws(), d = Kt(
|
|
500
|
-
b,
|
|
501
|
-
s,
|
|
502
|
-
n,
|
|
503
|
-
c,
|
|
504
|
-
v
|
|
505
|
-
), p = Vt(Fs({ env: d }));
|
|
506
|
-
p.value.setUsePartialUpdates(!0);
|
|
507
|
-
const t = Vt(p.value.state()), o = (D) => {
|
|
508
|
-
t.value = p.value.state();
|
|
509
|
-
};
|
|
510
|
-
p.value.addListener(o);
|
|
511
|
-
const u = (D, T, S) => {
|
|
512
|
-
switch (D) {
|
|
513
|
-
case yt.set:
|
|
514
|
-
Ut(t.value, T, S);
|
|
515
|
-
break;
|
|
516
|
-
case yt.add:
|
|
517
|
-
Rs(t.value, T, S);
|
|
518
|
-
break;
|
|
519
|
-
case yt.delete:
|
|
520
|
-
Ds(t.value, T);
|
|
521
|
-
break;
|
|
522
|
-
default:
|
|
523
|
-
console.warn(`Unknown partial update operation: ${D}, falling back to 'set'`), Ut(t.value, T, S);
|
|
524
|
-
}
|
|
525
|
-
T !== "remark" && T !== "ref" && bs(t);
|
|
526
|
-
};
|
|
527
|
-
p.value.addPartialListener(u);
|
|
528
|
-
function k() {
|
|
529
|
-
const D = Kt(
|
|
530
|
-
b,
|
|
531
|
-
s,
|
|
532
|
-
n,
|
|
533
|
-
c,
|
|
534
|
-
v
|
|
535
|
-
);
|
|
536
|
-
p.value.updateFullEnv(D), t.value = p.value.state();
|
|
537
|
-
}
|
|
538
|
-
Ge(
|
|
539
|
-
[
|
|
540
|
-
() => b.suppliers,
|
|
541
|
-
() => s.allLocations,
|
|
542
|
-
() => s._currentLocation,
|
|
543
|
-
() => n.inventory,
|
|
544
|
-
() => c.state.setting,
|
|
545
|
-
() => v.surcharges
|
|
546
|
-
],
|
|
547
|
-
() => {
|
|
548
|
-
k();
|
|
549
|
-
},
|
|
550
|
-
{ deep: !0 }
|
|
551
|
-
), ys(() => {
|
|
552
|
-
p.value.removeListener(o), p.value.removePartialListener(u);
|
|
553
|
-
});
|
|
554
|
-
function $(D) {
|
|
555
|
-
var T;
|
|
556
|
-
if (D != null && D._id) {
|
|
557
|
-
p.value.loadPurchaseOrder(D);
|
|
558
|
-
return;
|
|
559
|
-
}
|
|
560
|
-
if (!He().mustUsePoTemplate) {
|
|
561
|
-
p.value.init();
|
|
562
|
-
return;
|
|
563
|
-
}
|
|
564
|
-
D != null && D.template && ((T = D.templateDoc) != null && T.purchaseOrder) ? (D.items = D.templateDoc.purchaseOrder.items, p.value.initFromTemplate(D)) : p.value.initOutletToOutlet();
|
|
565
|
-
}
|
|
566
|
-
return {
|
|
567
|
-
controller: p,
|
|
568
|
-
state: t,
|
|
569
|
-
init: $
|
|
570
|
-
};
|
|
571
|
-
}
|
|
572
|
-
var xt = /* @__PURE__ */ ((b) => (b.RECEIVE_REQUEST = "receive/request", b.APPROVAL = "approval", b))(xt || {});
|
|
573
|
-
const Xe = Z(), bt = Z(), ht = Z();
|
|
574
|
-
function zl(b, s) {
|
|
575
|
-
const n = ft(), c = Me(), v = He(), d = Xt(), p = mt(), t = Ls(), o = Us(), u = Z(!1), k = Qe(), $ = Ye(), D = or(), T = Z(new Array()), S = Z(new Array()), F = Z(
|
|
576
|
-
s != null && s.startDate && (s != null && s.endDate) ? s : Gs()
|
|
577
|
-
), E = j(() => {
|
|
578
|
-
const f = new Date(F.value.startDate), i = new Date(F.value.endDate);
|
|
579
|
-
return {
|
|
580
|
-
start: As(f).toISOString(),
|
|
581
|
-
end: Ts(i).toISOString()
|
|
582
|
-
};
|
|
583
|
-
}), J = Z(new Array()), z = Ns(), ae = Z(null);
|
|
584
|
-
async function ge(f) {
|
|
585
|
-
function i(M) {
|
|
586
|
-
const G = {
|
|
587
|
-
mode: Bt.CREATE,
|
|
588
|
-
modelValue: f || void 0,
|
|
589
|
-
show: !0,
|
|
590
|
-
"onUpdate:show"(ie) {
|
|
591
|
-
Xe.value.show = ie;
|
|
592
|
-
},
|
|
593
|
-
templateId: M,
|
|
594
|
-
lastClosingDate: ae.value
|
|
595
|
-
};
|
|
596
|
-
Xe.value = G;
|
|
597
|
-
}
|
|
598
|
-
let O;
|
|
599
|
-
v.mustUsePoTemplate && !(f != null && f.template) ? n.open({
|
|
600
|
-
title: "Create transfer",
|
|
601
|
-
message: "",
|
|
602
|
-
primaryActions: {
|
|
603
|
-
text: "Select a template",
|
|
604
|
-
close: !0
|
|
605
|
-
},
|
|
606
|
-
secondaryActions: {
|
|
607
|
-
text: "Outlet to Outlet",
|
|
608
|
-
variant: "secondary",
|
|
609
|
-
close: !0
|
|
610
|
-
}
|
|
611
|
-
}).onPrimary(async () => {
|
|
612
|
-
O = await t.getTemplateId(), O && i(O);
|
|
613
|
-
}).onSecondary(() => {
|
|
614
|
-
i(void 0);
|
|
615
|
-
}) : i(O);
|
|
616
|
-
}
|
|
617
|
-
function H(f) {
|
|
618
|
-
const i = {
|
|
619
|
-
mode: Bt.UPDATE,
|
|
620
|
-
modelValue: Yt(f),
|
|
621
|
-
show: !0,
|
|
622
|
-
"onUpdate:show"(O) {
|
|
623
|
-
Xe.value.show = O;
|
|
624
|
-
},
|
|
625
|
-
lastClosingDate: ae.value
|
|
626
|
-
};
|
|
627
|
-
Xe.value = i;
|
|
628
|
-
}
|
|
629
|
-
function R(f) {
|
|
630
|
-
if (!p.currentBusiness.value) return;
|
|
631
|
-
const i = c.currentLocation;
|
|
632
|
-
if (i.type === "restaurant") {
|
|
633
|
-
const ee = c.locationRestaurantFromCore(i.doc._id);
|
|
634
|
-
ee !== null && (i.doc = ee);
|
|
635
|
-
}
|
|
636
|
-
const O = ts({
|
|
637
|
-
po: f,
|
|
638
|
-
currentLocation: i,
|
|
639
|
-
business: p.currentBusiness.value,
|
|
640
|
-
fulfilling: b === "approval",
|
|
641
|
-
por: f.request
|
|
642
|
-
});
|
|
643
|
-
if (!O) return;
|
|
644
|
-
const M = Qt(O.html), G = d.supplierById[f.supplier._id], ie = {
|
|
645
|
-
recipientName: G.name,
|
|
646
|
-
email: (G == null ? void 0 : G.email) ?? "",
|
|
647
|
-
business: p.currentBusiness.value,
|
|
648
|
-
modelValue: M,
|
|
649
|
-
show: !0,
|
|
650
|
-
"onUpdate:show"(ee) {
|
|
651
|
-
bt.value.show = ee;
|
|
652
|
-
}
|
|
653
|
-
};
|
|
654
|
-
bt.value = ie;
|
|
655
|
-
}
|
|
656
|
-
async function ne() {
|
|
657
|
-
T.value = [], S.value = [], u.value = !0;
|
|
658
|
-
try {
|
|
659
|
-
const f = await $.getPurchaseOrders(E.value);
|
|
660
|
-
T.value = f.sort((ee, ke) => ke._id.localeCompare(ee._id));
|
|
661
|
-
const i = f.flatMap((ee) => ee.shipmentIds || []).filter(Boolean), O = i.length > 0 ? await D.getShipmentsByIds(i) : [];
|
|
662
|
-
S.value = O;
|
|
663
|
-
const M = await z.readCurrentLocationLastClosing(!0), G = M == null ? void 0 : M._id;
|
|
664
|
-
G && (ae.value = $s(G)), await v.awaitFeatureLoaded(() => v.mustUsePoTemplate) && await o.fetchTemplates();
|
|
665
|
-
const ie = T.value.map((ee) => {
|
|
666
|
-
var ke;
|
|
667
|
-
return ((ke = ee.request) == null ? void 0 : ke.id) ?? "";
|
|
668
|
-
}).filter((ee) => ee);
|
|
669
|
-
J.value = await $.readRequestByIds(ie);
|
|
670
|
-
} catch {
|
|
671
|
-
k.open({
|
|
672
|
-
title: "Something went wrong",
|
|
673
|
-
message: "Error at fetching purchase orders",
|
|
674
|
-
type: "error"
|
|
675
|
-
});
|
|
676
|
-
} finally {
|
|
677
|
-
u.value = !1;
|
|
678
|
-
}
|
|
679
|
-
}
|
|
680
|
-
async function P() {
|
|
681
|
-
J.value = [], u.value = !0;
|
|
682
|
-
try {
|
|
683
|
-
J.value = await $.readRequests(
|
|
684
|
-
void 0,
|
|
685
|
-
E.value.start,
|
|
686
|
-
E.value.end
|
|
687
|
-
).then((f) => f.reverse());
|
|
688
|
-
} catch {
|
|
689
|
-
k.open({
|
|
690
|
-
title: "Something went wrong",
|
|
691
|
-
message: "Error at fetching purchase requests",
|
|
692
|
-
type: "error"
|
|
693
|
-
});
|
|
694
|
-
} finally {
|
|
695
|
-
u.value = !1;
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
function C() {
|
|
699
|
-
switch (b) {
|
|
700
|
-
case "receive/request":
|
|
701
|
-
return ne();
|
|
702
|
-
case "approval":
|
|
703
|
-
return P();
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
function K(f, i) {
|
|
707
|
-
F.value = {
|
|
708
|
-
startDate: f,
|
|
709
|
-
endDate: i
|
|
710
|
-
}, C();
|
|
711
|
-
}
|
|
712
|
-
c.watchLocation(async (f) => {
|
|
713
|
-
if (!f) {
|
|
714
|
-
T.value = [];
|
|
715
|
-
return;
|
|
716
|
-
}
|
|
717
|
-
await C();
|
|
718
|
-
});
|
|
719
|
-
const N = Z(), X = Z(Math.random().toString());
|
|
720
|
-
async function be(f, i) {
|
|
721
|
-
const O = Math.random().toString();
|
|
722
|
-
X.value = O, i ?? (i = J.value.computeFirst(
|
|
723
|
-
(ee) => ee.purchaseOrderId === f._id ? ee : null
|
|
724
|
-
) ?? void 0);
|
|
725
|
-
const M = b === "receive/request" ? c.currentLocation : i == null ? void 0 : i.to, G = b === "approval", ie = {
|
|
726
|
-
poRequest: i,
|
|
727
|
-
purchaseOrder: {
|
|
728
|
-
...f,
|
|
729
|
-
status: G && (i != null && i.rejectedAt) ? ve.Enum.REJECT : f.status
|
|
730
|
-
},
|
|
731
|
-
transferTo: M == null ? void 0 : M.name,
|
|
732
|
-
transferToDbName: M == null ? void 0 : M.dbName,
|
|
733
|
-
show: !0,
|
|
734
|
-
canResubmit: !1,
|
|
735
|
-
canApprove: G,
|
|
736
|
-
"onUpdate:show"(ee) {
|
|
737
|
-
N.value.show = ee;
|
|
738
|
-
},
|
|
739
|
-
scope: b,
|
|
740
|
-
receivedMap: ct(f) ?? {},
|
|
741
|
-
shipments: S.value
|
|
742
|
-
};
|
|
743
|
-
N.value = ie;
|
|
744
|
-
}
|
|
745
|
-
async function ye(f, i, O, M, G) {
|
|
746
|
-
const ie = os();
|
|
747
|
-
u.value = !0;
|
|
748
|
-
try {
|
|
749
|
-
await ie({
|
|
750
|
-
operate: {
|
|
751
|
-
operation: i,
|
|
752
|
-
doc: f,
|
|
753
|
-
options: (
|
|
754
|
-
// auto receive for supplier to warehouse
|
|
755
|
-
(i === V.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
756
|
-
i === V.enum.completeReceive) && v.autoReceiveWarehouse ? {
|
|
757
|
-
autoReceive: !0
|
|
758
|
-
} : void 0
|
|
759
|
-
)
|
|
760
|
-
},
|
|
761
|
-
operateV2: {
|
|
762
|
-
_id: f._id,
|
|
763
|
-
_rev: f._rev ?? "",
|
|
764
|
-
action: i === V.enum.submitRequest ? V.enum.confirmDraft : i,
|
|
765
|
-
payloads: G ?? []
|
|
766
|
-
},
|
|
767
|
-
transferTo: M
|
|
768
|
-
}), await new Promise((le) => setTimeout(le, 1e3));
|
|
769
|
-
const ke = Me().currentLocationDBName.startsWith("restaurant_");
|
|
770
|
-
i === V.enum.confirmDraft && f.effectiveAt && ke ? k.open({
|
|
771
|
-
title: "Success",
|
|
772
|
-
message: `${O}. The backdate will be reflected once your POS has received this change.`,
|
|
773
|
-
type: "success"
|
|
774
|
-
}) : k.open({
|
|
775
|
-
title: "Success",
|
|
776
|
-
message: O,
|
|
777
|
-
type: "success"
|
|
778
|
-
});
|
|
779
|
-
} catch (ee) {
|
|
780
|
-
k.open({
|
|
781
|
-
title: "Something went wrong",
|
|
782
|
-
message: ee instanceof Error ? ee.message : "Please try again.",
|
|
783
|
-
type: "error"
|
|
784
|
-
}), console.error("Error when submitting PO operation", i, f, ee);
|
|
785
|
-
} finally {
|
|
786
|
-
u.value = !1, C();
|
|
787
|
-
}
|
|
788
|
-
}
|
|
789
|
-
async function pe(f, i, O) {
|
|
790
|
-
const M = ss[i];
|
|
791
|
-
if (!M) {
|
|
792
|
-
k.open({
|
|
793
|
-
title: "Something went wrong",
|
|
794
|
-
message: `Cannot process order: ${Ot(i)}`,
|
|
795
|
-
type: "error"
|
|
796
|
-
});
|
|
797
|
-
return;
|
|
798
|
-
}
|
|
799
|
-
const { successMessage: G, ...ie } = M;
|
|
800
|
-
if (i === V.enum.rejectDraft) {
|
|
801
|
-
let le = "";
|
|
802
|
-
n.open({
|
|
803
|
-
title: ie.title,
|
|
804
|
-
message: ie.message,
|
|
805
|
-
primaryActions: ie.primaryActions,
|
|
806
|
-
contentComponent: rs,
|
|
807
|
-
contentComponentProps: {
|
|
808
|
-
message: ie.message,
|
|
809
|
-
onChange: (r) => le = r
|
|
810
|
-
}
|
|
811
|
-
}).onPrimary(() => {
|
|
812
|
-
const r = [];
|
|
813
|
-
r.push({
|
|
814
|
-
action: "rejectDraft",
|
|
815
|
-
payload: {
|
|
816
|
-
rejectReason: le
|
|
817
|
-
}
|
|
818
|
-
}), ye(f, i, G, O, r);
|
|
819
|
-
});
|
|
820
|
-
return;
|
|
821
|
-
}
|
|
822
|
-
const ee = [], ke = ns();
|
|
823
|
-
ke.init(f), (i === V.enum.confirmDraft || i === V.enum.submitRequest) && ee.push({
|
|
824
|
-
action: "confirmDraft",
|
|
825
|
-
payload: ke.controller.value.toConfirmDraftData(De())
|
|
826
|
-
}), n.open({
|
|
827
|
-
title: ie.title,
|
|
828
|
-
message: ie.message,
|
|
829
|
-
primaryActions: ie.primaryActions
|
|
830
|
-
}).onPrimary(() => {
|
|
831
|
-
ye(f, i, G, O, ee);
|
|
832
|
-
});
|
|
833
|
-
}
|
|
834
|
-
async function fe() {
|
|
835
|
-
n.open({
|
|
836
|
-
title: "Upload Transfer",
|
|
837
|
-
primaryActions: {
|
|
838
|
-
text: "Xilnex transfer note",
|
|
839
|
-
close: !0
|
|
840
|
-
},
|
|
841
|
-
secondaryActions: {
|
|
842
|
-
text: "Cancel",
|
|
843
|
-
close: !0
|
|
844
|
-
}
|
|
845
|
-
}).onPrimary(() => {
|
|
846
|
-
const f = {
|
|
847
|
-
show: !0,
|
|
848
|
-
"onUpdate:show"(i) {
|
|
849
|
-
ht.value.show = i;
|
|
850
|
-
}
|
|
851
|
-
};
|
|
852
|
-
ht.value = f;
|
|
853
|
-
});
|
|
854
|
-
}
|
|
855
|
-
return {
|
|
856
|
-
purchaseOrders: T,
|
|
857
|
-
shipments: S,
|
|
858
|
-
purchaseRequests: J,
|
|
859
|
-
updateDateRange: K,
|
|
860
|
-
fetchData: C,
|
|
861
|
-
loading: u,
|
|
862
|
-
transferDialogProps: Xe,
|
|
863
|
-
promptCreateTransferDialog: ge,
|
|
864
|
-
promptUpdateTransferDialog: H,
|
|
865
|
-
transferDetailsProps: N,
|
|
866
|
-
promptShowTransferDetails: be,
|
|
867
|
-
submitAction: pe,
|
|
868
|
-
xilnexImportDialogProps: ht,
|
|
869
|
-
promptUploadTransferDialog: fe,
|
|
870
|
-
emailDialogProps: bt,
|
|
871
|
-
promptEmailDialog: R
|
|
872
|
-
};
|
|
873
|
-
}
|
|
874
|
-
function cr(b) {
|
|
875
|
-
const { po: s, currentLocation: n, business: c, fulfilling: v, por: d } = b, { name: p, address: t, regNo: o, legalName: u } = n.doc.profile, k = {
|
|
876
|
-
name: p,
|
|
877
|
-
legalName: u,
|
|
878
|
-
registrationNumber: o,
|
|
879
|
-
line1: t == null ? void 0 : t.line1,
|
|
880
|
-
line2: t == null ? void 0 : t.line2,
|
|
881
|
-
postcode: t == null ? void 0 : t.postcode,
|
|
882
|
-
city: t == null ? void 0 : t.city,
|
|
883
|
-
state: t == null ? void 0 : t.state,
|
|
884
|
-
country: t == null ? void 0 : t.country
|
|
885
|
-
}, $ = {
|
|
886
|
-
name: s.supplier.name,
|
|
887
|
-
phoneNumber: s.supplier.phoneNumber,
|
|
888
|
-
registrationNumber: s.supplier.registrationNumber,
|
|
889
|
-
line1: s.supplier.address.line1,
|
|
890
|
-
line2: s.supplier.address.line2,
|
|
891
|
-
postcode: s.supplier.address.postcode,
|
|
892
|
-
city: s.supplier.address.city,
|
|
893
|
-
state: s.supplier.address.state,
|
|
894
|
-
country: s.supplier.address.country
|
|
895
|
-
}, D = s.items.map((H) => {
|
|
896
|
-
const { sku: R, measurement: ne } = H, P = xe(
|
|
897
|
-
es(H.sku, s.deliveryOrder || []),
|
|
898
|
-
!1
|
|
899
|
-
);
|
|
900
|
-
return {
|
|
901
|
-
code: R.code,
|
|
902
|
-
description: R.name,
|
|
903
|
-
quantity: xe(H.quantity, !1),
|
|
904
|
-
unit: (ne == null ? void 0 : ne.abbrev) || R.unit.abbrev,
|
|
905
|
-
received: P,
|
|
906
|
-
cost: H.totalCost ? `${H.totalCost.currency} ${Ze.toFormatString({
|
|
907
|
-
value: H.totalCost
|
|
908
|
-
})}` : void 0
|
|
909
|
-
};
|
|
910
|
-
}), T = s.deliveryOrder.map((H) => ({
|
|
911
|
-
createdAt: wt(new Date(H.createdAt)),
|
|
912
|
-
ref: H.deliveryOrderNumber,
|
|
913
|
-
remark: H.remark || "",
|
|
914
|
-
items: H.received.map((R) => {
|
|
915
|
-
var ne;
|
|
916
|
-
return {
|
|
917
|
-
code: R.sku.code,
|
|
918
|
-
description: R.sku.name,
|
|
919
|
-
quantity: xe(R.amount),
|
|
920
|
-
unit: ((ne = R.measurement) == null ? void 0 : ne.abbrev) || R.sku.unit.abbrev
|
|
921
|
-
};
|
|
922
|
-
})
|
|
923
|
-
})), S = [
|
|
924
|
-
// Production
|
|
925
|
-
"67ca5d2c80bd0e001c5bf5bc",
|
|
926
|
-
// Dev
|
|
927
|
-
"6880b36a3054c5001db19218"
|
|
928
|
-
];
|
|
929
|
-
let F = "Inventory Receive Note";
|
|
930
|
-
if (s.supplier.internal ? (F = "Inventory Transfer Note", S.includes((c == null ? void 0 : c._id) || "") && (F = "Stock Request")) : F = "Purchase Order", d) {
|
|
931
|
-
const H = d.from.dbName;
|
|
932
|
-
n.dbName === H || (F = "Inventory Receive Note");
|
|
933
|
-
}
|
|
934
|
-
const J = {
|
|
935
|
-
title: F,
|
|
936
|
-
businessName: c == null ? void 0 : c.name,
|
|
937
|
-
logo: c == null ? void 0 : c.thumbnail,
|
|
938
|
-
orderNumber: s.seqNumber.toString(),
|
|
939
|
-
createdAt: st(s._id),
|
|
940
|
-
ref: s.ref || "",
|
|
941
|
-
remark: s.remark || "",
|
|
942
|
-
buyer: k,
|
|
943
|
-
supplier: $,
|
|
944
|
-
items: D,
|
|
945
|
-
status: s.status,
|
|
946
|
-
deliveryOrders: T
|
|
947
|
-
}, z = new URL(window.location.href), ae = v && (s.deliveryFullfillment || []).length > 0 ? "receive-request/delivery-print-preview" : "receive-request/print-preview";
|
|
948
|
-
z.pathname = z.hostname.includes("portal.feedme") ? `/inventory/${ae}` : `/${ae}`;
|
|
949
|
-
const ge = Es.compressToEncodedURIComponent(JSON.stringify(J));
|
|
950
|
-
z.searchParams.append("data", ge), window.open(z.href, "_blank", "noreferrer");
|
|
951
|
-
}
|
|
952
|
-
const je = {
|
|
953
|
-
submitRequest: {
|
|
954
|
-
translationKey: "inventory.transfer.receiveRequest.actions.submitRequest",
|
|
955
|
-
color: "text-fm-color-typo-primary",
|
|
956
|
-
value: V.enum.submitRequest
|
|
957
|
-
},
|
|
958
|
-
confirmDraft: {
|
|
959
|
-
translationKey: "inventory.transfer.receiveRequest.actions.confirmDraft",
|
|
960
|
-
color: "text-fm-color-typo-primary",
|
|
961
|
-
value: V.enum.confirmDraft
|
|
962
|
-
},
|
|
963
|
-
cancelDraft: {
|
|
964
|
-
translationKey: "inventory.transfer.receiveRequest.actions.cancelDraft",
|
|
965
|
-
color: "text-fm-color-typo-error",
|
|
966
|
-
value: V.enum.cancelDraft
|
|
967
|
-
},
|
|
968
|
-
approveRequest: {
|
|
969
|
-
translationKey: "inventory.transfer.receiveRequest.actions.approveRequest",
|
|
970
|
-
color: "text-fm-color-typo-primary",
|
|
971
|
-
value: V.enum.approveRequest
|
|
972
|
-
},
|
|
973
|
-
rejectRequest: {
|
|
974
|
-
translationKey: "inventory.transfer.receiveRequest.actions.rejectRequest",
|
|
975
|
-
color: "text-fm-color-typo-error",
|
|
976
|
-
value: V.enum.rejectRequest
|
|
977
|
-
},
|
|
978
|
-
processRequest: {
|
|
979
|
-
translationKey: "inventory.transfer.receiveRequest.actions.processRequest",
|
|
980
|
-
color: "text-fm-color-typo-primary",
|
|
981
|
-
value: V.enum.processRequest
|
|
982
|
-
},
|
|
983
|
-
receiveStock: {
|
|
984
|
-
translationKey: "inventory.transfer.receiveRequest.actions.receiveStock",
|
|
985
|
-
color: "text-fm-color-typo-primary",
|
|
986
|
-
value: V.enum.receiveStock
|
|
987
|
-
},
|
|
988
|
-
completeReceive: {
|
|
989
|
-
translationKey: "inventory.transfer.receiveRequest.actions.completeReceive",
|
|
990
|
-
color: "text-fm-color-typo-primary",
|
|
991
|
-
value: V.enum.completeReceive
|
|
992
|
-
},
|
|
993
|
-
closeRequest: {
|
|
994
|
-
translationKey: "inventory.transfer.receiveRequest.actions.closeRequest",
|
|
995
|
-
color: "system-error-300",
|
|
996
|
-
value: V.enum.closeRequest
|
|
997
|
-
},
|
|
998
|
-
approveDraft: {
|
|
999
|
-
translationKey: "inventory.transfer.receiveRequest.actions.approveDraft",
|
|
1000
|
-
color: "text-fm-color-typo-primary",
|
|
1001
|
-
value: V.enum.approveDraft
|
|
1002
|
-
},
|
|
1003
|
-
rejectDraft: {
|
|
1004
|
-
translationKey: "inventory.transfer.receiveRequest.actions.rejectDraft",
|
|
1005
|
-
color: "text-fm-color-typo-error",
|
|
1006
|
-
value: V.enum.rejectDraft
|
|
1007
|
-
},
|
|
1008
|
-
returnStock: {
|
|
1009
|
-
translationKey: "inventory.transfer.receiveRequest.actions.returnStock",
|
|
1010
|
-
color: "text-fm-color-typo-primary",
|
|
1011
|
-
value: V.enum.returnStock
|
|
1012
|
-
}
|
|
1013
|
-
};
|
|
1014
|
-
function as() {
|
|
1015
|
-
const b = He();
|
|
1016
|
-
return {
|
|
1017
|
-
ableToMarkReceived(s) {
|
|
1018
|
-
if (!s || s.status !== ve.enum.RECEIVING || b.useOperatePurchaseOrderV2) return !1;
|
|
1019
|
-
const c = Me().currentLocationDBName;
|
|
1020
|
-
return `${s.supplier.internal}_${s.supplier._id}` !== c;
|
|
1021
|
-
},
|
|
1022
|
-
ableToMarkApproved(s) {
|
|
1023
|
-
return !(!s || (s == null ? void 0 : s.status) !== ve.enum.REQUESTING);
|
|
1024
|
-
},
|
|
1025
|
-
ableToCreateFulfillment(s, n) {
|
|
1026
|
-
var d, p;
|
|
1027
|
-
if (!b.acceptRequireFulfillment || !s || !n || s.status !== ve.enum.PROCESSING || !n.processedAt)
|
|
1028
|
-
return !1;
|
|
1029
|
-
const c = (d = n == null ? void 0 : n.from) == null ? void 0 : d.dbName, v = (p = n == null ? void 0 : n.to) == null ? void 0 : p.dbName;
|
|
1030
|
-
return !(c.startsWith("restaurant_") && v.startsWith("restaurant_"));
|
|
1031
|
-
}
|
|
1032
|
-
};
|
|
1033
|
-
}
|
|
1034
|
-
function ls() {
|
|
1035
|
-
const b = j(() => [
|
|
1036
|
-
{
|
|
1037
|
-
action: Mt.Action.manage,
|
|
1038
|
-
subject: Mt.Subject.Business.inventory_orderDraftApproval
|
|
1039
|
-
}
|
|
1040
|
-
]), { hasPermission: s } = Js(b);
|
|
1041
|
-
return {
|
|
1042
|
-
hasOrderDraftPermission: hs(s)
|
|
1043
|
-
};
|
|
1044
|
-
}
|
|
1045
|
-
function Kl(b, s, n) {
|
|
1046
|
-
const c = Me(), v = pt(), d = mt(), p = as(), { t } = dt(), { hasOrderDraftPermission: o } = ls(), u = He(), k = j(
|
|
1047
|
-
() => u.enablePrintTemplate ? [Pe[Se.PrintCustom]] : []
|
|
1048
|
-
), $ = j(
|
|
1049
|
-
() => u.enablePurchaseOrderEmail ? [Pe[Se.Email]] : []
|
|
1050
|
-
);
|
|
1051
|
-
function D(R) {
|
|
1052
|
-
switch (R.status) {
|
|
1053
|
-
case "DRAFT":
|
|
1054
|
-
return [
|
|
1055
|
-
Pe[Se.Update],
|
|
1056
|
-
Pe[Se.Details],
|
|
1057
|
-
R.supplier.internal === "restaurant" || R.supplier.internal === "warehouse" ? je[V.enum.submitRequest] : je[V.enum.confirmDraft],
|
|
1058
|
-
je[V.enum.cancelDraft]
|
|
1059
|
-
];
|
|
1060
|
-
case "RECEIVING":
|
|
1061
|
-
return [
|
|
1062
|
-
...p.ableToMarkReceived(R) ? [je[V.enum.completeReceive]] : [],
|
|
1063
|
-
Pe[Se.Details],
|
|
1064
|
-
Pe[Se.Print],
|
|
1065
|
-
...k.value,
|
|
1066
|
-
...$.value
|
|
1067
|
-
];
|
|
1068
|
-
case "PENDING_APPROVAL": {
|
|
1069
|
-
const P = [Pe[Se.Details]];
|
|
1070
|
-
return o.value && P.push(
|
|
1071
|
-
Pe[Se.Update],
|
|
1072
|
-
je[V.enum.approveDraft],
|
|
1073
|
-
je[V.enum.rejectDraft]
|
|
1074
|
-
), P;
|
|
1075
|
-
}
|
|
1076
|
-
case "REQUESTING":
|
|
1077
|
-
return b === "receive/request" ? [
|
|
1078
|
-
Pe[Se.Details],
|
|
1079
|
-
Pe[Se.Print],
|
|
1080
|
-
...k.value
|
|
1081
|
-
] : [
|
|
1082
|
-
je[V.enum.approveRequest],
|
|
1083
|
-
je[V.enum.rejectRequest],
|
|
1084
|
-
Pe[Se.Details]
|
|
1085
|
-
// DefaultRowActions[RowActionEnum.Print]
|
|
1086
|
-
];
|
|
1087
|
-
case "PROCESSING":
|
|
1088
|
-
return [
|
|
1089
|
-
Pe[Se.Details],
|
|
1090
|
-
Pe[Se.Print],
|
|
1091
|
-
...k.value
|
|
1092
|
-
];
|
|
1093
|
-
case "COMPLETE":
|
|
1094
|
-
case "CANCEL":
|
|
1095
|
-
default:
|
|
1096
|
-
return [
|
|
1097
|
-
Pe[Se.Details],
|
|
1098
|
-
Pe[Se.Print],
|
|
1099
|
-
...k.value
|
|
1100
|
-
];
|
|
1101
|
-
}
|
|
1102
|
-
}
|
|
1103
|
-
function T(R) {
|
|
1104
|
-
return Object.values(V.enum).includes(R);
|
|
1105
|
-
}
|
|
1106
|
-
async function S(R, ne, P) {
|
|
1107
|
-
var K, N, X, be, ye, pe, fe;
|
|
1108
|
-
const C = Yt(ne);
|
|
1109
|
-
if (R === Se.Print || R === Se.PrintCustom) {
|
|
1110
|
-
const f = (P == null ? void 0 : P.toInventoryLocation) ?? c.currentLocation;
|
|
1111
|
-
if (f.type === "restaurant") {
|
|
1112
|
-
const O = c.locationRestaurantFromCore(f.doc._id);
|
|
1113
|
-
O !== null && (f.doc = O);
|
|
1114
|
-
}
|
|
1115
|
-
((K = P == null ? void 0 : P.netSuite) != null && K.refNo || (N = C.netSuite) != null && N.refNo) && (C.ref = [((X = P == null ? void 0 : P.netSuite) == null ? void 0 : X.refNo) || ((be = C.netSuite) == null ? void 0 : be.refNo)].filter((O) => O).join(" "));
|
|
1116
|
-
const i = {
|
|
1117
|
-
po: C,
|
|
1118
|
-
currentLocation: f,
|
|
1119
|
-
business: d.currentBusiness.value,
|
|
1120
|
-
fulfilling: b === "approval",
|
|
1121
|
-
por: P
|
|
1122
|
-
};
|
|
1123
|
-
if (R === Se.PrintCustom) {
|
|
1124
|
-
const O = ts(i);
|
|
1125
|
-
O && (ae.value = O.html, ge.value = O.templateName, H.value = O.isDefault, z.value = !0);
|
|
1126
|
-
} else
|
|
1127
|
-
cr(i);
|
|
1128
|
-
return;
|
|
1129
|
-
}
|
|
1130
|
-
if (R === Se.Details) {
|
|
1131
|
-
s.promptShowTransferDetails(C, P);
|
|
1132
|
-
return;
|
|
1133
|
-
}
|
|
1134
|
-
if (R === Se.Update) {
|
|
1135
|
-
(ye = s.promptUpdateTransferDialog) == null || ye.call(s, C);
|
|
1136
|
-
return;
|
|
1137
|
-
}
|
|
1138
|
-
if (R === Se.Email) {
|
|
1139
|
-
(pe = s.promptEmailDialog) == null || pe.call(s, C);
|
|
1140
|
-
return;
|
|
1141
|
-
}
|
|
1142
|
-
if (T(R)) {
|
|
1143
|
-
s.submitAction(ne, R, (fe = P == null ? void 0 : P.to) == null ? void 0 : fe.dbName);
|
|
1144
|
-
return;
|
|
1145
|
-
}
|
|
1146
|
-
}
|
|
1147
|
-
function F() {
|
|
1148
|
-
var ne;
|
|
1149
|
-
const R = [
|
|
1150
|
-
{
|
|
1151
|
-
accessorKey: "seqNumber",
|
|
1152
|
-
header: () => t("inventory.transfer.table.seqNo"),
|
|
1153
|
-
enableSorting: !0,
|
|
1154
|
-
size: 80,
|
|
1155
|
-
sortUndefined: "last"
|
|
1156
|
-
},
|
|
1157
|
-
{
|
|
1158
|
-
accessorKey: "_id",
|
|
1159
|
-
header: () => t("inventory.transfer.table.createdAt"),
|
|
1160
|
-
cell(P) {
|
|
1161
|
-
return st(`${P.getValue()}`);
|
|
1162
|
-
},
|
|
1163
|
-
enableSorting: !0
|
|
1164
|
-
},
|
|
1165
|
-
{
|
|
1166
|
-
accessorKey: "supplier.name",
|
|
1167
|
-
header: () => t("inventory.transfer.table.transferFrom"),
|
|
1168
|
-
enableSorting: !0,
|
|
1169
|
-
size: 200
|
|
1170
|
-
},
|
|
1171
|
-
{
|
|
1172
|
-
accessorKey: "items.length",
|
|
1173
|
-
header: () => t("inventory.transfer.table.noOfItems"),
|
|
1174
|
-
cell: (P) => {
|
|
1175
|
-
const C = P.row.original.version || "1", K = P.getValue();
|
|
1176
|
-
return Y("div", { class: "flex items-center gap-2" }, [
|
|
1177
|
-
K,
|
|
1178
|
-
C !== "1" ? Y(
|
|
1179
|
-
"div",
|
|
1180
|
-
{ class: "py-3" },
|
|
1181
|
-
Y(
|
|
1182
|
-
We,
|
|
1183
|
-
Y(
|
|
1184
|
-
"div",
|
|
1185
|
-
{
|
|
1186
|
-
class: ["fm-status-badge", "fm-status-badge-draft"].join(" ")
|
|
1187
|
-
},
|
|
1188
|
-
`v${C}`
|
|
1189
|
-
)
|
|
1190
|
-
)
|
|
1191
|
-
) : null
|
|
1192
|
-
]);
|
|
1193
|
-
},
|
|
1194
|
-
enableSorting: !1,
|
|
1195
|
-
meta: {
|
|
1196
|
-
width: "10rem"
|
|
1197
|
-
}
|
|
1198
|
-
},
|
|
1199
|
-
{
|
|
1200
|
-
accessorKey: "ref",
|
|
1201
|
-
header: () => t("inventory.transfer.table.reference"),
|
|
1202
|
-
enableSorting: !1,
|
|
1203
|
-
size: "auto"
|
|
1204
|
-
},
|
|
1205
|
-
...(ne = d.sessionUser.value) != null && ne.role.isAdmin ? [
|
|
1206
|
-
{
|
|
1207
|
-
id: "statusForAdmin",
|
|
1208
|
-
header: () => Y(We, {}, () => `${t("inventory.transfer.table.status")}`),
|
|
1209
|
-
cell(P) {
|
|
1210
|
-
return P.row.original.status;
|
|
1211
|
-
},
|
|
1212
|
-
enableSorting: !0,
|
|
1213
|
-
size: 200
|
|
1214
|
-
}
|
|
1215
|
-
] : [],
|
|
1216
|
-
{
|
|
1217
|
-
accessorKey: "status",
|
|
1218
|
-
header: () => t("inventory.transfer.table.status"),
|
|
1219
|
-
cell(P) {
|
|
1220
|
-
const C = P.getValue(), K = ct(P.row.original), { partial: N, over: X } = _t(K), be = St(C ?? "", N, X);
|
|
1221
|
-
let ye = t(`inventory.transfer.status.${be}`), pe = `${C ?? ""}`.toLocaleLowerCase("en-us");
|
|
1222
|
-
be === ve.enum.CLOSE && (ye = `${t(`inventory.transfer.status.${ve.enum.COMPLETE}`)}`), be === "PARTIAL_RECEIVED" && pe === ve.enum.PROCESSING.toLocaleLowerCase("en-us") && (pe = ve.enum.RECEIVING.toLocaleLowerCase("en-us"));
|
|
1223
|
-
let fe = null;
|
|
1224
|
-
const f = n.value.find((i) => i.ref === P.row.original._id);
|
|
1225
|
-
if (f != null && f.milestones && f.milestones.length > 0) {
|
|
1226
|
-
const i = f.milestones[f.milestones.length - 1];
|
|
1227
|
-
if (i.estimatedTime) {
|
|
1228
|
-
const O = new Date(i.estimatedTime), M = O.getDate().toString().padStart(2, "0");
|
|
1229
|
-
fe = `${O.toLocaleString("en-US", { month: "short" })} ${M}`;
|
|
1230
|
-
}
|
|
1231
|
-
}
|
|
1232
|
-
return Y(
|
|
1233
|
-
"div",
|
|
1234
|
-
{
|
|
1235
|
-
class: "flex"
|
|
1236
|
-
},
|
|
1237
|
-
[
|
|
1238
|
-
Y(
|
|
1239
|
-
"div",
|
|
1240
|
-
{ class: "flex items-center" },
|
|
1241
|
-
Y(
|
|
1242
|
-
"div",
|
|
1243
|
-
{
|
|
1244
|
-
class: [
|
|
1245
|
-
"fm-status-badge",
|
|
1246
|
-
`fm-status-badge-${pe}`,
|
|
1247
|
-
X && "fm-status-badge-error"
|
|
1248
|
-
].filter(Boolean).join(" ")
|
|
1249
|
-
},
|
|
1250
|
-
`${ye}`
|
|
1251
|
-
)
|
|
1252
|
-
),
|
|
1253
|
-
...fe ? [
|
|
1254
|
-
Y(
|
|
1255
|
-
"div",
|
|
1256
|
-
{
|
|
1257
|
-
class: "flex items-center gap-1 ml-2"
|
|
1258
|
-
},
|
|
1259
|
-
[
|
|
1260
|
-
Y(lt.FmIcon, {
|
|
1261
|
-
name: "local_shipping",
|
|
1262
|
-
size: "md",
|
|
1263
|
-
color: "neutral-gray-400"
|
|
1264
|
-
}),
|
|
1265
|
-
Y(
|
|
1266
|
-
"span",
|
|
1267
|
-
{ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
|
|
1268
|
-
fe
|
|
1269
|
-
)
|
|
1270
|
-
]
|
|
1271
|
-
)
|
|
1272
|
-
] : []
|
|
1273
|
-
]
|
|
1274
|
-
);
|
|
1275
|
-
},
|
|
1276
|
-
enableSorting: !0,
|
|
1277
|
-
size: 150
|
|
1278
|
-
},
|
|
1279
|
-
{
|
|
1280
|
-
id: "action",
|
|
1281
|
-
cell(P) {
|
|
1282
|
-
const C = P.row.original, K = D(C);
|
|
1283
|
-
return Lt(K, (N) => S(N, C));
|
|
1284
|
-
},
|
|
1285
|
-
enableSorting: !1,
|
|
1286
|
-
size: 40,
|
|
1287
|
-
meta: {
|
|
1288
|
-
cellClass: "",
|
|
1289
|
-
headerClass: ""
|
|
1290
|
-
}
|
|
1291
|
-
}
|
|
1292
|
-
];
|
|
1293
|
-
if (v.isEnabled) {
|
|
1294
|
-
const P = [
|
|
1295
|
-
{
|
|
1296
|
-
id: "netsuiteTransferOrder",
|
|
1297
|
-
accessorFn: (C) => {
|
|
1298
|
-
var K;
|
|
1299
|
-
return (K = C.netSuite) != null && K.id ? `${C.netSuite.refNo} (${C.netSuite.id})` : "N/A";
|
|
1300
|
-
},
|
|
1301
|
-
header: () => "NetSuite Order (ID)",
|
|
1302
|
-
cell(C) {
|
|
1303
|
-
var N;
|
|
1304
|
-
const K = C.row.original;
|
|
1305
|
-
return (N = K.netSuite) != null && N.id ? `${K.netSuite.refNo} (${K.netSuite.id})` : "N/A";
|
|
1306
|
-
},
|
|
1307
|
-
enableSorting: !1,
|
|
1308
|
-
size: 200,
|
|
1309
|
-
meta: {
|
|
1310
|
-
cellClass: "",
|
|
1311
|
-
headerClass: ""
|
|
1312
|
-
}
|
|
1313
|
-
},
|
|
1314
|
-
{
|
|
1315
|
-
id: "netsuiteTransactionNumber",
|
|
1316
|
-
accessorFn: (C) => {
|
|
1317
|
-
var K, N;
|
|
1318
|
-
return ((N = (K = C.netSuite) == null ? void 0 : K.additionalInfo) == null ? void 0 : N.transactionnumber) ?? "N/A";
|
|
1319
|
-
},
|
|
1320
|
-
header: () => "NetSuite Transaction No.",
|
|
1321
|
-
cell(C) {
|
|
1322
|
-
var N, X;
|
|
1323
|
-
return ((X = (N = C.row.original.netSuite) == null ? void 0 : N.additionalInfo) == null ? void 0 : X.transactionnumber) ?? "N/A";
|
|
1324
|
-
},
|
|
1325
|
-
enableSorting: !1,
|
|
1326
|
-
size: 200,
|
|
1327
|
-
meta: {
|
|
1328
|
-
cellClass: "",
|
|
1329
|
-
headerClass: ""
|
|
1330
|
-
}
|
|
1331
|
-
}
|
|
1332
|
-
];
|
|
1333
|
-
R.splice(R.length - 1, 0, ...P);
|
|
1334
|
-
}
|
|
1335
|
-
return R;
|
|
1336
|
-
}
|
|
1337
|
-
function E() {
|
|
1338
|
-
var ne;
|
|
1339
|
-
const R = [
|
|
1340
|
-
{
|
|
1341
|
-
accessorKey: "purchaseOrder.seqNumber",
|
|
1342
|
-
header: () => t("inventory.transfer.table.seqNo"),
|
|
1343
|
-
enableSorting: !0,
|
|
1344
|
-
size: 80,
|
|
1345
|
-
sortUndefined: "last"
|
|
1346
|
-
},
|
|
1347
|
-
{
|
|
1348
|
-
accessorKey: "purchaseOrder._id",
|
|
1349
|
-
header: () => t("inventory.transfer.table.createdAt"),
|
|
1350
|
-
cell(P) {
|
|
1351
|
-
return st(`${P.getValue()}`);
|
|
1352
|
-
},
|
|
1353
|
-
enableSorting: !0
|
|
1354
|
-
},
|
|
1355
|
-
{
|
|
1356
|
-
accessorKey: "to.name",
|
|
1357
|
-
header: () => t("inventory.transfer.table.transferTo"),
|
|
1358
|
-
enableSorting: !1,
|
|
1359
|
-
size: 200
|
|
1360
|
-
},
|
|
1361
|
-
{
|
|
1362
|
-
accessorKey: "purchaseOrder.items.length",
|
|
1363
|
-
header: () => t("inventory.transfer.table.noOfItems"),
|
|
1364
|
-
enableSorting: !1
|
|
1365
|
-
},
|
|
1366
|
-
{
|
|
1367
|
-
accessorKey: "purchaseOrder.ref",
|
|
1368
|
-
header: () => t("inventory.transfer.table.reference"),
|
|
1369
|
-
enableSorting: !1,
|
|
1370
|
-
size: "auto"
|
|
1371
|
-
},
|
|
1372
|
-
...(ne = d.sessionUser.value) != null && ne.role.isAdmin ? [
|
|
1373
|
-
{
|
|
1374
|
-
id: "statusForAdmin",
|
|
1375
|
-
header: () => Y(We, {}, () => `${t("inventory.transfer.table.status")}`),
|
|
1376
|
-
cell(P) {
|
|
1377
|
-
return P.row.original.status;
|
|
1378
|
-
},
|
|
1379
|
-
enableSorting: !0,
|
|
1380
|
-
size: 200
|
|
1381
|
-
}
|
|
1382
|
-
] : [],
|
|
1383
|
-
{
|
|
1384
|
-
accessorKey: "purchaseOrder.status",
|
|
1385
|
-
header: () => t("inventory.transfer.table.status"),
|
|
1386
|
-
cell(P) {
|
|
1387
|
-
const C = P.row.original, K = P.getValue();
|
|
1388
|
-
if (!C.purchaseOrder)
|
|
1389
|
-
return Y(lt.FmChip, {
|
|
1390
|
-
label: "N/A",
|
|
1391
|
-
compact: !0
|
|
1392
|
-
});
|
|
1393
|
-
const N = ct(C.purchaseOrder), { partial: X, over: be } = _t(N), ye = St(K ?? "", X, be);
|
|
1394
|
-
let pe = t(`inventory.transfer.status.${ye}`), fe = `${K ?? ""}`.toLocaleLowerCase("en-us");
|
|
1395
|
-
return ye === ve.enum.CLOSE && (pe = `${t(`inventory.transfer.status.${ve.enum.COMPLETE}`)}`), ye === "PARTIAL_RECEIVED" && fe === ve.enum.PROCESSING.toLocaleLowerCase("en-us") && (fe = ve.enum.RECEIVING.toLocaleLowerCase("en-us")), C.rejectedAt && (pe = t("inventory.transfer.status.REJECT"), fe = ve.enum.REJECT.toLocaleLowerCase("en-us")), Y(
|
|
1396
|
-
"div",
|
|
1397
|
-
{
|
|
1398
|
-
class: "flex"
|
|
1399
|
-
},
|
|
1400
|
-
Y(
|
|
1401
|
-
"div",
|
|
1402
|
-
{
|
|
1403
|
-
class: [
|
|
1404
|
-
"fm-status-badge",
|
|
1405
|
-
`fm-status-badge-${fe}`,
|
|
1406
|
-
be && "fm-status-badge-error"
|
|
1407
|
-
].filter(Boolean).join(" ")
|
|
1408
|
-
},
|
|
1409
|
-
`${pe}`
|
|
1410
|
-
)
|
|
1411
|
-
);
|
|
1412
|
-
},
|
|
1413
|
-
enableSorting: !0
|
|
1414
|
-
},
|
|
1415
|
-
{
|
|
1416
|
-
id: "action",
|
|
1417
|
-
cell(P) {
|
|
1418
|
-
const C = P.row.original, N = (C.purchaseOrder ? D(C.purchaseOrder) : []).map((X) => X.value === Se.Print ? {
|
|
1419
|
-
...X,
|
|
1420
|
-
translationKey: "inventory.transfer.receiveRequest.details.printDeliveryOrder"
|
|
1421
|
-
} : X);
|
|
1422
|
-
return Lt(
|
|
1423
|
-
N,
|
|
1424
|
-
(X) => C.purchaseOrder ? S(X, C.purchaseOrder, C) : void 0
|
|
1425
|
-
);
|
|
1426
|
-
},
|
|
1427
|
-
enableSorting: !1,
|
|
1428
|
-
size: 40,
|
|
1429
|
-
meta: {
|
|
1430
|
-
cellClass: "",
|
|
1431
|
-
headerClass: ""
|
|
1432
|
-
}
|
|
1433
|
-
}
|
|
1434
|
-
];
|
|
1435
|
-
if (v.isEnabled) {
|
|
1436
|
-
const P = [
|
|
1437
|
-
{
|
|
1438
|
-
id: "netsuiteTransferOrder",
|
|
1439
|
-
accessorFn: (C) => {
|
|
1440
|
-
var K;
|
|
1441
|
-
return (K = C.netSuite) != null && K.id ? `${C.netSuite.refNo} (${C.netSuite.id})` : "N/A";
|
|
1442
|
-
},
|
|
1443
|
-
header: () => "NetSuite Order (ID)",
|
|
1444
|
-
cell(C) {
|
|
1445
|
-
var N;
|
|
1446
|
-
const K = C.row.original;
|
|
1447
|
-
return (N = K.netSuite) != null && N.id ? `${K.netSuite.refNo} (${K.netSuite.id})` : "N/A";
|
|
1448
|
-
},
|
|
1449
|
-
enableSorting: !1,
|
|
1450
|
-
size: 200,
|
|
1451
|
-
meta: {
|
|
1452
|
-
cellClass: "",
|
|
1453
|
-
headerClass: ""
|
|
1454
|
-
}
|
|
1455
|
-
},
|
|
1456
|
-
{
|
|
1457
|
-
id: "netsuiteTransactionNumber",
|
|
1458
|
-
accessorFn: (C) => {
|
|
1459
|
-
var K, N;
|
|
1460
|
-
return ((N = (K = C.netSuite) == null ? void 0 : K.additionalInfo) == null ? void 0 : N.transactionnumber) ?? "N/A";
|
|
1461
|
-
},
|
|
1462
|
-
header: () => "NetSuite Transaction No.",
|
|
1463
|
-
cell(C) {
|
|
1464
|
-
var N, X;
|
|
1465
|
-
return ((X = (N = C.row.original.netSuite) == null ? void 0 : N.additionalInfo) == null ? void 0 : X.transactionnumber) ?? "N/A";
|
|
1466
|
-
},
|
|
1467
|
-
enableSorting: !1,
|
|
1468
|
-
size: 200,
|
|
1469
|
-
meta: {
|
|
1470
|
-
cellClass: "",
|
|
1471
|
-
headerClass: ""
|
|
1472
|
-
}
|
|
1473
|
-
}
|
|
1474
|
-
];
|
|
1475
|
-
R.splice(R.length - 2, 0, ...P);
|
|
1476
|
-
}
|
|
1477
|
-
return R;
|
|
1478
|
-
}
|
|
1479
|
-
const J = j(() => b === "receive/request" ? F() : E()), z = Z(!1), ae = Z(""), ge = Z(""), H = Z(!1);
|
|
1480
|
-
return {
|
|
1481
|
-
columnDefs: J,
|
|
1482
|
-
showCustomPrintDialog: z,
|
|
1483
|
-
customPrintHtml: ae,
|
|
1484
|
-
customPrintTemplateName: ge,
|
|
1485
|
-
customPrintIsDefault: H
|
|
1486
|
-
};
|
|
1487
|
-
}
|
|
1488
|
-
const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, dr = { class: "flex flex-col gap-8" }, mr = { class: "flex w-full justify-end gap-16" }, pr = /* @__PURE__ */ qe({
|
|
1489
|
-
__name: "FulfillmentForm",
|
|
1490
|
-
props: {
|
|
1491
|
-
purchaseOrder: {},
|
|
1492
|
-
confirm: { type: Function }
|
|
1493
|
-
},
|
|
1494
|
-
emits: ["update:show"],
|
|
1495
|
-
setup(b, { emit: s }) {
|
|
1496
|
-
const n = b, c = gs({
|
|
1497
|
-
id: "",
|
|
1498
|
-
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1499
|
-
items: []
|
|
1500
|
-
}), v = Z(), d = s, p = (o) => o != null && o !== "";
|
|
1501
|
-
Wt(() => {
|
|
1502
|
-
n.purchaseOrder && (c.items = n.purchaseOrder.items.map((o) => ({
|
|
1503
|
-
id: o.id,
|
|
1504
|
-
sku: o.sku,
|
|
1505
|
-
measurement: o.measurement,
|
|
1506
|
-
amount: o.quantity ?? { amount: 1, precision: 0 }
|
|
1507
|
-
})));
|
|
1508
|
-
});
|
|
1509
|
-
const t = j(() => c.items.length <= 10);
|
|
1510
|
-
return (o, u) => {
|
|
1511
|
-
const k = re("FmTable"), $ = re("FmButton"), D = re("FmForm");
|
|
1512
|
-
return l(), me(D, {
|
|
1513
|
-
ref_key: "formRef",
|
|
1514
|
-
ref: v,
|
|
1515
|
-
class: "bg-white flex flex-col gap-32 rounded-3xl p-24 w-[800px]",
|
|
1516
|
-
onValidationFailed: console.log,
|
|
1517
|
-
onValidationSuccess: u[1] || (u[1] = () => n.confirm(c))
|
|
1518
|
-
}, {
|
|
1519
|
-
default: ce(() => [
|
|
1520
|
-
u[2] || (u[2] = e("div", { class: "fm-typo-en-title-sm-600" }, "Confirm the transfer amount", -1)),
|
|
1521
|
-
e("div", ur, [
|
|
1522
|
-
e("div", dr, [
|
|
1523
|
-
L(k, {
|
|
1524
|
-
"column-defs": [
|
|
1525
|
-
{
|
|
1526
|
-
header: "Code",
|
|
1527
|
-
cell: (T) => {
|
|
1528
|
-
const S = n.purchaseOrder.items.find((F) => p(T.row.original.id) ? F.id === T.row.original.id : F.sku._id === T.row.original.sku._id);
|
|
1529
|
-
return Y(
|
|
1530
|
-
_(lt).FmTooltip,
|
|
1531
|
-
{
|
|
1532
|
-
content: S.code,
|
|
1533
|
-
placement: "top",
|
|
1534
|
-
variant: "plain",
|
|
1535
|
-
zIndex: 50
|
|
1536
|
-
},
|
|
1537
|
-
Y(
|
|
1538
|
-
"span",
|
|
1539
|
-
{
|
|
1540
|
-
class: "flex-auto line-clamp-2 text-ellipsis break-all"
|
|
1541
|
-
},
|
|
1542
|
-
S.code
|
|
1543
|
-
)
|
|
1544
|
-
);
|
|
1545
|
-
}
|
|
1546
|
-
},
|
|
1547
|
-
{
|
|
1548
|
-
header: "Name",
|
|
1549
|
-
cell: (T) => {
|
|
1550
|
-
const S = n.purchaseOrder.items.find((F) => p(T.row.original.id) ? F.id === T.row.original.id : F.sku._id === T.row.original.sku._id);
|
|
1551
|
-
return Y(
|
|
1552
|
-
_(lt).FmTooltip,
|
|
1553
|
-
{
|
|
1554
|
-
content: S.name,
|
|
1555
|
-
placement: "top",
|
|
1556
|
-
variant: "plain",
|
|
1557
|
-
zIndex: 50
|
|
1558
|
-
},
|
|
1559
|
-
Y(
|
|
1560
|
-
"span",
|
|
1561
|
-
{
|
|
1562
|
-
class: "flex-auto line-clamp-2 text-ellipsis break-all"
|
|
1563
|
-
},
|
|
1564
|
-
S.name
|
|
1565
|
-
)
|
|
1566
|
-
);
|
|
1567
|
-
}
|
|
1568
|
-
},
|
|
1569
|
-
{
|
|
1570
|
-
header: "Amount",
|
|
1571
|
-
cell: (T) => {
|
|
1572
|
-
const S = T.row.original, F = n.purchaseOrder.items.find((J) => p(S.id) ? J.id === S.id : J.sku._id === S.sku._id), E = S.amount ?? {
|
|
1573
|
-
amount: 1,
|
|
1574
|
-
precision: 0
|
|
1575
|
-
};
|
|
1576
|
-
return Y(js, {
|
|
1577
|
-
style: {
|
|
1578
|
-
flex: "1 1 0%"
|
|
1579
|
-
},
|
|
1580
|
-
modelValue: {
|
|
1581
|
-
amount: E,
|
|
1582
|
-
measurement: S.measurement ?? null
|
|
1583
|
-
},
|
|
1584
|
-
key: p(S.id) ? S.id : S.sku._id,
|
|
1585
|
-
unit: S.sku.unit,
|
|
1586
|
-
"onUpdate:modelValue": (J) => {
|
|
1587
|
-
if (!J) return;
|
|
1588
|
-
const z = c.items.find((ae) => p(S.id) ? ae.id === S.id : ae.sku._id === S.sku._id);
|
|
1589
|
-
z && (z.amount = J.amount);
|
|
1590
|
-
},
|
|
1591
|
-
disableUnit: !0,
|
|
1592
|
-
rules: [
|
|
1593
|
-
_(Bs)(
|
|
1594
|
-
+_(xe)({ amount: 0, precision: 0 })
|
|
1595
|
-
),
|
|
1596
|
-
_(zs)(+_(xe)(F.quantity))
|
|
1597
|
-
],
|
|
1598
|
-
applyDefaultRules: !0
|
|
1599
|
-
});
|
|
1600
|
-
}
|
|
1601
|
-
}
|
|
1602
|
-
],
|
|
1603
|
-
"row-data": c.items,
|
|
1604
|
-
"hide-footer": t.value
|
|
1605
|
-
}, null, 8, ["column-defs", "row-data", "hide-footer"])
|
|
1606
|
-
])
|
|
1607
|
-
]),
|
|
1608
|
-
e("div", mr, [
|
|
1609
|
-
L($, {
|
|
1610
|
-
class: "px-16",
|
|
1611
|
-
label: "Confirm",
|
|
1612
|
-
size: "md",
|
|
1613
|
-
variant: "primary",
|
|
1614
|
-
type: "submit"
|
|
1615
|
-
}),
|
|
1616
|
-
L($, {
|
|
1617
|
-
class: "px-16",
|
|
1618
|
-
label: "Cancel",
|
|
1619
|
-
size: "md",
|
|
1620
|
-
variant: "secondary",
|
|
1621
|
-
onClick: u[0] || (u[0] = () => d("update:show", !1))
|
|
1622
|
-
})
|
|
1623
|
-
])
|
|
1624
|
-
]),
|
|
1625
|
-
_: 1
|
|
1626
|
-
}, 8, ["onValidationFailed"]);
|
|
1627
|
-
};
|
|
1628
|
-
}
|
|
1629
|
-
}), gt = {
|
|
1630
|
-
submitRequest: {
|
|
1631
|
-
translationKey: "inventory.transfer.receiveRequest.actions.submitRequest",
|
|
1632
|
-
color: "primary",
|
|
1633
|
-
buttonVariant: Ve.Primary
|
|
1634
|
-
},
|
|
1635
|
-
confirmDraft: {
|
|
1636
|
-
translationKey: "inventory.transfer.receiveRequest.actions.confirmDraft",
|
|
1637
|
-
color: "primary",
|
|
1638
|
-
buttonVariant: Ve.Primary
|
|
1639
|
-
},
|
|
1640
|
-
cancelDraft: {
|
|
1641
|
-
translationKey: "inventory.transfer.receiveRequest.actions.cancelDraft",
|
|
1642
|
-
color: "system-error-300",
|
|
1643
|
-
buttonVariant: Ve.Destructive
|
|
1644
|
-
},
|
|
1645
|
-
approveDraft: {
|
|
1646
|
-
translationKey: "inventory.transfer.receiveRequest.actions.approveDraft",
|
|
1647
|
-
color: "primary",
|
|
1648
|
-
buttonVariant: Ve.Primary
|
|
1649
|
-
},
|
|
1650
|
-
rejectDraft: {
|
|
1651
|
-
translationKey: "inventory.transfer.receiveRequest.actions.rejectDraft",
|
|
1652
|
-
color: "system-error-300",
|
|
1653
|
-
buttonVariant: Ve.Destructive
|
|
1654
|
-
},
|
|
1655
|
-
approveRequest: {
|
|
1656
|
-
translationKey: "inventory.transfer.receiveRequest.actions.approveRequest",
|
|
1657
|
-
color: "primary",
|
|
1658
|
-
buttonVariant: Ve.Primary
|
|
1659
|
-
},
|
|
1660
|
-
processRequest: {
|
|
1661
|
-
translationKey: "inventory.transfer.receiveRequest.actions.processRequest",
|
|
1662
|
-
color: "primary",
|
|
1663
|
-
buttonVariant: Ve.Primary
|
|
1664
|
-
},
|
|
1665
|
-
receiveStock: {
|
|
1666
|
-
translationKey: "inventory.transfer.receiveRequest.actions.receiveStock",
|
|
1667
|
-
color: "primary",
|
|
1668
|
-
buttonVariant: Ve.Primary,
|
|
1669
|
-
available: !1
|
|
1670
|
-
},
|
|
1671
|
-
completeReceive: {
|
|
1672
|
-
translationKey: "inventory.transfer.receiveRequest.actions.completeReceive",
|
|
1673
|
-
color: "primary",
|
|
1674
|
-
buttonVariant: Ve.Plain
|
|
1675
|
-
},
|
|
1676
|
-
rejectRequest: {
|
|
1677
|
-
translationKey: "inventory.transfer.receiveRequest.actions.rejectRequest",
|
|
1678
|
-
color: "system-error-300",
|
|
1679
|
-
buttonVariant: Ve.Destructive
|
|
1680
|
-
},
|
|
1681
|
-
closeRequest: {
|
|
1682
|
-
translationKey: "inventory.transfer.receiveRequest.actions.closeRequest",
|
|
1683
|
-
color: "system-error-300",
|
|
1684
|
-
buttonVariant: Ve.Destructive,
|
|
1685
|
-
available: !1
|
|
1686
|
-
},
|
|
1687
|
-
returnStock: {
|
|
1688
|
-
translationKey: "inventory.transfer.receiveRequest.actions.returnStock",
|
|
1689
|
-
color: "primary",
|
|
1690
|
-
buttonVariant: Ve.Primary,
|
|
1691
|
-
available: !1
|
|
1692
|
-
}
|
|
1693
|
-
}, fr = { class: "flex flex-row-reverse" }, vr = /* @__PURE__ */ qe({
|
|
1694
|
-
__name: "NetSuiteSync",
|
|
1695
|
-
props: {
|
|
1696
|
-
poRequest: {},
|
|
1697
|
-
purchaseOrder: {},
|
|
1698
|
-
isTransferBetweenOutlets: { type: Boolean },
|
|
1699
|
-
scope: {}
|
|
1700
|
-
},
|
|
1701
|
-
setup(b) {
|
|
1702
|
-
const s = b, n = pt(), c = Qe(), v = ft(), d = Z(!1);
|
|
1703
|
-
j(() => {
|
|
1704
|
-
var k, $, D, T;
|
|
1705
|
-
let t = !0;
|
|
1706
|
-
n.isEnabled || (t = !1);
|
|
1707
|
-
const o = s.purchaseOrder, u = s.poRequest;
|
|
1708
|
-
return o && ((k = o == null ? void 0 : o.supplier) != null && k.internal ? (!u && o.status == ve.enum.DRAFT && (t = !1), u && !(($ = u == null ? void 0 : u.netSuite) != null && $.id) && (t = !1), s.isTransferBetweenOutlets && (t = !1)) : ((o == null ? void 0 : o.status) !== ve.enum.REQUESTING && o.supplier.internal && (t = !1), !u && !((D = o == null ? void 0 : o.netSuite) != null && D.id) && (t = !1), !u && ((T = o == null ? void 0 : o.netSuite) != null && T.id) && (o == null ? void 0 : o.status) == ve.enum.REQUESTING && (t = !1))), t;
|
|
1709
|
-
});
|
|
1710
|
-
async function p() {
|
|
1711
|
-
d.value || v.open({
|
|
1712
|
-
title: "Sync with NetSuite",
|
|
1713
|
-
contentComponent: Y("div", [
|
|
1714
|
-
Y("p", "Are you sure you want to sync now?"),
|
|
1715
|
-
Y("br"),
|
|
1716
|
-
Y(
|
|
1717
|
-
"p",
|
|
1718
|
-
{ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
1719
|
-
"Please wait a moment before syncing manually to avoid unnecessary actions."
|
|
1720
|
-
)
|
|
1721
|
-
]),
|
|
1722
|
-
primaryActions: {
|
|
1723
|
-
text: "Sync",
|
|
1724
|
-
close: !0,
|
|
1725
|
-
variant: "destructive"
|
|
1726
|
-
},
|
|
1727
|
-
secondaryActions: { text: "Not now", close: !0 }
|
|
1728
|
-
}).onPrimary(async () => {
|
|
1729
|
-
var t, o, u, k, $, D, T;
|
|
1730
|
-
try {
|
|
1731
|
-
d.value = !0;
|
|
1732
|
-
const S = ((t = s.purchaseOrder) == null ? void 0 : t._id) || ((o = s.poRequest) == null ? void 0 : o.purchaseOrderId) || "", F = (u = s.poRequest) == null ? void 0 : u.to.dbName;
|
|
1733
|
-
await n.syncPurchaseOrder({
|
|
1734
|
-
purchaseOrderId: S,
|
|
1735
|
-
locationId: s.scope === "approval" ? F : void 0,
|
|
1736
|
-
netsuiteId: (($ = (k = s.purchaseOrder) == null ? void 0 : k.netSuite) == null ? void 0 : $.id) || ((T = (D = s.poRequest) == null ? void 0 : D.netSuite) == null ? void 0 : T.id)
|
|
1737
|
-
}), c.open({
|
|
1738
|
-
title: "Sync with NetSuite",
|
|
1739
|
-
message: "Requested to sync with NetSuite. Please wait a moment.",
|
|
1740
|
-
type: "success"
|
|
1741
|
-
}), await new Promise((E) => setTimeout(E, 5e3)), d.value = !1;
|
|
1742
|
-
} catch (S) {
|
|
1743
|
-
console.log("Failed to sync with NetSuite", S), c.open({
|
|
1744
|
-
title: "Error",
|
|
1745
|
-
message: "Failed to sync with NetSuite",
|
|
1746
|
-
type: "error"
|
|
1747
|
-
}), d.value = !1;
|
|
1748
|
-
}
|
|
1749
|
-
});
|
|
1750
|
-
}
|
|
1751
|
-
return (t, o) => {
|
|
1752
|
-
const u = re("FmButton");
|
|
1753
|
-
return l(), h("div", fr, [
|
|
1754
|
-
L(u, {
|
|
1755
|
-
"prepend-icon": "sync",
|
|
1756
|
-
variant: "secondary",
|
|
1757
|
-
label: "Sync",
|
|
1758
|
-
loading: d.value,
|
|
1759
|
-
onClick: p,
|
|
1760
|
-
"text-color": "primary",
|
|
1761
|
-
"bg-color": "transparent",
|
|
1762
|
-
"border-color": "primary"
|
|
1763
|
-
}, null, 8, ["loading"])
|
|
1764
|
-
]);
|
|
1765
|
-
};
|
|
1766
|
-
}
|
|
1767
|
-
}), yr = {
|
|
1768
|
-
key: 0,
|
|
1769
|
-
class: "flex flex-col gap-8"
|
|
1770
|
-
}, br = { class: "flex flex-col gap-4" }, hr = { class: "fm-typo-en-body-lg-600" }, gr = {
|
|
1771
|
-
key: 0,
|
|
1772
|
-
class: "flex flex-col gap-4"
|
|
1773
|
-
}, _r = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Sr = { class: "fm-typo-en-body-lg-600" }, xr = { key: 0 }, kr = { key: 1 }, Or = {
|
|
1774
|
-
key: 1,
|
|
1775
|
-
class: "flex flex-col gap-4"
|
|
1776
|
-
}, wr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, $r = { class: "fm-typo-en-body-lg-600" }, Cr = { key: 0 }, Dr = { key: 1 }, Rr = {
|
|
1777
|
-
key: 2,
|
|
1778
|
-
class: "flex flex-col gap-4"
|
|
1779
|
-
}, Nr = { class: "fm-typo-en-body-lg-600" }, Ar = {
|
|
1780
|
-
key: 3,
|
|
1781
|
-
class: "flex flex-col gap-4"
|
|
1782
|
-
}, Tr = { class: "fm-typo-en-body-lg-600" }, Pr = /* @__PURE__ */ qe({
|
|
1783
|
-
__name: "NetSuiteInfo",
|
|
1784
|
-
props: {
|
|
1785
|
-
transferType: {},
|
|
1786
|
-
transferToDbName: {},
|
|
1787
|
-
poRequest: {},
|
|
1788
|
-
purchaseOrder: {},
|
|
1789
|
-
isTransferBetweenOutlets: { type: Boolean },
|
|
1790
|
-
scope: {}
|
|
1791
|
-
},
|
|
1792
|
-
setup(b) {
|
|
1793
|
-
const s = b, n = pt(), c = Ye(), v = Z(s.poRequest);
|
|
1794
|
-
Wt(async () => {
|
|
1795
|
-
var o;
|
|
1796
|
-
if (!s.poRequest && ((o = s.purchaseOrder) != null && o._id)) {
|
|
1797
|
-
const u = await c.getLatestPurchaseOrderRequest(s.purchaseOrder._id);
|
|
1798
|
-
v.value = u;
|
|
1799
|
-
}
|
|
1800
|
-
});
|
|
1801
|
-
const d = j(
|
|
1802
|
-
() => {
|
|
1803
|
-
var o, u, k, $, D, T;
|
|
1804
|
-
return n.getSubsidiaryFullName(
|
|
1805
|
-
((k = (u = (o = s.purchaseOrder) == null ? void 0 : o.netSuite) == null ? void 0 : u.subsidiary) == null ? void 0 : k.id) || ((T = (D = ($ = s.poRequest) == null ? void 0 : $.netSuite) == null ? void 0 : D.subsidiary) == null ? void 0 : T.id)
|
|
1806
|
-
).fullName;
|
|
1807
|
-
}
|
|
1808
|
-
), p = j(() => {
|
|
1809
|
-
var o, u, k, $, D, T, S, F, E, J, z, ae;
|
|
1810
|
-
return (k = (u = (o = s.purchaseOrder) == null ? void 0 : o.netSuite) == null ? void 0 : u.additionalInfo) != null && k.transactionnumber ? (T = (D = ($ = s.purchaseOrder) == null ? void 0 : $.netSuite) == null ? void 0 : D.additionalInfo) == null ? void 0 : T.transactionnumber : (E = (F = (S = v.value) == null ? void 0 : S.netSuite) == null ? void 0 : F.additionalInfo) != null && E.transactionnumber ? (ae = (z = (J = v.value) == null ? void 0 : J.netSuite) == null ? void 0 : z.additionalInfo) == null ? void 0 : ae.transactionnumber : null;
|
|
1811
|
-
}), t = j(() => {
|
|
1812
|
-
var o, u, k, $, D, T;
|
|
1813
|
-
return (u = (o = s.purchaseOrder) == null ? void 0 : o.deliveryFullfillment) != null && u.length && (($ = (k = s.purchaseOrder) == null ? void 0 : k.deliveryFullfillment) == null ? void 0 : $.length) > 0 ? (T = (D = s.purchaseOrder) == null ? void 0 : D.deliveryFullfillment) == null ? void 0 : T.map((S) => {
|
|
1814
|
-
var F;
|
|
1815
|
-
return (F = S.netSuite) == null ? void 0 : F.refNo;
|
|
1816
|
-
}).join(", ") : "N/A";
|
|
1817
|
-
});
|
|
1818
|
-
return (o, u) => {
|
|
1819
|
-
var k, $, D, T, S, F, E, J, z, ae, ge, H, R, ne, P, C;
|
|
1820
|
-
return _(n).isEnabled ? (l(), h("div", yr, [
|
|
1821
|
-
e("div", br, [
|
|
1822
|
-
u[0] || (u[0] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "NetSuite subsidiary", -1)),
|
|
1823
|
-
e("div", hr, x(d.value || "N/A"), 1)
|
|
1824
|
-
]),
|
|
1825
|
-
!o.isTransferBetweenOutlets && o.scope === _(xt).RECEIVE_REQUEST ? (l(), h("div", gr, [
|
|
1826
|
-
e("div", _r, " NetSuite " + x(($ = (k = o.purchaseOrder) == null ? void 0 : k.netSuite) != null && $.recordType ? _(Jt)((T = (D = o.purchaseOrder) == null ? void 0 : D.netSuite) == null ? void 0 : T.recordType) : o.transferType === _(et).enum.purchase ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
|
|
1827
|
-
e("div", Sr, [
|
|
1828
|
-
(F = (S = o.purchaseOrder) == null ? void 0 : S.netSuite) != null && F.id ? (l(), h("span", xr, x((J = (E = o.purchaseOrder) == null ? void 0 : E.netSuite) == null ? void 0 : J.refNo) + " (" + x((ae = (z = o.purchaseOrder) == null ? void 0 : z.netSuite) == null ? void 0 : ae.id) + ") ", 1)) : (l(), h("span", kr, "N/A"))
|
|
1829
|
-
])
|
|
1830
|
-
])) : I("", !0),
|
|
1831
|
-
!o.isTransferBetweenOutlets && v.value || o.scope === _(xt).APPROVAL ? (l(), h("div", Or, [
|
|
1832
|
-
e("div", wr, " (Request) NetSuite " + x(o.transferType === _(et).enum.purchase ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
|
|
1833
|
-
e("div", $r, [
|
|
1834
|
-
(H = (ge = v.value) == null ? void 0 : ge.netSuite) != null && H.id ? (l(), h("span", Cr, x((ne = (R = v.value) == null ? void 0 : R.netSuite) == null ? void 0 : ne.refNo) + " (" + x((C = (P = v.value) == null ? void 0 : P.netSuite) == null ? void 0 : C.id) + ") ", 1)) : (l(), h("span", Dr, "N/A"))
|
|
1835
|
-
])
|
|
1836
|
-
])) : I("", !0),
|
|
1837
|
-
p.value ? (l(), h("div", Rr, [
|
|
1838
|
-
u[1] || (u[1] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite Transaction Number ", -1)),
|
|
1839
|
-
e("div", Nr, x(p.value), 1)
|
|
1840
|
-
])) : I("", !0),
|
|
1841
|
-
_(n).isEnabled && o.transferType === _(et).enum.transfer && !o.isTransferBetweenOutlets ? (l(), h("div", Ar, [
|
|
1842
|
-
u[2] || (u[2] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite fulfillment IDs ", -1)),
|
|
1843
|
-
e("div", Tr, x(t.value), 1)
|
|
1844
|
-
])) : I("", !0)
|
|
1845
|
-
])) : I("", !0);
|
|
1846
|
-
};
|
|
1847
|
-
}
|
|
1848
|
-
}), Ir = { class: "flex flex-row-reverse" }, Fr = /* @__PURE__ */ qe({
|
|
1849
|
-
__name: "NetSuiteLog",
|
|
1850
|
-
props: {
|
|
1851
|
-
netsuiteId: {},
|
|
1852
|
-
purchaseOrderId: {}
|
|
1853
|
-
},
|
|
1854
|
-
setup(b) {
|
|
1855
|
-
const s = Qe(), n = $t();
|
|
1856
|
-
async function c(v, d) {
|
|
1857
|
-
const p = [];
|
|
1858
|
-
if (v && p.push(`body.message:*${v}*`), d) {
|
|
1859
|
-
const k = d.replace(/:/g, "\\:");
|
|
1860
|
-
p.push(`${k}`);
|
|
1861
|
-
}
|
|
1862
|
-
if (p.length === 0) {
|
|
1863
|
-
s.open({
|
|
1864
|
-
message: "Cannot open logs without valid filters.",
|
|
1865
|
-
type: "error"
|
|
1866
|
-
});
|
|
1867
|
-
return;
|
|
1868
|
-
}
|
|
1869
|
-
const o = `attributes.pod:netsuite* AND (${p.join(" OR ")})`, { url: u } = await n.getSyncLogs(o);
|
|
1870
|
-
s.open(
|
|
1871
|
-
{
|
|
1872
|
-
message: "Opening NetSuite logs...",
|
|
1873
|
-
type: "info"
|
|
1874
|
-
},
|
|
1875
|
-
800
|
|
1876
|
-
), await new Promise((k) => setTimeout(k, 800)), window.open(u, "_blank");
|
|
1877
|
-
}
|
|
1878
|
-
return (v, d) => {
|
|
1879
|
-
const p = re("FmButton");
|
|
1880
|
-
return l(), h("div", Ir, [
|
|
1881
|
-
L(p, {
|
|
1882
|
-
"prepend-icon": "history",
|
|
1883
|
-
variant: "secondary",
|
|
1884
|
-
label: "Logs",
|
|
1885
|
-
onClick: d[0] || (d[0] = (t) => c(v.netsuiteId, v.purchaseOrderId)),
|
|
1886
|
-
"text-color": "primary",
|
|
1887
|
-
"bg-color": "transparent",
|
|
1888
|
-
"border-color": "primary"
|
|
1889
|
-
})
|
|
1890
|
-
]);
|
|
1891
|
-
};
|
|
1892
|
-
}
|
|
1893
|
-
}), Er = { class: "flex flex-row-reverse" }, qr = { key: 0 }, Vr = { key: 1 }, Lr = { class: "mb-6" }, Ur = { class: "fm-typo-en-body-md-400" }, Mr = { key: 0 }, jr = { key: 1 }, Br = {
|
|
1894
|
-
key: 0,
|
|
1895
|
-
class: "flex"
|
|
1896
|
-
}, zr = {
|
|
1897
|
-
key: 1,
|
|
1898
|
-
class: "border-t pt-6"
|
|
1899
|
-
}, Kr = { class: "fm-typo-en-body-lg-600 mb-4 flex items-center gap-2" }, Hr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg overflow-y-auto" }, Gr = { class: "w-full" }, Wr = {
|
|
1900
|
-
class: "p-3 fm-typo-en-body-sm-600",
|
|
1901
|
-
style: { "min-width": "130px" }
|
|
1902
|
-
}, Qr = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, 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-600" }, so = { key: 2 }, ro = { key: 1 }, oo = /* @__PURE__ */ qe({
|
|
1903
|
-
__name: "NetSuiteLatestInfo",
|
|
1904
|
-
props: {
|
|
1905
|
-
netsuiteId: {},
|
|
1906
|
-
purchaseOrderId: {}
|
|
1907
|
-
},
|
|
1908
|
-
setup(b) {
|
|
1909
|
-
const s = b, n = $t(), c = Z(!1), v = Me(), d = Z(!0), p = Z(!1), t = Z(!1), o = Z(!1), u = Z(null), k = Z([]);
|
|
1910
|
-
async function $() {
|
|
1911
|
-
if (!u.value) {
|
|
1912
|
-
c.value = !0;
|
|
1913
|
-
try {
|
|
1914
|
-
d.value = !0;
|
|
1915
|
-
const F = await n.getMoreInfo(
|
|
1916
|
-
v.currentLocation.dbName,
|
|
1917
|
-
s.purchaseOrderId
|
|
1918
|
-
);
|
|
1919
|
-
u.value = F, p.value = !1;
|
|
1920
|
-
} catch {
|
|
1921
|
-
p.value = !0;
|
|
1922
|
-
} finally {
|
|
1923
|
-
d.value = !1;
|
|
1924
|
-
}
|
|
1925
|
-
await D();
|
|
1926
|
-
}
|
|
1927
|
-
}
|
|
1928
|
-
async function D() {
|
|
1929
|
-
if (!(k.value.length > 0))
|
|
1930
|
-
try {
|
|
1931
|
-
t.value = !0;
|
|
1932
|
-
const F = await n.getChangeLogs(s.netsuiteId);
|
|
1933
|
-
k.value = F, o.value = !1;
|
|
1934
|
-
} catch {
|
|
1935
|
-
o.value = !0;
|
|
1936
|
-
} finally {
|
|
1937
|
-
t.value = !1;
|
|
1938
|
-
}
|
|
1939
|
-
}
|
|
1940
|
-
function T(F) {
|
|
1941
|
-
switch (F) {
|
|
1942
|
-
case Le.Create:
|
|
1943
|
-
return "text-green-600 bg-green-100";
|
|
1944
|
-
case Le.Set:
|
|
1945
|
-
return "text-blue-600 bg-blue-100";
|
|
1946
|
-
case Le.Change:
|
|
1947
|
-
return "text-yellow-600 bg-yellow-100";
|
|
1948
|
-
case Le.Unset:
|
|
1949
|
-
return "text-red-600 bg-red-100";
|
|
1950
|
-
default:
|
|
1951
|
-
return "text-gray-600 bg-gray-100";
|
|
1952
|
-
}
|
|
1953
|
-
}
|
|
1954
|
-
function S(F) {
|
|
1955
|
-
return new Date(F).toLocaleDateString("en-US", {
|
|
1956
|
-
year: "numeric",
|
|
1957
|
-
month: "short",
|
|
1958
|
-
day: "numeric",
|
|
1959
|
-
hour: "2-digit",
|
|
1960
|
-
minute: "2-digit"
|
|
1961
|
-
});
|
|
1962
|
-
}
|
|
1963
|
-
return (F, E) => {
|
|
1964
|
-
const J = re("FmButton"), z = re("FmLabel"), ae = re("FmCircularProgress"), ge = re("FmIcon"), H = re("FmDialog");
|
|
1965
|
-
return l(), h("div", Er, [
|
|
1966
|
-
L(H, {
|
|
1967
|
-
modelValue: c.value,
|
|
1968
|
-
"onUpdate:modelValue": E[2] || (E[2] = (R) => c.value = R),
|
|
1969
|
-
overlay: !0,
|
|
1970
|
-
"max-width": 800
|
|
1971
|
-
}, {
|
|
1972
|
-
"dialog-button": ce(() => [
|
|
1973
|
-
L(J, {
|
|
1974
|
-
"prepend-icon": "info",
|
|
1975
|
-
variant: "secondary",
|
|
1976
|
-
label: "Latest Info",
|
|
1977
|
-
onClick: E[0] || (E[0] = (R) => $()),
|
|
1978
|
-
"text-color": "primary",
|
|
1979
|
-
"bg-color": "transparent",
|
|
1980
|
-
"border-color": "primary"
|
|
1981
|
-
})
|
|
1982
|
-
]),
|
|
1983
|
-
"dialog-header": ce(() => E[3] || (E[3] = [
|
|
1984
|
-
e("div", null, "NetSuite latest info", -1)
|
|
1985
|
-
])),
|
|
1986
|
-
default: ce(() => [
|
|
1987
|
-
d.value ? (l(), h("div", qr, "Loading...")) : (l(), h("div", Vr, [
|
|
1988
|
-
p.value ? (l(), h("p", ro, "Something went wrong.")) : (l(), h(Ce, { key: 0 }, [
|
|
1989
|
-
e("div", Lr, [
|
|
1990
|
-
E[4] || (E[4] = e("h3", { class: "fm-typo-en-body-lg-600 mb-4" }, "NetSuite Order Details", -1)),
|
|
1991
|
-
(l(!0), h(Ce, null, Ee(u.value, (R, ne) => (l(), h("div", {
|
|
1992
|
-
key: ne,
|
|
1993
|
-
class: "mb-2"
|
|
1994
|
-
}, [
|
|
1995
|
-
e("div", null, [
|
|
1996
|
-
L(z, {
|
|
1997
|
-
label: _(Ot)(ne)
|
|
1998
|
-
}, null, 8, ["label"]),
|
|
1999
|
-
e("div", Ur, [
|
|
2000
|
-
Array.isArray(R) ? (l(), h("span", Mr, x(R.length > 0 ? R.join(", ") : "N/A"), 1)) : (l(), h("span", jr, x(R), 1))
|
|
2001
|
-
])
|
|
2002
|
-
])
|
|
2003
|
-
]))), 128))
|
|
2004
|
-
]),
|
|
2005
|
-
t.value ? (l(), h("div", Br, [
|
|
2006
|
-
E[5] || (E[5] = e("span", null, "Change Log Loading...", -1)),
|
|
2007
|
-
L(ae, { size: "md" })
|
|
2008
|
-
])) : I("", !0),
|
|
2009
|
-
!t.value && k.value.length > 0 ? (l(), h("div", zr, [
|
|
2010
|
-
e("h3", Kr, [
|
|
2011
|
-
L(ge, {
|
|
2012
|
-
name: "error",
|
|
2013
|
-
color: "#ff9500",
|
|
2014
|
-
size: "sm"
|
|
2015
|
-
}),
|
|
2016
|
-
E[6] || (E[6] = ze(" Change Logs "))
|
|
2017
|
-
]),
|
|
2018
|
-
e("div", Hr, [
|
|
2019
|
-
e("table", Gr, [
|
|
2020
|
-
E[7] || (E[7] = e("thead", { class: "bg-fm-color-neutral-gray-50" }, [
|
|
2021
|
-
e("tr", { class: "border-b border-fm-color-neutral-gray-200" }, [
|
|
2022
|
-
e("th", {
|
|
2023
|
-
class: "text-left p-3 fm-typo-en-body-md-600",
|
|
2024
|
-
style: { "min-width": "130px" }
|
|
2025
|
-
}, " Date "),
|
|
2026
|
-
e("th", { class: "text-left p-3 fm-typo-en-body-md-600" }, "Role"),
|
|
2027
|
-
e("th", { class: "text-left p-3 fm-typo-en-body-md-600" }, "Name"),
|
|
2028
|
-
e("th", { class: "text-left p-3 fm-typo-en-body-md-600" }, "Context"),
|
|
2029
|
-
e("th", { class: "text-left p-3 fm-typo-en-body-md-600" }, "Type"),
|
|
2030
|
-
e("th", { class: "text-left p-3 fm-typo-en-body-md-600" }, "Line ID"),
|
|
2031
|
-
e("th", { class: "text-left p-3 fm-typo-en-body-md-600" }, "Field"),
|
|
2032
|
-
e("th", { class: "text-left p-3 fm-typo-en-body-md-600" }, "Old Value"),
|
|
2033
|
-
e("th", { class: "text-left p-3 fm-typo-en-body-md-600" }, "New Value")
|
|
2034
|
-
])
|
|
2035
|
-
], -1)),
|
|
2036
|
-
e("tbody", null, [
|
|
2037
|
-
(l(!0), h(Ce, null, Ee(k.value, (R, ne) => (l(), h("tr", {
|
|
2038
|
-
key: ne,
|
|
2039
|
-
class: "border-b border-fm-color-neutral-gray-200 last:border-b-0"
|
|
2040
|
-
}, [
|
|
2041
|
-
e("td", Wr, x(S(R._dateiso8601)), 1),
|
|
2042
|
-
e("td", Qr, x(R._rolename), 1),
|
|
2043
|
-
e("td", Yr, x(R._employeename), 1),
|
|
2044
|
-
e("td", Jr, x(R._contextname), 1),
|
|
2045
|
-
e("td", {
|
|
2046
|
-
class: Ue(`p-3 fm-typo-en-body-sm-600 ${T(Number(R.type) - 1)}`)
|
|
2047
|
-
}, x(_(Le)[Number(R.type) - 1]), 3),
|
|
2048
|
-
e("td", Xr, x(R.lineid || ""), 1),
|
|
2049
|
-
e("td", Zr, x(R._fieldname), 1),
|
|
2050
|
-
e("td", eo, x(R.oldvalue || ""), 1),
|
|
2051
|
-
e("td", to, x(R.newvalue || ""), 1)
|
|
2052
|
-
]))), 128))
|
|
2053
|
-
])
|
|
2054
|
-
])
|
|
2055
|
-
])
|
|
2056
|
-
])) : (l(), h("div", so, E[8] || (E[8] = [
|
|
2057
|
-
e("p", null, "No change logs available.", -1)
|
|
2058
|
-
])))
|
|
2059
|
-
], 64))
|
|
2060
|
-
]))
|
|
2061
|
-
]),
|
|
2062
|
-
"dialog-footer": ce(() => [
|
|
2063
|
-
L(J, {
|
|
2064
|
-
class: "ml-auto sm:w-full xs:w-full",
|
|
2065
|
-
label: "Close",
|
|
2066
|
-
size: "md",
|
|
2067
|
-
variant: "primary",
|
|
2068
|
-
onClick: E[1] || (E[1] = (R) => c.value = !1)
|
|
2069
|
-
})
|
|
2070
|
-
]),
|
|
2071
|
-
_: 1
|
|
2072
|
-
}, 8, ["modelValue"])
|
|
2073
|
-
]);
|
|
2074
|
-
};
|
|
2075
|
-
}
|
|
2076
|
-
}), no = {
|
|
2077
|
-
key: 0,
|
|
2078
|
-
class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16 flex flex-col gap-8"
|
|
2079
|
-
}, ao = { class: "flex gap-8 items-center" }, lo = { class: "ml-auto" }, io = { class: "flex gap-3" }, co = /* @__PURE__ */ qe({
|
|
2080
|
-
__name: "NetSuitePanel",
|
|
2081
|
-
props: {
|
|
2082
|
-
poRequest: {},
|
|
2083
|
-
purchaseOrder: {},
|
|
2084
|
-
transferType: {},
|
|
2085
|
-
transferToDbName: {},
|
|
2086
|
-
scope: {}
|
|
2087
|
-
},
|
|
2088
|
-
setup(b) {
|
|
2089
|
-
const s = b, n = Hs(), c = j(() => n.isNetSuiteEnabled);
|
|
2090
|
-
return (v, d) => {
|
|
2091
|
-
var t, o;
|
|
2092
|
-
const p = re("FmMenuDivider");
|
|
2093
|
-
return c.value ? (l(), h("div", no, [
|
|
2094
|
-
e("div", ao, [
|
|
2095
|
-
d[0] || (d[0] = e("span", { class: "flex-1 fm-typo-en-body-lg-600" }, "NetSuite Info", -1)),
|
|
2096
|
-
e("div", lo, [
|
|
2097
|
-
e("div", io, [
|
|
2098
|
-
(o = (t = s.purchaseOrder) == null ? void 0 : t.netSuite) != null && o.id ? (l(), me(We, { key: 0 }, {
|
|
2099
|
-
default: ce(() => {
|
|
2100
|
-
var u, k, $;
|
|
2101
|
-
return [
|
|
2102
|
-
L(oo, {
|
|
2103
|
-
"netsuite-id": (k = (u = v.purchaseOrder) == null ? void 0 : u.netSuite) == null ? void 0 : k.id,
|
|
2104
|
-
"purchase-order-id": ($ = v.purchaseOrder) == null ? void 0 : $._id
|
|
2105
|
-
}, null, 8, ["netsuite-id", "purchase-order-id"])
|
|
2106
|
-
];
|
|
2107
|
-
}),
|
|
2108
|
-
_: 1
|
|
2109
|
-
})) : I("", !0),
|
|
2110
|
-
L(We, null, {
|
|
2111
|
-
default: ce(() => {
|
|
2112
|
-
var u, k, $;
|
|
2113
|
-
return [
|
|
2114
|
-
L(Fr, {
|
|
2115
|
-
"netsuite-id": (k = (u = v.purchaseOrder) == null ? void 0 : u.netSuite) == null ? void 0 : k.id,
|
|
2116
|
-
"purchase-order-id": ($ = v.purchaseOrder) == null ? void 0 : $._id
|
|
2117
|
-
}, null, 8, ["netsuite-id", "purchase-order-id"])
|
|
2118
|
-
];
|
|
2119
|
-
}),
|
|
2120
|
-
_: 1
|
|
2121
|
-
}),
|
|
2122
|
-
L(vr, {
|
|
2123
|
-
"po-request": v.poRequest,
|
|
2124
|
-
"purchase-order": v.purchaseOrder,
|
|
2125
|
-
"is-transfer-between-outlets": !c.value,
|
|
2126
|
-
scope: v.scope
|
|
2127
|
-
}, null, 8, ["po-request", "purchase-order", "is-transfer-between-outlets", "scope"])
|
|
2128
|
-
])
|
|
2129
|
-
])
|
|
2130
|
-
]),
|
|
2131
|
-
L(p),
|
|
2132
|
-
L(Pr, {
|
|
2133
|
-
"po-request": v.poRequest,
|
|
2134
|
-
"purchase-order": v.purchaseOrder,
|
|
2135
|
-
"transfer-type": v.transferType,
|
|
2136
|
-
"transfer-to-db-name": v.transferToDbName,
|
|
2137
|
-
"is-transfer-between-outlets": !c.value,
|
|
2138
|
-
scope: v.scope
|
|
2139
|
-
}, null, 8, ["po-request", "purchase-order", "transfer-type", "transfer-to-db-name", "is-transfer-between-outlets", "scope"])
|
|
2140
|
-
])) : I("", !0);
|
|
2141
|
-
};
|
|
2142
|
-
}
|
|
2143
|
-
}), uo = ["open"], mo = { class: "fm-typo-en-body-sm-600 cursor-pointer select-none" }, Ht = /* @__PURE__ */ qe({
|
|
2144
|
-
__name: "FmAdminCollapsiblePanel",
|
|
2145
|
-
props: {
|
|
2146
|
-
title: { default: "Admin" },
|
|
2147
|
-
open: { type: Boolean, default: !1 },
|
|
2148
|
-
selectable: { type: Boolean, default: !0 },
|
|
2149
|
-
class: { default: void 0 },
|
|
2150
|
-
contentClass: { default: void 0 }
|
|
2151
|
-
},
|
|
2152
|
-
setup(b) {
|
|
2153
|
-
const s = b;
|
|
2154
|
-
return (n, c) => (l(), me(We, {
|
|
2155
|
-
selectable: s.selectable,
|
|
2156
|
-
class: Ue(s.class)
|
|
2157
|
-
}, {
|
|
2158
|
-
default: ce(() => [
|
|
2159
|
-
e("details", {
|
|
2160
|
-
open: s.open,
|
|
2161
|
-
class: "w-full"
|
|
2162
|
-
}, [
|
|
2163
|
-
e("summary", mo, x(s.title), 1),
|
|
2164
|
-
e("div", {
|
|
2165
|
-
class: Ue(["mt-4 flex flex-col gap-2", s.contentClass])
|
|
2166
|
-
}, [
|
|
2167
|
-
_s(n.$slots, "default")
|
|
2168
|
-
], 2)
|
|
2169
|
-
], 8, uo)
|
|
2170
|
-
]),
|
|
2171
|
-
_: 3
|
|
2172
|
-
}, 8, ["selectable", "class"]));
|
|
2173
|
-
}
|
|
2174
|
-
});
|
|
2175
|
-
function is(b) {
|
|
2176
|
-
if (!(b != null && b.itemsAtSubmission)) return [];
|
|
2177
|
-
const s = b.version === Fe.enum[2], n = new Set(b.itemsAtSubmission.map((c) => s ? c.id : c.sku._id));
|
|
2178
|
-
return b.items.filter((c) => {
|
|
2179
|
-
const v = s ? c.id : c.sku._id;
|
|
2180
|
-
return !n.has(v);
|
|
2181
|
-
});
|
|
2182
|
-
}
|
|
2183
|
-
function cs(b, s) {
|
|
2184
|
-
var d;
|
|
2185
|
-
if (!b || s.length === 0) return {};
|
|
2186
|
-
const n = b.version === Fe.enum[2], c = new Set(s.map((p) => n ? p.id : p.sku._id)), v = {};
|
|
2187
|
-
for (const p of b.deliveryOrder ?? [])
|
|
2188
|
-
for (const t of p.received ?? []) {
|
|
2189
|
-
const o = n ? t.id : t.sku._id;
|
|
2190
|
-
o && c.has(o) && (v[o] = (v[o] ?? 0) + (((d = t.amount) == null ? void 0 : d.amount) ?? 0));
|
|
2191
|
-
}
|
|
2192
|
-
return s.reduce(
|
|
2193
|
-
(p, t) => {
|
|
2194
|
-
var D, T;
|
|
2195
|
-
const o = (n ? t.id : t.sku._id) ?? "", u = ((D = t.quantity) == null ? void 0 : D.amount) ?? 0, k = v[o] ?? 0, $ = ((T = t.quantity) == null ? void 0 : T.precision) ?? 0;
|
|
2196
|
-
return p[o] = {
|
|
2197
|
-
key: o,
|
|
2198
|
-
total: { amount: u, precision: $ },
|
|
2199
|
-
received: { amount: k, precision: $ },
|
|
2200
|
-
remaining: { amount: u - k, precision: $ }
|
|
2201
|
-
}, p;
|
|
2202
|
-
},
|
|
2203
|
-
{}
|
|
2204
|
-
);
|
|
2205
|
-
}
|
|
2206
|
-
const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4" }, vo = { class: "flex flex-col gap-4 fm-typo-en-body-lg-600" }, yo = { class: "flex flex-col gap-4" }, bo = { class: "flex justify-between items-start py-1 gap-4" }, ho = { class: "flex flex-col flex-1 min-w-0" }, go = { class: "fm-typo-en-body-lg-600 truncate" }, _o = { class: "fm-typo-en-body-md-400 truncate" }, So = { class: "flex flex-col gap-2 items-end w-52 shrink-0" }, xo = {
|
|
2207
|
-
key: 0,
|
|
2208
|
-
class: "flex items-center gap-2"
|
|
2209
|
-
}, ko = {
|
|
2210
|
-
key: 0,
|
|
2211
|
-
class: "border-b border-fm-color-stroke-secondary"
|
|
2212
|
-
}, Oo = { class: "flex flex-col gap-4" }, wo = { class: "flex items-center justify-between" }, $o = {
|
|
2213
|
-
key: 0,
|
|
2214
|
-
class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary"
|
|
2215
|
-
}, Co = { class: "flex justify-between items-start py-1 gap-4" }, Do = { class: "flex-1 min-w-0 flex flex-col gap-2" }, Ro = { class: "flex flex-col gap-2 items-end w-52 shrink-0" }, No = {
|
|
2216
|
-
key: 0,
|
|
2217
|
-
class: "flex items-center gap-2"
|
|
2218
|
-
}, Ao = {
|
|
2219
|
-
key: 0,
|
|
2220
|
-
class: "border-b border-fm-color-stroke-secondary"
|
|
2221
|
-
}, To = { class: "flex flex-col gap-4" }, Po = { class: "flex flex-col gap-4" }, Io = { class: "flex flex-col gap-4" }, Fo = { class: "flex flex-col gap-4 fm-typo-en-body-lg-600" }, Eo = {
|
|
2222
|
-
key: 0,
|
|
2223
|
-
class: "flex flex-col gap-4"
|
|
2224
|
-
}, qo = { class: "flex flex-col gap-4 fm-typo-en-body-lg-600" }, nt = "Will be ignored on save (zero or negative quantity)", Vo = /* @__PURE__ */ qe({
|
|
2225
|
-
__name: "EditForm",
|
|
2226
|
-
props: {
|
|
2227
|
-
purchaseOrder: {},
|
|
2228
|
-
deliveryOrder: {},
|
|
2229
|
-
receivedInfoMap: {}
|
|
2230
|
-
},
|
|
2231
|
-
emits: ["submitted"],
|
|
2232
|
-
setup(b, { emit: s }) {
|
|
2233
|
-
const { t: n } = Ys(), c = He(), v = Qe(), d = Z(!1), p = kt(), t = b, o = s, u = Zt("deliveryOrder"), k = Ye(), $ = j(
|
|
2234
|
-
() => {
|
|
2235
|
-
var f;
|
|
2236
|
-
return ((f = t.purchaseOrder.deliveryFullfillment) == null ? void 0 : f.findIndex(
|
|
2237
|
-
(i) => t.deliveryOrder.fullfillmentId && i.id === t.deliveryOrder.fullfillmentId
|
|
2238
|
-
)) ?? -1;
|
|
2239
|
-
}
|
|
2240
|
-
), D = c.enablePurchaseOrderReceiveWithCustomCost, T = c.enablePortalDeliveryOrderWrite, S = Z({}), F = j(
|
|
2241
|
-
() => (t.purchaseOrder.itemsAtSubmission ?? t.purchaseOrder.items).length
|
|
2242
|
-
), E = j(() => is(t.purchaseOrder)), J = j(
|
|
2243
|
-
() => cs(t.purchaseOrder, E.value)
|
|
2244
|
-
), z = j(
|
|
2245
|
-
() => t.purchaseOrder.items.map(
|
|
2246
|
-
(f, i) => j({
|
|
2247
|
-
get: () => {
|
|
2248
|
-
var M;
|
|
2249
|
-
const O = (M = u.received[i]) == null ? void 0 : M.amount;
|
|
2250
|
-
return O ? +xe(O) : 0;
|
|
2251
|
-
},
|
|
2252
|
-
set: (O) => {
|
|
2253
|
-
u.received[i].amount = Ke(O, 2);
|
|
2254
|
-
}
|
|
2255
|
-
})
|
|
2256
|
-
)
|
|
2257
|
-
), ae = j(
|
|
2258
|
-
() => t.purchaseOrder.items.map(
|
|
2259
|
-
(f, i) => j({
|
|
2260
|
-
get: () => {
|
|
2261
|
-
var M;
|
|
2262
|
-
const O = (M = u.received[i]) == null ? void 0 : M.cost;
|
|
2263
|
-
return O ? +xe(O) : 0;
|
|
2264
|
-
},
|
|
2265
|
-
set: (O) => {
|
|
2266
|
-
u.received[i].cost = {
|
|
2267
|
-
currency: De(),
|
|
2268
|
-
...Ke(O, 4)
|
|
2269
|
-
};
|
|
2270
|
-
}
|
|
2271
|
-
})
|
|
2272
|
-
)
|
|
2273
|
-
);
|
|
2274
|
-
function ge(f) {
|
|
2275
|
-
var O;
|
|
2276
|
-
const i = !S.value[f];
|
|
2277
|
-
if (S.value[f] = i, i) {
|
|
2278
|
-
const M = (O = u.received[f]) == null ? void 0 : O.cost;
|
|
2279
|
-
u.received[f].cost = M ? { ...M, precision: 4 } : { currency: De(), amount: 0, precision: 4 };
|
|
2280
|
-
} else
|
|
2281
|
-
delete u.received[f].cost;
|
|
2282
|
-
}
|
|
2283
|
-
const H = Z([]), R = j(
|
|
2284
|
-
() => p.skus.filter((f) => !f.isInactive).map((f) => ({ label: `${f.name} (${f.code})`, value: f._id }))
|
|
2285
|
-
);
|
|
2286
|
-
function ne() {
|
|
2287
|
-
H.value.push({ skuId: null, costEnabled: !1 }), u.received.push({
|
|
2288
|
-
sku: null,
|
|
2289
|
-
amount: Ae.fromNumber(0),
|
|
2290
|
-
measurement: null
|
|
2291
|
-
});
|
|
2292
|
-
}
|
|
2293
|
-
function P(f) {
|
|
2294
|
-
H.value.splice(f, 1), u.received.splice(F.value + f, 1);
|
|
2295
|
-
}
|
|
2296
|
-
function C(f, i) {
|
|
2297
|
-
H.value[f].skuId = i;
|
|
2298
|
-
const O = i ? p.skuById[i] : null;
|
|
2299
|
-
u.received[F.value + f].sku = O;
|
|
2300
|
-
}
|
|
2301
|
-
function K(f, i) {
|
|
2302
|
-
var ie, ee;
|
|
2303
|
-
const O = (ie = t.receivedInfoMap) == null ? void 0 : ie[i.sku._id], M = O ? `${n("inventory.transfer.receiveRequest.details.received")} ${Ae.toFormatString({ value: O.received })} / ${it(i.quantity, i.sku.unit, i.measurement)}` : void 0;
|
|
2304
|
-
return (((ee = z.value[f]) == null ? void 0 : ee.value) ?? 0) > 0 ? M : M ? `${M} · ${nt}` : nt;
|
|
2305
|
-
}
|
|
2306
|
-
function N(f, i) {
|
|
2307
|
-
var ie;
|
|
2308
|
-
const M = (((ie = X.value[i]) == null ? void 0 : ie.value) ?? 0) <= 0;
|
|
2309
|
-
let G;
|
|
2310
|
-
if (f.skuId && J.value[f.skuId]) {
|
|
2311
|
-
const ee = J.value[f.skuId], ke = Ae.toFormatString({ value: ee.received });
|
|
2312
|
-
G = `${n("inventory.transfer.receiveRequest.details.received")} ${ke}`;
|
|
2313
|
-
}
|
|
2314
|
-
return M ? G ? `${G} · ${nt}` : nt : G;
|
|
2315
|
-
}
|
|
2316
|
-
const X = j(
|
|
2317
|
-
() => H.value.map((f, i) => {
|
|
2318
|
-
const O = F.value + i;
|
|
2319
|
-
return j({
|
|
2320
|
-
get: () => {
|
|
2321
|
-
var G;
|
|
2322
|
-
const M = (G = u.received[O]) == null ? void 0 : G.amount;
|
|
2323
|
-
return M ? +xe(M) : 0;
|
|
2324
|
-
},
|
|
2325
|
-
set: (M) => {
|
|
2326
|
-
u.received[O].amount = Ke(M, 2);
|
|
2327
|
-
}
|
|
2328
|
-
});
|
|
2329
|
-
})
|
|
2330
|
-
), be = j(
|
|
2331
|
-
() => H.value.map((f, i) => {
|
|
2332
|
-
const O = F.value + i;
|
|
2333
|
-
return j({
|
|
2334
|
-
get: () => {
|
|
2335
|
-
var G;
|
|
2336
|
-
const M = (G = u.received[O]) == null ? void 0 : G.cost;
|
|
2337
|
-
return M ? +xe(M) : 0;
|
|
2338
|
-
},
|
|
2339
|
-
set: (M) => {
|
|
2340
|
-
u.received[O].cost = {
|
|
2341
|
-
currency: De(),
|
|
2342
|
-
...Ke(M, 4)
|
|
2343
|
-
};
|
|
2344
|
-
}
|
|
2345
|
-
});
|
|
2346
|
-
})
|
|
2347
|
-
);
|
|
2348
|
-
function ye(f) {
|
|
2349
|
-
const i = H.value[f], O = F.value + f;
|
|
2350
|
-
i.costEnabled = !i.costEnabled, i.costEnabled ? u.received[O].cost = { currency: De(), amount: 0, precision: 4 } : delete u.received[O].cost;
|
|
2351
|
-
}
|
|
2352
|
-
Ge(
|
|
2353
|
-
() => d.value,
|
|
2354
|
-
(f) => {
|
|
2355
|
-
var ke, le, r;
|
|
2356
|
-
if (!f) {
|
|
2357
|
-
H.value = [], S.value = {};
|
|
2358
|
-
return;
|
|
2359
|
-
}
|
|
2360
|
-
const i = t.purchaseOrder.itemsAtSubmission ?? t.purchaseOrder.items, O = new Set(i.map((a) => a.sku._id)), M = {}, G = [];
|
|
2361
|
-
for (const a of t.deliveryOrder.received ?? []) {
|
|
2362
|
-
const w = (ke = a.sku) == null ? void 0 : ke._id;
|
|
2363
|
-
w && (O.has(w) ? M[w] = a : G.push(a));
|
|
2364
|
-
}
|
|
2365
|
-
u.received = i.map((a) => {
|
|
2366
|
-
const w = M[a.sku._id];
|
|
2367
|
-
return w ? { ...w } : {
|
|
2368
|
-
sku: a.sku,
|
|
2369
|
-
amount: Ae.fromNumber(0),
|
|
2370
|
-
measurement: a.measurement ?? null
|
|
2371
|
-
};
|
|
2372
|
-
});
|
|
2373
|
-
const ie = {};
|
|
2374
|
-
for (let a = 0; a < i.length; a++)
|
|
2375
|
-
(le = M[i[a].sku._id]) != null && le.cost && (ie[a] = !0);
|
|
2376
|
-
S.value = ie, H.value = [];
|
|
2377
|
-
const ee = E.value;
|
|
2378
|
-
for (const a of G) {
|
|
2379
|
-
const w = ee.find((q) => {
|
|
2380
|
-
var W;
|
|
2381
|
-
return q.sku._id === ((W = a.sku) == null ? void 0 : W._id);
|
|
2382
|
-
});
|
|
2383
|
-
H.value.push({
|
|
2384
|
-
skuId: ((r = a.sku) == null ? void 0 : r._id) ?? null,
|
|
2385
|
-
costEnabled: !!a.cost,
|
|
2386
|
-
locked: !0,
|
|
2387
|
-
quantityLocked: !0,
|
|
2388
|
-
historyItem: w
|
|
2389
|
-
}), u.received.push({ ...a });
|
|
2390
|
-
}
|
|
2391
|
-
if (ee.length) {
|
|
2392
|
-
const a = new Set(G.map((w) => {
|
|
2393
|
-
var q;
|
|
2394
|
-
return (q = w.sku) == null ? void 0 : q._id;
|
|
2395
|
-
}));
|
|
2396
|
-
for (const w of ee)
|
|
2397
|
-
a.has(w.sku._id) || (H.value.push({
|
|
2398
|
-
skuId: w.sku._id,
|
|
2399
|
-
costEnabled: !1,
|
|
2400
|
-
locked: !0,
|
|
2401
|
-
historyItem: w
|
|
2402
|
-
}), u.received.push({
|
|
2403
|
-
sku: w.sku,
|
|
2404
|
-
amount: Ae.fromNumber(0),
|
|
2405
|
-
measurement: w.measurement ?? null
|
|
2406
|
-
}));
|
|
2407
|
-
}
|
|
2408
|
-
}
|
|
2409
|
-
);
|
|
2410
|
-
const pe = Z(!1);
|
|
2411
|
-
function fe() {
|
|
2412
|
-
pe.value = !0, k.updateDeliveryOrder({
|
|
2413
|
-
deliveryOrder: {
|
|
2414
|
-
...t.deliveryOrder,
|
|
2415
|
-
...u
|
|
2416
|
-
},
|
|
2417
|
-
purchaseOrderId: t.purchaseOrder._id,
|
|
2418
|
-
purchaseOrderRev: t.purchaseOrder._rev
|
|
2419
|
-
}).then(() => {
|
|
2420
|
-
v.open(
|
|
2421
|
-
{
|
|
2422
|
-
title: "Success",
|
|
2423
|
-
message: `PO# ${t.purchaseOrder.seqNumber} Changes have been saved`,
|
|
2424
|
-
type: "success"
|
|
2425
|
-
},
|
|
2426
|
-
1e4
|
|
2427
|
-
), d.value = !1, o("submitted");
|
|
2428
|
-
}).finally(() => {
|
|
2429
|
-
pe.value = !1;
|
|
2430
|
-
});
|
|
2431
|
-
}
|
|
2432
|
-
return (f, i) => {
|
|
2433
|
-
const O = re("FmButton"), M = re("FmStepperField"), G = re("FmSwitch"), ie = re("FmSelect"), ee = re("FmTextField"), ke = re("FmDialog");
|
|
2434
|
-
return l(), me(ke, {
|
|
2435
|
-
modelValue: d.value,
|
|
2436
|
-
"onUpdate:modelValue": i[1] || (i[1] = (le) => d.value = le),
|
|
2437
|
-
overlay: !0,
|
|
2438
|
-
"min-width": 800
|
|
2439
|
-
}, {
|
|
2440
|
-
"dialog-button": ce(() => [
|
|
2441
|
-
_(T) ? (l(), me(O, {
|
|
2442
|
-
key: 0,
|
|
2443
|
-
variant: "plain",
|
|
2444
|
-
label: "Edit",
|
|
2445
|
-
size: "md",
|
|
2446
|
-
"prepend-icon": "edit"
|
|
2447
|
-
})) : I("", !0)
|
|
2448
|
-
]),
|
|
2449
|
-
"dialog-header": ce(() => [
|
|
2450
|
-
e("div", null, "Received on " + x(_(tt)(t.deliveryOrder.createdAt)), 1)
|
|
2451
|
-
]),
|
|
2452
|
-
"dialog-footer": ce(() => [
|
|
2453
|
-
L(O, {
|
|
2454
|
-
class: "ml-auto",
|
|
2455
|
-
label: "Apply changes",
|
|
2456
|
-
size: "md",
|
|
2457
|
-
variant: "destructive",
|
|
2458
|
-
disabled: pe.value,
|
|
2459
|
-
loading: pe.value,
|
|
2460
|
-
onClick: fe
|
|
2461
|
-
}, null, 8, ["disabled", "loading"])
|
|
2462
|
-
]),
|
|
2463
|
-
default: ce(() => [
|
|
2464
|
-
e("div", po, [
|
|
2465
|
-
e("div", fo, [
|
|
2466
|
-
i[2] || (i[2] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Adjustment date", -1)),
|
|
2467
|
-
e("div", vo, x(t.deliveryOrder.adjustment ? _(tt)(new Date(_(at)(t.deliveryOrder.adjustment))) : "-"), 1)
|
|
2468
|
-
]),
|
|
2469
|
-
e("div", yo, [
|
|
2470
|
-
i[4] || (i[4] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Items going to receive ", -1)),
|
|
2471
|
-
(l(!0), h(Ce, null, Ee(t.purchaseOrder.items, (le, r) => {
|
|
2472
|
-
var a;
|
|
2473
|
-
return l(), h("div", { key: r }, [
|
|
2474
|
-
e("div", bo, [
|
|
2475
|
-
e("div", ho, [
|
|
2476
|
-
e("span", go, x(le.sku.name), 1),
|
|
2477
|
-
e("span", _o, x(le.sku.code), 1)
|
|
2478
|
-
]),
|
|
2479
|
-
e("div", So, [
|
|
2480
|
-
L(M, {
|
|
2481
|
-
label: "Receive Quantity",
|
|
2482
|
-
modelValue: z.value[r].value,
|
|
2483
|
-
"onUpdate:modelValue": (w) => z.value[r].value = w,
|
|
2484
|
-
"append-text": ((a = le.measurement) == null ? void 0 : a.abbrev) ?? le.sku.unit.abbrev,
|
|
2485
|
-
"helper-text": K(r, le)
|
|
2486
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text", "helper-text"]),
|
|
2487
|
-
_(D) ? (l(), h("div", xo, [
|
|
2488
|
-
L(G, {
|
|
2489
|
-
"model-value": S.value[r],
|
|
2490
|
-
"onUpdate:modelValue": (w) => ge(r),
|
|
2491
|
-
size: "sm"
|
|
2492
|
-
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
2493
|
-
i[3] || (i[3] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
|
|
2494
|
-
])) : I("", !0),
|
|
2495
|
-
_(D) && S.value[r] ? (l(), me(M, {
|
|
2496
|
-
key: 1,
|
|
2497
|
-
modelValue: ae.value[r].value,
|
|
2498
|
-
"onUpdate:modelValue": (w) => ae.value[r].value = w,
|
|
2499
|
-
label: "Total Cost",
|
|
2500
|
-
step: 1e-4,
|
|
2501
|
-
min: 0,
|
|
2502
|
-
placeholder: "0.0000",
|
|
2503
|
-
size: "sm",
|
|
2504
|
-
"append-text": _(De)()
|
|
2505
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) : I("", !0)
|
|
2506
|
-
])
|
|
2507
|
-
]),
|
|
2508
|
-
r < t.purchaseOrder.items.length - 1 ? (l(), h("div", ko)) : I("", !0)
|
|
2509
|
-
]);
|
|
2510
|
-
}), 128))
|
|
2511
|
-
]),
|
|
2512
|
-
e("div", Oo, [
|
|
2513
|
-
e("div", wo, [
|
|
2514
|
-
i[5] || (i[5] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Extra items", -1)),
|
|
2515
|
-
L(O, {
|
|
2516
|
-
variant: "tertiary",
|
|
2517
|
-
label: "Add item",
|
|
2518
|
-
"prepend-icon": "add",
|
|
2519
|
-
size: "md",
|
|
2520
|
-
onClick: ne
|
|
2521
|
-
})
|
|
2522
|
-
]),
|
|
2523
|
-
H.value.length === 0 ? (l(), h("div", $o, " No extra items added ")) : I("", !0),
|
|
2524
|
-
(l(!0), h(Ce, null, Ee(H.value, (le, r) => {
|
|
2525
|
-
var a, w;
|
|
2526
|
-
return l(), h("div", { key: r }, [
|
|
2527
|
-
e("div", Co, [
|
|
2528
|
-
e("div", Do, [
|
|
2529
|
-
L(ie, {
|
|
2530
|
-
"model-value": le.skuId,
|
|
2531
|
-
"onUpdate:modelValue": (q) => C(r, q),
|
|
2532
|
-
label: "Ingredient",
|
|
2533
|
-
items: R.value,
|
|
2534
|
-
searchable: "",
|
|
2535
|
-
searchTarget: "label",
|
|
2536
|
-
placeholder: "Select ingredient",
|
|
2537
|
-
disabled: le.locked
|
|
2538
|
-
}, null, 8, ["model-value", "onUpdate:modelValue", "items", "disabled"])
|
|
2539
|
-
]),
|
|
2540
|
-
e("div", Ro, [
|
|
2541
|
-
L(M, {
|
|
2542
|
-
label: "Receive Quantity",
|
|
2543
|
-
modelValue: X.value[r].value,
|
|
2544
|
-
"onUpdate:modelValue": (q) => X.value[r].value = q,
|
|
2545
|
-
"append-text": le.skuId ? ((w = (a = _(p).skuById[le.skuId]) == null ? void 0 : a.unit) == null ? void 0 : w.abbrev) ?? "" : "",
|
|
2546
|
-
"helper-text": N(le, r),
|
|
2547
|
-
disabled: le.quantityLocked || !le.skuId
|
|
2548
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text", "helper-text", "disabled"]),
|
|
2549
|
-
_(D) ? (l(), h("div", No, [
|
|
2550
|
-
L(G, {
|
|
2551
|
-
"model-value": le.costEnabled,
|
|
2552
|
-
"onUpdate:modelValue": (q) => ye(r),
|
|
2553
|
-
size: "sm"
|
|
2554
|
-
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
2555
|
-
i[6] || (i[6] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
|
|
2556
|
-
])) : I("", !0),
|
|
2557
|
-
_(D) && le.costEnabled ? (l(), me(M, {
|
|
2558
|
-
key: 1,
|
|
2559
|
-
modelValue: be.value[r].value,
|
|
2560
|
-
"onUpdate:modelValue": (q) => be.value[r].value = q,
|
|
2561
|
-
label: "Total Cost",
|
|
2562
|
-
step: 1e-4,
|
|
2563
|
-
min: 0,
|
|
2564
|
-
placeholder: "0.0000",
|
|
2565
|
-
size: "sm",
|
|
2566
|
-
"append-text": _(De)()
|
|
2567
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) : I("", !0)
|
|
2568
|
-
]),
|
|
2569
|
-
le.locked ? I("", !0) : (l(), me(O, {
|
|
2570
|
-
key: 0,
|
|
2571
|
-
variant: "tertiary",
|
|
2572
|
-
"prepend-icon": "delete",
|
|
2573
|
-
size: "md",
|
|
2574
|
-
class: "mt-6",
|
|
2575
|
-
onClick: (q) => P(r)
|
|
2576
|
-
}, null, 8, ["onClick"]))
|
|
2577
|
-
]),
|
|
2578
|
-
r < H.value.length - 1 ? (l(), h("div", Ao)) : I("", !0)
|
|
2579
|
-
]);
|
|
2580
|
-
}), 128))
|
|
2581
|
-
]),
|
|
2582
|
-
e("div", To, [
|
|
2583
|
-
i[7] || (i[7] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Delivery order no.", -1)),
|
|
2584
|
-
e("div", Po, [
|
|
2585
|
-
L(ee, {
|
|
2586
|
-
modelValue: _(u).deliveryOrderNumber,
|
|
2587
|
-
"onUpdate:modelValue": i[0] || (i[0] = (le) => _(u).deliveryOrderNumber = le),
|
|
2588
|
-
size: "md",
|
|
2589
|
-
placeholder: t.deliveryOrder.deliveryOrderNumber
|
|
2590
|
-
}, null, 8, ["modelValue", "placeholder"])
|
|
2591
|
-
])
|
|
2592
|
-
]),
|
|
2593
|
-
e("div", Io, [
|
|
2594
|
-
i[8] || (i[8] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Remark", -1)),
|
|
2595
|
-
e("div", Fo, x(t.deliveryOrder.remark || "N/A"), 1)
|
|
2596
|
-
]),
|
|
2597
|
-
$.value >= 0 ? (l(), h("div", Eo, [
|
|
2598
|
-
i[9] || (i[9] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Fulfilment's sequence", -1)),
|
|
2599
|
-
e("div", qo, x($.value + 1), 1)
|
|
2600
|
-
])) : I("", !0)
|
|
2601
|
-
])
|
|
2602
|
-
]),
|
|
2603
|
-
_: 1
|
|
2604
|
-
}, 8, ["modelValue"]);
|
|
2605
|
-
};
|
|
2606
|
-
}
|
|
2607
|
-
}), Lo = { class: "flex flex-col gap-3" }, Uo = { class: "flex flex-col gap-4" }, Mo = { class: "flex flex-col gap-4 fm-typo-en-body-lg-600" }, jo = {
|
|
2608
|
-
key: 0,
|
|
2609
|
-
class: "flex flex-col gap-4"
|
|
2610
|
-
}, Bo = { class: "flex items-center justify-between" }, zo = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ko = {
|
|
2611
|
-
key: 0,
|
|
2612
|
-
class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
2613
|
-
}, Ho = { class: "flex gap-4" }, Go = { class: "flex-1" }, Wo = { class: "flex-1" }, Qo = {
|
|
2614
|
-
key: 0,
|
|
2615
|
-
class: "flex items-center text-fm-color-system-error-300"
|
|
2616
|
-
}, Yo = { class: "fm-typo-en-body-md-400" }, Jo = { class: "flex flex-col gap-4" }, Xo = { class: "flex justify-between items-start py-1 gap-4" }, Zo = { class: "flex flex-col flex-1 min-w-0" }, en = { class: "fm-typo-en-body-lg-600 truncate" }, tn = { class: "fm-typo-en-body-md-400 truncate" }, sn = { class: "flex flex-col gap-2 items-end w-52 shrink-0" }, rn = {
|
|
2617
|
-
key: 0,
|
|
2618
|
-
class: "fm-typo-en-body-sm-400 text-fm-color-system-error-300 self-end text-right"
|
|
2619
|
-
}, on = {
|
|
2620
|
-
key: 1,
|
|
2621
|
-
class: "flex items-center gap-2"
|
|
2622
|
-
}, nn = {
|
|
2623
|
-
key: 0,
|
|
2624
|
-
class: "border-b border-fm-color-stroke-secondary"
|
|
2625
|
-
}, an = { class: "flex flex-col gap-4" }, ln = { class: "flex items-center justify-between" }, cn = {
|
|
2626
|
-
key: 0,
|
|
2627
|
-
class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary"
|
|
2628
|
-
}, un = { class: "flex justify-between items-start py-1 gap-4" }, dn = { class: "flex-1 min-w-0 flex flex-col gap-2" }, mn = { class: "flex flex-col gap-2 items-end w-52 shrink-0" }, pn = {
|
|
2629
|
-
key: 0,
|
|
2630
|
-
class: "fm-typo-en-body-sm-400 text-fm-color-system-error-300 self-end text-right"
|
|
2631
|
-
}, fn = {
|
|
2632
|
-
key: 1,
|
|
2633
|
-
class: "flex items-center gap-2"
|
|
2634
|
-
}, vn = {
|
|
2635
|
-
key: 0,
|
|
2636
|
-
class: "border-b border-fm-color-stroke-secondary"
|
|
2637
|
-
}, yn = { class: "flex flex-col gap-4" }, bn = { class: "flex flex-col gap-4" }, hn = { class: "flex flex-col gap-4" }, gn = { class: "flex flex-col gap-4 fm-typo-en-body-lg-600" }, Gt = "Will be ignored on save (zero or negative quantity)", _n = /* @__PURE__ */ qe({
|
|
2638
|
-
__name: "CreateForm",
|
|
2639
|
-
props: {
|
|
2640
|
-
purchaseOrder: {},
|
|
2641
|
-
receivedInfoMap: {},
|
|
2642
|
-
receivedMap: {}
|
|
2643
|
-
},
|
|
2644
|
-
emits: ["submitted"],
|
|
2645
|
-
setup(b, { emit: s }) {
|
|
2646
|
-
var oe, A, ue;
|
|
2647
|
-
const { t: n } = dt(), c = Z(!1), v = mt(), d = b, p = s, t = Zt("", {
|
|
2648
|
-
default: {
|
|
2649
|
-
deliveryOrderNumber: "",
|
|
2650
|
-
remark: "",
|
|
2651
|
-
received: (d.purchaseOrder.itemsAtSubmission ?? d.purchaseOrder.items).map((y) => ({
|
|
2652
|
-
sku: y.sku,
|
|
2653
|
-
amount: Ae.fromNumber(0),
|
|
2654
|
-
measurement: y.measurement
|
|
2655
|
-
})),
|
|
2656
|
-
createdBy: {
|
|
2657
|
-
id: ((oe = v.sessionUser.value) == null ? void 0 : oe.id) || "",
|
|
2658
|
-
name: ((A = v.sessionUser.value) == null ? void 0 : A.displayName) || ""
|
|
2659
|
-
},
|
|
2660
|
-
createdAt: ""
|
|
2661
|
-
}
|
|
2662
|
-
}), o = Ye(), u = ft(), k = He(), $ = kt(), D = ((ue = d.purchaseOrder) == null ? void 0 : ue.supplier.internal) != null, T = D && k.enablePOSTransferRequireFulfillment, S = k.enablePortalDeliveryOrderWrite && (d.purchaseOrder.status === ve.Enum.RECEIVING || d.purchaseOrder.status === ve.Enum.COMPLETE) && (D ? !T : !0), F = k.enablePurchaseOrderReceiveWithCustomCost, E = k.enableBackdateReceive, J = Z({}), z = j(
|
|
2663
|
-
() => d.purchaseOrder.itemsAtSubmission ?? d.purchaseOrder.items
|
|
2664
|
-
), ae = j(() => is(d.purchaseOrder)), ge = j(
|
|
2665
|
-
() => cs(d.purchaseOrder, ae.value)
|
|
2666
|
-
), H = j(
|
|
2667
|
-
() => {
|
|
2668
|
-
var y;
|
|
2669
|
-
return (((y = d.purchaseOrder) == null ? void 0 : y.version) ?? Fe.enum[1]) === Fe.enum[2];
|
|
2670
|
-
}
|
|
2671
|
-
);
|
|
2672
|
-
function R(y) {
|
|
2673
|
-
return (H.value ? y.id : y.sku._id) ?? null;
|
|
2674
|
-
}
|
|
2675
|
-
const ne = Qe(), P = j({
|
|
2676
|
-
get() {
|
|
2677
|
-
if (!t.createdAt) return "";
|
|
2678
|
-
const y = new Date(t.createdAt), m = y.getFullYear(), g = String(y.getMonth() + 1).padStart(2, "0"), U = String(y.getDate()).padStart(2, "0");
|
|
2679
|
-
return `${m}-${g}-${U}`;
|
|
2680
|
-
},
|
|
2681
|
-
set(y) {
|
|
2682
|
-
if (y) {
|
|
2683
|
-
const m = t.createdAt ? new Date(t.createdAt) : /* @__PURE__ */ new Date(), [g, U, B] = y.split("-");
|
|
2684
|
-
m.setFullYear(parseInt(g)), m.setMonth(parseInt(U) - 1), m.setDate(parseInt(B)), t.createdAt = m.toISOString();
|
|
2685
|
-
}
|
|
2686
|
-
}
|
|
2687
|
-
}), C = j({
|
|
2688
|
-
get() {
|
|
2689
|
-
if (!t.createdAt) return "";
|
|
2690
|
-
const y = new Date(t.createdAt), m = String(y.getHours()).padStart(2, "0"), g = String(y.getMinutes()).padStart(2, "0");
|
|
2691
|
-
return `${m}:${g}`;
|
|
2692
|
-
},
|
|
2693
|
-
set(y) {
|
|
2694
|
-
if (y) {
|
|
2695
|
-
const m = t.createdAt ? new Date(t.createdAt) : /* @__PURE__ */ new Date(), [g, U] = y.split(":");
|
|
2696
|
-
m.setHours(parseInt(g)), m.setMinutes(parseInt(U)), t.createdAt = m.toISOString();
|
|
2697
|
-
}
|
|
2698
|
-
}
|
|
2699
|
-
}), K = j(() => {
|
|
2700
|
-
const y = at(d.purchaseOrder._id);
|
|
2701
|
-
if (!y) return "";
|
|
2702
|
-
const m = new Date(y), g = m.getFullYear(), U = String(m.getMonth() + 1).padStart(2, "0"), B = String(m.getDate()).padStart(2, "0");
|
|
2703
|
-
return `${g}-${U}-${B}`;
|
|
2704
|
-
}), N = j(() => {
|
|
2705
|
-
const y = at(d.purchaseOrder._id);
|
|
2706
|
-
return y ? new Date(y) : null;
|
|
2707
|
-
}), X = j(() => {
|
|
2708
|
-
if (!P.value || !C.value || !N.value) return null;
|
|
2709
|
-
if (/* @__PURE__ */ new Date(`${P.value}T${C.value}:00`) < N.value) {
|
|
2710
|
-
const m = K.value, g = N.value.getHours(), U = N.value.getMinutes(), B = g >= 12 ? "PM" : "AM", _e = g % 12 || 12, $e = `${String(_e).padStart(2, "0")}:${String(U).padStart(2, "0")} ${B}`;
|
|
2711
|
-
return `Delivery date & time cannot be earlier than order creation (${m} ${$e})`;
|
|
2712
|
-
}
|
|
2713
|
-
return null;
|
|
2714
|
-
}), be = j(() => X.value || O.value.some((m) => !m.skuId) ? !1 : t.received.some((m) => {
|
|
2715
|
-
const g = m.amount;
|
|
2716
|
-
return g ? +xe(g) > 0 : !1;
|
|
2717
|
-
}));
|
|
2718
|
-
function ye(y) {
|
|
2719
|
-
var g;
|
|
2720
|
-
const m = (g = d.receivedInfoMap[y.sku._id]) == null ? void 0 : g.received;
|
|
2721
|
-
return `${n("inventory.transfer.receiveRequest.details.received")} ${Ae.toFormatString({ value: m })} / ${it(y.quantity, y.sku.unit, y.measurement)}`;
|
|
2722
|
-
}
|
|
2723
|
-
function pe() {
|
|
2724
|
-
t.createdAt = "";
|
|
2725
|
-
}
|
|
2726
|
-
const fe = j(() => z.value.map((y, m) => j({
|
|
2727
|
-
get: () => {
|
|
2728
|
-
var U;
|
|
2729
|
-
const g = (U = t.received[m]) == null ? void 0 : U.amount;
|
|
2730
|
-
return g ? +xe(g) : 0;
|
|
2731
|
-
},
|
|
2732
|
-
set: (g) => {
|
|
2733
|
-
t.received[m].amount = Ke(g, 2);
|
|
2734
|
-
}
|
|
2735
|
-
})));
|
|
2736
|
-
function f(y) {
|
|
2737
|
-
const m = !J.value[y];
|
|
2738
|
-
if (J.value[y] = m, m) {
|
|
2739
|
-
const g = z.value[y];
|
|
2740
|
-
g.totalCost ? t.received[y].cost = {
|
|
2741
|
-
currency: g.totalCost.currency,
|
|
2742
|
-
amount: g.totalCost.amount,
|
|
2743
|
-
precision: 4
|
|
2744
|
-
// Standardize to 4 decimals
|
|
2745
|
-
} : t.received[y].cost = {
|
|
2746
|
-
currency: De(),
|
|
2747
|
-
amount: 0,
|
|
2748
|
-
precision: 4
|
|
2749
|
-
};
|
|
2750
|
-
} else
|
|
2751
|
-
delete t.received[y].cost;
|
|
2752
|
-
}
|
|
2753
|
-
const i = j(() => z.value.map((y, m) => j({
|
|
2754
|
-
get: () => {
|
|
2755
|
-
var U;
|
|
2756
|
-
const g = (U = t.received[m]) == null ? void 0 : U.cost;
|
|
2757
|
-
return g ? +xe(g) : 0;
|
|
2758
|
-
},
|
|
2759
|
-
set: (g) => {
|
|
2760
|
-
t.received[m].cost = {
|
|
2761
|
-
currency: De(),
|
|
2762
|
-
...Ke(g, 4)
|
|
2763
|
-
};
|
|
2764
|
-
}
|
|
2765
|
-
}))), O = Z([]), M = j(
|
|
2766
|
-
() => $.skus.filter((y) => !y.isInactive).map((y) => ({ label: `${y.name} (${y.code})`, value: y._id }))
|
|
2767
|
-
), G = j(() => z.value.length);
|
|
2768
|
-
function ie() {
|
|
2769
|
-
O.value.push({ skuId: null, stableKey: null, costEnabled: !1 }), t.received.push({
|
|
2770
|
-
sku: null,
|
|
2771
|
-
amount: Ae.fromNumber(0),
|
|
2772
|
-
measurement: null
|
|
2773
|
-
});
|
|
2774
|
-
}
|
|
2775
|
-
function ee(y) {
|
|
2776
|
-
O.value.splice(y, 1), t.received.splice(G.value + y, 1);
|
|
2777
|
-
}
|
|
2778
|
-
function ke(y, m) {
|
|
2779
|
-
O.value[y].skuId = m;
|
|
2780
|
-
const g = m ? $.skuById[m] : null;
|
|
2781
|
-
t.received[G.value + y].sku = g;
|
|
2782
|
-
}
|
|
2783
|
-
function le(y) {
|
|
2784
|
-
const m = y.stableKey;
|
|
2785
|
-
if (m && ge.value[m]) {
|
|
2786
|
-
const g = ge.value[m], U = Ae.toFormatString({ value: g.received });
|
|
2787
|
-
return `${n("inventory.transfer.receiveRequest.details.received")} ${U}`;
|
|
2788
|
-
}
|
|
2789
|
-
}
|
|
2790
|
-
const r = j(
|
|
2791
|
-
() => O.value.map((y, m) => {
|
|
2792
|
-
const g = G.value + m;
|
|
2793
|
-
return j({
|
|
2794
|
-
get: () => {
|
|
2795
|
-
var B;
|
|
2796
|
-
const U = (B = t.received[g]) == null ? void 0 : B.amount;
|
|
2797
|
-
return U ? +xe(U) : 0;
|
|
2798
|
-
},
|
|
2799
|
-
set: (U) => {
|
|
2800
|
-
t.received[g].amount = Ke(U, 2);
|
|
2801
|
-
}
|
|
2802
|
-
});
|
|
2803
|
-
})
|
|
2804
|
-
), a = j(
|
|
2805
|
-
() => O.value.map((y, m) => {
|
|
2806
|
-
const g = G.value + m;
|
|
2807
|
-
return j({
|
|
2808
|
-
get: () => {
|
|
2809
|
-
var B;
|
|
2810
|
-
const U = (B = t.received[g]) == null ? void 0 : B.cost;
|
|
2811
|
-
return U ? +xe(U) : 0;
|
|
2812
|
-
},
|
|
2813
|
-
set: (U) => {
|
|
2814
|
-
t.received[g].cost = {
|
|
2815
|
-
currency: De(),
|
|
2816
|
-
...Ke(U, 4)
|
|
2817
|
-
};
|
|
2818
|
-
}
|
|
2819
|
-
});
|
|
2820
|
-
})
|
|
2821
|
-
);
|
|
2822
|
-
function w(y) {
|
|
2823
|
-
const m = O.value[y], g = G.value + y;
|
|
2824
|
-
m.costEnabled = !m.costEnabled, m.costEnabled ? t.received[g].cost = { currency: De(), amount: 0, precision: 4 } : delete t.received[g].cost;
|
|
2825
|
-
}
|
|
2826
|
-
function q() {
|
|
2827
|
-
u.open({
|
|
2828
|
-
title: "Confirm Create Delivery Order",
|
|
2829
|
-
message: `Are you sure you want to create delivery order for PO# ${d.purchaseOrder.seqNumber}?`,
|
|
2830
|
-
primaryActions: {
|
|
2831
|
-
text: "Create",
|
|
2832
|
-
close: !0,
|
|
2833
|
-
variant: "primary"
|
|
2834
|
-
},
|
|
2835
|
-
secondaryActions: {
|
|
2836
|
-
text: "Cancel",
|
|
2837
|
-
close: !0
|
|
2838
|
-
}
|
|
2839
|
-
}).onPrimary(() => Q());
|
|
2840
|
-
}
|
|
2841
|
-
const W = Z(!1);
|
|
2842
|
-
function Q() {
|
|
2843
|
-
W.value = !0, o.createDeliveryOrder({
|
|
2844
|
-
deliveryOrder: t,
|
|
2845
|
-
purchaseOrderId: d.purchaseOrder._id,
|
|
2846
|
-
purchaseOrderRev: d.purchaseOrder._rev,
|
|
2847
|
-
currency: De()
|
|
2848
|
-
}).then(() => {
|
|
2849
|
-
ne.open(
|
|
2850
|
-
{
|
|
2851
|
-
title: "Success",
|
|
2852
|
-
message: `New delivery order created for PO# ${d.purchaseOrder.seqNumber}`,
|
|
2853
|
-
type: "success"
|
|
2854
|
-
},
|
|
2855
|
-
1e4
|
|
2856
|
-
), c.value = !1, p("submitted");
|
|
2857
|
-
}).finally(() => {
|
|
2858
|
-
W.value = !1;
|
|
2859
|
-
});
|
|
2860
|
-
}
|
|
2861
|
-
return Ge(
|
|
2862
|
-
() => c.value,
|
|
2863
|
-
(y) => {
|
|
2864
|
-
var U;
|
|
2865
|
-
if (!y) {
|
|
2866
|
-
O.value = [], t.received = z.value.map((B) => ({
|
|
2867
|
-
sku: B.sku,
|
|
2868
|
-
amount: Ae.fromNumber(0),
|
|
2869
|
-
measurement: B.measurement
|
|
2870
|
-
}));
|
|
2871
|
-
return;
|
|
2872
|
-
}
|
|
2873
|
-
const m = z.value;
|
|
2874
|
-
for (let B = 0; B < m.length; B++) {
|
|
2875
|
-
const _e = m[B], te = (((U = d.purchaseOrder) == null ? void 0 : U.version) ?? Fe.enum[1]) === Fe.enum[2] ? _e.id : _e.sku._id, he = d.receivedMap[te], we = +xe(_e.quantity), Re = he ? +xe(he.received) : 0;
|
|
2876
|
-
fe.value[B].value = Math.max(0, we - Re);
|
|
2877
|
-
}
|
|
2878
|
-
const g = ae.value;
|
|
2879
|
-
if (g.length) {
|
|
2880
|
-
for (const B of g) {
|
|
2881
|
-
const _e = R(B);
|
|
2882
|
-
O.value.push({
|
|
2883
|
-
skuId: B.sku._id,
|
|
2884
|
-
stableKey: _e,
|
|
2885
|
-
costEnabled: !1,
|
|
2886
|
-
historyItem: B
|
|
2887
|
-
}), t.received.push({
|
|
2888
|
-
// Propagate the stable id so V2 submissions align with the existing PO line.
|
|
2889
|
-
...H.value && B.id ? { id: B.id } : {},
|
|
2890
|
-
sku: B.sku,
|
|
2891
|
-
amount: Ae.fromNumber(0),
|
|
2892
|
-
measurement: B.measurement ?? null
|
|
2893
|
-
});
|
|
2894
|
-
}
|
|
2895
|
-
for (let B = 0; B < g.length; B++) {
|
|
2896
|
-
const _e = R(g[B]), $e = _e ? ge.value[_e] : void 0;
|
|
2897
|
-
if ($e) {
|
|
2898
|
-
const te = Math.pow(10, $e.remaining.precision ?? 2);
|
|
2899
|
-
r.value[B].value = Math.max(0, $e.remaining.amount / te);
|
|
2900
|
-
}
|
|
2901
|
-
}
|
|
2902
|
-
}
|
|
2903
|
-
}
|
|
2904
|
-
), (y, m) => {
|
|
2905
|
-
const g = re("FmButton"), U = re("FmDatePicker"), B = re("FmTimePicker"), _e = re("FmIcon"), $e = re("FmStepperField"), te = re("FmSwitch"), he = re("FmSelect"), we = re("FmTextField"), Re = re("FmDialog");
|
|
2906
|
-
return l(), me(Re, {
|
|
2907
|
-
modelValue: c.value,
|
|
2908
|
-
"onUpdate:modelValue": m[4] || (m[4] = (Ne) => c.value = Ne),
|
|
2909
|
-
overlay: !0,
|
|
2910
|
-
"min-width": 800
|
|
2911
|
-
}, {
|
|
2912
|
-
"dialog-button": ce(() => [
|
|
2913
|
-
_(S) ? (l(), me(g, {
|
|
2914
|
-
key: 0,
|
|
2915
|
-
variant: "primary",
|
|
2916
|
-
label: "Create",
|
|
2917
|
-
size: "md",
|
|
2918
|
-
"prepend-icon": "add",
|
|
2919
|
-
class: "w-full"
|
|
2920
|
-
})) : I("", !0)
|
|
2921
|
-
]),
|
|
2922
|
-
"dialog-header": ce(() => [
|
|
2923
|
-
e("div", null, "Order #" + x(d.purchaseOrder.seqNumber) + " (New Delivery Order)", 1)
|
|
2924
|
-
]),
|
|
2925
|
-
"dialog-footer": ce(() => [
|
|
2926
|
-
L(g, {
|
|
2927
|
-
class: "ml-auto",
|
|
2928
|
-
label: "Create",
|
|
2929
|
-
size: "md",
|
|
2930
|
-
variant: "destructive",
|
|
2931
|
-
disabled: !be.value || W.value,
|
|
2932
|
-
loading: W.value,
|
|
2933
|
-
onClick: q
|
|
2934
|
-
}, null, 8, ["disabled", "loading"])
|
|
2935
|
-
]),
|
|
2936
|
-
default: ce(() => {
|
|
2937
|
-
var Ne;
|
|
2938
|
-
return [
|
|
2939
|
-
e("div", Lo, [
|
|
2940
|
-
e("div", Uo, [
|
|
2941
|
-
m[5] || (m[5] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Received by", -1)),
|
|
2942
|
-
e("div", Mo, x((Ne = _(v).sessionUser.value) == null ? void 0 : Ne.displayName), 1)
|
|
2943
|
-
]),
|
|
2944
|
-
_(E) ? (l(), h("div", jo, [
|
|
2945
|
-
e("div", Bo, [
|
|
2946
|
-
e("div", zo, [
|
|
2947
|
-
m[6] || (m[6] = ze(" Delivery Date & Time ")),
|
|
2948
|
-
!P.value && !C.value ? (l(), h("div", Ko, " Leave blank to use current date & time ")) : I("", !0)
|
|
2949
|
-
]),
|
|
2950
|
-
P.value || C.value ? (l(), me(g, {
|
|
2951
|
-
key: 0,
|
|
2952
|
-
variant: "tertiary",
|
|
2953
|
-
label: "Clear",
|
|
2954
|
-
"prepend-icon": "close",
|
|
2955
|
-
onClick: pe
|
|
2956
|
-
})) : I("", !0)
|
|
2957
|
-
]),
|
|
2958
|
-
e("div", Ho, [
|
|
2959
|
-
e("div", Go, [
|
|
2960
|
-
L(U, {
|
|
2961
|
-
modelValue: P.value,
|
|
2962
|
-
"onUpdate:modelValue": m[0] || (m[0] = (de) => P.value = de)
|
|
2963
|
-
}, null, 8, ["modelValue"])
|
|
2964
|
-
]),
|
|
2965
|
-
e("div", Wo, [
|
|
2966
|
-
L(B, {
|
|
2967
|
-
modelValue: C.value,
|
|
2968
|
-
"onUpdate:modelValue": m[1] || (m[1] = (de) => C.value = de)
|
|
2969
|
-
}, null, 8, ["modelValue"])
|
|
2970
|
-
])
|
|
2971
|
-
]),
|
|
2972
|
-
X.value ? (l(), h("div", Qo, [
|
|
2973
|
-
L(_e, {
|
|
2974
|
-
name: "error",
|
|
2975
|
-
class: "inline-block mr-1",
|
|
2976
|
-
size: "sm"
|
|
2977
|
-
}),
|
|
2978
|
-
e("div", Yo, x(X.value), 1)
|
|
2979
|
-
])) : I("", !0)
|
|
2980
|
-
])) : I("", !0),
|
|
2981
|
-
e("div", Jo, [
|
|
2982
|
-
m[8] || (m[8] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Items going to receive ", -1)),
|
|
2983
|
-
(l(!0), h(Ce, null, Ee(z.value, (de, se) => {
|
|
2984
|
-
var Oe;
|
|
2985
|
-
return l(), h("div", { key: se }, [
|
|
2986
|
-
e("div", Xo, [
|
|
2987
|
-
e("div", Zo, [
|
|
2988
|
-
e("span", en, x(de.sku.name), 1),
|
|
2989
|
-
e("span", tn, x(de.sku.code), 1)
|
|
2990
|
-
]),
|
|
2991
|
-
e("div", sn, [
|
|
2992
|
-
L($e, {
|
|
2993
|
-
label: "Receive Quantity",
|
|
2994
|
-
modelValue: fe.value[se].value,
|
|
2995
|
-
"onUpdate:modelValue": (Te) => fe.value[se].value = Te,
|
|
2996
|
-
"helper-text": ye(de),
|
|
2997
|
-
"append-text": ((Oe = de.measurement) == null ? void 0 : Oe.abbrev) ?? de.sku.unit.abbrev
|
|
2998
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "helper-text", "append-text"]),
|
|
2999
|
-
fe.value[se].value <= 0 ? (l(), h("div", rn, x(Gt))) : I("", !0),
|
|
3000
|
-
_(F) ? (l(), h("div", on, [
|
|
3001
|
-
L(te, {
|
|
3002
|
-
"model-value": J.value[se],
|
|
3003
|
-
"onUpdate:modelValue": (Te) => f(se),
|
|
3004
|
-
size: "sm"
|
|
3005
|
-
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
3006
|
-
m[7] || (m[7] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
|
|
3007
|
-
])) : I("", !0),
|
|
3008
|
-
_(F) && J.value[se] ? (l(), me($e, {
|
|
3009
|
-
key: 2,
|
|
3010
|
-
modelValue: i.value[se].value,
|
|
3011
|
-
"onUpdate:modelValue": (Te) => i.value[se].value = Te,
|
|
3012
|
-
label: "Total Cost",
|
|
3013
|
-
step: 1e-4,
|
|
3014
|
-
min: 0,
|
|
3015
|
-
placeholder: "0.0000",
|
|
3016
|
-
size: "sm",
|
|
3017
|
-
"append-text": _(De)()
|
|
3018
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) : I("", !0)
|
|
3019
|
-
])
|
|
3020
|
-
]),
|
|
3021
|
-
se < z.value.length - 1 ? (l(), h("div", nn)) : I("", !0)
|
|
3022
|
-
]);
|
|
3023
|
-
}), 128))
|
|
3024
|
-
]),
|
|
3025
|
-
e("div", an, [
|
|
3026
|
-
e("div", ln, [
|
|
3027
|
-
m[9] || (m[9] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Extra items", -1)),
|
|
3028
|
-
L(g, {
|
|
3029
|
-
variant: "tertiary",
|
|
3030
|
-
label: "Add item",
|
|
3031
|
-
"prepend-icon": "add",
|
|
3032
|
-
size: "md",
|
|
3033
|
-
onClick: ie
|
|
3034
|
-
})
|
|
3035
|
-
]),
|
|
3036
|
-
O.value.length === 0 ? (l(), h("div", cn, " No extra items added ")) : I("", !0),
|
|
3037
|
-
(l(!0), h(Ce, null, Ee(O.value, (de, se) => {
|
|
3038
|
-
var Oe, Te;
|
|
3039
|
-
return l(), h("div", { key: se }, [
|
|
3040
|
-
e("div", un, [
|
|
3041
|
-
e("div", dn, [
|
|
3042
|
-
L(he, {
|
|
3043
|
-
"model-value": de.skuId,
|
|
3044
|
-
"onUpdate:modelValue": (Ie) => ke(se, Ie),
|
|
3045
|
-
label: "Ingredient",
|
|
3046
|
-
items: M.value,
|
|
3047
|
-
searchable: "",
|
|
3048
|
-
searchTarget: "label",
|
|
3049
|
-
placeholder: "Select ingredient",
|
|
3050
|
-
disabled: !!de.historyItem
|
|
3051
|
-
}, null, 8, ["model-value", "onUpdate:modelValue", "items", "disabled"])
|
|
3052
|
-
]),
|
|
3053
|
-
e("div", mn, [
|
|
3054
|
-
L($e, {
|
|
3055
|
-
label: "Receive Quantity",
|
|
3056
|
-
modelValue: r.value[se].value,
|
|
3057
|
-
"onUpdate:modelValue": (Ie) => r.value[se].value = Ie,
|
|
3058
|
-
"append-text": de.skuId ? ((Te = (Oe = _($).skuById[de.skuId]) == null ? void 0 : Oe.unit) == null ? void 0 : Te.abbrev) ?? "" : "",
|
|
3059
|
-
"helper-text": le(de)
|
|
3060
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text", "helper-text"]),
|
|
3061
|
-
r.value[se].value <= 0 ? (l(), h("div", pn, x(Gt))) : I("", !0),
|
|
3062
|
-
_(F) ? (l(), h("div", fn, [
|
|
3063
|
-
L(te, {
|
|
3064
|
-
"model-value": de.costEnabled,
|
|
3065
|
-
"onUpdate:modelValue": (Ie) => w(se),
|
|
3066
|
-
size: "sm"
|
|
3067
|
-
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
3068
|
-
m[10] || (m[10] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
|
|
3069
|
-
])) : I("", !0),
|
|
3070
|
-
_(F) && de.costEnabled ? (l(), me($e, {
|
|
3071
|
-
key: 2,
|
|
3072
|
-
modelValue: a.value[se].value,
|
|
3073
|
-
"onUpdate:modelValue": (Ie) => a.value[se].value = Ie,
|
|
3074
|
-
label: "Total Cost",
|
|
3075
|
-
step: 1e-4,
|
|
3076
|
-
min: 0,
|
|
3077
|
-
placeholder: "0.0000",
|
|
3078
|
-
size: "sm",
|
|
3079
|
-
"append-text": _(De)()
|
|
3080
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) : I("", !0)
|
|
3081
|
-
]),
|
|
3082
|
-
de.historyItem ? I("", !0) : (l(), me(g, {
|
|
3083
|
-
key: 0,
|
|
3084
|
-
variant: "tertiary",
|
|
3085
|
-
"prepend-icon": "delete",
|
|
3086
|
-
size: "md",
|
|
3087
|
-
class: "mt-6",
|
|
3088
|
-
onClick: (Ie) => ee(se)
|
|
3089
|
-
}, null, 8, ["onClick"]))
|
|
3090
|
-
]),
|
|
3091
|
-
se < O.value.length - 1 ? (l(), h("div", vn)) : I("", !0)
|
|
3092
|
-
]);
|
|
3093
|
-
}), 128))
|
|
3094
|
-
]),
|
|
3095
|
-
e("div", yn, [
|
|
3096
|
-
m[11] || (m[11] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Delivery order no.", -1)),
|
|
3097
|
-
e("div", bn, [
|
|
3098
|
-
L(we, {
|
|
3099
|
-
modelValue: _(t).deliveryOrderNumber,
|
|
3100
|
-
"onUpdate:modelValue": m[2] || (m[2] = (de) => _(t).deliveryOrderNumber = de),
|
|
3101
|
-
size: "md"
|
|
3102
|
-
}, null, 8, ["modelValue"])
|
|
3103
|
-
])
|
|
3104
|
-
]),
|
|
3105
|
-
e("div", hn, [
|
|
3106
|
-
m[12] || (m[12] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Remark", -1)),
|
|
3107
|
-
e("div", gn, [
|
|
3108
|
-
L(we, {
|
|
3109
|
-
modelValue: _(t).remark,
|
|
3110
|
-
"onUpdate:modelValue": m[3] || (m[3] = (de) => _(t).remark = de),
|
|
3111
|
-
size: "md"
|
|
3112
|
-
}, null, 8, ["modelValue"])
|
|
3113
|
-
])
|
|
3114
|
-
])
|
|
3115
|
-
])
|
|
3116
|
-
];
|
|
3117
|
-
}),
|
|
3118
|
-
_: 1
|
|
3119
|
-
}, 8, ["modelValue"]);
|
|
3120
|
-
};
|
|
3121
|
-
}
|
|
3122
|
-
}), Sn = { class: "flex flex-row-reverse" }, xn = {
|
|
3123
|
-
key: 0,
|
|
3124
|
-
class: "flex"
|
|
3125
|
-
}, kn = {
|
|
3126
|
-
key: 1,
|
|
3127
|
-
class: "border-t pt-6"
|
|
3128
|
-
}, On = { class: "fm-typo-en-body-lg-600 mb-4 flex items-center gap-2" }, wn = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg overflow-y-auto" }, $n = { class: "w-full" }, Cn = {
|
|
3129
|
-
class: "p-3 fm-typo-en-body-sm-600",
|
|
3130
|
-
style: { "min-width": "130px" }
|
|
3131
|
-
}, Dn = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Rn = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Nn = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, An = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Tn = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Pn = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, In = { class: "p-3 fm-typo-en-body-sm-600" }, Fn = { key: 2 }, En = /* @__PURE__ */ qe({
|
|
3132
|
-
__name: "NetSuiteTransactionChangeLog",
|
|
3133
|
-
props: {
|
|
3134
|
-
netsuiteId: {}
|
|
3135
|
-
},
|
|
3136
|
-
setup(b) {
|
|
3137
|
-
const s = b, n = $t(), c = Z(!1), v = Z(!1), d = Z(!1), p = Z([]);
|
|
3138
|
-
async function t() {
|
|
3139
|
-
if (!(p.value.length > 0))
|
|
3140
|
-
try {
|
|
3141
|
-
v.value = !0;
|
|
3142
|
-
const k = await n.getChangeLogs(s.netsuiteId);
|
|
3143
|
-
p.value = k, d.value = !1;
|
|
3144
|
-
} catch {
|
|
3145
|
-
d.value = !0;
|
|
3146
|
-
} finally {
|
|
3147
|
-
v.value = !1;
|
|
3148
|
-
}
|
|
3149
|
-
}
|
|
3150
|
-
function o(k) {
|
|
3151
|
-
switch (k) {
|
|
3152
|
-
case Le.Create:
|
|
3153
|
-
return "text-green-600 bg-green-100";
|
|
3154
|
-
case Le.Set:
|
|
3155
|
-
return "text-blue-600 bg-blue-100";
|
|
3156
|
-
case Le.Change:
|
|
3157
|
-
return "text-yellow-600 bg-yellow-100";
|
|
3158
|
-
case Le.Unset:
|
|
3159
|
-
return "text-red-600 bg-red-100";
|
|
3160
|
-
default:
|
|
3161
|
-
return "text-gray-600 bg-gray-100";
|
|
3162
|
-
}
|
|
3163
|
-
}
|
|
3164
|
-
function u(k) {
|
|
3165
|
-
return new Date(k).toLocaleDateString("en-US", {
|
|
3166
|
-
year: "numeric",
|
|
3167
|
-
month: "short",
|
|
3168
|
-
day: "numeric",
|
|
3169
|
-
hour: "2-digit",
|
|
3170
|
-
minute: "2-digit"
|
|
3171
|
-
});
|
|
3172
|
-
}
|
|
3173
|
-
return (k, $) => {
|
|
3174
|
-
const D = re("FmButton"), T = re("FmCircularProgress"), S = re("FmIcon"), F = re("FmDialog");
|
|
3175
|
-
return l(), h("div", Sn, [
|
|
3176
|
-
L(F, {
|
|
3177
|
-
modelValue: c.value,
|
|
3178
|
-
"onUpdate:modelValue": $[2] || ($[2] = (E) => c.value = E),
|
|
3179
|
-
overlay: !0,
|
|
3180
|
-
"max-width": 800
|
|
3181
|
-
}, {
|
|
3182
|
-
"dialog-button": ce(() => [
|
|
3183
|
-
L(D, {
|
|
3184
|
-
"prepend-icon": "info",
|
|
3185
|
-
variant: "secondary",
|
|
3186
|
-
label: "NetSuite",
|
|
3187
|
-
onClick: $[0] || ($[0] = (E) => t()),
|
|
3188
|
-
"text-color": "primary",
|
|
3189
|
-
"bg-color": "transparent",
|
|
3190
|
-
"border-color": "primary"
|
|
3191
|
-
})
|
|
3192
|
-
]),
|
|
3193
|
-
"dialog-header": ce(() => $[3] || ($[3] = [
|
|
3194
|
-
e("div", null, "NetSuite info", -1)
|
|
3195
|
-
])),
|
|
3196
|
-
default: ce(() => [
|
|
3197
|
-
v.value ? (l(), h("div", xn, [
|
|
3198
|
-
$[4] || ($[4] = e("span", null, "Change Log Loading...", -1)),
|
|
3199
|
-
L(T, { size: "md" })
|
|
3200
|
-
])) : I("", !0),
|
|
3201
|
-
!v.value && p.value.length > 0 ? (l(), h("div", kn, [
|
|
3202
|
-
e("h3", On, [
|
|
3203
|
-
L(S, {
|
|
3204
|
-
name: "error",
|
|
3205
|
-
color: "#ff9500",
|
|
3206
|
-
size: "sm"
|
|
3207
|
-
}),
|
|
3208
|
-
$[5] || ($[5] = ze(" Change Logs "))
|
|
3209
|
-
]),
|
|
3210
|
-
e("div", wn, [
|
|
3211
|
-
e("table", $n, [
|
|
3212
|
-
$[6] || ($[6] = e("thead", { class: "bg-fm-color-neutral-gray-50" }, [
|
|
3213
|
-
e("tr", { class: "border-b border-fm-color-neutral-gray-200" }, [
|
|
3214
|
-
e("th", {
|
|
3215
|
-
class: "text-left p-3 fm-typo-en-body-md-600",
|
|
3216
|
-
style: { "min-width": "130px" }
|
|
3217
|
-
}, " Date "),
|
|
3218
|
-
e("th", { class: "text-left p-3 fm-typo-en-body-md-600" }, "Role"),
|
|
3219
|
-
e("th", { class: "text-left p-3 fm-typo-en-body-md-600" }, "Name"),
|
|
3220
|
-
e("th", { class: "text-left p-3 fm-typo-en-body-md-600" }, "Context"),
|
|
3221
|
-
e("th", { class: "text-left p-3 fm-typo-en-body-md-600" }, "Type"),
|
|
3222
|
-
e("th", { class: "text-left p-3 fm-typo-en-body-md-600" }, "Line ID"),
|
|
3223
|
-
e("th", { class: "text-left p-3 fm-typo-en-body-md-600" }, "Field"),
|
|
3224
|
-
e("th", { class: "text-left p-3 fm-typo-en-body-md-600" }, "Old Value"),
|
|
3225
|
-
e("th", { class: "text-left p-3 fm-typo-en-body-md-600" }, "New Value")
|
|
3226
|
-
])
|
|
3227
|
-
], -1)),
|
|
3228
|
-
e("tbody", null, [
|
|
3229
|
-
(l(!0), h(Ce, null, Ee(p.value, (E, J) => (l(), h("tr", {
|
|
3230
|
-
key: J,
|
|
3231
|
-
class: "border-b border-fm-color-neutral-gray-200 last:border-b-0"
|
|
3232
|
-
}, [
|
|
3233
|
-
e("td", Cn, x(u(E._dateiso8601)), 1),
|
|
3234
|
-
e("td", Dn, x(E._rolename), 1),
|
|
3235
|
-
e("td", Rn, x(E._employeename), 1),
|
|
3236
|
-
e("td", Nn, x(E._contextname), 1),
|
|
3237
|
-
e("td", {
|
|
3238
|
-
class: Ue(`p-3 fm-typo-en-body-sm-600 ${o(Number(E.type) - 1)}`)
|
|
3239
|
-
}, x(_(Le)[Number(E.type) - 1]), 3),
|
|
3240
|
-
e("td", An, x(E.lineid || ""), 1),
|
|
3241
|
-
e("td", Tn, x(E._fieldname), 1),
|
|
3242
|
-
e("td", Pn, x(E.oldvalue || ""), 1),
|
|
3243
|
-
e("td", In, x(E.newvalue || ""), 1)
|
|
3244
|
-
]))), 128))
|
|
3245
|
-
])
|
|
3246
|
-
])
|
|
3247
|
-
])
|
|
3248
|
-
])) : (l(), h("div", Fn, $[7] || ($[7] = [
|
|
3249
|
-
e("p", null, "No change logs available.", -1)
|
|
3250
|
-
])))
|
|
3251
|
-
]),
|
|
3252
|
-
"dialog-footer": ce(() => [
|
|
3253
|
-
L(D, {
|
|
3254
|
-
class: "ml-auto sm:w-full xs:w-full",
|
|
3255
|
-
label: "Close",
|
|
3256
|
-
size: "md",
|
|
3257
|
-
variant: "primary",
|
|
3258
|
-
onClick: $[1] || ($[1] = (E) => c.value = !1)
|
|
3259
|
-
})
|
|
3260
|
-
]),
|
|
3261
|
-
_: 1
|
|
3262
|
-
}, 8, ["modelValue"])
|
|
3263
|
-
]);
|
|
3264
|
-
};
|
|
3265
|
-
}
|
|
3266
|
-
}), qn = { class: "flex flex-col w-full gap-3" }, Vn = { class: "flex" }, Ln = { class: "fm-typo-en-title-md-600 text-fm-color-typo-primary" }, Un = { class: "flex flex-col gap-16 w-full h-full" }, Mn = { class: "flex justify-between" }, jn = { class: "fm-typo-en-body-lg-600" }, Bn = { class: "flex gap-2" }, zn = {
|
|
3267
|
-
key: 0,
|
|
3268
|
-
class: "flex items-center gap-1"
|
|
3269
|
-
}, Kn = { class: "fm-typo-en-body-md-400" }, Hn = { class: "flex flex-col gap-8" }, Gn = {
|
|
3270
|
-
key: 0,
|
|
3271
|
-
class: "flex items-start justify-between gap-6"
|
|
3272
|
-
}, Wn = { class: "text-xs font-mono text-right break-all" }, Qn = {
|
|
3273
|
-
key: 1,
|
|
3274
|
-
class: "flex items-start justify-between gap-6"
|
|
3275
|
-
}, Yn = { class: "fm-typo-en-body-sm-600" }, Jn = {
|
|
3276
|
-
key: 2,
|
|
3277
|
-
class: "flex items-start justify-between gap-6"
|
|
3278
|
-
}, Xn = { class: "text-xs font-mono text-right break-all" }, Zn = {
|
|
3279
|
-
key: 3,
|
|
3280
|
-
class: "flex items-start justify-between gap-6"
|
|
3281
|
-
}, ea = { class: "text-xs font-mono text-right break-all" }, ta = { class: "flex flex-col gap-4" }, sa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ra = { class: "flex gap-1" }, oa = { class: "fm-typo-en-body-lg-600" }, na = {
|
|
3282
|
-
key: 0,
|
|
3283
|
-
class: "flex flex-col gap-4"
|
|
3284
|
-
}, aa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, la = { class: "fm-typo-en-body-lg-600" }, ia = { class: "flex flex-col gap-4" }, ca = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ua = { class: "fm-typo-en-body-lg-600" }, da = {
|
|
3285
|
-
key: 1,
|
|
3286
|
-
class: "flex flex-col gap-4"
|
|
3287
|
-
}, ma = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, pa = { class: "fm-typo-en-body-lg-600" }, fa = {
|
|
3288
|
-
key: 2,
|
|
3289
|
-
class: "flex flex-col gap-4"
|
|
3290
|
-
}, va = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ya = { class: "fm-typo-en-body-lg-600" }, ba = {
|
|
3291
|
-
key: 3,
|
|
3292
|
-
class: "flex flex-col gap-4"
|
|
3293
|
-
}, ha = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ga = { class: "fm-typo-en-body-lg-600" }, _a = {
|
|
3294
|
-
key: 4,
|
|
3295
|
-
class: "flex flex-col gap-4"
|
|
3296
|
-
}, Sa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, xa = { class: "fm-typo-en-body-lg-600" }, ka = {
|
|
3297
|
-
key: 5,
|
|
3298
|
-
class: "flex flex-col gap-4"
|
|
3299
|
-
}, Oa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, wa = { class: "fm-typo-en-body-lg-600" }, $a = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Ca = { class: "flex flex-col gap-8" }, Da = { class: "flex gap-8 items-center" }, Ra = { class: "flex-1 fm-typo-en-body-lg-600" }, Na = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary flex flex-col gap-4" }, Aa = { class: "flex w-full gap-4" }, Ta = { class: "basis-1/2 shrink-0 grow fm-typo-en-body-lg-400 line-clamp-2 flex items-center gap-2" }, Pa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary flex flex-col gap-2" }, Ia = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, Fa = ["innerHTML"], Ea = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, qa = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-1" }, Va = {
|
|
3300
|
-
key: 0,
|
|
3301
|
-
class: "flex items-center gap-4"
|
|
3302
|
-
}, La = { class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ua = {
|
|
3303
|
-
key: 0,
|
|
3304
|
-
class: "inline-flex items-center gap-1 text-xs font-medium text-gray-500 bg-gray-100 px-2 py-0.5 rounded-full"
|
|
3305
|
-
}, Ma = { class: "py-8" }, ja = { class: "flex justify-end gap-4 items-center" }, Ba = { class: "fm-typo-en-body-lg-600" }, za = {
|
|
3306
|
-
key: 1,
|
|
3307
|
-
class: "flex-1 xs:w-screen xs:max-w-full"
|
|
3308
|
-
}, Ka = {
|
|
3309
|
-
key: 0,
|
|
3310
|
-
class: "flex flex-col items-center gap-8 h-full"
|
|
3311
|
-
}, Ha = ["src"], Ga = { class: "fm-typo-en-body-lg-600" }, Wa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, Qa = {
|
|
3312
|
-
key: 1,
|
|
3313
|
-
class: "px-4 flex flex-col"
|
|
3314
|
-
}, Ya = { class: "flex gap-12 content-stretch" }, Ja = {
|
|
3315
|
-
class: "flex flex-col w-40",
|
|
3316
|
-
name: "circles"
|
|
3317
|
-
}, Xa = { class: "flex-1 flex flex-col items-center" }, Za = { class: "h-40 w-40 bg-fm-color-primary rounded-full flex items-center justify-center" }, el = { class: "flex-1 flex flex-col items-center" }, tl = { class: "flex w-full items-center gap-4" }, sl = {
|
|
3318
|
-
class: "py-12 flex flex-col gap-4",
|
|
3319
|
-
name: "received-at header"
|
|
3320
|
-
}, rl = { class: "fm-typo-en-body-lg-400" }, ol = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, nl = { class: "ml-auto flex gap-1" }, al = { class: "flex gap-12 content-stretch" }, ll = {
|
|
3321
|
-
class: "flex flex-col w-40",
|
|
3322
|
-
name: "circles"
|
|
3323
|
-
}, il = { class: "flex-1 flex flex-col items-center" }, cl = {
|
|
3324
|
-
class: "py-12 flex flex-col gap-4 flex-1",
|
|
3325
|
-
name: "delivery details"
|
|
3326
|
-
}, ul = { class: "flex flex-col gap-8" }, dl = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ml = { class: "flex flex-col gap-4" }, pl = { class: "flex gap-8 xs:flex-col" }, Hl = /* @__PURE__ */ qe({
|
|
3327
|
-
__name: "TransferDetails",
|
|
3328
|
-
props: {
|
|
3329
|
-
poRequest: {},
|
|
3330
|
-
purchaseOrder: {},
|
|
3331
|
-
transferTo: {},
|
|
3332
|
-
transferToDbName: {},
|
|
3333
|
-
show: { type: Boolean },
|
|
3334
|
-
canResubmit: { type: Boolean },
|
|
3335
|
-
canApprove: { type: Boolean },
|
|
3336
|
-
scope: {},
|
|
3337
|
-
receivedMap: {},
|
|
3338
|
-
shipments: {}
|
|
3339
|
-
},
|
|
3340
|
-
emits: ["update:show", "submitted"],
|
|
3341
|
-
setup(b, { emit: s }) {
|
|
3342
|
-
const n = b, c = s, v = ft(), d = Qe(), p = He(), t = Me(), o = mt(), { hasOrderDraftPermission: u } = ls(), k = ns();
|
|
3343
|
-
function $(r) {
|
|
3344
|
-
const a = r.isCustomCost, w = r.totalCost;
|
|
3345
|
-
return a != null ? a === !0 : w != null;
|
|
3346
|
-
}
|
|
3347
|
-
Ge(
|
|
3348
|
-
() => n.purchaseOrder,
|
|
3349
|
-
(r) => {
|
|
3350
|
-
k.init(r);
|
|
3351
|
-
},
|
|
3352
|
-
{ immediate: !0 }
|
|
3353
|
-
);
|
|
3354
|
-
const D = j(
|
|
3355
|
-
() => {
|
|
3356
|
-
var r, a;
|
|
3357
|
-
return {
|
|
3358
|
-
id: ((r = o.sessionUser.value) == null ? void 0 : r.id) ?? "",
|
|
3359
|
-
name: ((a = o.sessionUser.value) == null ? void 0 : a.displayName) ?? ""
|
|
3360
|
-
};
|
|
3361
|
-
}
|
|
3362
|
-
), T = as(), { t: S } = dt(), F = j(
|
|
3363
|
-
() => {
|
|
3364
|
-
var r, a, w, q;
|
|
3365
|
-
return ((a = (r = n.purchaseOrder) == null ? void 0 : r.supplier) == null ? void 0 : a.internal) === "restaurant" || ((q = (w = n.purchaseOrder) == null ? void 0 : w.supplier) == null ? void 0 : q.internal) === "warehouse" ? et.enum.transfer : et.enum.purchase;
|
|
3366
|
-
}
|
|
3367
|
-
), E = j(() => {
|
|
3368
|
-
var w;
|
|
3369
|
-
const r = (w = n.shipments) == null ? void 0 : w.find((q) => {
|
|
3370
|
-
var W;
|
|
3371
|
-
return q.ref === ((W = n.purchaseOrder) == null ? void 0 : W._id);
|
|
3372
|
-
});
|
|
3373
|
-
let a = null;
|
|
3374
|
-
if (r != null && r.milestones && r.milestones.length > 0) {
|
|
3375
|
-
const q = r.milestones[r.milestones.length - 1];
|
|
3376
|
-
if (q.estimatedTime) {
|
|
3377
|
-
const W = new Date(q.estimatedTime), Q = W.getDate().toString().padStart(2, "0");
|
|
3378
|
-
a = `${W.toLocaleString("en-US", { month: "short" })} ${Q}`;
|
|
3379
|
-
}
|
|
3380
|
-
}
|
|
3381
|
-
return a;
|
|
3382
|
-
}), J = Z(!1), z = Z(""), ae = Z(!0), ge = Ye(), H = Ks(ge.getWorkflowConfig), R = os(), ne = [
|
|
3383
|
-
V.enum.receiveStock,
|
|
3384
|
-
V.enum.processRequest,
|
|
3385
|
-
V.enum.closeRequest
|
|
3386
|
-
], P = j(() => {
|
|
3387
|
-
if (!n.purchaseOrder)
|
|
3388
|
-
return [];
|
|
3389
|
-
const r = H.result.value;
|
|
3390
|
-
if (r.state === jt.loading)
|
|
3391
|
-
return [];
|
|
3392
|
-
const a = {
|
|
3393
|
-
user: D.value,
|
|
3394
|
-
executedAt: t.locations.computeFirst(
|
|
3395
|
-
(oe) => {
|
|
3396
|
-
var A;
|
|
3397
|
-
return oe.dbName === ((A = t._currentLocation) == null ? void 0 : A.dbName) ? oe : null;
|
|
3398
|
-
}
|
|
3399
|
-
),
|
|
3400
|
-
purchaseOrderRequest: n.poRequest,
|
|
3401
|
-
purchaseOrder: n.purchaseOrder
|
|
3402
|
-
}, w = p.useOperatePurchaseOrderV2, q = p.poWorkflowAllowToMarkCompleted, W = [...ne];
|
|
3403
|
-
w && !q && W.push(V.enum.completeReceive);
|
|
3404
|
-
let Q = [];
|
|
3405
|
-
try {
|
|
3406
|
-
r.state === jt.error ? (console.error("Error fetching workflow config:", r.error), Q = vt.getAvailableActions({
|
|
3407
|
-
...a,
|
|
3408
|
-
orderConfig: vt.getDefaultConfig()
|
|
3409
|
-
}).actions.filter((oe) => !W.includes(oe))) : Q = vt.getAvailableActions({
|
|
3410
|
-
...a,
|
|
3411
|
-
orderConfig: r.data
|
|
3412
|
-
}).actions.filter((oe) => !W.includes(oe));
|
|
3413
|
-
} catch (oe) {
|
|
3414
|
-
console.error("Error getting available actions:", oe);
|
|
3415
|
-
}
|
|
3416
|
-
return n.scope === "approval" && (Q = Q.filter((oe) => oe !== V.enum.completeReceive)), u.value || (Q = Q.filter(
|
|
3417
|
-
(oe) => oe !== V.enum.approveDraft && oe !== V.enum.rejectDraft
|
|
3418
|
-
)), Q;
|
|
3419
|
-
}), C = qs(n, "show"), K = j(() => [
|
|
3420
|
-
{
|
|
3421
|
-
label: S("inventory.transfer.receiveRequest.details.overview"),
|
|
3422
|
-
value: "overview"
|
|
3423
|
-
},
|
|
3424
|
-
{
|
|
3425
|
-
label: S("inventory.transfer.receiveRequest.details.deliveryHistory"),
|
|
3426
|
-
value: "deliveryHistory"
|
|
3427
|
-
}
|
|
3428
|
-
]), N = Z(K.value[0]);
|
|
3429
|
-
Ge(
|
|
3430
|
-
() => n.show,
|
|
3431
|
-
(r) => {
|
|
3432
|
-
r && (N.value = K.value[0]);
|
|
3433
|
-
}
|
|
3434
|
-
);
|
|
3435
|
-
function X(r) {
|
|
3436
|
-
return r.map((a) => ({
|
|
3437
|
-
...a,
|
|
3438
|
-
amount: {
|
|
3439
|
-
...a.amount,
|
|
3440
|
-
amount: -Math.abs(a.amount.amount)
|
|
3441
|
-
}
|
|
3442
|
-
}));
|
|
3443
|
-
}
|
|
3444
|
-
async function be(r, a, w, q, W) {
|
|
3445
|
-
return new Promise((Q, oe) => {
|
|
3446
|
-
const A = {
|
|
3447
|
-
closeButton: !1,
|
|
3448
|
-
title: q.title,
|
|
3449
|
-
message: q.message,
|
|
3450
|
-
primaryActions: q.primaryActions,
|
|
3451
|
-
secondaryActions: { text: "No", close: !1 }
|
|
3452
|
-
};
|
|
3453
|
-
let ue = a.rejectReason ?? "";
|
|
3454
|
-
w === V.enum.rejectDraft && (A.contentComponent = rs, A.contentComponentProps = {
|
|
3455
|
-
message: q.message,
|
|
3456
|
-
onChange: (y) => {
|
|
3457
|
-
ue = y ?? "";
|
|
3458
|
-
}
|
|
3459
|
-
}), v.open(A).onPrimary(async () => {
|
|
3460
|
-
var m, g, U, B;
|
|
3461
|
-
const y = [];
|
|
3462
|
-
w === V.enum.confirmDraft || w === V.enum.submitRequest ? y.push({
|
|
3463
|
-
action: "confirmDraft",
|
|
3464
|
-
payload: k.controller.value.toConfirmDraftData(De())
|
|
3465
|
-
}) : w === V.enum.approveRequest ? (y.push({
|
|
3466
|
-
action: "approveRequest",
|
|
3467
|
-
payload: null
|
|
3468
|
-
}), a.fulfillment && y.push({
|
|
3469
|
-
action: "processRequest",
|
|
3470
|
-
payload: {
|
|
3471
|
-
fulfillmentId: "",
|
|
3472
|
-
deliveryOrderNumber: "",
|
|
3473
|
-
deliveryRemark: null,
|
|
3474
|
-
items: X(a.fulfillment.items),
|
|
3475
|
-
createdBy: D.value
|
|
3476
|
-
}
|
|
3477
|
-
})) : w === V.enum.processRequest ? a.fulfillment && y.push({
|
|
3478
|
-
action: "processRequest",
|
|
3479
|
-
payload: {
|
|
3480
|
-
fulfillmentId: "",
|
|
3481
|
-
deliveryOrderNumber: "",
|
|
3482
|
-
deliveryRemark: null,
|
|
3483
|
-
items: X(a.fulfillment.items),
|
|
3484
|
-
createdBy: D.value
|
|
3485
|
-
}
|
|
3486
|
-
}) : w === V.enum.rejectRequest ? y.push({
|
|
3487
|
-
action: "rejectRequest",
|
|
3488
|
-
payload: null
|
|
3489
|
-
}) : w === V.enum.closeRequest ? y.push({
|
|
3490
|
-
action: "closeRequest",
|
|
3491
|
-
payload: null
|
|
3492
|
-
}) : w === V.enum.rejectDraft && y.push({
|
|
3493
|
-
action: "rejectDraft",
|
|
3494
|
-
payload: {
|
|
3495
|
-
rejectReason: ue ?? ""
|
|
3496
|
-
}
|
|
3497
|
-
});
|
|
3498
|
-
try {
|
|
3499
|
-
await R({
|
|
3500
|
-
operate: {
|
|
3501
|
-
operation: w,
|
|
3502
|
-
doc: r,
|
|
3503
|
-
options: a
|
|
3504
|
-
},
|
|
3505
|
-
operateV2: {
|
|
3506
|
-
_id: ((m = n.purchaseOrder) == null ? void 0 : m._id) ?? "",
|
|
3507
|
-
_rev: ((g = n.purchaseOrder) == null ? void 0 : g._rev) ?? "",
|
|
3508
|
-
action: w === V.enum.submitRequest ? V.enum.confirmDraft : w,
|
|
3509
|
-
payloads: y
|
|
3510
|
-
// add payload if action is receiveStock or processRequest
|
|
3511
|
-
},
|
|
3512
|
-
transferTo: (B = (U = n.poRequest) == null ? void 0 : U.to) == null ? void 0 : B.dbName
|
|
3513
|
-
}).delayed(1e3), Q("submitted");
|
|
3514
|
-
} catch (_e) {
|
|
3515
|
-
oe(_e);
|
|
3516
|
-
}
|
|
3517
|
-
}).onSecondary(() => {
|
|
3518
|
-
Q("cancelled");
|
|
3519
|
-
for (let y = 0; y < W + 2; y++)
|
|
3520
|
-
v.close();
|
|
3521
|
-
}).onClose(() => {
|
|
3522
|
-
});
|
|
3523
|
-
});
|
|
3524
|
-
}
|
|
3525
|
-
async function ye(r) {
|
|
3526
|
-
var W, Q, oe, A;
|
|
3527
|
-
if (r === V.enum.receiveStock)
|
|
3528
|
-
return;
|
|
3529
|
-
const a = ss[r];
|
|
3530
|
-
if (!a) {
|
|
3531
|
-
d.open({
|
|
3532
|
-
title: "Something went wrong",
|
|
3533
|
-
message: `Cannot process order: ${Ot(r)}`,
|
|
3534
|
-
type: "error"
|
|
3535
|
-
});
|
|
3536
|
-
return;
|
|
3537
|
-
}
|
|
3538
|
-
const { successMessage: w, ...q } = a;
|
|
3539
|
-
if (n.purchaseOrder) {
|
|
3540
|
-
z.value = `${r}`, J.value = !0, ae.value = !1;
|
|
3541
|
-
const ue = {};
|
|
3542
|
-
let y = 0;
|
|
3543
|
-
if ((r === V.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
3544
|
-
r === V.enum.completeReceive) && p.autoReceiveWarehouse)
|
|
3545
|
-
ue.autoReceive = !0;
|
|
3546
|
-
else if ((r === V.enum.approveRequest || r === V.enum.processRequest) && p.acceptRequireFulfillment) {
|
|
3547
|
-
const m = (Q = (W = n.poRequest) == null ? void 0 : W.from) == null ? void 0 : Q.dbName, g = (A = (oe = n.poRequest) == null ? void 0 : oe.to) == null ? void 0 : A.dbName;
|
|
3548
|
-
if (m && g && (m.startsWith("warehouse_") || g.startsWith("warehouse_"))) {
|
|
3549
|
-
const U = await new Promise((B, _e) => {
|
|
3550
|
-
v.open({
|
|
3551
|
-
closeButton: !1,
|
|
3552
|
-
title: "Confirm transfer amount",
|
|
3553
|
-
dialogComponent: pr,
|
|
3554
|
-
dialogComponentProps: {
|
|
3555
|
-
purchaseOrder: n.purchaseOrder,
|
|
3556
|
-
confirm: B,
|
|
3557
|
-
"onUpdate:show": ($e) => {
|
|
3558
|
-
$e || (z.value = "", J.value = !1, ae.value = !0, y++, v.close()), _e("cancelled");
|
|
3559
|
-
}
|
|
3560
|
-
}
|
|
3561
|
-
});
|
|
3562
|
-
});
|
|
3563
|
-
ue.fulfillment = U;
|
|
3564
|
-
}
|
|
3565
|
-
}
|
|
3566
|
-
try {
|
|
3567
|
-
await be(
|
|
3568
|
-
n.purchaseOrder,
|
|
3569
|
-
ue,
|
|
3570
|
-
r,
|
|
3571
|
-
a,
|
|
3572
|
-
y
|
|
3573
|
-
) === "submitted" && (d.open({
|
|
3574
|
-
title: "Success",
|
|
3575
|
-
message: w,
|
|
3576
|
-
type: "success"
|
|
3577
|
-
}), c("update:show", !1), c("submitted"));
|
|
3578
|
-
} catch (m) {
|
|
3579
|
-
d.open({
|
|
3580
|
-
title: "Something went wrong",
|
|
3581
|
-
message: m instanceof Error ? m.message : "Please try again.",
|
|
3582
|
-
type: "error"
|
|
3583
|
-
}), console.error("Error when submitting PO operation", r, n.purchaseOrder, m);
|
|
3584
|
-
} finally {
|
|
3585
|
-
z.value = "", J.value = !1, ae.value = !0;
|
|
3586
|
-
}
|
|
3587
|
-
}
|
|
3588
|
-
}
|
|
3589
|
-
const pe = j(() => {
|
|
3590
|
-
var r, a;
|
|
3591
|
-
return ((r = n.purchaseOrder) == null ? void 0 : r.status) === ve.enum.RECEIVING || ((a = n.purchaseOrder) == null ? void 0 : a.status) === ve.enum.COMPLETE;
|
|
3592
|
-
}), fe = j(() => n.purchaseOrder ? ct(n.purchaseOrder) : {}), f = j(() => {
|
|
3593
|
-
const r = n.purchaseOrder;
|
|
3594
|
-
if (!r) return { status: "", statusClass: "" };
|
|
3595
|
-
const { partial: a, over: w } = _t(fe.value), q = St(r.status, a, w);
|
|
3596
|
-
let W = S(`inventory.transfer.status.${q}`), Q = `${r.status}`.toLocaleLowerCase("en-us");
|
|
3597
|
-
return q === ve.enum.CLOSE && (W = `${S(`inventory.transfer.status.${ve.enum.COMPLETE}`)}`), q === "PARTIAL_RECEIVED" && Q === ve.enum.PROCESSING.toLocaleLowerCase("en-us") && (Q = ve.enum.RECEIVING.toLocaleLowerCase("en-us")), {
|
|
3598
|
-
status: W,
|
|
3599
|
-
statusClass: `fm-status-badge fm-status-badge-${Q}`
|
|
3600
|
-
};
|
|
3601
|
-
}), i = j(() => {
|
|
3602
|
-
var Q, oe;
|
|
3603
|
-
const r = ((Q = n.purchaseOrder) == null ? void 0 : Q.deliveryOrder) ?? [], a = ((oe = n.purchaseOrder) == null ? void 0 : oe.deliveryFullfillment) ?? [], w = [
|
|
3604
|
-
...r.map((A) => ({
|
|
3605
|
-
createdAt: A.createdAt,
|
|
3606
|
-
type: "grn",
|
|
3607
|
-
doc: A
|
|
3608
|
-
})),
|
|
3609
|
-
...a.map((A) => ({
|
|
3610
|
-
createdAt: A.createdAt,
|
|
3611
|
-
type: "fulfillment",
|
|
3612
|
-
doc: A
|
|
3613
|
-
}))
|
|
3614
|
-
];
|
|
3615
|
-
w.reverse().sort((A, ue) => A.createdAt.localeCompare(ue.createdAt));
|
|
3616
|
-
function q(A) {
|
|
3617
|
-
var m, g, U, B, _e, $e, te, he, we, Re, Ne, de;
|
|
3618
|
-
const ue = a.findIndex((se) => se.id === A.fullfillmentId), y = [
|
|
3619
|
-
(g = (m = a[ue]) == null ? void 0 : m.netSuite) != null && g.id ? {
|
|
3620
|
-
label: "Fulfillment's ref no. (Netsuite)",
|
|
3621
|
-
values: [
|
|
3622
|
-
`${((B = (U = a[ue]) == null ? void 0 : U.netSuite) == null ? void 0 : B.refNo) ?? "N/A"} (${(($e = (_e = a[ue]) == null ? void 0 : _e.netSuite) == null ? void 0 : $e.id) ?? "-"})`
|
|
3623
|
-
]
|
|
3624
|
-
} : null,
|
|
3625
|
-
(te = A == null ? void 0 : A.netSuite) != null && te.id ? {
|
|
3626
|
-
label: "Netsuite ref no.",
|
|
3627
|
-
values: [`${((he = A == null ? void 0 : A.netSuite) == null ? void 0 : he.refNo) ?? "N/A"} (${((we = A == null ? void 0 : A.netSuite) == null ? void 0 : we.id) ?? "-"})`]
|
|
3628
|
-
} : null,
|
|
3629
|
-
(Re = A == null ? void 0 : A.netSuite) != null && Re.recordType ? {
|
|
3630
|
-
label: "Netsuite Type",
|
|
3631
|
-
values: [Jt((Ne = A == null ? void 0 : A.netSuite) == null ? void 0 : Ne.recordType)]
|
|
3632
|
-
} : null
|
|
3633
|
-
];
|
|
3634
|
-
return {
|
|
3635
|
-
header: "Received",
|
|
3636
|
-
deliveryOrder: A,
|
|
3637
|
-
date: tt(new Date(A.createdAt)),
|
|
3638
|
-
info: [
|
|
3639
|
-
{
|
|
3640
|
-
label: "Adjustment date",
|
|
3641
|
-
values: [
|
|
3642
|
-
A.adjustment ? tt(new Date(at(A.adjustment))) : "-"
|
|
3643
|
-
]
|
|
3644
|
-
},
|
|
3645
|
-
{
|
|
3646
|
-
label: "Received by",
|
|
3647
|
-
values: [(de = A.createdBy) == null ? void 0 : de.name]
|
|
3648
|
-
},
|
|
3649
|
-
{
|
|
3650
|
-
label: "Received items",
|
|
3651
|
-
values: A.received.map((se) => {
|
|
3652
|
-
var Oe;
|
|
3653
|
-
return Y("div", [
|
|
3654
|
-
Y(
|
|
3655
|
-
"div",
|
|
3656
|
-
{
|
|
3657
|
-
class: "flex gap-4"
|
|
3658
|
-
},
|
|
3659
|
-
[
|
|
3660
|
-
Y(
|
|
3661
|
-
"div",
|
|
3662
|
-
{
|
|
3663
|
-
class: "flex flex-col"
|
|
3664
|
-
},
|
|
3665
|
-
[
|
|
3666
|
-
Y(
|
|
3667
|
-
"span",
|
|
3668
|
-
{
|
|
3669
|
-
class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
|
|
3670
|
-
},
|
|
3671
|
-
`${se.sku.name}`
|
|
3672
|
-
),
|
|
3673
|
-
Y(
|
|
3674
|
-
"span",
|
|
3675
|
-
{
|
|
3676
|
-
class: "fm-typo-en-body-md-400"
|
|
3677
|
-
},
|
|
3678
|
-
`${se.sku.code} `
|
|
3679
|
-
)
|
|
3680
|
-
]
|
|
3681
|
-
),
|
|
3682
|
-
Y(
|
|
3683
|
-
"div",
|
|
3684
|
-
{
|
|
3685
|
-
class: "ml-auto flex flex-col"
|
|
3686
|
-
},
|
|
3687
|
-
[
|
|
3688
|
-
Y(
|
|
3689
|
-
"div",
|
|
3690
|
-
{
|
|
3691
|
-
class: "ml-auto flex gap-1"
|
|
3692
|
-
},
|
|
3693
|
-
[
|
|
3694
|
-
Y(
|
|
3695
|
-
"span",
|
|
3696
|
-
{
|
|
3697
|
-
class: "fm-typo-en-body-lg-600 self-end"
|
|
3698
|
-
},
|
|
3699
|
-
xe(se.amount, !1)
|
|
3700
|
-
),
|
|
3701
|
-
Y(
|
|
3702
|
-
"span",
|
|
3703
|
-
{
|
|
3704
|
-
class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
3705
|
-
},
|
|
3706
|
-
((Oe = se.measurement) == null ? void 0 : Oe.abbrev) ?? se.sku.unit.abbrev
|
|
3707
|
-
)
|
|
3708
|
-
]
|
|
3709
|
-
),
|
|
3710
|
-
Y(
|
|
3711
|
-
"div",
|
|
3712
|
-
{
|
|
3713
|
-
class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
3714
|
-
},
|
|
3715
|
-
`${se.cost ? `(${ot(se.cost)})` : ""}`
|
|
3716
|
-
)
|
|
3717
|
-
]
|
|
3718
|
-
)
|
|
3719
|
-
]
|
|
3720
|
-
)
|
|
3721
|
-
]);
|
|
3722
|
-
})
|
|
3723
|
-
},
|
|
3724
|
-
{
|
|
3725
|
-
label: "Delivery order no.",
|
|
3726
|
-
values: [A.deliveryOrderNumber || "N/A"]
|
|
3727
|
-
},
|
|
3728
|
-
{
|
|
3729
|
-
label: "Remark",
|
|
3730
|
-
values: [A.remark || "N/A"]
|
|
3731
|
-
},
|
|
3732
|
-
ue > -1 ? {
|
|
3733
|
-
label: "Fulfilment's sequence",
|
|
3734
|
-
values: [`${ue + 1}`]
|
|
3735
|
-
} : null,
|
|
3736
|
-
...y
|
|
3737
|
-
].filter((se) => !!se)
|
|
3738
|
-
};
|
|
3739
|
-
}
|
|
3740
|
-
function W(A) {
|
|
3741
|
-
var y, m, g;
|
|
3742
|
-
const ue = a.findIndex((U) => U.id === A.id);
|
|
3743
|
-
return {
|
|
3744
|
-
header: "Fulfillment",
|
|
3745
|
-
date: tt(new Date(A.createdAt)),
|
|
3746
|
-
info: [
|
|
3747
|
-
{
|
|
3748
|
-
label: "Sequence",
|
|
3749
|
-
values: [String(ue + 1)]
|
|
3750
|
-
},
|
|
3751
|
-
{
|
|
3752
|
-
label: "Receiveable items",
|
|
3753
|
-
values: A.items.map((U) => {
|
|
3754
|
-
var B;
|
|
3755
|
-
return Y("div", [
|
|
3756
|
-
Y(
|
|
3757
|
-
"div",
|
|
3758
|
-
{
|
|
3759
|
-
class: "flex gap-4"
|
|
3760
|
-
},
|
|
3761
|
-
[
|
|
3762
|
-
Y(
|
|
3763
|
-
"div",
|
|
3764
|
-
{
|
|
3765
|
-
class: "flex flex-col"
|
|
3766
|
-
},
|
|
3767
|
-
[
|
|
3768
|
-
Y(
|
|
3769
|
-
"span",
|
|
3770
|
-
{
|
|
3771
|
-
class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
|
|
3772
|
-
},
|
|
3773
|
-
`${U.sku.name}`
|
|
3774
|
-
),
|
|
3775
|
-
Y(
|
|
3776
|
-
"span",
|
|
3777
|
-
{
|
|
3778
|
-
class: "fm-typo-en-body-md-400"
|
|
3779
|
-
},
|
|
3780
|
-
`${U.sku.code} `
|
|
3781
|
-
)
|
|
3782
|
-
]
|
|
3783
|
-
),
|
|
3784
|
-
Y(
|
|
3785
|
-
"div",
|
|
3786
|
-
{
|
|
3787
|
-
class: "ml-auto flex flex-col"
|
|
3788
|
-
},
|
|
3789
|
-
[
|
|
3790
|
-
Y(
|
|
3791
|
-
"div",
|
|
3792
|
-
{
|
|
3793
|
-
class: "ml-auto flex gap-1"
|
|
3794
|
-
},
|
|
3795
|
-
[
|
|
3796
|
-
Y(
|
|
3797
|
-
"span",
|
|
3798
|
-
{
|
|
3799
|
-
class: "fm-typo-en-body-lg-600 self-end"
|
|
3800
|
-
},
|
|
3801
|
-
xe(U.amount, !1)
|
|
3802
|
-
),
|
|
3803
|
-
Y(
|
|
3804
|
-
"span",
|
|
3805
|
-
{
|
|
3806
|
-
class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
3807
|
-
},
|
|
3808
|
-
((B = U.measurement) == null ? void 0 : B.abbrev) ?? U.sku.unit.abbrev
|
|
3809
|
-
)
|
|
3810
|
-
]
|
|
3811
|
-
),
|
|
3812
|
-
Y(
|
|
3813
|
-
"div",
|
|
3814
|
-
{
|
|
3815
|
-
class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
3816
|
-
},
|
|
3817
|
-
`${U.cost ? `(${ot(U.cost)})` : ""}`
|
|
3818
|
-
)
|
|
3819
|
-
]
|
|
3820
|
-
)
|
|
3821
|
-
]
|
|
3822
|
-
)
|
|
3823
|
-
]);
|
|
3824
|
-
})
|
|
3825
|
-
},
|
|
3826
|
-
(y = A.netSuite) != null && y.refNo ? {
|
|
3827
|
-
label: "Netsuite Ref no. (ID)",
|
|
3828
|
-
values: [`${(m = A.netSuite) == null ? void 0 : m.refNo} (${((g = A.netSuite) == null ? void 0 : g.id) ?? "-"})`]
|
|
3829
|
-
} : null
|
|
3830
|
-
].filter((U) => !!U)
|
|
3831
|
-
};
|
|
3832
|
-
}
|
|
3833
|
-
return w.map(
|
|
3834
|
-
(A) => A.type === "grn" ? q(A.doc) : W(A.doc)
|
|
3835
|
-
);
|
|
3836
|
-
});
|
|
3837
|
-
function O(r) {
|
|
3838
|
-
var Q;
|
|
3839
|
-
const w = (((Q = n.purchaseOrder) == null ? void 0 : Q.version) ?? Fe.enum[1]) === Fe.enum[2] ? r.id : r.sku._id, q = n.receivedMap[w], W = G(r);
|
|
3840
|
-
return q ? `<span class="${W} fm-typo-en-body-lg-600">${Ae.toFormatString({ value: q.received })}</span>/${it(r.quantity, r.sku.unit, r.measurement)}` : `<span class="fm-typo-en-body-lg-600">-</span>/${it(r.quantity, r.sku.unit, r.measurement)}`;
|
|
3841
|
-
}
|
|
3842
|
-
function M(r) {
|
|
3843
|
-
const a = n.purchaseOrder;
|
|
3844
|
-
if (!(a != null && a.itemsAtSubmission)) return !1;
|
|
3845
|
-
const w = a.version === Fe.enum[2], q = w ? r.id : r.sku._id;
|
|
3846
|
-
return q == null ? !1 : !a.itemsAtSubmission.some((W) => (w ? W.id : W.sku._id) === q);
|
|
3847
|
-
}
|
|
3848
|
-
function G(r) {
|
|
3849
|
-
var ue;
|
|
3850
|
-
const w = (((ue = n.purchaseOrder) == null ? void 0 : ue.version) ?? Fe.enum[1]) === Fe.enum[2] ? r.id : r.sku._id, q = n.receivedMap[w], { isPartialReceive: W, isNoReceive: Q, isOverReceive: oe, isFullReceive: A } = ir(q);
|
|
3851
|
-
return Q ? "text-fm-color-typo-tertiary" : W ? "text-fm-color-system-warning-300" : oe ? "text-fm-color-system-error-300" : A ? "text-fm-color-system-success-300" : "";
|
|
3852
|
-
}
|
|
3853
|
-
const ie = j(() => {
|
|
3854
|
-
var r, a, w;
|
|
3855
|
-
return (r = n.purchaseOrder) != null && r.itemsAtSubmission ? ((a = n.purchaseOrder) == null ? void 0 : a.version) === Fe.enum[2] ? n.purchaseOrder.items.reduce((q, W) => {
|
|
3856
|
-
var oe, A;
|
|
3857
|
-
const Q = (A = (oe = n.purchaseOrder) == null ? void 0 : oe.itemsAtSubmission) == null ? void 0 : A.find(
|
|
3858
|
-
(ue) => ue.id === W.id
|
|
3859
|
-
);
|
|
3860
|
-
return Q && Q.quantity !== W.quantity && q.set(W.sku.code, {
|
|
3861
|
-
originalAmount: Number(Ae.toFormatString({ value: Q.quantity })),
|
|
3862
|
-
newAmount: Number(Ae.toFormatString({ value: W.quantity }))
|
|
3863
|
-
}), q;
|
|
3864
|
-
}, /* @__PURE__ */ new Map()) : (w = n.purchaseOrder) == null ? void 0 : w.items.reduce((q, W) => {
|
|
3865
|
-
var ue, y;
|
|
3866
|
-
const Q = (y = (ue = n.purchaseOrder) == null ? void 0 : ue.itemsAtSubmission) == null ? void 0 : y.find(
|
|
3867
|
-
(m) => m.sku._id === W.sku._id
|
|
3868
|
-
), oe = Q ? Number(Ae.toFormatString({ value: Q.quantity })) : 0, A = Number(Ae.toFormatString({ value: W.quantity }));
|
|
3869
|
-
return Q && oe !== A && q.set(W.sku.code, {
|
|
3870
|
-
originalAmount: oe,
|
|
3871
|
-
newAmount: A
|
|
3872
|
-
}), q;
|
|
3873
|
-
}, /* @__PURE__ */ new Map()) : /* @__PURE__ */ new Map();
|
|
3874
|
-
}), ee = (r) => {
|
|
3875
|
-
var w, q;
|
|
3876
|
-
const a = ie.value;
|
|
3877
|
-
return ((w = n.purchaseOrder) == null ? void 0 : w.version) === Fe.enum[2] ? a.has(r.id) : a.has((q = r.sku) == null ? void 0 : q.code);
|
|
3878
|
-
}, ke = (r) => {
|
|
3879
|
-
var w, q;
|
|
3880
|
-
const a = ie.value;
|
|
3881
|
-
return ((w = n.purchaseOrder) == null ? void 0 : w.version) === Fe.enum[2] ? a.get(r.id) : a.get((q = r.sku) == null ? void 0 : q.code);
|
|
3882
|
-
}, le = j(() => {
|
|
3883
|
-
const r = n.purchaseOrder;
|
|
3884
|
-
if (!r) return "";
|
|
3885
|
-
const a = r.actionChangelogs ?? [], w = a.length ? a[a.length - 1] : null;
|
|
3886
|
-
if (w && w.action === "rejectDraft") {
|
|
3887
|
-
const q = w.remarks ?? "";
|
|
3888
|
-
return q && q.toString().trim() !== "" ? q.toString() : "-";
|
|
3889
|
-
}
|
|
3890
|
-
return "";
|
|
3891
|
-
});
|
|
3892
|
-
return (r, a) => {
|
|
3893
|
-
const w = re("FmButton"), q = re("FmButtonGroup"), W = re("FmChip"), Q = re("FmIcon"), oe = re("FmMenuDivider"), A = re("FmCard"), ue = re("FmTooltip"), y = re("FmSpacer"), m = re("FmSideSheet");
|
|
3894
|
-
return l(), me(m, {
|
|
3895
|
-
modelValue: _(C),
|
|
3896
|
-
"onUpdate:modelValue": a[8] || (a[8] = (g) => Ss(C) ? C.value = g : null),
|
|
3897
|
-
"dismiss-away": ae.value,
|
|
3898
|
-
"max-width": 600,
|
|
3899
|
-
"close-button": !1
|
|
3900
|
-
}, {
|
|
3901
|
-
"side-sheet-header": ce(() => {
|
|
3902
|
-
var g, U;
|
|
3903
|
-
return [
|
|
3904
|
-
e("div", qn, [
|
|
3905
|
-
e("div", Vn, [
|
|
3906
|
-
e("div", Ln, x(_(S)("inventory.transfer.receiveRequest.details.title") + ((g = r.purchaseOrder) != null && g.seqNumber ? ` #${(U = r.purchaseOrder) == null ? void 0 : U.seqNumber}` : "")), 1),
|
|
3907
|
-
L(w, {
|
|
3908
|
-
class: "ml-auto -m-2",
|
|
3909
|
-
variant: "tertiary",
|
|
3910
|
-
"prepend-icon": "close",
|
|
3911
|
-
onClick: a[0] || (a[0] = (B) => c("update:show", !1))
|
|
3912
|
-
})
|
|
3913
|
-
]),
|
|
3914
|
-
L(q, {
|
|
3915
|
-
items: K.value,
|
|
3916
|
-
modelValue: N.value,
|
|
3917
|
-
"onUpdate:modelValue": a[1] || (a[1] = (B) => N.value = B)
|
|
3918
|
-
}, null, 8, ["items", "modelValue"]),
|
|
3919
|
-
r.purchaseOrder && N.value.value === "deliveryHistory" ? (l(), me(_n, {
|
|
3920
|
-
key: 0,
|
|
3921
|
-
"purchase-order": r.purchaseOrder,
|
|
3922
|
-
"received-info-map": fe.value,
|
|
3923
|
-
"received-map": r.receivedMap,
|
|
3924
|
-
onSubmitted: a[2] || (a[2] = () => {
|
|
3925
|
-
c("update:show", !1), c("submitted");
|
|
3926
|
-
})
|
|
3927
|
-
}, null, 8, ["purchase-order", "received-info-map", "received-map"])) : I("", !0)
|
|
3928
|
-
])
|
|
3929
|
-
];
|
|
3930
|
-
}),
|
|
3931
|
-
default: ce(() => {
|
|
3932
|
-
var g, U, B, _e, $e;
|
|
3933
|
-
return [
|
|
3934
|
-
e("div", Un, [
|
|
3935
|
-
N.value.value === "overview" ? (l(), h(Ce, { key: 0 }, [
|
|
3936
|
-
e("div", null, [
|
|
3937
|
-
L(A, {
|
|
3938
|
-
variant: "outlined",
|
|
3939
|
-
class: "flex flex-col gap-8 px-12 py-16"
|
|
3940
|
-
}, {
|
|
3941
|
-
default: ce(() => {
|
|
3942
|
-
var te, he, we, Re, Ne, de, se, Oe, Te, Ie;
|
|
3943
|
-
return [
|
|
3944
|
-
e("div", Mn, [
|
|
3945
|
-
e("div", jn, x(_(S)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
|
|
3946
|
-
e("div", Bn, [
|
|
3947
|
-
L(W, {
|
|
3948
|
-
label: f.value.status,
|
|
3949
|
-
class: Ue(f.value.statusClass),
|
|
3950
|
-
compact: ""
|
|
3951
|
-
}, null, 8, ["label", "class"]),
|
|
3952
|
-
E.value ? (l(), h("div", zn, [
|
|
3953
|
-
L(Q, {
|
|
3954
|
-
name: "local_shipping",
|
|
3955
|
-
color: "#666666"
|
|
3956
|
-
}),
|
|
3957
|
-
e("span", Kn, x(E.value), 1)
|
|
3958
|
-
])) : I("", !0)
|
|
3959
|
-
])
|
|
3960
|
-
]),
|
|
3961
|
-
L(oe),
|
|
3962
|
-
e("div", Hn, [
|
|
3963
|
-
L(Ht, { title: "Debug Info" }, {
|
|
3964
|
-
default: ce(() => {
|
|
3965
|
-
var rt, Ct, Dt, Rt, Nt, At, Tt, Pt, It, Ft, Et, qt;
|
|
3966
|
-
return [
|
|
3967
|
-
(rt = r.purchaseOrder) != null && rt._id ? (l(), h("div", Gn, [
|
|
3968
|
-
a[9] || (a[9] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Purchase Order ID ", -1)),
|
|
3969
|
-
e("span", Wn, x((Ct = r.purchaseOrder) == null ? void 0 : Ct._id), 1)
|
|
3970
|
-
])) : I("", !0),
|
|
3971
|
-
(Dt = r.purchaseOrder) != null && Dt.status ? (l(), h("div", Qn, [
|
|
3972
|
-
a[10] || (a[10] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Purchase Order Status ", -1)),
|
|
3973
|
-
e("span", Yn, x((Rt = r.purchaseOrder) == null ? void 0 : Rt.status), 1)
|
|
3974
|
-
])) : I("", !0),
|
|
3975
|
-
(At = (Nt = r.purchaseOrder) == null ? void 0 : Nt.supplier) != null && At._id ? (l(), h("div", Jn, [
|
|
3976
|
-
a[11] || (a[11] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Source Location ID ", -1)),
|
|
3977
|
-
e("span", Xn, x(((Pt = (Tt = r.purchaseOrder) == null ? void 0 : Tt.supplier) == null ? void 0 : Pt.internal) != null ? `${(Ft = (It = r.purchaseOrder) == null ? void 0 : It.supplier) == null ? void 0 : Ft.internal}_` : "") + x((qt = (Et = r.purchaseOrder) == null ? void 0 : Et.supplier) == null ? void 0 : qt._id), 1)
|
|
3978
|
-
])) : I("", !0),
|
|
3979
|
-
r.transferToDbName ? (l(), h("div", Zn, [
|
|
3980
|
-
a[12] || (a[12] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Destination Location ID ", -1)),
|
|
3981
|
-
e("span", ea, x(r.transferToDbName), 1)
|
|
3982
|
-
])) : I("", !0)
|
|
3983
|
-
];
|
|
3984
|
-
}),
|
|
3985
|
-
_: 1
|
|
3986
|
-
}),
|
|
3987
|
-
e("div", ta, [
|
|
3988
|
-
e("div", sa, [
|
|
3989
|
-
e("div", ra, x(_(S)("inventory.transfer.receiveRequest.details.createdAt")), 1)
|
|
3990
|
-
]),
|
|
3991
|
-
e("div", oa, x(_(st)(((te = r.purchaseOrder) == null ? void 0 : te._id) ?? "")), 1)
|
|
3992
|
-
]),
|
|
3993
|
-
(he = r.purchaseOrder) != null && he.effectiveAt ? (l(), h("div", na, [
|
|
3994
|
-
e("div", aa, x(_(S)("inventory.transfer.receiveRequest.details.date")), 1),
|
|
3995
|
-
e("div", la, x(_(wt)(new Date((we = r.purchaseOrder) == null ? void 0 : we.effectiveAt))), 1)
|
|
3996
|
-
])) : I("", !0),
|
|
3997
|
-
e("div", ia, [
|
|
3998
|
-
e("div", ca, x(_(S)("inventory.transfer.receiveRequest.details.type.title")), 1),
|
|
3999
|
-
e("div", ua, x(_(S)(
|
|
4000
|
-
`inventory.transfer.receiveRequest.details.type.${F.value.toLocaleLowerCase("en-US")}`
|
|
4001
|
-
)), 1)
|
|
4002
|
-
]),
|
|
4003
|
-
(Ne = (Re = r.purchaseOrder) == null ? void 0 : Re.supplier) != null && Ne.name ? (l(), h("div", da, [
|
|
4004
|
-
e("div", ma, x(_(S)("inventory.transfer.receiveRequest.details.from")), 1),
|
|
4005
|
-
e("div", pa, x((se = (de = r.purchaseOrder) == null ? void 0 : de.supplier) == null ? void 0 : se.name), 1)
|
|
4006
|
-
])) : I("", !0),
|
|
4007
|
-
r.transferTo ? (l(), h("div", fa, [
|
|
4008
|
-
e("div", va, x(_(S)("inventory.transfer.receiveRequest.details.to")), 1),
|
|
4009
|
-
e("div", ya, x(r.transferTo), 1)
|
|
4010
|
-
])) : I("", !0),
|
|
4011
|
-
(Oe = r.purchaseOrder) != null && Oe.ref ? (l(), h("div", ba, [
|
|
4012
|
-
e("div", ha, x(_(S)("inventory.transfer.receiveRequest.details.reference")), 1),
|
|
4013
|
-
e("div", ga, x(r.purchaseOrder.ref), 1)
|
|
4014
|
-
])) : I("", !0),
|
|
4015
|
-
(Te = r.purchaseOrder) != null && Te.remark ? (l(), h("div", _a, [
|
|
4016
|
-
e("div", Sa, x(_(S)("inventory.transfer.receiveRequest.details.remark")), 1),
|
|
4017
|
-
e("div", xa, x(r.purchaseOrder.remark), 1)
|
|
4018
|
-
])) : I("", !0),
|
|
4019
|
-
((Ie = r.purchaseOrder) == null ? void 0 : Ie.status) === _(ve).enum.DRAFT && le.value ? (l(), h("div", ka, [
|
|
4020
|
-
e("div", Oa, x(_(S)("inventory.transfer.receiveRequest.details.rejectionReason")), 1),
|
|
4021
|
-
e("div", wa, x(le.value !== "" ? le.value : "-"), 1)
|
|
4022
|
-
])) : I("", !0)
|
|
4023
|
-
])
|
|
4024
|
-
];
|
|
4025
|
-
}),
|
|
4026
|
-
_: 1
|
|
4027
|
-
})
|
|
4028
|
-
]),
|
|
4029
|
-
L(co, {
|
|
4030
|
-
"po-request": r.poRequest,
|
|
4031
|
-
purchaseOrder: r.purchaseOrder,
|
|
4032
|
-
transferType: F.value,
|
|
4033
|
-
transferToDbName: r.transferToDbName,
|
|
4034
|
-
scope: r.scope
|
|
4035
|
-
}, null, 8, ["po-request", "purchaseOrder", "transferType", "transferToDbName", "scope"]),
|
|
4036
|
-
e("div", $a, [
|
|
4037
|
-
e("div", Ca, [
|
|
4038
|
-
e("div", Da, [
|
|
4039
|
-
e("span", Ra, [
|
|
4040
|
-
ze(x(pe.value ? _(S)("inventory.transfer.receiveRequest.details.receivedItems") : _(S)("inventory.transfer.receiveRequest.details.requestedItems")) + " ", 1),
|
|
4041
|
-
(U = (g = r.purchaseOrder) == null ? void 0 : g.netSuite) != null && U.missingItems && ((_e = (B = r.purchaseOrder) == null ? void 0 : B.netSuite) == null ? void 0 : _e.missingItems.length) > 0 ? (l(), me(ue, {
|
|
4042
|
-
key: 0,
|
|
4043
|
-
variant: "rich",
|
|
4044
|
-
placement: "top",
|
|
4045
|
-
"z-index": 51
|
|
4046
|
-
}, {
|
|
4047
|
-
content: ce(() => {
|
|
4048
|
-
var te, he;
|
|
4049
|
-
return [
|
|
4050
|
-
e("div", Na, [
|
|
4051
|
-
(l(!0), h(Ce, null, Ee((he = (te = r.purchaseOrder) == null ? void 0 : te.netSuite) == null ? void 0 : he.missingItems, (we, Re) => (l(), h("div", {
|
|
4052
|
-
class: "flex justify-center align-middle",
|
|
4053
|
-
key: Re
|
|
4054
|
-
}, [
|
|
4055
|
-
L(Q, {
|
|
4056
|
-
name: "arrow_right",
|
|
4057
|
-
size: "sm"
|
|
4058
|
-
}),
|
|
4059
|
-
ze(" " + x(`(${we.netSuiteId}) ${we.name}: ${we.reason}`), 1)
|
|
4060
|
-
]))), 128))
|
|
4061
|
-
])
|
|
4062
|
-
];
|
|
4063
|
-
}),
|
|
4064
|
-
default: ce(() => [
|
|
4065
|
-
L(Q, {
|
|
4066
|
-
name: "error",
|
|
4067
|
-
color: "#ff2c2c",
|
|
4068
|
-
size: "sm"
|
|
4069
|
-
})
|
|
4070
|
-
]),
|
|
4071
|
-
_: 1
|
|
4072
|
-
})) : I("", !0)
|
|
4073
|
-
])
|
|
4074
|
-
]),
|
|
4075
|
-
L(oe),
|
|
4076
|
-
(l(!0), h(Ce, null, Ee((($e = r.purchaseOrder) == null ? void 0 : $e.items) ?? [], (te, he) => {
|
|
4077
|
-
var we;
|
|
4078
|
-
return l(), h("div", {
|
|
4079
|
-
key: he,
|
|
4080
|
-
class: "flex flex-col"
|
|
4081
|
-
}, [
|
|
4082
|
-
e("div", Aa, [
|
|
4083
|
-
e("div", Ta, [
|
|
4084
|
-
ze(x(te.name) + " ", 1),
|
|
4085
|
-
M(te) ? (l(), me(ue, {
|
|
4086
|
-
key: 0,
|
|
4087
|
-
variant: "rich",
|
|
4088
|
-
placement: "top",
|
|
4089
|
-
"z-index": 51
|
|
4090
|
-
}, {
|
|
4091
|
-
content: ce(() => a[13] || (a[13] = [
|
|
4092
|
-
e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Extra item (added during delivery) ", -1)
|
|
4093
|
-
])),
|
|
4094
|
-
default: ce(() => [
|
|
4095
|
-
L(Q, {
|
|
4096
|
-
name: "add_circle",
|
|
4097
|
-
color: "#6b7280",
|
|
4098
|
-
size: "sm"
|
|
4099
|
-
})
|
|
4100
|
-
]),
|
|
4101
|
-
_: 1
|
|
4102
|
-
})) : I("", !0),
|
|
4103
|
-
ee(te) ? (l(), me(ue, {
|
|
4104
|
-
key: 1,
|
|
4105
|
-
variant: "rich",
|
|
4106
|
-
placement: "top",
|
|
4107
|
-
"z-index": 51
|
|
4108
|
-
}, {
|
|
4109
|
-
content: ce(() => {
|
|
4110
|
-
var Re, Ne;
|
|
4111
|
-
return [
|
|
4112
|
-
e("div", Pa, [
|
|
4113
|
-
a[14] || (a[14] = e("div", { class: "font-semibold" }, "Submission changes", -1)),
|
|
4114
|
-
e("div", null, "Original Amount: " + x((Re = ke(te)) == null ? void 0 : Re.originalAmount), 1),
|
|
4115
|
-
e("div", null, " New Amount: " + x((Ne = ke(te)) == null ? void 0 : Ne.newAmount), 1)
|
|
4116
|
-
])
|
|
4117
|
-
];
|
|
4118
|
-
}),
|
|
4119
|
-
default: ce(() => [
|
|
4120
|
-
L(Q, {
|
|
4121
|
-
name: "error",
|
|
4122
|
-
color: "#ff9500",
|
|
4123
|
-
size: "sm"
|
|
4124
|
-
})
|
|
4125
|
-
]),
|
|
4126
|
-
_: 2
|
|
4127
|
-
}, 1024)) : I("", !0)
|
|
4128
|
-
]),
|
|
4129
|
-
e("div", Ia, [
|
|
4130
|
-
e("span", {
|
|
4131
|
-
innerHTML: O(te)
|
|
4132
|
-
}, null, 8, Fa)
|
|
4133
|
-
])
|
|
4134
|
-
]),
|
|
4135
|
-
e("div", Ea, [
|
|
4136
|
-
e("div", qa, x(te.code), 1),
|
|
4137
|
-
_(p).enableTotalCost ? (l(), h("div", Va, [
|
|
4138
|
-
e("span", La, x(_(ot)(
|
|
4139
|
-
(we = te.totalCost) != null && we.amount ? te.totalCost : _(k).controller.value.getItemCost(te, _(De)()).cost
|
|
4140
|
-
)), 1),
|
|
4141
|
-
$(te) ? I("", !0) : (l(), h("span", Ua, [
|
|
4142
|
-
a[15] || (a[15] = e("span", { class: "w-1.5 h-1.5 rounded-full bg-gray-400" }, null, -1)),
|
|
4143
|
-
ze(" " + x(_(S)("inventory.transfer.form.items.autoCalculated")), 1)
|
|
4144
|
-
]))
|
|
4145
|
-
])) : I("", !0)
|
|
4146
|
-
])
|
|
4147
|
-
]);
|
|
4148
|
-
}), 128)),
|
|
4149
|
-
+_(xe)(_(k).controller.value.getTotalCosts()) ? (l(), h(Ce, { key: 0 }, [
|
|
4150
|
-
e("div", Ma, [
|
|
4151
|
-
L(oe)
|
|
4152
|
-
]),
|
|
4153
|
-
e("div", ja, [
|
|
4154
|
-
a[16] || (a[16] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Total:", -1)),
|
|
4155
|
-
e("div", Ba, x(_(De)()) + " " + x(_(ot)({
|
|
4156
|
-
..._(k).controller.value.getTotalCosts(),
|
|
4157
|
-
currency: _(De)()
|
|
4158
|
-
}).replace(/[^0-9.,]/g, "")), 1)
|
|
4159
|
-
])
|
|
4160
|
-
], 64)) : I("", !0)
|
|
4161
|
-
])
|
|
4162
|
-
])
|
|
4163
|
-
], 64)) : N.value.value === "deliveryHistory" ? (l(), h("div", za, [
|
|
4164
|
-
i.value.length ? (l(), h("div", Qa, [
|
|
4165
|
-
(l(!0), h(Ce, null, Ee(i.value, (te, he) => {
|
|
4166
|
-
var we, Re, Ne, de, se;
|
|
4167
|
-
return l(), h(Ce, { key: he }, [
|
|
4168
|
-
e("div", Ya, [
|
|
4169
|
-
e("div", Ja, [
|
|
4170
|
-
e("div", Xa, [
|
|
4171
|
-
e("div", {
|
|
4172
|
-
class: Ue([
|
|
4173
|
-
{
|
|
4174
|
-
"bg-fm-color-primary": he !== 0,
|
|
4175
|
-
"bg-white": he === 0
|
|
4176
|
-
},
|
|
4177
|
-
"w-[2px] h-full"
|
|
4178
|
-
])
|
|
4179
|
-
}, null, 2)
|
|
4180
|
-
]),
|
|
4181
|
-
e("div", Za, [
|
|
4182
|
-
te.header === "Received" ? (l(), me(Q, {
|
|
4183
|
-
key: 0,
|
|
4184
|
-
name: "local_shipping",
|
|
4185
|
-
outline: "",
|
|
4186
|
-
color: "#ffffff"
|
|
4187
|
-
})) : I("", !0)
|
|
4188
|
-
]),
|
|
4189
|
-
e("div", el, [
|
|
4190
|
-
e("div", {
|
|
4191
|
-
class: Ue([
|
|
4192
|
-
{
|
|
4193
|
-
"bg-fm-color-primary": he < i.value.length - 1,
|
|
4194
|
-
"bg-white": he >= i.value.length - 1
|
|
4195
|
-
},
|
|
4196
|
-
"w-[2px] h-full"
|
|
4197
|
-
])
|
|
4198
|
-
}, null, 2)
|
|
4199
|
-
])
|
|
4200
|
-
]),
|
|
4201
|
-
e("div", tl, [
|
|
4202
|
-
e("div", sl, [
|
|
4203
|
-
e("div", rl, x(te.header), 1),
|
|
4204
|
-
e("div", ol, x(te.date), 1)
|
|
4205
|
-
]),
|
|
4206
|
-
e("div", nl, [
|
|
4207
|
-
te.header === "Received" && te.deliveryOrder && r.purchaseOrder ? (l(), me(Vo, {
|
|
4208
|
-
key: 0,
|
|
4209
|
-
deliveryOrder: te.deliveryOrder,
|
|
4210
|
-
purchaseOrder: r.purchaseOrder,
|
|
4211
|
-
"received-info-map": fe.value,
|
|
4212
|
-
onSubmitted: a[3] || (a[3] = () => {
|
|
4213
|
-
c("update:show", !1), c("submitted");
|
|
4214
|
-
})
|
|
4215
|
-
}, null, 8, ["deliveryOrder", "purchaseOrder", "received-info-map"])) : I("", !0),
|
|
4216
|
-
(Re = (we = te.deliveryOrder) == null ? void 0 : we.netSuite) != null && Re.id ? (l(), me(Ht, {
|
|
4217
|
-
key: 1,
|
|
4218
|
-
title: "Admin",
|
|
4219
|
-
class: "min-w-[140px]"
|
|
4220
|
-
}, {
|
|
4221
|
-
default: ce(() => {
|
|
4222
|
-
var Oe, Te;
|
|
4223
|
-
return [
|
|
4224
|
-
L(En, {
|
|
4225
|
-
"netsuite-id": (Te = (Oe = te.deliveryOrder) == null ? void 0 : Oe.netSuite) == null ? void 0 : Te.id
|
|
4226
|
-
}, null, 8, ["netsuite-id"])
|
|
4227
|
-
];
|
|
4228
|
-
}),
|
|
4229
|
-
_: 2
|
|
4230
|
-
}, 1024)) : I("", !0),
|
|
4231
|
-
r.purchaseOrder && ((Ne = te.deliveryOrder) != null && Ne.id) ? (l(), me(Ms, {
|
|
4232
|
-
key: 2,
|
|
4233
|
-
"purchase-order-id": (de = r.purchaseOrder) == null ? void 0 : de._id,
|
|
4234
|
-
"delivery-order-id": (se = te.deliveryOrder) == null ? void 0 : se.id
|
|
4235
|
-
}, null, 8, ["purchase-order-id", "delivery-order-id"])) : I("", !0)
|
|
4236
|
-
])
|
|
4237
|
-
])
|
|
4238
|
-
]),
|
|
4239
|
-
e("div", al, [
|
|
4240
|
-
e("div", ll, [
|
|
4241
|
-
e("div", il, [
|
|
4242
|
-
e("div", {
|
|
4243
|
-
class: Ue([
|
|
4244
|
-
{
|
|
4245
|
-
"bg-fm-color-primary": he < i.value.length - 1,
|
|
4246
|
-
"bg-white": he >= i.value.length - 1
|
|
4247
|
-
},
|
|
4248
|
-
"w-[2px] h-full"
|
|
4249
|
-
])
|
|
4250
|
-
}, null, 2)
|
|
4251
|
-
])
|
|
4252
|
-
]),
|
|
4253
|
-
e("div", cl, [
|
|
4254
|
-
L(A, {
|
|
4255
|
-
variant: "outlined",
|
|
4256
|
-
class: "py-12 px-16"
|
|
4257
|
-
}, {
|
|
4258
|
-
default: ce(() => [
|
|
4259
|
-
e("div", ul, [
|
|
4260
|
-
(l(!0), h(Ce, null, Ee(te.info, (Oe, Te) => (l(), h("div", {
|
|
4261
|
-
key: Te,
|
|
4262
|
-
class: "flex flex-col gap-4"
|
|
4263
|
-
}, [
|
|
4264
|
-
e("div", dl, x(Oe == null ? void 0 : Oe.label), 1),
|
|
4265
|
-
e("div", ml, [
|
|
4266
|
-
(l(!0), h(Ce, null, Ee(Oe == null ? void 0 : Oe.values, (Ie, rt) => (l(), h("div", {
|
|
4267
|
-
key: rt,
|
|
4268
|
-
class: "fm-typo-en-body-lg-600"
|
|
4269
|
-
}, [
|
|
4270
|
-
typeof Ie == "string" ? (l(), h(Ce, { key: 0 }, [
|
|
4271
|
-
ze(x(Ie), 1)
|
|
4272
|
-
], 64)) : (l(), me(xs(Ie), { key: 1 }))
|
|
4273
|
-
]))), 128))
|
|
4274
|
-
])
|
|
4275
|
-
]))), 128))
|
|
4276
|
-
])
|
|
4277
|
-
]),
|
|
4278
|
-
_: 2
|
|
4279
|
-
}, 1024)
|
|
4280
|
-
])
|
|
4281
|
-
])
|
|
4282
|
-
], 64);
|
|
4283
|
-
}), 128))
|
|
4284
|
-
])) : (l(), h("div", Ka, [
|
|
4285
|
-
L(y),
|
|
4286
|
-
e("div", null, [
|
|
4287
|
-
e("img", {
|
|
4288
|
-
src: _(Vs),
|
|
4289
|
-
alt: "List is empty"
|
|
4290
|
-
}, null, 8, Ha)
|
|
4291
|
-
]),
|
|
4292
|
-
e("div", Ga, x(_(S)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
|
|
4293
|
-
e("div", Wa, x(_(S)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
|
|
4294
|
-
L(y),
|
|
4295
|
-
L(y)
|
|
4296
|
-
]))
|
|
4297
|
-
])) : I("", !0)
|
|
4298
|
-
])
|
|
4299
|
-
];
|
|
4300
|
-
}),
|
|
4301
|
-
"side-sheet-footer": ce(() => [
|
|
4302
|
-
e("div", pl, [
|
|
4303
|
-
(l(!0), h(Ce, null, Ee(P.value, (g) => (l(), h(Ce, null, [
|
|
4304
|
-
_(gt)[g].available != !1 ? (l(), me(w, {
|
|
4305
|
-
key: g,
|
|
4306
|
-
label: _(S)(_(gt)[g].translationKey),
|
|
4307
|
-
onClick: (U) => ye(g),
|
|
4308
|
-
loading: z.value === g,
|
|
4309
|
-
disabled: z.value !== g && J.value,
|
|
4310
|
-
variant: _(gt)[g].buttonVariant
|
|
4311
|
-
}, null, 8, ["label", "onClick", "loading", "disabled", "variant"])) : I("", !0)
|
|
4312
|
-
], 64))), 256)),
|
|
4313
|
-
_(T).ableToMarkReceived(r.purchaseOrder) && !P.value.includes("completeReceive") ? (l(), me(w, {
|
|
4314
|
-
key: 0,
|
|
4315
|
-
label: _(S)("inventory.transfer.receiveRequest.actions.completeReceive"),
|
|
4316
|
-
onClick: a[4] || (a[4] = (g) => ye("completeReceive")),
|
|
4317
|
-
loading: z.value === "completeReceive",
|
|
4318
|
-
disabled: z.value !== "completeReceive" && J.value
|
|
4319
|
-
}, null, 8, ["label", "loading", "disabled"])) : I("", !0),
|
|
4320
|
-
_(T).ableToMarkApproved(r.purchaseOrder) && r.canApprove && !P.value.includes("approveRequest") ? (l(), me(w, {
|
|
4321
|
-
key: 1,
|
|
4322
|
-
label: _(S)("inventory.transfer.approval.actions.approveRequest"),
|
|
4323
|
-
onClick: a[5] || (a[5] = (g) => ye("approveRequest")),
|
|
4324
|
-
loading: z.value === "approveRequest",
|
|
4325
|
-
disabled: z.value !== "approveRequest" && J.value
|
|
4326
|
-
}, null, 8, ["label", "loading", "disabled"])) : I("", !0),
|
|
4327
|
-
_(T).ableToCreateFulfillment(r.purchaseOrder, r.poRequest) && n.scope === "approval" ? (l(), me(w, {
|
|
4328
|
-
key: 2,
|
|
4329
|
-
label: _(S)("inventory.transfer.receiveRequest.actions.processRequest"),
|
|
4330
|
-
onClick: a[6] || (a[6] = (g) => ye("processRequest")),
|
|
4331
|
-
loading: z.value === "processRequest",
|
|
4332
|
-
disabled: z.value !== "processRequest" && J.value
|
|
4333
|
-
}, null, 8, ["label", "loading", "disabled"])) : I("", !0),
|
|
4334
|
-
L(w, {
|
|
4335
|
-
label: _(S)("common.close"),
|
|
4336
|
-
variant: "tertiary",
|
|
4337
|
-
onClick: a[7] || (a[7] = (g) => c("update:show", !1))
|
|
4338
|
-
}, null, 8, ["label"])
|
|
4339
|
-
])
|
|
4340
|
-
]),
|
|
4341
|
-
_: 1
|
|
4342
|
-
}, 8, ["modelValue", "dismiss-away"]);
|
|
4343
|
-
};
|
|
4344
|
-
}
|
|
4345
|
-
});
|
|
4346
|
-
export {
|
|
4347
|
-
xt as P,
|
|
4348
|
-
Hl as _,
|
|
4349
|
-
Kl as a,
|
|
4350
|
-
Bl as b,
|
|
4351
|
-
or as c,
|
|
4352
|
-
ts as d,
|
|
4353
|
-
ct as e,
|
|
4354
|
-
rs as f,
|
|
4355
|
-
es as g,
|
|
4356
|
-
ns as h,
|
|
4357
|
-
os as i,
|
|
4358
|
-
ss as j,
|
|
4359
|
-
zl as u
|
|
4360
|
-
};
|