@feedmepos/mf-inventory-portal 1.8.0-dev.19 → 1.8.0-dev.20
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-BXDscpMf.js → App-5GYyCfFq.js} +9 -9
- package/dist/{ApprovalView-CbP2H_8q.js → ApprovalView-DY1ayl1W.js} +9 -9
- package/dist/{BindingsDialog-C7OFDUAr.js → BindingsDialog-Dm7uKMfV.js} +2 -2
- package/dist/{BindingsPicker-BQjHQWPl.js → BindingsPicker-DhnMlj4x.js} +2 -2
- package/dist/{BindingsTable-grJZdI5F.js → BindingsTable-Cxibcjka.js} +4 -4
- package/dist/{BulkReceiveRequestPage-jZtPq5XF.js → BulkReceiveRequestPage-w4AA6BxB.js} +21 -21
- package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-DOgwkHnO.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-B3ESPbQp.js} +1 -1
- package/dist/{ClosingDraftView-UmNAyX_s.js → ClosingDraftView-DMaONEZ7.js} +19 -19
- package/dist/{ClosingHistoryView-CZcOYK98.js → ClosingHistoryView-BBYruOux.js} +7 -7
- package/dist/{ClosingTemplateView-CP2-ib2S.js → ClosingTemplateView-DcwgokRl.js} +18 -18
- package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DYZjiuAH.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-a72IldDO.js} +1 -1
- package/dist/{DefaultView-DOa4PWSU.js → DefaultView-BVr_7JDn.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-DtFuSUby.js → DeliveryOrderPrintPreview-BXZFD3D5.js} +2 -2
- package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-CxsxIwZm.js → EmailDialog.vue_vue_type_script_setup_true_lang-Dne_9P3j.js} +25 -25
- package/dist/{FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-B3mPB7-O.js → FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-CYkPbFSA.js} +1 -1
- package/dist/FeatureCapabilityGate-DK_rTVyJ.js +82 -0
- package/dist/{FeaturePageGate.vue_vue_type_script_setup_true_lang-O58GGptu.js → FeaturePageGate.vue_vue_type_script_setup_true_lang-DIhV51l7.js} +1 -1
- package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-CCrEBis5.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-B80EHMBT.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-YGOFZ7uY.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C94IFGoH.js} +2 -2
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-F36jHbKZ.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-COZPDuAM.js} +2 -2
- package/dist/{FmMultiselectDialog-BDCQmCSh.js → FmMultiselectDialog-C1P22sj2.js} +2 -2
- package/dist/{FmMultiselectDialog-Dd9oKz5m.js → FmMultiselectDialog-Kb3IftHf.js} +2 -2
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CUmlLKDV.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BqB71yfu.js} +5 -5
- package/dist/ImportView-EJ4u8NHM.js +1540 -0
- package/dist/{IngredientsView-Bcxo5AlS.js → IngredientsView-Bxsgm4E7.js} +15 -15
- package/dist/{IntegrationExplorerView-C2jsPi_3.js → IntegrationExplorerView-owEaOVeG.js} +6 -6
- package/dist/{IntegrationPlatformView-Cr7Fyt4p.js → IntegrationPlatformView-BuptPyjg.js} +2 -2
- package/dist/{IntegrationView-BTcnK-_q.js → IntegrationView-DAcdY_d_.js} +14 -14
- package/dist/{InventoryBindingForm-e1rSW4FA.js → InventoryBindingForm-BvjY4zrn.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-BjDz4LFE.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DhbF-jgN.js} +4 -4
- package/dist/{InventoryBindingSummary-CAGMRuy4.js → InventoryBindingSummary-DPqm94GX.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-eygCK9vN.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DDsigNJ4.js} +2 -2
- package/dist/{ProductionRunDetailPage-CQz-U7Sw.js → ProductionRunDetailPage-BaPCJUqT.js} +4 -4
- package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-BtnKFZy2.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-CNRX3MYt.js} +8 -8
- package/dist/{ProductionRunPage-BZnmoyLo.js → ProductionRunPage-B6Jsv9Hh.js} +4 -4
- package/dist/{PublishView-BJFoRmsD.js → PublishView-DonUv6nP.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-BQExGk_A.js → PurchaseOrderPrintPreview-CK3Cqdwp.js} +2 -2
- package/dist/{ReceiveRequestView-C4XUYhl5.js → ReceiveRequestView-CMAnKxzm.js} +13 -13
- package/dist/RecipeView-Bx13Bckq.js +3272 -0
- package/dist/{SettingsView-BDogzqxV.js → SettingsView-D1MiAkD8.js} +397 -425
- package/dist/StockView-CsxTjVEd.js +3003 -0
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Ce82k1-V.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BT73j9SA.js} +1 -1
- package/dist/{SupplierView-DRSh4m07.js → SupplierView-CFACoZya.js} +13 -13
- package/dist/{SurchargeView-gNIDCY22.js → SurchargeView-CShhZa3x.js} +7 -7
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-DrP1vAZX.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-B2OdmdI_.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Cxpc2Wtp.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-x3N2Oypo.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-D4kpyIAQ.js → TransferDetails.vue_vue_type_script_setup_true_lang-BISmGBJE.js} +517 -517
- package/dist/{TransferTemplateView-adEB_aZg.js → TransferTemplateView-kx2IPqEv.js} +19 -19
- package/dist/{UnitCostHistoryView-ClgafUAg.js → UnitCostHistoryView-DgPWsXaB.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-DpN-7H9P.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-BtfJJgIP.js} +4 -4
- package/dist/{UnitView-DU-Kim1r.js → UnitView-aupXLRMk.js} +7 -7
- package/dist/{WarehouseView-Dw1xkcrx.js → WarehouseView-MTvbY4n4.js} +8 -8
- package/dist/{WastageTemplateView-CQj821yg.js → WastageTemplateView-Bs9HL-LK.js} +15 -15
- package/dist/api/bill.d.ts +4 -2
- package/dist/api/bill.spec.d.ts +1 -0
- package/dist/api/closing.d.ts +1 -0
- package/dist/api/feature-flags.d.ts +2 -0
- package/dist/api/license.d.ts +0 -1
- package/dist/api/stock.d.ts +1 -1
- package/dist/{app--e70sT_h.js → app-D38sV2ls.js} +2286 -2147
- package/dist/app.d.ts +92 -8
- package/dist/app.js +1 -1
- package/dist/bulk-edit-simulation.helper-DgniL8FN.js +178 -0
- package/dist/{closing-template-i0bDCk-x.js → closing-template-D_NAj_mU.js} +1 -1
- package/dist/{date2-CXI-d_rQ.js → date2-CvgxwuM1.js} +1 -1
- package/dist/{dayjs.min-Ivf4HAC3.js → dayjs.min-BOKV8T5Q.js} +1 -1
- package/dist/{decimal-d3XWw4d_.js → decimal-5xyg1WLu.js} +2 -2
- package/dist/{defineDeepModel-DrQmqGvi.js → defineDeepModel-BwB9XcMu.js} +1 -1
- package/dist/{duplicate-template-yVd6JWGz.js → duplicate-template-DvIgjm4K.js} +1 -1
- package/dist/{feature-CBrHj9bO.js → feature-CsPbMoeJ.js} +231 -221
- package/dist/{format-time-from-id-DpFUCBGw.js → format-time-from-id-DD6Ik9EK.js} +1 -1
- package/dist/{format-unit-display-CICNepRU.js → format-unit-display-DG564AN3.js} +12 -12
- package/dist/helper/country.spec.d.ts +1 -0
- package/dist/{id-to-date-BicEvFx1.js → id-to-date-DoN7OM21.js} +1 -1
- package/dist/{import-export.helper-Cy-nm8Ao.js → import-export.helper-CevBRFTZ.js} +6 -5
- package/dist/{index-CiWNQMAX.js → index-BIh1oTQH.js} +3 -3
- package/dist/{index-BfY6L-3r.js → index-BP3Avix6.js} +1 -1
- package/dist/{index-W7Q7cZGV.js → index-mzXhLwrZ.js} +1 -1
- package/dist/{lz-string-ClJ0qg4U.js → lz-string-DMjWYCk6.js} +1 -1
- package/dist/{netsuite-jSt2nlwO.js → netsuite-ZtoZBFBX.js} +2 -2
- package/dist/{netsuite-explorer-BWrO3KfB.js → netsuite-explorer-h_vID_ao.js} +1 -1
- package/dist/{predefined-templates-DKiqLY6F.js → predefined-templates-CdurFRJ4.js} +1 -1
- package/dist/{purchase-order-template-D-NkhbNh.js → purchase-order-template-BVdCftEo.js} +1 -1
- package/dist/{recalculationUtils-Bbe1w-wj.js → recalculationUtils-DBG8HGiJ.js} +1 -1
- package/dist/{row-action.enum-C8JhgYiR.js → row-action.enum-CGyAg4dC.js} +1 -1
- package/dist/{rules-CrAeAKSS.js → rules-DbFiOzUd.js} +3 -3
- package/dist/{stock-x072pQVW.js → stock-BATH4SoA.js} +1 -1
- package/dist/{stock-B27nWQ5z.js → stock-DXxsDPEO.js} +2 -2
- package/dist/stores/feature.d.ts +4 -0
- package/dist/style.css +1 -1
- package/dist/{supplier-sh98cdAW.js → supplier-CKXQmBZn.js} +2 -2
- package/dist/{surcharge-DsF53Jiz.js → surcharge-qupRJjjO.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-DuYrxEZK.js → uom-rules-ALtgjANX.js} +1 -1
- package/dist/{use-ingredient-select-dialog-DZJPaYJX.js → use-ingredient-select-dialog-C1sJpjfV.js} +2 -2
- package/dist/{use-inventory-binding-dialog-CEr-Nctj.js → use-inventory-binding-dialog-tl7-epun.js} +2 -2
- package/dist/{use-template-enabled-locations-h-1Om4op.js → use-template-enabled-locations-DWk2ndDC.js} +2 -2
- package/dist/{use-transfer-locations-CuCYcO6G.js → use-transfer-locations-CsdYY996.js} +2 -2
- package/dist/{useHrmPermission-Db-rrPU-.js → useHrmPermission-BtuqUrwj.js} +1 -1
- package/dist/{useNavigationMenu-DJCT15IW.js → useNavigationMenu-DKxKXykI.js} +4 -4
- package/dist/{useSseClient-B2_SvHJ2.js → useSseClient-CRfpltKK.js} +1 -1
- package/dist/views/import/helper/submit-rows.d.ts +1 -1
- package/dist/views/integration/components/IntegrationCard.vue.d.ts +3 -3
- package/dist/views/production-run/features/detail/ProductionRunItemsTable.vue.d.ts +2 -2
- package/dist/views/recipe/helper/import-recipe.d.ts +30 -0
- package/dist/views/settings/PlanLicenseDisplay.vue.d.ts +1 -14
- package/dist/views/stock/components/StockRecordCard.spec.d.ts +1 -0
- package/dist/views/stock/components/StockRecordCard.vue.d.ts +3 -863
- package/dist/views/stock/components/dialog/BillInventoryInfoDialog.spec.d.ts +1 -0
- package/dist/views/stock/components/dialog/BillInventoryInfoDialog.vue.d.ts +36 -0
- package/dist/views/stock/composables/use-last-closing-summary.d.ts +4 -0
- package/dist/views/stock/composables/use-last-closing-summary.spec.d.ts +1 -0
- package/dist/{vue-Co39mHJn.js → vue-CVco8McV.js} +2 -2
- package/dist/{vue-i18n-C2pkD_vQ.js → vue-i18n-C443zpcA.js} +280 -280
- package/dist/{xlsx.util-CLUjDX2E.js → xlsx.util-5_47Kslf.js} +2 -2
- package/package.json +2 -2
- package/dist/FeatureCapabilityGate-Dp_SfIlO.js +0 -77
- package/dist/ImportView-CbRrxlrW.js +0 -1290
- package/dist/RecipeView-Bd5--ENI.js +0 -3440
- package/dist/StockView-BCWwamwk.js +0 -2756
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { f as lt, p as xs } from "./format-time-from-id-
|
|
1
|
+
import { f as lt, p as xs } from "./format-time-from-id-DD6Ik9EK.js";
|
|
2
2
|
import { defineComponent as Ve, ref as ae, watch as Ye, createElementBlock as h, openBlock as i, createCommentVNode as V, createElementVNode as e, withDirectives as ws, toDisplayString as O, unref as y, vModelText as $s, toRaw as Cs, shallowRef as dt, onUnmounted as ns, triggerRef as As, computed as H, getCurrentScope as Ns, onScopeDispose as Ds, readonly as Rs, h as ie, resolveComponent as ue, createVNode as q, Fragment as De, renderList as Te, reactive as Ps, onMounted as as, createBlock as he, withCtx as me, createTextVNode as Ge, normalizeClass as We, renderSlot as Fs, isRef as Is, resolveDynamicComponent as Ts } from "vue";
|
|
3
3
|
import { c as Gt } from "./component-BmLAdDiY.js";
|
|
4
|
-
import { D as qe, R as Ne } from "./row-action.enum-
|
|
5
|
-
import { s as
|
|
6
|
-
import { h as Pt, a as Us, t as Ms, b as et } from "./date2-
|
|
7
|
-
import { l as Bs, a as Ce, t as Qe, d as ut } from "./rules-
|
|
8
|
-
import { F as Be, u as Je, c as zs,
|
|
9
|
-
import { L as Ks } from "./lz-string-
|
|
10
|
-
import { useI18n as ht, useCoreStore as
|
|
11
|
-
import { useDialog as
|
|
12
|
-
import { u as _t, a as Ft, S as Me } from "./netsuite-
|
|
4
|
+
import { D as qe, R as Ne } from "./row-action.enum-CGyAg4dC.js";
|
|
5
|
+
import { s as Re, q as $e, H as st, d as Es, u as ze, a0 as K, a5 as ls, a6 as yt, $ as Oe, a as Dt, a7 as Wt, a8 as qs, a9 as Vs, G as Ls, t as Rt, c as wt, O as Qt, aa as is, r as at, C as je, B as mt, ab as js } from "./app-D38sV2ls.js";
|
|
6
|
+
import { h as Pt, a as Us, t as Ms, b as et } from "./date2-CvgxwuM1.js";
|
|
7
|
+
import { l as Bs, a as Ce, t as Qe, d as ut } from "./rules-DbFiOzUd.js";
|
|
8
|
+
import { F as Be, u as Je, c as zs, b as Yt, d as St } from "./feature-CsPbMoeJ.js";
|
|
9
|
+
import { L as Ks } from "./lz-string-DMjWYCk6.js";
|
|
10
|
+
import { useI18n as ht, useCoreStore as bt } from "@feedmepos/mf-common";
|
|
11
|
+
import { useDialog as gt, useSnackbar as Xe, components as pt, FmButtonVariant as Ue, useProxiedModel as Hs } from "@feedmepos/ui-library";
|
|
12
|
+
import { u as _t, a as Ft, S as Me } from "./netsuite-ZtoZBFBX.js";
|
|
13
13
|
import { F as tt } from "./FmAdminBadge-DlplQOHb.js";
|
|
14
14
|
import { _ as Jt } from "./empty-placeholder-B0QU467o.js";
|
|
15
|
-
import { a as Gs, b as Ws, f as ft } from "./format-unit-display-
|
|
16
|
-
import { u as Ze, _ as Qs } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-
|
|
17
|
-
import { F as Xt } from "./FeatureCapabilityGate-
|
|
18
|
-
import { _ as Ys, a as Js, b as Xs } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-
|
|
19
|
-
import { e as Zs } from "./index-
|
|
20
|
-
import { i as er } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-
|
|
15
|
+
import { a as Gs, b as Ws, f as ft } from "./format-unit-display-DG564AN3.js";
|
|
16
|
+
import { u as Ze, _ as Qs } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-B2OdmdI_.js";
|
|
17
|
+
import { F as Xt } from "./FeatureCapabilityGate-DK_rTVyJ.js";
|
|
18
|
+
import { _ as Ys, a as Js, b as Xs } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-BqB71yfu.js";
|
|
19
|
+
import { e as Zs } from "./index-BIh1oTQH.js";
|
|
20
|
+
import { i as er } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-B80EHMBT.js";
|
|
21
21
|
import { F as Zt } from "./form-mode.enum-BKiNVH6A.js";
|
|
22
|
-
import { u as us } from "./supplier-
|
|
23
|
-
import { u as tr } from "./surcharge-
|
|
24
|
-
import { f as sr, h as rr, r as or, s as nr } from "./predefined-templates-
|
|
25
|
-
import { F as ar } from "./decimal-
|
|
26
|
-
import { d as cs } from "./defineDeepModel-
|
|
27
|
-
import { u as lr } from "./vue-i18n-
|
|
28
|
-
import { u as ir } from "./useHrmPermission-
|
|
22
|
+
import { u as us } from "./supplier-CKXQmBZn.js";
|
|
23
|
+
import { u as tr } from "./surcharge-qupRJjjO.js";
|
|
24
|
+
import { f as sr, h as rr, r as or, s as nr } from "./predefined-templates-CdurFRJ4.js";
|
|
25
|
+
import { F as ar } from "./decimal-5xyg1WLu.js";
|
|
26
|
+
import { d as cs } from "./defineDeepModel-BwB9XcMu.js";
|
|
27
|
+
import { u as lr } from "./vue-i18n-C443zpcA.js";
|
|
28
|
+
import { u as ir } from "./useHrmPermission-BtuqUrwj.js";
|
|
29
29
|
function ds(u, t) {
|
|
30
30
|
return t.reduce(
|
|
31
31
|
(o, m) => {
|
|
32
32
|
const c = m.received.find((d) => d.sku._id === u._id);
|
|
33
33
|
return c && (o = Bs(o, c.amount)), o;
|
|
34
34
|
},
|
|
35
|
-
ar.toPrecision(
|
|
35
|
+
ar.toPrecision(Re.fromNumber(0), u.unit.precision)
|
|
36
36
|
);
|
|
37
37
|
}
|
|
38
38
|
function ms(u) {
|
|
@@ -58,7 +58,7 @@ function ms(u) {
|
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
function ur(u) {
|
|
61
|
-
var xe, Ae, Q, ye, P, k,
|
|
61
|
+
var xe, Ae, Q, ye, P, k, g;
|
|
62
62
|
const { po: t, currentLocation: r, business: o, fulfilling: m, por: c } = u, d = r.doc.profile || {}, { name: n, address: l, regNo: C, legalName: v } = d, D = {
|
|
63
63
|
name: n || r.name || "",
|
|
64
64
|
legalName: v || void 0,
|
|
@@ -79,12 +79,12 @@ function ur(u) {
|
|
|
79
79
|
city: ((ye = t.supplier.address) == null ? void 0 : ye.city) || "",
|
|
80
80
|
state: ((P = t.supplier.address) == null ? void 0 : P.state) || "",
|
|
81
81
|
country: ((k = t.supplier.address) == null ? void 0 : k.country) || ""
|
|
82
|
-
},
|
|
82
|
+
}, I = ms(t), S = [], B = t.items.filter(($) => $.sku).map(($) => {
|
|
83
83
|
var te;
|
|
84
84
|
const { sku: j, measurement: J } = $, ee = Ce(
|
|
85
85
|
ds($.sku, t.deliveryOrder || []),
|
|
86
86
|
!1
|
|
87
|
-
), L =
|
|
87
|
+
), L = I($);
|
|
88
88
|
return L && S.push(L), {
|
|
89
89
|
code: j.code,
|
|
90
90
|
description: j.name,
|
|
@@ -98,7 +98,7 @@ function ur(u) {
|
|
|
98
98
|
value: L
|
|
99
99
|
})}` : void 0
|
|
100
100
|
};
|
|
101
|
-
}),
|
|
101
|
+
}), T = S.length ? `${S[0].currency} ${Be.toFormatString({
|
|
102
102
|
value: S.reduce(($, j) => Be.add([$, j]), Be.reset())
|
|
103
103
|
})}` : void 0, re = (t.deliveryOrder || []).map(($) => ({
|
|
104
104
|
createdAt: Pt(new Date($.createdAt)),
|
|
@@ -115,11 +115,11 @@ function ur(u) {
|
|
|
115
115
|
})
|
|
116
116
|
}));
|
|
117
117
|
let oe = st.Enum.purchaseOrder, X = "Inventory Receive Note";
|
|
118
|
-
if (t.supplier.internal ? (X = "Inventory Transfer Note", oe = st.Enum.transferOrder) : (X = "Purchase Order", oe = st.Enum.purchaseOrder), (
|
|
118
|
+
if (t.supplier.internal ? (X = "Inventory Transfer Note", oe = st.Enum.transferOrder) : (X = "Purchase Order", oe = st.Enum.purchaseOrder), (g = c == null ? void 0 : c.from) != null && g.dbName) {
|
|
119
119
|
const $ = c.from.dbName;
|
|
120
120
|
r.dbName === $ || (X = "Inventory Receive Note", oe = st.Enum.goodsReceivedNote);
|
|
121
121
|
}
|
|
122
|
-
const
|
|
122
|
+
const be = {
|
|
123
123
|
title: X,
|
|
124
124
|
businessName: o == null ? void 0 : o.name,
|
|
125
125
|
logo: o == null ? void 0 : o.thumbnail,
|
|
@@ -130,17 +130,17 @@ function ur(u) {
|
|
|
130
130
|
buyer: D,
|
|
131
131
|
supplier: R,
|
|
132
132
|
items: B,
|
|
133
|
-
grandTotal:
|
|
133
|
+
grandTotal: T,
|
|
134
134
|
status: t.status,
|
|
135
135
|
deliveryOrders: re
|
|
136
136
|
}, ce = m && (t.deliveryFullfillment || []).length > 0;
|
|
137
|
-
return ce && (oe = st.Enum.deliveryOrder), { printData:
|
|
137
|
+
return ce && (oe = st.Enum.deliveryOrder), { printData: be, templateType: oe, isDeliveryPrint: ce };
|
|
138
138
|
}
|
|
139
139
|
function ps(u) {
|
|
140
140
|
var v;
|
|
141
141
|
const { printData: t, templateType: r } = ur(u), m = sr().getTemplateByType(r), c = !!((v = m == null ? void 0 : m.blocks) != null && v.length), d = rr(r), n = c ? m.blocks : d.blocks, l = c ? m.name : d.name, C = !c;
|
|
142
142
|
try {
|
|
143
|
-
const D = or(n, t), R = D.match(/<style>([\s\S]*?)<\/style>/),
|
|
143
|
+
const D = or(n, t), R = D.match(/<style>([\s\S]*?)<\/style>/), I = R ? `<style>${R[1]}</style>` : "", S = D.replace(/<style>[\s\S]*?<\/style>/, "");
|
|
144
144
|
return {
|
|
145
145
|
html: `<!DOCTYPE html>
|
|
146
146
|
<html>
|
|
@@ -154,7 +154,7 @@ function ps(u) {
|
|
|
154
154
|
}
|
|
155
155
|
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
156
156
|
</style>
|
|
157
|
-
${
|
|
157
|
+
${I}
|
|
158
158
|
</head>
|
|
159
159
|
<body>${S}</body>
|
|
160
160
|
</html>`,
|
|
@@ -382,7 +382,7 @@ const hs = { line1: "", state: "", city: "", postcode: "", country: "" };
|
|
|
382
382
|
function rt(u) {
|
|
383
383
|
return u == null ? "" : String(u);
|
|
384
384
|
}
|
|
385
|
-
function
|
|
385
|
+
function bs(u) {
|
|
386
386
|
const t = u.address, r = t != null ? {
|
|
387
387
|
...t,
|
|
388
388
|
line1: rt(t.line1),
|
|
@@ -398,7 +398,7 @@ function gs(u) {
|
|
|
398
398
|
};
|
|
399
399
|
}
|
|
400
400
|
function ts(u, t, r, o, m) {
|
|
401
|
-
const c = He(u.suppliers ?? []).map(
|
|
401
|
+
const c = He(u.suppliers ?? []).map(bs), d = He(t.allLocations ?? []).map(es), n = t._currentLocation ? es(He(t._currentLocation)) : null, l = r.inventory ? [He(r.inventory)] : [], C = o.state.setting ? He(o.state.setting) : null, v = He(m.surcharges ?? []);
|
|
402
402
|
return {
|
|
403
403
|
suppliers: c,
|
|
404
404
|
locations: d,
|
|
@@ -408,7 +408,7 @@ function ts(u, t, r, o, m) {
|
|
|
408
408
|
surcharges: v
|
|
409
409
|
};
|
|
410
410
|
}
|
|
411
|
-
function
|
|
411
|
+
function gs() {
|
|
412
412
|
const u = us(), t = ze(), r = Dt(), o = _t(), m = tr(), c = ts(
|
|
413
413
|
u,
|
|
414
414
|
t,
|
|
@@ -421,21 +421,21 @@ function bs() {
|
|
|
421
421
|
n.value = d.value.state();
|
|
422
422
|
};
|
|
423
423
|
d.value.addListener(l);
|
|
424
|
-
const C = (R,
|
|
424
|
+
const C = (R, I, S) => {
|
|
425
425
|
switch (R) {
|
|
426
426
|
case Ot.set:
|
|
427
|
-
Wt(n.value,
|
|
427
|
+
Wt(n.value, I, S);
|
|
428
428
|
break;
|
|
429
429
|
case Ot.add:
|
|
430
|
-
Vs(n.value,
|
|
430
|
+
Vs(n.value, I, S);
|
|
431
431
|
break;
|
|
432
432
|
case Ot.delete:
|
|
433
|
-
qs(n.value,
|
|
433
|
+
qs(n.value, I);
|
|
434
434
|
break;
|
|
435
435
|
default:
|
|
436
|
-
console.warn(`Unknown partial update operation: ${R}, falling back to 'set'`), Wt(n.value,
|
|
436
|
+
console.warn(`Unknown partial update operation: ${R}, falling back to 'set'`), Wt(n.value, I, S);
|
|
437
437
|
}
|
|
438
|
-
|
|
438
|
+
I !== "remark" && I !== "ref" && As(n);
|
|
439
439
|
};
|
|
440
440
|
d.value.addPartialListener(C);
|
|
441
441
|
function v() {
|
|
@@ -448,8 +448,8 @@ function bs() {
|
|
|
448
448
|
);
|
|
449
449
|
try {
|
|
450
450
|
d.value.updateFullEnv(R), n.value = d.value.state();
|
|
451
|
-
} catch (
|
|
452
|
-
console.error("[PurchaseOrderFormController] updateFullEnv failed",
|
|
451
|
+
} catch (I) {
|
|
452
|
+
console.error("[PurchaseOrderFormController] updateFullEnv failed", I);
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
455
|
Ye(
|
|
@@ -469,9 +469,9 @@ function bs() {
|
|
|
469
469
|
d.value.removeListener(l), d.value.removePartialListener(C);
|
|
470
470
|
});
|
|
471
471
|
function D(R) {
|
|
472
|
-
var
|
|
472
|
+
var I;
|
|
473
473
|
if (R != null && R._id) {
|
|
474
|
-
const S = /* @__PURE__ */ new Set(["1", "2"]), B = R,
|
|
474
|
+
const S = /* @__PURE__ */ new Set(["1", "2"]), B = R, T = B.supplier, re = T != null ? bs(T) : { _id: "", name: "", registrationNumber: "", address: { ...hs } }, oe = {
|
|
475
475
|
...R,
|
|
476
476
|
version: S.has(R.version) ? R.version : null,
|
|
477
477
|
supplier: re,
|
|
@@ -489,8 +489,8 @@ function bs() {
|
|
|
489
489
|
...X,
|
|
490
490
|
received: (X.received ?? []).filter((le) => {
|
|
491
491
|
if (le == null || le.sku == null || typeof le.sku != "object") return !1;
|
|
492
|
-
const
|
|
493
|
-
return
|
|
492
|
+
const be = le;
|
|
493
|
+
return be.sku.unit != null && be.amount != null && typeof be.amount == "object";
|
|
494
494
|
})
|
|
495
495
|
}))
|
|
496
496
|
};
|
|
@@ -505,7 +505,7 @@ function bs() {
|
|
|
505
505
|
d.value.init();
|
|
506
506
|
return;
|
|
507
507
|
}
|
|
508
|
-
R != null && R.template && ((
|
|
508
|
+
R != null && R.template && ((I = R.templateDoc) != null && I.purchaseOrder) ? (R.items = R.templateDoc.purchaseOrder.items, d.value.initFromTemplate(R)) : d.value.initOutletToOutlet();
|
|
509
509
|
}
|
|
510
510
|
return {
|
|
511
511
|
controller: d,
|
|
@@ -516,36 +516,36 @@ function bs() {
|
|
|
516
516
|
var At = /* @__PURE__ */ ((u) => (u.RECEIVE_REQUEST = "receive/request", u.APPROVAL = "approval", u))(At || {});
|
|
517
517
|
const ot = ae(), kt = ae(), xt = ae();
|
|
518
518
|
function Ci(u, t) {
|
|
519
|
-
const r =
|
|
519
|
+
const r = gt(), o = ze(), m = Je(), c = us(), d = bt(), n = Gs(), l = Ws(), C = ae(!1), v = Xe(), D = Ze(), R = cr(), I = ae(new Array()), S = ae(new Array()), B = ae(
|
|
520
520
|
t != null && t.startDate && (t != null && t.endDate) ? t : er()
|
|
521
|
-
),
|
|
522
|
-
const F = new Date(B.value.startDate),
|
|
521
|
+
), T = H(() => {
|
|
522
|
+
const F = new Date(B.value.startDate), b = new Date(B.value.endDate);
|
|
523
523
|
return {
|
|
524
524
|
start: Ms(F).toISOString(),
|
|
525
|
-
end: Us(
|
|
525
|
+
end: Us(b).toISOString()
|
|
526
526
|
};
|
|
527
527
|
}), re = ae(new Array()), oe = Ls(), X = ae(null);
|
|
528
|
-
let le = null,
|
|
528
|
+
let le = null, be = null;
|
|
529
529
|
Ns() && Ds(() => {
|
|
530
|
-
le == null || le.abort(),
|
|
530
|
+
le == null || le.abort(), be == null || be.abort();
|
|
531
531
|
});
|
|
532
532
|
async function ce(F) {
|
|
533
533
|
var ne, ve, s;
|
|
534
|
-
|
|
535
|
-
const
|
|
536
|
-
|
|
534
|
+
be == null || be.abort();
|
|
535
|
+
const b = new AbortController();
|
|
536
|
+
be = b;
|
|
537
537
|
const _ = (ne = o._currentLocation) == null ? void 0 : ne.dbName, z = await m.awaitLocationFeatures(_, {
|
|
538
|
-
signal:
|
|
538
|
+
signal: b.signal,
|
|
539
539
|
retryOnError: !0
|
|
540
540
|
});
|
|
541
|
-
if (
|
|
541
|
+
if (b.signal.aborted || ((ve = o._currentLocation) == null ? void 0 : ve.dbName) !== _) return;
|
|
542
542
|
if (z !== "ready") {
|
|
543
543
|
z === "error" && ye();
|
|
544
544
|
return;
|
|
545
545
|
}
|
|
546
|
-
function
|
|
546
|
+
function W(a) {
|
|
547
547
|
var A;
|
|
548
|
-
if (
|
|
548
|
+
if (b.signal.aborted || ((A = o._currentLocation) == null ? void 0 : A.dbName) !== _) return;
|
|
549
549
|
const w = {
|
|
550
550
|
mode: Zt.CREATE,
|
|
551
551
|
modelValue: F || void 0,
|
|
@@ -560,7 +560,7 @@ function Ci(u, t) {
|
|
|
560
560
|
}
|
|
561
561
|
let Z;
|
|
562
562
|
if (m.mustUsePoTemplate && !(F != null && F.template)) {
|
|
563
|
-
if (await l.fetchTemplates(),
|
|
563
|
+
if (await l.fetchTemplates(), b.signal.aborted || ((s = o._currentLocation) == null ? void 0 : s.dbName) !== _) return;
|
|
564
564
|
r.open({
|
|
565
565
|
title: "Create transfer",
|
|
566
566
|
message: "",
|
|
@@ -574,15 +574,15 @@ function Ci(u, t) {
|
|
|
574
574
|
close: !0
|
|
575
575
|
}
|
|
576
576
|
}).onPrimary(async () => {
|
|
577
|
-
Z = await n.getTemplateId(), Z &&
|
|
577
|
+
Z = await n.getTemplateId(), Z && W(Z);
|
|
578
578
|
}).onSecondary(() => {
|
|
579
|
-
|
|
579
|
+
W(void 0);
|
|
580
580
|
});
|
|
581
581
|
} else
|
|
582
|
-
|
|
582
|
+
W(Z);
|
|
583
583
|
}
|
|
584
584
|
function xe(F) {
|
|
585
|
-
const
|
|
585
|
+
const b = {
|
|
586
586
|
mode: Zt.UPDATE,
|
|
587
587
|
modelValue: wt(F),
|
|
588
588
|
show: !0,
|
|
@@ -591,26 +591,26 @@ function Ci(u, t) {
|
|
|
591
591
|
},
|
|
592
592
|
lastClosingDate: X.value
|
|
593
593
|
};
|
|
594
|
-
ot.value =
|
|
594
|
+
ot.value = b;
|
|
595
595
|
}
|
|
596
596
|
function Ae(F) {
|
|
597
597
|
if (!d.currentBusiness.value) return;
|
|
598
|
-
const
|
|
599
|
-
if (
|
|
600
|
-
const ne = o.locationRestaurantFromCore(
|
|
601
|
-
ne !== null && (
|
|
598
|
+
const b = o.currentLocation;
|
|
599
|
+
if (b.type === "restaurant") {
|
|
600
|
+
const ne = o.locationRestaurantFromCore(b.doc._id);
|
|
601
|
+
ne !== null && (b.doc = ne);
|
|
602
602
|
}
|
|
603
603
|
const _ = ps({
|
|
604
604
|
po: F,
|
|
605
|
-
currentLocation:
|
|
605
|
+
currentLocation: b,
|
|
606
606
|
business: d.currentBusiness.value,
|
|
607
607
|
fulfilling: u === "approval",
|
|
608
608
|
por: F.request
|
|
609
609
|
});
|
|
610
610
|
if (!_) return;
|
|
611
|
-
const z = nr(_.html),
|
|
612
|
-
recipientName:
|
|
613
|
-
email: (
|
|
611
|
+
const z = nr(_.html), W = c.supplierById[F.supplier._id], Z = {
|
|
612
|
+
recipientName: W.name,
|
|
613
|
+
email: (W == null ? void 0 : W.email) ?? "",
|
|
614
614
|
business: d.currentBusiness.value,
|
|
615
615
|
modelValue: z,
|
|
616
616
|
show: !0,
|
|
@@ -621,34 +621,34 @@ function Ci(u, t) {
|
|
|
621
621
|
kt.value = Z;
|
|
622
622
|
}
|
|
623
623
|
async function Q() {
|
|
624
|
-
var _, z,
|
|
624
|
+
var _, z, W, Z, ne, ve;
|
|
625
625
|
le == null || le.abort();
|
|
626
626
|
const F = new AbortController();
|
|
627
627
|
le = F;
|
|
628
|
-
const
|
|
629
|
-
|
|
628
|
+
const b = (_ = o._currentLocation) == null ? void 0 : _.dbName;
|
|
629
|
+
I.value = [], S.value = [], C.value = !0;
|
|
630
630
|
try {
|
|
631
|
-
const s = await D.getPurchaseOrders(
|
|
632
|
-
if (F.signal.aborted || ((z = o._currentLocation) == null ? void 0 : z.dbName) !==
|
|
633
|
-
|
|
631
|
+
const s = await D.getPurchaseOrders(T.value);
|
|
632
|
+
if (F.signal.aborted || ((z = o._currentLocation) == null ? void 0 : z.dbName) !== b) return;
|
|
633
|
+
I.value = s.sort((de, f) => f._id.localeCompare(de._id));
|
|
634
634
|
const a = s.flatMap((de) => de.shipmentIds || []).filter(Boolean), w = a.length > 0 ? await R.getShipmentsByIds(a) : [];
|
|
635
|
-
if (F.signal.aborted || ((
|
|
635
|
+
if (F.signal.aborted || ((W = o._currentLocation) == null ? void 0 : W.dbName) !== b) return;
|
|
636
636
|
S.value = w;
|
|
637
637
|
const A = await oe.readCurrentLocationLastClosing(!0);
|
|
638
|
-
if (F.signal.aborted || ((Z = o._currentLocation) == null ? void 0 : Z.dbName) !==
|
|
638
|
+
if (F.signal.aborted || ((Z = o._currentLocation) == null ? void 0 : Z.dbName) !== b) return;
|
|
639
639
|
const N = A == null ? void 0 : A._id;
|
|
640
640
|
N && (X.value = xs(N));
|
|
641
|
-
const
|
|
641
|
+
const G = await m.awaitLocationFeatures(b, {
|
|
642
642
|
signal: F.signal,
|
|
643
643
|
retryOnError: !0
|
|
644
644
|
});
|
|
645
|
-
if (
|
|
646
|
-
const fe =
|
|
645
|
+
if (G === "superseded" || (G === "error" && ye(), G === "ready" && m.mustUsePoTemplate && await l.fetchTemplates(), F.signal.aborted || ((ne = o._currentLocation) == null ? void 0 : ne.dbName) !== b)) return;
|
|
646
|
+
const fe = I.value.map((de) => {
|
|
647
647
|
var f;
|
|
648
648
|
return ((f = de.request) == null ? void 0 : f.id) ?? "";
|
|
649
|
-
}).filter((de) => de),
|
|
650
|
-
if (F.signal.aborted || ((ve = o._currentLocation) == null ? void 0 : ve.dbName) !==
|
|
651
|
-
re.value =
|
|
649
|
+
}).filter((de) => de), E = await D.readRequestByIds(fe);
|
|
650
|
+
if (F.signal.aborted || ((ve = o._currentLocation) == null ? void 0 : ve.dbName) !== b) return;
|
|
651
|
+
re.value = E;
|
|
652
652
|
} catch {
|
|
653
653
|
if (F.signal.aborted) return;
|
|
654
654
|
v.open({
|
|
@@ -672,8 +672,8 @@ function Ci(u, t) {
|
|
|
672
672
|
try {
|
|
673
673
|
re.value = await D.readRequests(
|
|
674
674
|
void 0,
|
|
675
|
-
|
|
676
|
-
|
|
675
|
+
T.value.start,
|
|
676
|
+
T.value.end
|
|
677
677
|
).then((F) => F.reverse());
|
|
678
678
|
} catch {
|
|
679
679
|
v.open({
|
|
@@ -693,15 +693,15 @@ function Ci(u, t) {
|
|
|
693
693
|
return P();
|
|
694
694
|
}
|
|
695
695
|
}
|
|
696
|
-
function
|
|
696
|
+
function g(F, b) {
|
|
697
697
|
B.value = {
|
|
698
698
|
startDate: F,
|
|
699
|
-
endDate:
|
|
699
|
+
endDate: b
|
|
700
700
|
}, k();
|
|
701
701
|
}
|
|
702
702
|
o.watchLocation(async (F) => {
|
|
703
703
|
if (!F) {
|
|
704
|
-
|
|
704
|
+
I.value = [];
|
|
705
705
|
return;
|
|
706
706
|
}
|
|
707
707
|
await k();
|
|
@@ -710,22 +710,22 @@ function Ci(u, t) {
|
|
|
710
710
|
return F;
|
|
711
711
|
}
|
|
712
712
|
const j = ae(), J = ae(Math.random().toString());
|
|
713
|
-
async function ee(F,
|
|
713
|
+
async function ee(F, b) {
|
|
714
714
|
const _ = Math.random().toString();
|
|
715
|
-
J.value = _,
|
|
715
|
+
J.value = _, b ?? (b = re.value.computeFirst(
|
|
716
716
|
(ne) => ne.purchaseOrderId === F._id ? ne : null
|
|
717
717
|
) ?? void 0);
|
|
718
|
-
const z = u === "receive/request" ? o.currentLocation :
|
|
719
|
-
poRequest:
|
|
718
|
+
const z = u === "receive/request" ? o.currentLocation : b == null ? void 0 : b.to, W = u === "approval", Z = {
|
|
719
|
+
poRequest: b,
|
|
720
720
|
purchaseOrder: {
|
|
721
721
|
...F,
|
|
722
|
-
status:
|
|
722
|
+
status: W && (b != null && b.rejectedAt) ? Oe.Enum.REJECT : F.status
|
|
723
723
|
},
|
|
724
724
|
transferTo: z == null ? void 0 : z.name,
|
|
725
725
|
transferToDbName: z == null ? void 0 : z.dbName,
|
|
726
726
|
show: !0,
|
|
727
727
|
canResubmit: !1,
|
|
728
|
-
canApprove:
|
|
728
|
+
canApprove: W,
|
|
729
729
|
"onUpdate:show"(ne) {
|
|
730
730
|
j.value && (j.value = { ...j.value, show: ne });
|
|
731
731
|
},
|
|
@@ -735,18 +735,18 @@ function Ci(u, t) {
|
|
|
735
735
|
};
|
|
736
736
|
j.value = Z;
|
|
737
737
|
}
|
|
738
|
-
async function L(F,
|
|
738
|
+
async function L(F, b, _, z, W) {
|
|
739
739
|
const Z = ys();
|
|
740
740
|
C.value = !0;
|
|
741
741
|
try {
|
|
742
742
|
await Z({
|
|
743
743
|
operate: {
|
|
744
|
-
operation:
|
|
744
|
+
operation: b,
|
|
745
745
|
doc: F,
|
|
746
746
|
options: (
|
|
747
747
|
// auto receive for supplier to warehouse
|
|
748
|
-
(
|
|
749
|
-
|
|
748
|
+
(b === K.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
749
|
+
b === K.enum.completeReceive) && m.autoReceiveWarehouse ? {
|
|
750
750
|
autoReceive: !0
|
|
751
751
|
} : void 0
|
|
752
752
|
)
|
|
@@ -754,13 +754,13 @@ function Ci(u, t) {
|
|
|
754
754
|
operateV2: {
|
|
755
755
|
_id: F._id,
|
|
756
756
|
_rev: F._rev ?? "",
|
|
757
|
-
action:
|
|
758
|
-
payloads:
|
|
757
|
+
action: b === K.enum.submitRequest ? K.enum.confirmDraft : b,
|
|
758
|
+
payloads: W ?? []
|
|
759
759
|
},
|
|
760
760
|
transferTo: z
|
|
761
761
|
}), await new Promise((s) => setTimeout(s, 1e3));
|
|
762
762
|
const ve = ze().currentLocationDBName.startsWith("restaurant_");
|
|
763
|
-
|
|
763
|
+
b === K.enum.confirmDraft && F.effectiveAt && ve ? v.open({
|
|
764
764
|
title: "Success",
|
|
765
765
|
message: `${_}. The backdate will be reflected once your POS has received this change.`,
|
|
766
766
|
type: "success"
|
|
@@ -774,23 +774,23 @@ function Ci(u, t) {
|
|
|
774
774
|
title: "Something went wrong",
|
|
775
775
|
message: ne instanceof Error ? ne.message : "Please try again.",
|
|
776
776
|
type: "error"
|
|
777
|
-
}), console.error("Error when submitting PO operation",
|
|
777
|
+
}), console.error("Error when submitting PO operation", b, F, ne);
|
|
778
778
|
} finally {
|
|
779
779
|
C.value = !1, k();
|
|
780
780
|
}
|
|
781
781
|
}
|
|
782
|
-
async function te(F,
|
|
783
|
-
const z = fs[
|
|
782
|
+
async function te(F, b, _) {
|
|
783
|
+
const z = fs[b];
|
|
784
784
|
if (!z) {
|
|
785
785
|
v.open({
|
|
786
786
|
title: "Something went wrong",
|
|
787
|
-
message: `Cannot process order: ${Rt(
|
|
787
|
+
message: `Cannot process order: ${Rt(b)}`,
|
|
788
788
|
type: "error"
|
|
789
789
|
});
|
|
790
790
|
return;
|
|
791
791
|
}
|
|
792
|
-
const { successMessage:
|
|
793
|
-
if (
|
|
792
|
+
const { successMessage: W, ...Z } = z;
|
|
793
|
+
if (b === K.enum.rejectDraft) {
|
|
794
794
|
let s = "";
|
|
795
795
|
r.open({
|
|
796
796
|
title: Z.title,
|
|
@@ -808,12 +808,12 @@ function Ci(u, t) {
|
|
|
808
808
|
payload: {
|
|
809
809
|
rejectReason: s
|
|
810
810
|
}
|
|
811
|
-
}), L(F,
|
|
811
|
+
}), L(F, b, W, _, a);
|
|
812
812
|
});
|
|
813
813
|
return;
|
|
814
814
|
}
|
|
815
|
-
const ne = [], ve =
|
|
816
|
-
ve.init(F), (
|
|
815
|
+
const ne = [], ve = gs();
|
|
816
|
+
ve.init(F), (b === K.enum.confirmDraft || b === K.enum.submitRequest) && ne.push({
|
|
817
817
|
action: "confirmDraft",
|
|
818
818
|
payload: ve.controller.value.toConfirmDraftData($e())
|
|
819
819
|
}), r.open({
|
|
@@ -821,7 +821,7 @@ function Ci(u, t) {
|
|
|
821
821
|
message: Z.message,
|
|
822
822
|
primaryActions: Z.primaryActions
|
|
823
823
|
}).onPrimary(() => {
|
|
824
|
-
L(F,
|
|
824
|
+
L(F, b, W, _, ne);
|
|
825
825
|
});
|
|
826
826
|
}
|
|
827
827
|
async function _e() {
|
|
@@ -838,18 +838,18 @@ function Ci(u, t) {
|
|
|
838
838
|
}).onPrimary(() => {
|
|
839
839
|
const F = {
|
|
840
840
|
show: !0,
|
|
841
|
-
"onUpdate:show"(
|
|
842
|
-
xt.value.show =
|
|
841
|
+
"onUpdate:show"(b) {
|
|
842
|
+
xt.value.show = b;
|
|
843
843
|
}
|
|
844
844
|
};
|
|
845
845
|
xt.value = F;
|
|
846
846
|
});
|
|
847
847
|
}
|
|
848
848
|
return {
|
|
849
|
-
purchaseOrders:
|
|
849
|
+
purchaseOrders: I,
|
|
850
850
|
shipments: S,
|
|
851
851
|
purchaseRequests: re,
|
|
852
|
-
updateDateRange:
|
|
852
|
+
updateDateRange: g,
|
|
853
853
|
fetchData: k,
|
|
854
854
|
loading: C,
|
|
855
855
|
transferDialogProps: ot,
|
|
@@ -887,16 +887,16 @@ function vr(u) {
|
|
|
887
887
|
city: (Q = t.supplier.address) == null ? void 0 : Q.city,
|
|
888
888
|
state: (ye = t.supplier.address) == null ? void 0 : ye.state,
|
|
889
889
|
country: (P = t.supplier.address) == null ? void 0 : P.country
|
|
890
|
-
}, R = ms(t),
|
|
891
|
-
const { sku:
|
|
890
|
+
}, R = ms(t), I = t.items.map((k) => {
|
|
891
|
+
const { sku: g, measurement: $ } = k, j = Ce(
|
|
892
892
|
ds(k.sku, t.deliveryOrder || []),
|
|
893
893
|
!1
|
|
894
894
|
), J = R(k);
|
|
895
895
|
return {
|
|
896
|
-
code:
|
|
897
|
-
description:
|
|
896
|
+
code: g.code,
|
|
897
|
+
description: g.name,
|
|
898
898
|
quantity: Ce(k.quantity, !1),
|
|
899
|
-
unit: ($ == null ? void 0 : $.abbrev) ||
|
|
899
|
+
unit: ($ == null ? void 0 : $.abbrev) || g.unit.abbrev,
|
|
900
900
|
received: j,
|
|
901
901
|
cost: J ? `${J.currency} ${Be.toFormatString({
|
|
902
902
|
value: J
|
|
@@ -906,13 +906,13 @@ function vr(u) {
|
|
|
906
906
|
createdAt: Pt(new Date(k.createdAt)),
|
|
907
907
|
ref: k.deliveryOrderNumber,
|
|
908
908
|
remark: k.remark || "",
|
|
909
|
-
items: k.received.map((
|
|
909
|
+
items: k.received.map((g) => {
|
|
910
910
|
var $;
|
|
911
911
|
return {
|
|
912
|
-
code:
|
|
913
|
-
description:
|
|
914
|
-
quantity: Ce(
|
|
915
|
-
unit: (($ =
|
|
912
|
+
code: g.sku.code,
|
|
913
|
+
description: g.sku.name,
|
|
914
|
+
quantity: Ce(g.amount),
|
|
915
|
+
unit: (($ = g.measurement) == null ? void 0 : $.abbrev) || g.sku.unit.abbrev
|
|
916
916
|
};
|
|
917
917
|
})
|
|
918
918
|
})), B = [
|
|
@@ -921,13 +921,13 @@ function vr(u) {
|
|
|
921
921
|
// Dev
|
|
922
922
|
"6880b36a3054c5001db19218"
|
|
923
923
|
];
|
|
924
|
-
let
|
|
925
|
-
if (t.supplier.internal ? (
|
|
924
|
+
let T = "Inventory Receive Note";
|
|
925
|
+
if (t.supplier.internal ? (T = "Inventory Transfer Note", B.includes((o == null ? void 0 : o._id) || "") && (T = "Stock Request")) : T = "Purchase Order", c) {
|
|
926
926
|
const k = c.from.dbName;
|
|
927
|
-
r.dbName === k || (
|
|
927
|
+
r.dbName === k || (T = "Inventory Receive Note");
|
|
928
928
|
}
|
|
929
929
|
const oe = {
|
|
930
|
-
title:
|
|
930
|
+
title: T,
|
|
931
931
|
businessName: o == null ? void 0 : o.name,
|
|
932
932
|
logo: o == null ? void 0 : o.thumbnail,
|
|
933
933
|
orderNumber: t.seqNumber.toString(),
|
|
@@ -936,13 +936,13 @@ function vr(u) {
|
|
|
936
936
|
remark: t.remark || "",
|
|
937
937
|
buyer: v,
|
|
938
938
|
supplier: D,
|
|
939
|
-
items:
|
|
939
|
+
items: I,
|
|
940
940
|
status: t.status,
|
|
941
941
|
deliveryOrders: S
|
|
942
942
|
}, X = new URL(window.location.href), le = m && (t.deliveryFullfillment || []).length > 0 ? "receive-request/delivery-print-preview" : "receive-request/print-preview";
|
|
943
943
|
X.pathname = X.hostname.includes("portal.feedme") ? `/inventory/${le}` : `/${le}`;
|
|
944
|
-
const
|
|
945
|
-
X.searchParams.append("data",
|
|
944
|
+
const be = Ks.compressToEncodedURIComponent(JSON.stringify(oe));
|
|
945
|
+
X.searchParams.append("data", be), window.open(X.href, "_blank", "noreferrer");
|
|
946
946
|
}
|
|
947
947
|
const Ke = {
|
|
948
948
|
submitRequest: {
|
|
@@ -1041,9 +1041,9 @@ function ss(u) {
|
|
|
1041
1041
|
return u != null && u.id ? `${u.refNo ?? "N/A"} (${u.id})` : "N/A";
|
|
1042
1042
|
}
|
|
1043
1043
|
function Ai(u, t, r, o) {
|
|
1044
|
-
const m = ze(), c = _t(), d =
|
|
1044
|
+
const m = ze(), c = _t(), d = bt(), n = _s(), { t: l } = ht(), C = Xe(), { hasOrderDraftPermission: v } = Ss(), D = Je(), R = H(
|
|
1045
1045
|
() => D.enablePrintTemplate ? [qe[Ne.PrintCustom]] : []
|
|
1046
|
-
),
|
|
1046
|
+
), I = H(
|
|
1047
1047
|
() => D.enablePurchaseOrderEmail ? [qe[Ne.Email]] : []
|
|
1048
1048
|
);
|
|
1049
1049
|
function S(Q) {
|
|
@@ -1067,7 +1067,7 @@ function Ai(u, t, r, o) {
|
|
|
1067
1067
|
qe[Ne.Details],
|
|
1068
1068
|
qe[Ne.Print],
|
|
1069
1069
|
...R.value,
|
|
1070
|
-
...
|
|
1070
|
+
...I.value
|
|
1071
1071
|
];
|
|
1072
1072
|
case "PENDING_APPROVAL": {
|
|
1073
1073
|
const P = [qe[Ne.Details]];
|
|
@@ -1104,11 +1104,11 @@ function Ai(u, t, r, o) {
|
|
|
1104
1104
|
];
|
|
1105
1105
|
}
|
|
1106
1106
|
}
|
|
1107
|
-
function
|
|
1107
|
+
function T(Q) {
|
|
1108
1108
|
return Object.values(K.enum).includes(Q);
|
|
1109
1109
|
}
|
|
1110
1110
|
async function re(Q, ye, P) {
|
|
1111
|
-
var $, j, J, ee, L, te, _e, F,
|
|
1111
|
+
var $, j, J, ee, L, te, _e, F, b;
|
|
1112
1112
|
let k;
|
|
1113
1113
|
try {
|
|
1114
1114
|
k = t.resolvePO ? await t.resolvePO(ye) : ye;
|
|
@@ -1120,22 +1120,22 @@ function Ai(u, t, r, o) {
|
|
|
1120
1120
|
});
|
|
1121
1121
|
return;
|
|
1122
1122
|
}
|
|
1123
|
-
const
|
|
1124
|
-
if (!(o != null && o.onCustomAction && await o.onCustomAction(Q,
|
|
1123
|
+
const g = wt(k);
|
|
1124
|
+
if (!(o != null && o.onCustomAction && await o.onCustomAction(Q, g))) {
|
|
1125
1125
|
if (Q === Ne.Print || Q === Ne.PrintCustom) {
|
|
1126
|
-
let _ =
|
|
1126
|
+
let _ = g;
|
|
1127
1127
|
if (_.items == null && (o != null && o.fetchFullPo)) {
|
|
1128
|
-
const s = await o.fetchFullPo(
|
|
1128
|
+
const s = await o.fetchFullPo(g);
|
|
1129
1129
|
if (s == null) return;
|
|
1130
1130
|
_ = wt(s);
|
|
1131
1131
|
}
|
|
1132
|
-
const z = ($ = o == null ? void 0 : o.resolveLocation) == null ? void 0 : $.call(o,
|
|
1132
|
+
const z = ($ = o == null ? void 0 : o.resolveLocation) == null ? void 0 : $.call(o, g), Z = { ...(P == null ? void 0 : P.toInventoryLocation) ?? z ?? m.currentLocation };
|
|
1133
1133
|
if (Z.type === "restaurant") {
|
|
1134
1134
|
const s = m.locationRestaurantFromCore(Z.doc._id);
|
|
1135
1135
|
s !== null && (Z.doc = s);
|
|
1136
1136
|
}
|
|
1137
1137
|
((j = P == null ? void 0 : P.netSuite) != null && j.refNo || (J = _.netSuite) != null && J.refNo) && (_.ref = [((ee = P == null ? void 0 : P.netSuite) == null ? void 0 : ee.refNo) || ((L = _.netSuite) == null ? void 0 : L.refNo)].filter((s) => s).join(" "));
|
|
1138
|
-
const ne = P ?? ((te = o == null ? void 0 : o.resolvePurchaseRequest) == null ? void 0 : te.call(o,
|
|
1138
|
+
const ne = P ?? ((te = o == null ? void 0 : o.resolvePurchaseRequest) == null ? void 0 : te.call(o, g)), ve = {
|
|
1139
1139
|
po: _,
|
|
1140
1140
|
currentLocation: Z,
|
|
1141
1141
|
business: d.currentBusiness.value,
|
|
@@ -1144,25 +1144,25 @@ function Ai(u, t, r, o) {
|
|
|
1144
1144
|
};
|
|
1145
1145
|
if (Q === Ne.PrintCustom) {
|
|
1146
1146
|
const s = ps(ve);
|
|
1147
|
-
s && (ce.value = s.html, xe.value = s.templateName, Ae.value = s.isDefault,
|
|
1147
|
+
s && (ce.value = s.html, xe.value = s.templateName, Ae.value = s.isDefault, be.value = !0);
|
|
1148
1148
|
} else
|
|
1149
1149
|
vr(ve);
|
|
1150
1150
|
return;
|
|
1151
1151
|
}
|
|
1152
1152
|
if (Q === Ne.Details) {
|
|
1153
|
-
t.promptShowTransferDetails(
|
|
1153
|
+
t.promptShowTransferDetails(g, P);
|
|
1154
1154
|
return;
|
|
1155
1155
|
}
|
|
1156
1156
|
if (Q === Ne.Update) {
|
|
1157
|
-
(_e = t.promptUpdateTransferDialog) == null || _e.call(t,
|
|
1157
|
+
(_e = t.promptUpdateTransferDialog) == null || _e.call(t, g);
|
|
1158
1158
|
return;
|
|
1159
1159
|
}
|
|
1160
1160
|
if (Q === Ne.Email) {
|
|
1161
|
-
(F = t.promptEmailDialog) == null || F.call(t,
|
|
1161
|
+
(F = t.promptEmailDialog) == null || F.call(t, g);
|
|
1162
1162
|
return;
|
|
1163
1163
|
}
|
|
1164
|
-
if (
|
|
1165
|
-
t.submitAction(k, Q, (
|
|
1164
|
+
if (T(Q)) {
|
|
1165
|
+
t.submitAction(k, Q, (b = P == null ? void 0 : P.to) == null ? void 0 : b.dbName);
|
|
1166
1166
|
return;
|
|
1167
1167
|
}
|
|
1168
1168
|
}
|
|
@@ -1200,9 +1200,9 @@ function Ai(u, t, r, o) {
|
|
|
1200
1200
|
},
|
|
1201
1201
|
header: () => l("inventory.transfer.table.noOfItems"),
|
|
1202
1202
|
cell: (P) => {
|
|
1203
|
-
const k = P.row.original.version || "1",
|
|
1203
|
+
const k = P.row.original.version || "1", g = P.getValue();
|
|
1204
1204
|
return ie("div", { class: "flex items-center gap-2" }, [
|
|
1205
|
-
|
|
1205
|
+
g,
|
|
1206
1206
|
k !== "1" ? ie(
|
|
1207
1207
|
"div",
|
|
1208
1208
|
{ class: "py-3" },
|
|
@@ -1246,7 +1246,7 @@ function Ai(u, t, r, o) {
|
|
|
1246
1246
|
accessorKey: "status",
|
|
1247
1247
|
header: () => l("inventory.transfer.table.status"),
|
|
1248
1248
|
cell(P) {
|
|
1249
|
-
const k = P.getValue(),
|
|
1249
|
+
const k = P.getValue(), g = P.row.original, { partial: $, over: j } = g.items == null ? { partial: !!g.partialReceived, over: !!g.overReceived } : $t(vt(g)), J = Ct(k ?? "", $, j);
|
|
1250
1250
|
let ee = l(`inventory.transfer.status.${J}`), L = `${k ?? ""}`.toLocaleLowerCase("en-us");
|
|
1251
1251
|
J === Oe.enum.CLOSE && (ee = `${l(`inventory.transfer.status.${Oe.enum.COMPLETE}`)}`), J === "PARTIAL_RECEIVED" && L === Oe.enum.PROCESSING.toLocaleLowerCase("en-us") && (L = Oe.enum.RECEIVING.toLocaleLowerCase("en-us"));
|
|
1252
1252
|
let te = null;
|
|
@@ -1254,8 +1254,8 @@ function Ai(u, t, r, o) {
|
|
|
1254
1254
|
if (_e != null && _e.milestones && _e.milestones.length > 0) {
|
|
1255
1255
|
const F = _e.milestones[_e.milestones.length - 1];
|
|
1256
1256
|
if (F.estimatedTime) {
|
|
1257
|
-
const
|
|
1258
|
-
te = `${
|
|
1257
|
+
const b = new Date(F.estimatedTime), _ = b.getDate().toString().padStart(2, "0");
|
|
1258
|
+
te = `${b.toLocaleString("en-US", { month: "short" })} ${_}`;
|
|
1259
1259
|
}
|
|
1260
1260
|
}
|
|
1261
1261
|
return ie(
|
|
@@ -1309,11 +1309,11 @@ function Ai(u, t, r, o) {
|
|
|
1309
1309
|
id: "action",
|
|
1310
1310
|
cell(P) {
|
|
1311
1311
|
var $;
|
|
1312
|
-
const k = P.row.original,
|
|
1312
|
+
const k = P.row.original, g = [
|
|
1313
1313
|
...S(k),
|
|
1314
1314
|
...(($ = o == null ? void 0 : o.appendRowActions) == null ? void 0 : $.call(o, k)) ?? []
|
|
1315
1315
|
];
|
|
1316
|
-
return Gt(
|
|
1316
|
+
return Gt(g, (j) => re(j, k));
|
|
1317
1317
|
},
|
|
1318
1318
|
enableSorting: !1,
|
|
1319
1319
|
size: 40,
|
|
@@ -1328,14 +1328,14 @@ function Ai(u, t, r, o) {
|
|
|
1328
1328
|
{
|
|
1329
1329
|
id: "netsuiteTransferOrder",
|
|
1330
1330
|
accessorFn: (k) => {
|
|
1331
|
-
var
|
|
1332
|
-
return (
|
|
1331
|
+
var g;
|
|
1332
|
+
return (g = k.netSuite) != null && g.id ? `${k.netSuite.refNo ?? "N/A"} (${k.netSuite.id})` : "N/A";
|
|
1333
1333
|
},
|
|
1334
1334
|
header: () => "NetSuite Order (ID)",
|
|
1335
1335
|
cell(k) {
|
|
1336
1336
|
var $;
|
|
1337
|
-
const
|
|
1338
|
-
return ($ =
|
|
1337
|
+
const g = k.row.original;
|
|
1338
|
+
return ($ = g.netSuite) != null && $.id ? `${g.netSuite.refNo ?? "N/A"} (${g.netSuite.id})` : "N/A";
|
|
1339
1339
|
},
|
|
1340
1340
|
enableSorting: !1,
|
|
1341
1341
|
size: 200,
|
|
@@ -1347,8 +1347,8 @@ function Ai(u, t, r, o) {
|
|
|
1347
1347
|
{
|
|
1348
1348
|
id: "netsuiteTransactionNumber",
|
|
1349
1349
|
accessorFn: (k) => {
|
|
1350
|
-
var
|
|
1351
|
-
return (($ = (
|
|
1350
|
+
var g, $;
|
|
1351
|
+
return (($ = (g = k.netSuite) == null ? void 0 : g.additionalInfo) == null ? void 0 : $.transactionnumber) ?? "N/A";
|
|
1352
1352
|
},
|
|
1353
1353
|
header: () => "NetSuite Transaction No.",
|
|
1354
1354
|
cell(k) {
|
|
@@ -1366,11 +1366,11 @@ function Ai(u, t, r, o) {
|
|
|
1366
1366
|
id: "netsuiteRefNo",
|
|
1367
1367
|
accessorFn: (k) => {
|
|
1368
1368
|
var $, j;
|
|
1369
|
-
const
|
|
1369
|
+
const g = ($ = k.deliveryOrder) == null ? void 0 : $.filter((J) => {
|
|
1370
1370
|
var ee;
|
|
1371
1371
|
return (ee = J.netSuite) == null ? void 0 : ee.id;
|
|
1372
1372
|
});
|
|
1373
|
-
return
|
|
1373
|
+
return g != null && g.length ? g.map((J) => {
|
|
1374
1374
|
var ee, L;
|
|
1375
1375
|
return `${((ee = J.netSuite) == null ? void 0 : ee.refNo) ?? "N/A"} (${((L = J.netSuite) == null ? void 0 : L.id) ?? "-"})`;
|
|
1376
1376
|
}).join(", ") : (j = k.netSuite) != null && j.id ? `${k.netSuite.refNo ?? "N/A"} (${k.netSuite.id})` : "N/A";
|
|
@@ -1378,14 +1378,14 @@ function Ai(u, t, r, o) {
|
|
|
1378
1378
|
header: () => "Netsuite ref no.",
|
|
1379
1379
|
cell(k) {
|
|
1380
1380
|
var j, J;
|
|
1381
|
-
const
|
|
1381
|
+
const g = k.row.original, $ = (j = g.deliveryOrder) == null ? void 0 : j.filter((ee) => {
|
|
1382
1382
|
var L;
|
|
1383
1383
|
return (L = ee.netSuite) == null ? void 0 : L.id;
|
|
1384
1384
|
});
|
|
1385
1385
|
return $ != null && $.length ? $.map((ee) => {
|
|
1386
1386
|
var L, te;
|
|
1387
1387
|
return `${((L = ee.netSuite) == null ? void 0 : L.refNo) ?? "N/A"} (${((te = ee.netSuite) == null ? void 0 : te.id) ?? "-"})`;
|
|
1388
|
-
}).join(", ") : (J =
|
|
1388
|
+
}).join(", ") : (J = g.netSuite) != null && J.id ? `${g.netSuite.refNo ?? "N/A"} (${g.netSuite.id})` : "N/A";
|
|
1389
1389
|
},
|
|
1390
1390
|
enableSorting: !1,
|
|
1391
1391
|
size: 200,
|
|
@@ -1449,14 +1449,14 @@ function Ai(u, t, r, o) {
|
|
|
1449
1449
|
accessorKey: "purchaseOrder.status",
|
|
1450
1450
|
header: () => l("inventory.transfer.table.status"),
|
|
1451
1451
|
cell(P) {
|
|
1452
|
-
const k = P.row.original,
|
|
1452
|
+
const k = P.row.original, g = P.getValue();
|
|
1453
1453
|
if (!k.purchaseOrder)
|
|
1454
1454
|
return ie(pt.FmChip, {
|
|
1455
1455
|
label: "N/A",
|
|
1456
1456
|
compact: !0
|
|
1457
1457
|
});
|
|
1458
|
-
const $ = vt(k.purchaseOrder), { partial: j, over: J } = $t($), ee = Ct(
|
|
1459
|
-
let L = l(`inventory.transfer.status.${ee}`), te = `${
|
|
1458
|
+
const $ = vt(k.purchaseOrder), { partial: j, over: J } = $t($), ee = Ct(g ?? "", j, J);
|
|
1459
|
+
let L = l(`inventory.transfer.status.${ee}`), te = `${g ?? ""}`.toLocaleLowerCase("en-us");
|
|
1460
1460
|
return ee === Oe.enum.CLOSE && (L = `${l(`inventory.transfer.status.${Oe.enum.COMPLETE}`)}`), ee === "PARTIAL_RECEIVED" && te === Oe.enum.PROCESSING.toLocaleLowerCase("en-us") && (te = Oe.enum.RECEIVING.toLocaleLowerCase("en-us")), k.rejectedAt && (L = l("inventory.transfer.status.REJECT"), te = Oe.enum.REJECT.toLocaleLowerCase("en-us")), ie(
|
|
1461
1461
|
"div",
|
|
1462
1462
|
{
|
|
@@ -1507,14 +1507,14 @@ function Ai(u, t, r, o) {
|
|
|
1507
1507
|
// outlet's own view showed the very same order's ZPS number. Prefer the order,
|
|
1508
1508
|
// and keep the request's block as a fallback so rows that render today still do.
|
|
1509
1509
|
accessorFn: (k) => {
|
|
1510
|
-
var
|
|
1511
|
-
return ss(((
|
|
1510
|
+
var g;
|
|
1511
|
+
return ss(((g = k.purchaseOrder) == null ? void 0 : g.netSuite) ?? k.netSuite);
|
|
1512
1512
|
},
|
|
1513
1513
|
header: () => "NetSuite Order (ID)",
|
|
1514
1514
|
cell(k) {
|
|
1515
1515
|
var $;
|
|
1516
|
-
const
|
|
1517
|
-
return ss((($ =
|
|
1516
|
+
const g = k.row.original;
|
|
1517
|
+
return ss((($ = g.purchaseOrder) == null ? void 0 : $.netSuite) ?? g.netSuite);
|
|
1518
1518
|
},
|
|
1519
1519
|
enableSorting: !1,
|
|
1520
1520
|
size: 200,
|
|
@@ -1526,14 +1526,14 @@ function Ai(u, t, r, o) {
|
|
|
1526
1526
|
{
|
|
1527
1527
|
id: "netsuiteTransactionNumber",
|
|
1528
1528
|
accessorFn: (k) => {
|
|
1529
|
-
var
|
|
1530
|
-
return ((j = ($ = ((
|
|
1529
|
+
var g, $, j;
|
|
1530
|
+
return ((j = ($ = ((g = k.purchaseOrder) == null ? void 0 : g.netSuite) ?? k.netSuite) == null ? void 0 : $.additionalInfo) == null ? void 0 : j.transactionnumber) ?? "N/A";
|
|
1531
1531
|
},
|
|
1532
1532
|
header: () => "NetSuite Transaction No.",
|
|
1533
1533
|
cell(k) {
|
|
1534
1534
|
var $, j, J;
|
|
1535
|
-
const
|
|
1536
|
-
return ((J = (j = (($ =
|
|
1535
|
+
const g = k.row.original;
|
|
1536
|
+
return ((J = (j = (($ = g.purchaseOrder) == null ? void 0 : $.netSuite) ?? g.netSuite) == null ? void 0 : j.additionalInfo) == null ? void 0 : J.transactionnumber) ?? "N/A";
|
|
1537
1537
|
},
|
|
1538
1538
|
enableSorting: !1,
|
|
1539
1539
|
size: 200,
|
|
@@ -1546,11 +1546,11 @@ function Ai(u, t, r, o) {
|
|
|
1546
1546
|
id: "netsuiteRefNo",
|
|
1547
1547
|
accessorFn: (k) => {
|
|
1548
1548
|
var $, j, J;
|
|
1549
|
-
const
|
|
1549
|
+
const g = (j = ($ = k.purchaseOrder) == null ? void 0 : $.deliveryOrder) == null ? void 0 : j.filter((ee) => {
|
|
1550
1550
|
var L;
|
|
1551
1551
|
return (L = ee.netSuite) == null ? void 0 : L.id;
|
|
1552
1552
|
});
|
|
1553
|
-
return
|
|
1553
|
+
return g != null && g.length ? g.map((ee) => {
|
|
1554
1554
|
var L, te;
|
|
1555
1555
|
return `${((L = ee.netSuite) == null ? void 0 : L.refNo) ?? "N/A"} (${((te = ee.netSuite) == null ? void 0 : te.id) ?? "-"})`;
|
|
1556
1556
|
}).join(", ") : (J = k.netSuite) != null && J.id ? `${k.netSuite.refNo ?? "N/A"} (${k.netSuite.id})` : "N/A";
|
|
@@ -1558,14 +1558,14 @@ function Ai(u, t, r, o) {
|
|
|
1558
1558
|
header: () => "Netsuite ref no.",
|
|
1559
1559
|
cell(k) {
|
|
1560
1560
|
var j, J, ee;
|
|
1561
|
-
const
|
|
1561
|
+
const g = k.row.original, $ = (J = (j = g.purchaseOrder) == null ? void 0 : j.deliveryOrder) == null ? void 0 : J.filter((L) => {
|
|
1562
1562
|
var te;
|
|
1563
1563
|
return (te = L.netSuite) == null ? void 0 : te.id;
|
|
1564
1564
|
});
|
|
1565
1565
|
return $ != null && $.length ? $.map((L) => {
|
|
1566
1566
|
var te, _e;
|
|
1567
1567
|
return `${((te = L.netSuite) == null ? void 0 : te.refNo) ?? "N/A"} (${((_e = L.netSuite) == null ? void 0 : _e.id) ?? "-"})`;
|
|
1568
|
-
}).join(", ") : (ee =
|
|
1568
|
+
}).join(", ") : (ee = g.netSuite) != null && ee.id ? `${g.netSuite.refNo ?? "N/A"} (${g.netSuite.id})` : "N/A";
|
|
1569
1569
|
},
|
|
1570
1570
|
enableSorting: !1,
|
|
1571
1571
|
size: 200,
|
|
@@ -1578,11 +1578,11 @@ function Ai(u, t, r, o) {
|
|
|
1578
1578
|
id: "netsuiteRefNo",
|
|
1579
1579
|
accessorFn: (k) => {
|
|
1580
1580
|
var $, j, J;
|
|
1581
|
-
const
|
|
1581
|
+
const g = (j = ($ = k.purchaseOrder) == null ? void 0 : $.deliveryOrder) == null ? void 0 : j.filter((ee) => {
|
|
1582
1582
|
var L;
|
|
1583
1583
|
return (L = ee.netSuite) == null ? void 0 : L.id;
|
|
1584
1584
|
});
|
|
1585
|
-
return
|
|
1585
|
+
return g != null && g.length ? g.map((ee) => {
|
|
1586
1586
|
var L, te;
|
|
1587
1587
|
return `${((L = ee.netSuite) == null ? void 0 : L.refNo) ?? "N/A"} (${((te = ee.netSuite) == null ? void 0 : te.id) ?? "-"})`;
|
|
1588
1588
|
}).join(", ") : (J = k.netSuite) != null && J.id ? `${k.netSuite.refNo} (${k.netSuite.id})` : "N/A";
|
|
@@ -1590,14 +1590,14 @@ function Ai(u, t, r, o) {
|
|
|
1590
1590
|
header: () => "Netsuite ref no.",
|
|
1591
1591
|
cell(k) {
|
|
1592
1592
|
var j, J, ee;
|
|
1593
|
-
const
|
|
1593
|
+
const g = k.row.original, $ = (J = (j = g.purchaseOrder) == null ? void 0 : j.deliveryOrder) == null ? void 0 : J.filter((L) => {
|
|
1594
1594
|
var te;
|
|
1595
1595
|
return (te = L.netSuite) == null ? void 0 : te.id;
|
|
1596
1596
|
});
|
|
1597
1597
|
return $ != null && $.length ? $.map((L) => {
|
|
1598
1598
|
var te, _e;
|
|
1599
1599
|
return `${((te = L.netSuite) == null ? void 0 : te.refNo) ?? "N/A"} (${((_e = L.netSuite) == null ? void 0 : _e.id) ?? "-"})`;
|
|
1600
|
-
}).join(", ") : (ee =
|
|
1600
|
+
}).join(", ") : (ee = g.netSuite) != null && ee.id ? `${g.netSuite.refNo} (${g.netSuite.id})` : "N/A";
|
|
1601
1601
|
},
|
|
1602
1602
|
enableSorting: !1,
|
|
1603
1603
|
size: 200,
|
|
@@ -1611,19 +1611,19 @@ function Ai(u, t, r, o) {
|
|
|
1611
1611
|
}
|
|
1612
1612
|
return Q;
|
|
1613
1613
|
}
|
|
1614
|
-
const le = H(() => u === "receive/request" ? oe() : X()),
|
|
1614
|
+
const le = H(() => u === "receive/request" ? oe() : X()), be = ae(!1), ce = ae(""), xe = ae(""), Ae = ae(!1);
|
|
1615
1615
|
return {
|
|
1616
1616
|
columnDefs: le,
|
|
1617
|
-
showCustomPrintDialog:
|
|
1617
|
+
showCustomPrintDialog: be,
|
|
1618
1618
|
customPrintHtml: ce,
|
|
1619
1619
|
customPrintTemplateName: xe,
|
|
1620
1620
|
customPrintIsDefault: Ae
|
|
1621
1621
|
};
|
|
1622
1622
|
}
|
|
1623
|
-
const yr = { class: "flex flex-col gap-4 border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, hr = { class: "flex items-center justify-between" },
|
|
1623
|
+
const yr = { class: "flex flex-col gap-4 border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, hr = { class: "flex items-center justify-between" }, br = {
|
|
1624
1624
|
key: 0,
|
|
1625
1625
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary"
|
|
1626
|
-
},
|
|
1626
|
+
}, gr = { class: "flex justify-between items-start py-1 gap-4" }, _r = { class: "flex-1 min-w-0 flex flex-col gap-2" }, Sr = { class: "flex flex-col gap-2 items-end w-52 shrink-0" }, Or = {
|
|
1627
1627
|
key: 0,
|
|
1628
1628
|
class: "border-b border-fm-color-stroke-secondary"
|
|
1629
1629
|
}, It = /* @__PURE__ */ Ve({
|
|
@@ -1662,15 +1662,15 @@ const yr = { class: "flex flex-col gap-4 border border-fm-color-neutral-gray-200
|
|
|
1662
1662
|
onClick: m
|
|
1663
1663
|
})
|
|
1664
1664
|
]),
|
|
1665
|
-
r.value.length === 0 ? (i(), h("div",
|
|
1666
|
-
(i(!0), h(De, null, Te(r.value, (
|
|
1667
|
-
key:
|
|
1665
|
+
r.value.length === 0 ? (i(), h("div", br, " No price adjustments ")) : V("", !0),
|
|
1666
|
+
(i(!0), h(De, null, Te(r.value, (I, S) => (i(), h("div", {
|
|
1667
|
+
key: I.id
|
|
1668
1668
|
}, [
|
|
1669
|
-
e("div",
|
|
1669
|
+
e("div", gr, [
|
|
1670
1670
|
e("div", _r, [
|
|
1671
1671
|
q(D, {
|
|
1672
|
-
"model-value":
|
|
1673
|
-
"onUpdate:modelValue": (B) => c(
|
|
1672
|
+
"model-value": I.name,
|
|
1673
|
+
"onUpdate:modelValue": (B) => c(I.id, B),
|
|
1674
1674
|
label: "Name",
|
|
1675
1675
|
placeholder: "e.g. Freight, Discount",
|
|
1676
1676
|
size: "md"
|
|
@@ -1678,8 +1678,8 @@ const yr = { class: "flex flex-col gap-4 border border-fm-color-neutral-gray-200
|
|
|
1678
1678
|
]),
|
|
1679
1679
|
e("div", Sr, [
|
|
1680
1680
|
q(R, {
|
|
1681
|
-
"model-value": o(
|
|
1682
|
-
"onUpdate:modelValue": (B) => d(
|
|
1681
|
+
"model-value": o(I),
|
|
1682
|
+
"onUpdate:modelValue": (B) => d(I.id, B),
|
|
1683
1683
|
label: "Amount (+/-)",
|
|
1684
1684
|
step: 0.01,
|
|
1685
1685
|
placeholder: "0.00",
|
|
@@ -1692,7 +1692,7 @@ const yr = { class: "flex flex-col gap-4 border border-fm-color-neutral-gray-200
|
|
|
1692
1692
|
"prepend-icon": "delete",
|
|
1693
1693
|
size: "md",
|
|
1694
1694
|
class: "mt-6",
|
|
1695
|
-
onClick: (B) => n(
|
|
1695
|
+
onClick: (B) => n(I.id)
|
|
1696
1696
|
}, null, 8, ["onClick"])
|
|
1697
1697
|
]),
|
|
1698
1698
|
S < r.value.length - 1 ? (i(), h("div", Or)) : V("", !0)
|
|
@@ -1762,8 +1762,8 @@ const kr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1762
1762
|
"column-defs": [
|
|
1763
1763
|
{
|
|
1764
1764
|
header: "Code",
|
|
1765
|
-
cell: (
|
|
1766
|
-
const S = r.purchaseOrder.items.find((B) => d(
|
|
1765
|
+
cell: (I) => {
|
|
1766
|
+
const S = r.purchaseOrder.items.find((B) => d(I.row.original.id) ? B.id === I.row.original.id : B.sku._id === I.row.original.sku._id);
|
|
1767
1767
|
return ie(
|
|
1768
1768
|
y(pt).FmTooltip,
|
|
1769
1769
|
{
|
|
@@ -1784,8 +1784,8 @@ const kr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1784
1784
|
},
|
|
1785
1785
|
{
|
|
1786
1786
|
header: "Name",
|
|
1787
|
-
cell: (
|
|
1788
|
-
const S = r.purchaseOrder.items.find((B) => d(
|
|
1787
|
+
cell: (I) => {
|
|
1788
|
+
const S = r.purchaseOrder.items.find((B) => d(I.row.original.id) ? B.id === I.row.original.id : B.sku._id === I.row.original.sku._id);
|
|
1789
1789
|
return ie(
|
|
1790
1790
|
y(pt).FmTooltip,
|
|
1791
1791
|
{
|
|
@@ -1806,8 +1806,8 @@ const kr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1806
1806
|
},
|
|
1807
1807
|
{
|
|
1808
1808
|
header: "Amount",
|
|
1809
|
-
cell: (
|
|
1810
|
-
const S =
|
|
1809
|
+
cell: (I) => {
|
|
1810
|
+
const S = I.row.original, B = r.purchaseOrder.items.find((re) => d(S.id) ? re.id === S.id : re.sku._id === S.sku._id), T = S.amount ?? {
|
|
1811
1811
|
amount: 1,
|
|
1812
1812
|
precision: 0
|
|
1813
1813
|
};
|
|
@@ -1816,7 +1816,7 @@ const kr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1816
1816
|
flex: "1 1 0%"
|
|
1817
1817
|
},
|
|
1818
1818
|
modelValue: {
|
|
1819
|
-
amount:
|
|
1819
|
+
amount: T,
|
|
1820
1820
|
measurement: S.measurement ?? null
|
|
1821
1821
|
},
|
|
1822
1822
|
key: d(S.id) ? S.id : S.sku._id,
|
|
@@ -1962,13 +1962,13 @@ const nt = {
|
|
|
1962
1962
|
scope: {}
|
|
1963
1963
|
},
|
|
1964
1964
|
setup(u) {
|
|
1965
|
-
const t = u, r = _t(), o = Xe(), m =
|
|
1965
|
+
const t = u, r = _t(), o = Xe(), m = gt(), c = ae(!1);
|
|
1966
1966
|
H(() => {
|
|
1967
|
-
var v, D, R,
|
|
1967
|
+
var v, D, R, I;
|
|
1968
1968
|
let n = !0;
|
|
1969
1969
|
r.isEnabled || (n = !1);
|
|
1970
1970
|
const l = t.purchaseOrder, C = t.poRequest;
|
|
1971
|
-
return l && ((v = l == null ? void 0 : l.supplier) != null && v.internal ? (!C && l.status == Oe.enum.DRAFT && (n = !1), C && !((D = C == null ? void 0 : C.netSuite) != null && D.id) && (n = !1), t.isTransferBetweenOutlets && (n = !1)) : ((l == null ? void 0 : l.status) !== Oe.enum.REQUESTING && l.supplier.internal && (n = !1), !C && !((R = l == null ? void 0 : l.netSuite) != null && R.id) && (n = !1), !C && ((
|
|
1971
|
+
return l && ((v = l == null ? void 0 : l.supplier) != null && v.internal ? (!C && l.status == Oe.enum.DRAFT && (n = !1), C && !((D = C == null ? void 0 : C.netSuite) != null && D.id) && (n = !1), t.isTransferBetweenOutlets && (n = !1)) : ((l == null ? void 0 : l.status) !== Oe.enum.REQUESTING && l.supplier.internal && (n = !1), !C && !((R = l == null ? void 0 : l.netSuite) != null && R.id) && (n = !1), !C && ((I = l == null ? void 0 : l.netSuite) != null && I.id) && (l == null ? void 0 : l.status) == Oe.enum.REQUESTING && (n = !1))), n;
|
|
1972
1972
|
});
|
|
1973
1973
|
async function d() {
|
|
1974
1974
|
c.value || m.open({
|
|
@@ -1989,19 +1989,19 @@ const nt = {
|
|
|
1989
1989
|
},
|
|
1990
1990
|
secondaryActions: { text: "Not now", close: !0 }
|
|
1991
1991
|
}).onPrimary(async () => {
|
|
1992
|
-
var n, l, C, v, D, R,
|
|
1992
|
+
var n, l, C, v, D, R, I;
|
|
1993
1993
|
try {
|
|
1994
1994
|
c.value = !0;
|
|
1995
1995
|
const S = ((n = t.purchaseOrder) == null ? void 0 : n._id) || ((l = t.poRequest) == null ? void 0 : l.purchaseOrderId) || "", B = (C = t.poRequest) == null ? void 0 : C.to.dbName;
|
|
1996
1996
|
await r.syncPurchaseOrder({
|
|
1997
1997
|
purchaseOrderId: S,
|
|
1998
1998
|
locationId: t.scope === "approval" ? B : void 0,
|
|
1999
|
-
netsuiteId: ((D = (v = t.purchaseOrder) == null ? void 0 : v.netSuite) == null ? void 0 : D.id) || ((
|
|
1999
|
+
netsuiteId: ((D = (v = t.purchaseOrder) == null ? void 0 : v.netSuite) == null ? void 0 : D.id) || ((I = (R = t.poRequest) == null ? void 0 : R.netSuite) == null ? void 0 : I.id)
|
|
2000
2000
|
}), o.open({
|
|
2001
2001
|
title: "Sync with NetSuite",
|
|
2002
2002
|
message: "Requested to sync with NetSuite. Please wait a moment.",
|
|
2003
2003
|
type: "success"
|
|
2004
|
-
}), await new Promise((
|
|
2004
|
+
}), await new Promise((T) => setTimeout(T, 5e3)), c.value = !1;
|
|
2005
2005
|
} catch (S) {
|
|
2006
2006
|
console.log("Failed to sync with NetSuite", S), o.open({
|
|
2007
2007
|
title: "Error",
|
|
@@ -2063,40 +2063,40 @@ const nt = {
|
|
|
2063
2063
|
});
|
|
2064
2064
|
const c = H(
|
|
2065
2065
|
() => {
|
|
2066
|
-
var l, C, v, D, R,
|
|
2066
|
+
var l, C, v, D, R, I;
|
|
2067
2067
|
return r.getSubsidiaryFullName(
|
|
2068
|
-
((v = (C = (l = t.purchaseOrder) == null ? void 0 : l.netSuite) == null ? void 0 : C.subsidiary) == null ? void 0 : v.id) || ((
|
|
2068
|
+
((v = (C = (l = t.purchaseOrder) == null ? void 0 : l.netSuite) == null ? void 0 : C.subsidiary) == null ? void 0 : v.id) || ((I = (R = (D = t.poRequest) == null ? void 0 : D.netSuite) == null ? void 0 : R.subsidiary) == null ? void 0 : I.id)
|
|
2069
2069
|
).fullName;
|
|
2070
2070
|
}
|
|
2071
2071
|
), d = H(() => {
|
|
2072
|
-
var l, C, v, D, R,
|
|
2073
|
-
return (v = (C = (l = t.purchaseOrder) == null ? void 0 : l.netSuite) == null ? void 0 : C.additionalInfo) != null && v.transactionnumber ? (
|
|
2072
|
+
var l, C, v, D, R, I, S, B, T, re, oe, X;
|
|
2073
|
+
return (v = (C = (l = t.purchaseOrder) == null ? void 0 : l.netSuite) == null ? void 0 : C.additionalInfo) != null && v.transactionnumber ? (I = (R = (D = t.purchaseOrder) == null ? void 0 : D.netSuite) == null ? void 0 : R.additionalInfo) == null ? void 0 : I.transactionnumber : (T = (B = (S = m.value) == null ? void 0 : S.netSuite) == null ? void 0 : B.additionalInfo) != null && T.transactionnumber ? (X = (oe = (re = m.value) == null ? void 0 : re.netSuite) == null ? void 0 : oe.additionalInfo) == null ? void 0 : X.transactionnumber : null;
|
|
2074
2074
|
}), n = H(() => {
|
|
2075
|
-
var l, C, v, D, R,
|
|
2076
|
-
return (C = (l = t.purchaseOrder) == null ? void 0 : l.deliveryFullfillment) != null && C.length && ((D = (v = t.purchaseOrder) == null ? void 0 : v.deliveryFullfillment) == null ? void 0 : D.length) > 0 ? (
|
|
2075
|
+
var l, C, v, D, R, I;
|
|
2076
|
+
return (C = (l = t.purchaseOrder) == null ? void 0 : l.deliveryFullfillment) != null && C.length && ((D = (v = t.purchaseOrder) == null ? void 0 : v.deliveryFullfillment) == null ? void 0 : D.length) > 0 ? (I = (R = t.purchaseOrder) == null ? void 0 : R.deliveryFullfillment) == null ? void 0 : I.map(
|
|
2077
2077
|
(S) => {
|
|
2078
|
-
var B,
|
|
2079
|
-
return `${((B = S.netSuite) == null ? void 0 : B.refNo) ?? "N/A"} (${((
|
|
2078
|
+
var B, T;
|
|
2079
|
+
return `${((B = S.netSuite) == null ? void 0 : B.refNo) ?? "N/A"} (${((T = S.netSuite) == null ? void 0 : T.id) ?? "-"})`;
|
|
2080
2080
|
}
|
|
2081
2081
|
).join(", ") : "N/A";
|
|
2082
2082
|
});
|
|
2083
2083
|
return (l, C) => {
|
|
2084
|
-
var v, D, R,
|
|
2084
|
+
var v, D, R, I, S, B, T, re, oe, X, le, be, ce, xe, Ae, Q;
|
|
2085
2085
|
return y(r).isEnabled ? (i(), h("div", Dr, [
|
|
2086
2086
|
e("div", Rr, [
|
|
2087
2087
|
C[0] || (C[0] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "NetSuite subsidiary", -1)),
|
|
2088
2088
|
e("div", Pr, O(c.value || "N/A"), 1)
|
|
2089
2089
|
]),
|
|
2090
2090
|
!l.isTransferBetweenOutlets && l.scope === y(At).RECEIVE_REQUEST ? (i(), h("div", Fr, [
|
|
2091
|
-
e("div", Ir, " NetSuite " + O((D = (v = l.purchaseOrder) == null ? void 0 : v.netSuite) != null && D.recordType ? y(is)((
|
|
2091
|
+
e("div", Ir, " NetSuite " + O((D = (v = l.purchaseOrder) == null ? void 0 : v.netSuite) != null && D.recordType ? y(is)((I = (R = l.purchaseOrder) == null ? void 0 : R.netSuite) == null ? void 0 : I.recordType) : l.transferType === y(at).enum.purchase ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
|
|
2092
2092
|
e("div", Tr, [
|
|
2093
|
-
(B = (S = l.purchaseOrder) == null ? void 0 : S.netSuite) != null && B.id ? (i(), h("span", Er, O((re = (
|
|
2093
|
+
(B = (S = l.purchaseOrder) == null ? void 0 : S.netSuite) != null && B.id ? (i(), h("span", Er, O((re = (T = l.purchaseOrder) == null ? void 0 : T.netSuite) == null ? void 0 : re.refNo) + " (" + O((X = (oe = l.purchaseOrder) == null ? void 0 : oe.netSuite) == null ? void 0 : X.id) + ") ", 1)) : (i(), h("span", qr, "N/A"))
|
|
2094
2094
|
])
|
|
2095
2095
|
])) : V("", !0),
|
|
2096
2096
|
!l.isTransferBetweenOutlets && m.value || l.scope === y(At).APPROVAL ? (i(), h("div", Vr, [
|
|
2097
2097
|
e("div", Lr, " (Request) NetSuite " + O(l.transferType === y(at).enum.purchase ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
|
|
2098
2098
|
e("div", jr, [
|
|
2099
|
-
(
|
|
2099
|
+
(be = (le = m.value) == null ? void 0 : le.netSuite) != null && be.id ? (i(), h("span", Ur, O((xe = (ce = m.value) == null ? void 0 : ce.netSuite) == null ? void 0 : xe.refNo) + " (" + O((Q = (Ae = m.value) == null ? void 0 : Ae.netSuite) == null ? void 0 : Q.id) + ") ", 1)) : (i(), h("span", Mr, "N/A"))
|
|
2100
2100
|
])
|
|
2101
2101
|
])) : V("", !0),
|
|
2102
2102
|
d.value ? (i(), h("div", Br, [
|
|
@@ -2164,7 +2164,7 @@ const nt = {
|
|
|
2164
2164
|
}, no = { class: "fm-typo-en-body-lg-600 mb-4 flex items-center gap-2" }, ao = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg overflow-y-auto" }, lo = { class: "w-full" }, io = {
|
|
2165
2165
|
class: "p-3 fm-typo-en-body-sm-600",
|
|
2166
2166
|
style: { "min-width": "130px" }
|
|
2167
|
-
}, uo = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, co = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, mo = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, po = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, fo = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, vo = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, yo = { class: "p-3 fm-typo-en-body-sm-600" }, ho = { key: 2 },
|
|
2167
|
+
}, uo = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, co = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, mo = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, po = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, fo = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, vo = { class: "p-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, yo = { class: "p-3 fm-typo-en-body-sm-600" }, ho = { key: 2 }, bo = { key: 1 }, go = /* @__PURE__ */ Ve({
|
|
2168
2168
|
__name: "NetSuiteLatestInfo",
|
|
2169
2169
|
props: {
|
|
2170
2170
|
netsuiteId: {},
|
|
@@ -2202,7 +2202,7 @@ const nt = {
|
|
|
2202
2202
|
n.value = !1;
|
|
2203
2203
|
}
|
|
2204
2204
|
}
|
|
2205
|
-
function
|
|
2205
|
+
function I(B) {
|
|
2206
2206
|
switch (B) {
|
|
2207
2207
|
case Me.Create:
|
|
2208
2208
|
return "text-green-600 bg-green-100";
|
|
@@ -2225,12 +2225,12 @@ const nt = {
|
|
|
2225
2225
|
minute: "2-digit"
|
|
2226
2226
|
});
|
|
2227
2227
|
}
|
|
2228
|
-
return (B,
|
|
2229
|
-
const re = ue("FmButton"), oe = ue("FmLabel"), X = ue("FmCircularProgress"), le = ue("FmIcon"),
|
|
2228
|
+
return (B, T) => {
|
|
2229
|
+
const re = ue("FmButton"), oe = ue("FmLabel"), X = ue("FmCircularProgress"), le = ue("FmIcon"), be = ue("FmDialog");
|
|
2230
2230
|
return i(), h("div", Yr, [
|
|
2231
|
-
q(
|
|
2231
|
+
q(be, {
|
|
2232
2232
|
modelValue: o.value,
|
|
2233
|
-
"onUpdate:modelValue":
|
|
2233
|
+
"onUpdate:modelValue": T[2] || (T[2] = (ce) => o.value = ce),
|
|
2234
2234
|
overlay: !0,
|
|
2235
2235
|
"max-width": 800
|
|
2236
2236
|
}, {
|
|
@@ -2239,20 +2239,20 @@ const nt = {
|
|
|
2239
2239
|
"prepend-icon": "info",
|
|
2240
2240
|
variant: "secondary",
|
|
2241
2241
|
label: "Latest Info",
|
|
2242
|
-
onClick:
|
|
2242
|
+
onClick: T[0] || (T[0] = (ce) => D()),
|
|
2243
2243
|
"text-color": "primary",
|
|
2244
2244
|
"bg-color": "transparent",
|
|
2245
2245
|
"border-color": "primary"
|
|
2246
2246
|
})
|
|
2247
2247
|
]),
|
|
2248
|
-
"dialog-header": me(() =>
|
|
2248
|
+
"dialog-header": me(() => T[3] || (T[3] = [
|
|
2249
2249
|
e("div", null, "NetSuite latest info", -1)
|
|
2250
2250
|
])),
|
|
2251
2251
|
default: me(() => [
|
|
2252
2252
|
c.value ? (i(), h("div", Jr, "Loading...")) : (i(), h("div", Xr, [
|
|
2253
|
-
d.value ? (i(), h("p",
|
|
2253
|
+
d.value ? (i(), h("p", bo, "Something went wrong.")) : (i(), h(De, { key: 0 }, [
|
|
2254
2254
|
e("div", Zr, [
|
|
2255
|
-
|
|
2255
|
+
T[4] || (T[4] = e("h3", { class: "fm-typo-en-body-lg-600 mb-4" }, "NetSuite Order Details", -1)),
|
|
2256
2256
|
(i(!0), h(De, null, Te(C.value, (ce, xe) => (i(), h("div", {
|
|
2257
2257
|
key: xe,
|
|
2258
2258
|
class: "mb-2"
|
|
@@ -2268,7 +2268,7 @@ const nt = {
|
|
|
2268
2268
|
]))), 128))
|
|
2269
2269
|
]),
|
|
2270
2270
|
n.value ? (i(), h("div", ro, [
|
|
2271
|
-
|
|
2271
|
+
T[5] || (T[5] = e("span", null, "Change Log Loading...", -1)),
|
|
2272
2272
|
q(X, { size: "md" })
|
|
2273
2273
|
])) : V("", !0),
|
|
2274
2274
|
!n.value && v.value.length > 0 ? (i(), h("div", oo, [
|
|
@@ -2278,11 +2278,11 @@ const nt = {
|
|
|
2278
2278
|
color: "#ff9500",
|
|
2279
2279
|
size: "sm"
|
|
2280
2280
|
}),
|
|
2281
|
-
|
|
2281
|
+
T[6] || (T[6] = Ge(" Change Logs "))
|
|
2282
2282
|
]),
|
|
2283
2283
|
e("div", ao, [
|
|
2284
2284
|
e("table", lo, [
|
|
2285
|
-
|
|
2285
|
+
T[7] || (T[7] = e("thead", { class: "bg-fm-color-neutral-gray-50" }, [
|
|
2286
2286
|
e("tr", { class: "border-b border-fm-color-neutral-gray-200" }, [
|
|
2287
2287
|
e("th", {
|
|
2288
2288
|
class: "text-left p-3 fm-typo-en-body-md-600",
|
|
@@ -2308,7 +2308,7 @@ const nt = {
|
|
|
2308
2308
|
e("td", co, O(ce._employeename), 1),
|
|
2309
2309
|
e("td", mo, O(ce._contextname), 1),
|
|
2310
2310
|
e("td", {
|
|
2311
|
-
class: We(`p-3 fm-typo-en-body-sm-600 ${
|
|
2311
|
+
class: We(`p-3 fm-typo-en-body-sm-600 ${I(Number(ce.type) - 1)}`)
|
|
2312
2312
|
}, O(y(Me)[Number(ce.type) - 1]), 3),
|
|
2313
2313
|
e("td", po, O(ce.lineid || ""), 1),
|
|
2314
2314
|
e("td", fo, O(ce._fieldname), 1),
|
|
@@ -2318,7 +2318,7 @@ const nt = {
|
|
|
2318
2318
|
])
|
|
2319
2319
|
])
|
|
2320
2320
|
])
|
|
2321
|
-
])) : (i(), h("div", ho,
|
|
2321
|
+
])) : (i(), h("div", ho, T[8] || (T[8] = [
|
|
2322
2322
|
e("p", null, "No change logs available.", -1)
|
|
2323
2323
|
])))
|
|
2324
2324
|
], 64))
|
|
@@ -2330,7 +2330,7 @@ const nt = {
|
|
|
2330
2330
|
label: "Close",
|
|
2331
2331
|
size: "md",
|
|
2332
2332
|
variant: "primary",
|
|
2333
|
-
onClick:
|
|
2333
|
+
onClick: T[1] || (T[1] = (ce) => o.value = !1)
|
|
2334
2334
|
})
|
|
2335
2335
|
]),
|
|
2336
2336
|
_: 1
|
|
@@ -2364,7 +2364,7 @@ const nt = {
|
|
|
2364
2364
|
default: me(() => {
|
|
2365
2365
|
var C, v, D;
|
|
2366
2366
|
return [
|
|
2367
|
-
q(
|
|
2367
|
+
q(go, {
|
|
2368
2368
|
"netsuite-id": (v = (C = m.purchaseOrder) == null ? void 0 : C.netSuite) == null ? void 0 : v.id,
|
|
2369
2369
|
"purchase-order-id": (D = m.purchaseOrder) == null ? void 0 : D._id
|
|
2370
2370
|
}, null, 8, ["netsuite-id", "purchase-order-id"])
|
|
@@ -2499,41 +2499,41 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
2499
2499
|
var F;
|
|
2500
2500
|
const { t: r } = lr(), o = Je(), m = Xe(), c = ae(!1), d = Dt(), n = u, l = (((F = n.purchaseOrder) == null ? void 0 : F.version) ?? je.enum[1]) === je.enum[2], C = t, v = cs("deliveryOrder"), D = Ze(), {
|
|
2501
2501
|
controller: R,
|
|
2502
|
-
state:
|
|
2502
|
+
state: I,
|
|
2503
2503
|
reset: S
|
|
2504
2504
|
} = Tt({
|
|
2505
2505
|
currency: $e(),
|
|
2506
2506
|
adjustments: n.deliveryOrder.priceAdjustments
|
|
2507
2507
|
}), B = H(
|
|
2508
2508
|
() => {
|
|
2509
|
-
var
|
|
2510
|
-
return ((
|
|
2509
|
+
var b;
|
|
2510
|
+
return ((b = n.purchaseOrder.deliveryFullfillment) == null ? void 0 : b.findIndex(
|
|
2511
2511
|
(_) => n.deliveryOrder.fullfillmentId && _.id === n.deliveryOrder.fullfillmentId
|
|
2512
2512
|
)) ?? -1;
|
|
2513
2513
|
}
|
|
2514
|
-
),
|
|
2514
|
+
), T = o.enablePurchaseOrderReceiveWithCustomCost, re = o.enablePortalDeliveryOrderWrite, oe = ae({}), X = H(
|
|
2515
2515
|
() => (n.purchaseOrder.itemsAtSubmission ?? n.purchaseOrder.items).length
|
|
2516
|
-
), le = H(() => Os(n.purchaseOrder)),
|
|
2516
|
+
), le = H(() => Os(n.purchaseOrder)), be = H(
|
|
2517
2517
|
() => ks(n.purchaseOrder, le.value)
|
|
2518
2518
|
), ce = H(
|
|
2519
2519
|
() => n.purchaseOrder.items.map(
|
|
2520
|
-
(
|
|
2520
|
+
(b, _) => H({
|
|
2521
2521
|
get: () => {
|
|
2522
|
-
var
|
|
2523
|
-
const z = (
|
|
2522
|
+
var W;
|
|
2523
|
+
const z = (W = v.received[_]) == null ? void 0 : W.amount;
|
|
2524
2524
|
return z ? +Ce(z) : 0;
|
|
2525
2525
|
},
|
|
2526
2526
|
set: (z) => {
|
|
2527
|
-
v.received[_].amount = Qe(z,
|
|
2527
|
+
v.received[_].amount = Qe(z, b.sku.unit.precision);
|
|
2528
2528
|
}
|
|
2529
2529
|
})
|
|
2530
2530
|
)
|
|
2531
2531
|
), xe = H(
|
|
2532
2532
|
() => n.purchaseOrder.items.map(
|
|
2533
|
-
(
|
|
2533
|
+
(b, _) => H({
|
|
2534
2534
|
get: () => {
|
|
2535
|
-
var
|
|
2536
|
-
const z = (
|
|
2535
|
+
var W;
|
|
2536
|
+
const z = (W = v.received[_]) == null ? void 0 : W.cost;
|
|
2537
2537
|
return z ? +Ce(z) : 0;
|
|
2538
2538
|
},
|
|
2539
2539
|
set: (z) => {
|
|
@@ -2545,120 +2545,120 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
2545
2545
|
})
|
|
2546
2546
|
)
|
|
2547
2547
|
);
|
|
2548
|
-
function Ae(
|
|
2548
|
+
function Ae(b) {
|
|
2549
2549
|
var z;
|
|
2550
|
-
const _ = !oe.value[
|
|
2551
|
-
if (oe.value[
|
|
2552
|
-
const
|
|
2553
|
-
v.received[
|
|
2550
|
+
const _ = !oe.value[b];
|
|
2551
|
+
if (oe.value[b] = _, _) {
|
|
2552
|
+
const W = (z = v.received[b]) == null ? void 0 : z.cost;
|
|
2553
|
+
v.received[b].cost = W ? { ...W, precision: 4 } : { currency: $e(), amount: 0, precision: 4 };
|
|
2554
2554
|
} else
|
|
2555
|
-
delete v.received[
|
|
2555
|
+
delete v.received[b].cost;
|
|
2556
2556
|
}
|
|
2557
2557
|
const Q = ae([]), ye = H(
|
|
2558
|
-
() => d.skus.filter((
|
|
2558
|
+
() => d.skus.filter((b) => !b.isInactive).map((b) => ({ label: `${b.name} (${b.code})`, value: b._id }))
|
|
2559
2559
|
);
|
|
2560
2560
|
function P() {
|
|
2561
2561
|
Q.value.push({ skuId: null, costEnabled: !1 }), v.received.push({
|
|
2562
2562
|
sku: null,
|
|
2563
|
-
amount:
|
|
2563
|
+
amount: Re.fromNumber(0),
|
|
2564
2564
|
measurement: null
|
|
2565
2565
|
});
|
|
2566
2566
|
}
|
|
2567
|
-
function k(
|
|
2568
|
-
Q.value.splice(
|
|
2567
|
+
function k(b) {
|
|
2568
|
+
Q.value.splice(b, 1), v.received.splice(X.value + b, 1);
|
|
2569
2569
|
}
|
|
2570
|
-
function b
|
|
2571
|
-
Q.value[
|
|
2570
|
+
function g(b, _) {
|
|
2571
|
+
Q.value[b].skuId = _;
|
|
2572
2572
|
const z = _ ? d.skuById[_] : null;
|
|
2573
|
-
v.received[X.value +
|
|
2573
|
+
v.received[X.value + b].sku = z;
|
|
2574
2574
|
}
|
|
2575
|
-
function $(
|
|
2575
|
+
function $(b, _) {
|
|
2576
2576
|
var ne, ve;
|
|
2577
|
-
const z = (ne = n.receivedInfoMap) == null ? void 0 : ne[_.sku._id],
|
|
2578
|
-
return (((ve = ce.value[
|
|
2577
|
+
const z = (ne = n.receivedInfoMap) == null ? void 0 : ne[_.sku._id], W = z ? `${r("inventory.transfer.receiveRequest.details.received")} ${Re.toFormatString({ value: z.received })} / ${ft(_.quantity, _.sku.unit, _.measurement)}` : void 0;
|
|
2578
|
+
return (((ve = ce.value[b]) == null ? void 0 : ve.value) ?? 0) > 0 ? W : W ? `${W} · ${ct}` : ct;
|
|
2579
2579
|
}
|
|
2580
|
-
function j(
|
|
2580
|
+
function j(b, _) {
|
|
2581
2581
|
var ne;
|
|
2582
|
-
const
|
|
2582
|
+
const W = (((ne = J.value[_]) == null ? void 0 : ne.value) ?? 0) <= 0;
|
|
2583
2583
|
let Z;
|
|
2584
|
-
if (
|
|
2585
|
-
const ve =
|
|
2584
|
+
if (b.skuId && be.value[b.skuId]) {
|
|
2585
|
+
const ve = be.value[b.skuId], s = Re.toFormatString({ value: ve.received });
|
|
2586
2586
|
Z = `${r("inventory.transfer.receiveRequest.details.received")} ${s}`;
|
|
2587
2587
|
}
|
|
2588
|
-
return
|
|
2588
|
+
return W ? Z ? `${Z} · ${ct}` : ct : Z;
|
|
2589
2589
|
}
|
|
2590
2590
|
const J = H(
|
|
2591
|
-
() => Q.value.map((
|
|
2591
|
+
() => Q.value.map((b, _) => {
|
|
2592
2592
|
const z = X.value + _;
|
|
2593
2593
|
return H({
|
|
2594
2594
|
get: () => {
|
|
2595
2595
|
var Z;
|
|
2596
|
-
const
|
|
2597
|
-
return
|
|
2596
|
+
const W = (Z = v.received[z]) == null ? void 0 : Z.amount;
|
|
2597
|
+
return W ? +Ce(W) : 0;
|
|
2598
2598
|
},
|
|
2599
|
-
set: (
|
|
2599
|
+
set: (W) => {
|
|
2600
2600
|
var ne, ve, s;
|
|
2601
|
-
const Z = ((ne =
|
|
2602
|
-
v.received[z].amount = Qe(
|
|
2601
|
+
const Z = ((ne = b.historyItem) == null ? void 0 : ne.sku.unit.precision) ?? (b.skuId ? (s = (ve = d.skuById[b.skuId]) == null ? void 0 : ve.unit) == null ? void 0 : s.precision : void 0) ?? 2;
|
|
2602
|
+
v.received[z].amount = Qe(W, Z);
|
|
2603
2603
|
}
|
|
2604
2604
|
});
|
|
2605
2605
|
})
|
|
2606
2606
|
), ee = H(
|
|
2607
|
-
() => Q.value.map((
|
|
2607
|
+
() => Q.value.map((b, _) => {
|
|
2608
2608
|
const z = X.value + _;
|
|
2609
2609
|
return H({
|
|
2610
2610
|
get: () => {
|
|
2611
2611
|
var Z;
|
|
2612
|
-
const
|
|
2613
|
-
return
|
|
2612
|
+
const W = (Z = v.received[z]) == null ? void 0 : Z.cost;
|
|
2613
|
+
return W ? +Ce(W) : 0;
|
|
2614
2614
|
},
|
|
2615
|
-
set: (
|
|
2615
|
+
set: (W) => {
|
|
2616
2616
|
v.received[z].cost = {
|
|
2617
2617
|
currency: $e(),
|
|
2618
|
-
...Qe(
|
|
2618
|
+
...Qe(W, 4)
|
|
2619
2619
|
};
|
|
2620
2620
|
}
|
|
2621
2621
|
});
|
|
2622
2622
|
})
|
|
2623
2623
|
);
|
|
2624
|
-
function L(
|
|
2625
|
-
const _ = Q.value[
|
|
2624
|
+
function L(b) {
|
|
2625
|
+
const _ = Q.value[b], z = X.value + b;
|
|
2626
2626
|
_.costEnabled = !_.costEnabled, _.costEnabled ? v.received[z].cost = { currency: $e(), amount: 0, precision: 4 } : delete v.received[z].cost;
|
|
2627
2627
|
}
|
|
2628
2628
|
Ye(
|
|
2629
2629
|
() => c.value,
|
|
2630
|
-
(
|
|
2630
|
+
(b) => {
|
|
2631
2631
|
var s, a, w;
|
|
2632
|
-
if (!
|
|
2632
|
+
if (!b) {
|
|
2633
2633
|
Q.value = [], oe.value = {};
|
|
2634
2634
|
return;
|
|
2635
2635
|
}
|
|
2636
2636
|
S(n.deliveryOrder.priceAdjustments);
|
|
2637
|
-
const _ = n.purchaseOrder.itemsAtSubmission ?? n.purchaseOrder.items, z = new Set(_.map((A) => A.sku._id)),
|
|
2637
|
+
const _ = n.purchaseOrder.itemsAtSubmission ?? n.purchaseOrder.items, z = new Set(_.map((A) => A.sku._id)), W = {}, Z = [];
|
|
2638
2638
|
for (const A of n.deliveryOrder.received ?? []) {
|
|
2639
2639
|
const N = (s = A.sku) == null ? void 0 : s._id;
|
|
2640
|
-
N && (z.has(N) ?
|
|
2640
|
+
N && (z.has(N) ? W[N] = A : Z.push(A));
|
|
2641
2641
|
}
|
|
2642
2642
|
v.received = _.map((A) => {
|
|
2643
|
-
const N =
|
|
2643
|
+
const N = W[A.sku._id];
|
|
2644
2644
|
return N ? { ...N } : {
|
|
2645
2645
|
// Propagate the stable id so V2 submissions match this existing PO line
|
|
2646
2646
|
// instead of the backend treating it as a new extra item (see CreateForm.vue).
|
|
2647
2647
|
...l && A.id ? { id: A.id } : {},
|
|
2648
2648
|
sku: A.sku,
|
|
2649
|
-
amount:
|
|
2649
|
+
amount: Re.fromNumber(0),
|
|
2650
2650
|
measurement: A.measurement ?? null
|
|
2651
2651
|
};
|
|
2652
2652
|
});
|
|
2653
2653
|
const ne = {};
|
|
2654
2654
|
for (let A = 0; A < _.length; A++)
|
|
2655
|
-
(a =
|
|
2655
|
+
(a = W[_[A].sku._id]) != null && a.cost && (ne[A] = !0);
|
|
2656
2656
|
oe.value = ne, Q.value = [];
|
|
2657
2657
|
const ve = le.value;
|
|
2658
2658
|
for (const A of Z) {
|
|
2659
|
-
const N = ve.find((
|
|
2659
|
+
const N = ve.find((G) => {
|
|
2660
2660
|
var fe;
|
|
2661
|
-
return
|
|
2661
|
+
return G.sku._id === ((fe = A.sku) == null ? void 0 : fe._id);
|
|
2662
2662
|
});
|
|
2663
2663
|
Q.value.push({
|
|
2664
2664
|
skuId: ((w = A.sku) == null ? void 0 : w._id) ?? null,
|
|
@@ -2670,8 +2670,8 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
2670
2670
|
}
|
|
2671
2671
|
if (ve.length) {
|
|
2672
2672
|
const A = new Set(Z.map((N) => {
|
|
2673
|
-
var
|
|
2674
|
-
return (
|
|
2673
|
+
var G;
|
|
2674
|
+
return (G = N.sku) == null ? void 0 : G._id;
|
|
2675
2675
|
}));
|
|
2676
2676
|
for (const N of ve)
|
|
2677
2677
|
A.has(N.sku._id) || (Q.value.push({
|
|
@@ -2682,7 +2682,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
2682
2682
|
}), v.received.push({
|
|
2683
2683
|
...l && N.id ? { id: N.id } : {},
|
|
2684
2684
|
sku: N.sku,
|
|
2685
|
-
amount:
|
|
2685
|
+
amount: Re.fromNumber(0),
|
|
2686
2686
|
measurement: N.measurement ?? null
|
|
2687
2687
|
}));
|
|
2688
2688
|
}
|
|
@@ -2711,8 +2711,8 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
2711
2711
|
te.value = !1;
|
|
2712
2712
|
});
|
|
2713
2713
|
}
|
|
2714
|
-
return (
|
|
2715
|
-
const z = ue("FmButton"),
|
|
2714
|
+
return (b, _) => {
|
|
2715
|
+
const z = ue("FmButton"), W = ue("FmStepperField"), Z = ue("FmSwitch"), ne = ue("FmSelect"), ve = ue("FmTextField"), s = ue("FmDialog");
|
|
2716
2716
|
return i(), he(s, {
|
|
2717
2717
|
modelValue: c.value,
|
|
2718
2718
|
"onUpdate:modelValue": _[1] || (_[1] = (a) => c.value = a),
|
|
@@ -2759,14 +2759,14 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
2759
2759
|
e("span", Io, O(a.sku.code), 1)
|
|
2760
2760
|
]),
|
|
2761
2761
|
e("div", To, [
|
|
2762
|
-
q(
|
|
2762
|
+
q(W, {
|
|
2763
2763
|
label: "Receive Quantity",
|
|
2764
2764
|
modelValue: ce.value[w].value,
|
|
2765
2765
|
"onUpdate:modelValue": (N) => ce.value[w].value = N,
|
|
2766
2766
|
"append-text": ((A = a.measurement) == null ? void 0 : A.abbrev) ?? a.sku.unit.abbrev,
|
|
2767
2767
|
"helper-text": $(w, a)
|
|
2768
2768
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text", "helper-text"]),
|
|
2769
|
-
y(
|
|
2769
|
+
y(T) ? (i(), h("div", Eo, [
|
|
2770
2770
|
q(Z, {
|
|
2771
2771
|
"model-value": oe.value[w],
|
|
2772
2772
|
"onUpdate:modelValue": (N) => Ae(w),
|
|
@@ -2774,7 +2774,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
2774
2774
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
2775
2775
|
_[3] || (_[3] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
|
|
2776
2776
|
])) : V("", !0),
|
|
2777
|
-
y(
|
|
2777
|
+
y(T) && oe.value[w] ? (i(), he(W, {
|
|
2778
2778
|
key: 1,
|
|
2779
2779
|
modelValue: xe.value[w].value,
|
|
2780
2780
|
"onUpdate:modelValue": (N) => xe.value[w].value = N,
|
|
@@ -2810,7 +2810,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
2810
2810
|
e("div", Mo, [
|
|
2811
2811
|
q(ne, {
|
|
2812
2812
|
"model-value": a.skuId,
|
|
2813
|
-
"onUpdate:modelValue": (
|
|
2813
|
+
"onUpdate:modelValue": (G) => g(w, G),
|
|
2814
2814
|
label: "Ingredient",
|
|
2815
2815
|
items: ye.value,
|
|
2816
2816
|
searchable: "",
|
|
@@ -2820,26 +2820,26 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
2820
2820
|
}, null, 8, ["model-value", "onUpdate:modelValue", "items", "disabled"])
|
|
2821
2821
|
]),
|
|
2822
2822
|
e("div", Bo, [
|
|
2823
|
-
q(
|
|
2823
|
+
q(W, {
|
|
2824
2824
|
label: "Receive Quantity",
|
|
2825
2825
|
modelValue: J.value[w].value,
|
|
2826
|
-
"onUpdate:modelValue": (
|
|
2826
|
+
"onUpdate:modelValue": (G) => J.value[w].value = G,
|
|
2827
2827
|
"append-text": a.skuId ? ((N = (A = y(d).skuById[a.skuId]) == null ? void 0 : A.unit) == null ? void 0 : N.abbrev) ?? "" : "",
|
|
2828
2828
|
"helper-text": j(a, w),
|
|
2829
2829
|
disabled: a.quantityLocked || !a.skuId
|
|
2830
2830
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text", "helper-text", "disabled"]),
|
|
2831
|
-
y(
|
|
2831
|
+
y(T) ? (i(), h("div", zo, [
|
|
2832
2832
|
q(Z, {
|
|
2833
2833
|
"model-value": a.costEnabled,
|
|
2834
|
-
"onUpdate:modelValue": (
|
|
2834
|
+
"onUpdate:modelValue": (G) => L(w),
|
|
2835
2835
|
size: "sm"
|
|
2836
2836
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
2837
2837
|
_[6] || (_[6] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
|
|
2838
2838
|
])) : V("", !0),
|
|
2839
|
-
y(
|
|
2839
|
+
y(T) && a.costEnabled ? (i(), he(W, {
|
|
2840
2840
|
key: 1,
|
|
2841
2841
|
modelValue: ee.value[w].value,
|
|
2842
|
-
"onUpdate:modelValue": (
|
|
2842
|
+
"onUpdate:modelValue": (G) => ee.value[w].value = G,
|
|
2843
2843
|
label: "Total Cost",
|
|
2844
2844
|
step: 1e-4,
|
|
2845
2845
|
min: 0,
|
|
@@ -2854,7 +2854,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
2854
2854
|
"prepend-icon": "delete",
|
|
2855
2855
|
size: "md",
|
|
2856
2856
|
class: "mt-6",
|
|
2857
|
-
onClick: (
|
|
2857
|
+
onClick: (G) => k(w)
|
|
2858
2858
|
}, null, 8, ["onClick"]))
|
|
2859
2859
|
]),
|
|
2860
2860
|
w < Q.value.length - 1 ? (i(), h("div", Ko)) : V("", !0)
|
|
@@ -2879,7 +2879,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
2879
2879
|
y(o).enablePurchaseOrderPriceAdjustment ? (i(), he(It, {
|
|
2880
2880
|
key: 0,
|
|
2881
2881
|
controller: y(R),
|
|
2882
|
-
state: y(
|
|
2882
|
+
state: y(I)
|
|
2883
2883
|
}, null, 8, ["controller", "state"])) : V("", !0),
|
|
2884
2884
|
B.value >= 0 ? (i(), h("div", Yo, [
|
|
2885
2885
|
_[9] || (_[9] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Fulfilment's sequence", -1)),
|
|
@@ -2900,10 +2900,10 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
2900
2900
|
}, an = { class: "flex gap-4" }, ln = { class: "flex-1" }, un = { class: "flex-1" }, cn = {
|
|
2901
2901
|
key: 0,
|
|
2902
2902
|
class: "flex items-center text-fm-color-system-error-300"
|
|
2903
|
-
}, dn = { class: "fm-typo-en-body-md-400" }, mn = { class: "flex flex-col gap-4" }, pn = { class: "flex justify-between items-start py-1 gap-4" }, fn = { class: "flex flex-col flex-1 min-w-0" }, vn = { class: "fm-typo-en-body-lg-600 truncate" }, yn = { class: "fm-typo-en-body-md-400 truncate" }, hn = { class: "flex flex-col gap-2 items-end w-52 shrink-0" },
|
|
2903
|
+
}, dn = { class: "fm-typo-en-body-md-400" }, mn = { class: "flex flex-col gap-4" }, pn = { class: "flex justify-between items-start py-1 gap-4" }, fn = { class: "flex flex-col flex-1 min-w-0" }, vn = { class: "fm-typo-en-body-lg-600 truncate" }, yn = { class: "fm-typo-en-body-md-400 truncate" }, hn = { class: "flex flex-col gap-2 items-end w-52 shrink-0" }, bn = {
|
|
2904
2904
|
key: 0,
|
|
2905
2905
|
class: "fm-typo-en-body-sm-400 text-fm-color-system-error-300 self-end text-right"
|
|
2906
|
-
},
|
|
2906
|
+
}, gn = {
|
|
2907
2907
|
key: 1,
|
|
2908
2908
|
class: "flex items-center gap-2"
|
|
2909
2909
|
}, _n = {
|
|
@@ -2930,8 +2930,8 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
2930
2930
|
},
|
|
2931
2931
|
emits: ["submitted"],
|
|
2932
2932
|
setup(u, { emit: t }) {
|
|
2933
|
-
var fe,
|
|
2934
|
-
const { t: r } = ht(), o = ae(!1), m =
|
|
2933
|
+
var fe, E, de;
|
|
2934
|
+
const { t: r } = ht(), o = ae(!1), m = bt(), c = u, d = t, n = cs("", {
|
|
2935
2935
|
default: {
|
|
2936
2936
|
deliveryOrderNumber: "",
|
|
2937
2937
|
remark: "",
|
|
@@ -2944,28 +2944,28 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
2944
2944
|
// every single delivery — inflating the PO's total ordered quantity forever).
|
|
2945
2945
|
...(((p = c.purchaseOrder) == null ? void 0 : p.version) ?? je.enum[1]) === je.enum[2] && f.id ? { id: f.id } : {},
|
|
2946
2946
|
sku: f.sku,
|
|
2947
|
-
amount:
|
|
2947
|
+
amount: Re.fromNumber(0),
|
|
2948
2948
|
measurement: f.measurement
|
|
2949
2949
|
};
|
|
2950
2950
|
}),
|
|
2951
2951
|
createdBy: {
|
|
2952
2952
|
id: ((fe = m.sessionUser.value) == null ? void 0 : fe.id) || "",
|
|
2953
|
-
name: ((
|
|
2953
|
+
name: ((E = m.sessionUser.value) == null ? void 0 : E.displayName) || ""
|
|
2954
2954
|
},
|
|
2955
2955
|
createdAt: ""
|
|
2956
2956
|
}
|
|
2957
|
-
}), l = Ze(), C =
|
|
2957
|
+
}), l = Ze(), C = gt(), v = Je(), D = Dt(), {
|
|
2958
2958
|
controller: R,
|
|
2959
|
-
state:
|
|
2959
|
+
state: I,
|
|
2960
2960
|
reset: S
|
|
2961
2961
|
} = Tt({ currency: $e() }), B = H(
|
|
2962
2962
|
() => c.purchaseOrder.deliveryFullfillment != null
|
|
2963
|
-
),
|
|
2963
|
+
), T = H(
|
|
2964
2964
|
() => v.enablePortalDeliveryOrderWrite && (c.purchaseOrder.status === Oe.Enum.RECEIVING || c.purchaseOrder.status === Oe.Enum.COMPLETE) && !B.value
|
|
2965
2965
|
), re = v.enablePurchaseOrderReceiveWithCustomCost, oe = v.enableBackdateReceive, X = ae({}), le = H(
|
|
2966
2966
|
() => c.purchaseOrder.itemsAtSubmission ?? c.purchaseOrder.items
|
|
2967
|
-
),
|
|
2968
|
-
() => ks(c.purchaseOrder,
|
|
2967
|
+
), be = H(() => Os(c.purchaseOrder)), ce = H(
|
|
2968
|
+
() => ks(c.purchaseOrder, be.value)
|
|
2969
2969
|
);
|
|
2970
2970
|
function xe(f) {
|
|
2971
2971
|
return f.sku._id ?? null;
|
|
@@ -2999,13 +2999,13 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
2999
2999
|
if (!f) return "";
|
|
3000
3000
|
const p = new Date(f), x = p.getFullYear(), U = String(p.getMonth() + 1).padStart(2, "0"), M = String(p.getDate()).padStart(2, "0");
|
|
3001
3001
|
return `${x}-${U}-${M}`;
|
|
3002
|
-
}),
|
|
3002
|
+
}), g = H(() => {
|
|
3003
3003
|
const f = mt(c.purchaseOrder._id);
|
|
3004
3004
|
return f ? new Date(f) : null;
|
|
3005
3005
|
}), $ = H(() => {
|
|
3006
|
-
if (!ye.value || !P.value || !
|
|
3007
|
-
if (/* @__PURE__ */ new Date(`${ye.value}T${P.value}:00`) <
|
|
3008
|
-
const p = k.value, x =
|
|
3006
|
+
if (!ye.value || !P.value || !g.value) return null;
|
|
3007
|
+
if (/* @__PURE__ */ new Date(`${ye.value}T${P.value}:00`) < g.value) {
|
|
3008
|
+
const p = k.value, x = g.value.getHours(), U = g.value.getMinutes(), M = x >= 12 ? "PM" : "AM", ke = x % 12 || 12, we = `${String(ke).padStart(2, "0")}:${String(U).padStart(2, "0")} ${M}`;
|
|
3009
3009
|
return `Delivery date & time cannot be earlier than order creation (${p} ${we})`;
|
|
3010
3010
|
}
|
|
3011
3011
|
return null;
|
|
@@ -3015,7 +3015,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3015
3015
|
}));
|
|
3016
3016
|
function J(f) {
|
|
3017
3017
|
var U;
|
|
3018
|
-
const p = (U = c.receivedInfoMap[f.sku._id]) == null ? void 0 : U.received, x = p != null ?
|
|
3018
|
+
const p = (U = c.receivedInfoMap[f.sku._id]) == null ? void 0 : U.received, x = p != null ? Re.toFormatString({ value: p }) : "0";
|
|
3019
3019
|
return `${r("inventory.transfer.receiveRequest.details.received")} ${x} / ${ft(f.quantity, f.sku.unit, f.measurement)}`;
|
|
3020
3020
|
}
|
|
3021
3021
|
function ee() {
|
|
@@ -3062,17 +3062,17 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3062
3062
|
...Qe(x, 4)
|
|
3063
3063
|
};
|
|
3064
3064
|
}
|
|
3065
|
-
}))), F = ae([]),
|
|
3065
|
+
}))), F = ae([]), b = H(
|
|
3066
3066
|
() => D.skus.filter((f) => !f.isInactive).map((f) => ({ label: `${f.name} (${f.code})`, value: f._id }))
|
|
3067
3067
|
), _ = H(() => le.value.length);
|
|
3068
3068
|
function z() {
|
|
3069
3069
|
F.value.push({ skuId: null, stableKey: null, costEnabled: !1 }), n.received.push({
|
|
3070
3070
|
sku: null,
|
|
3071
|
-
amount:
|
|
3071
|
+
amount: Re.fromNumber(0),
|
|
3072
3072
|
measurement: null
|
|
3073
3073
|
});
|
|
3074
3074
|
}
|
|
3075
|
-
function
|
|
3075
|
+
function W(f) {
|
|
3076
3076
|
F.value.splice(f, 1), n.received.splice(_.value + f, 1);
|
|
3077
3077
|
}
|
|
3078
3078
|
function Z(f, p) {
|
|
@@ -3083,7 +3083,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3083
3083
|
function ne(f) {
|
|
3084
3084
|
const p = f.stableKey;
|
|
3085
3085
|
if (p && ce.value[p]) {
|
|
3086
|
-
const x = ce.value[p], U =
|
|
3086
|
+
const x = ce.value[p], U = Re.toFormatString({ value: x.received });
|
|
3087
3087
|
return `${r("inventory.transfer.receiveRequest.details.received")} ${U}`;
|
|
3088
3088
|
}
|
|
3089
3089
|
}
|
|
@@ -3126,7 +3126,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3126
3126
|
p.costEnabled = !p.costEnabled, p.costEnabled ? n.received[x].cost = { currency: $e(), amount: 0, precision: 4 } : delete n.received[x].cost;
|
|
3127
3127
|
}
|
|
3128
3128
|
function w() {
|
|
3129
|
-
|
|
3129
|
+
G() && C.open({
|
|
3130
3130
|
title: "Confirm Create Delivery Order",
|
|
3131
3131
|
message: `Are you sure you want to create delivery order for PO# ${c.purchaseOrder.seqNumber}?`,
|
|
3132
3132
|
primaryActions: {
|
|
@@ -3142,7 +3142,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3142
3142
|
}
|
|
3143
3143
|
const A = ae(!1);
|
|
3144
3144
|
function N() {
|
|
3145
|
-
|
|
3145
|
+
G() && (A.value = !0, l.createDeliveryOrder({
|
|
3146
3146
|
deliveryOrder: {
|
|
3147
3147
|
...n,
|
|
3148
3148
|
priceAdjustments: R.value.state().adjustments
|
|
@@ -3163,7 +3163,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3163
3163
|
A.value = !1;
|
|
3164
3164
|
}));
|
|
3165
3165
|
}
|
|
3166
|
-
function
|
|
3166
|
+
function G() {
|
|
3167
3167
|
return B.value ? (o.value = !1, Q.open(
|
|
3168
3168
|
{
|
|
3169
3169
|
title: "Purchase order updated",
|
|
@@ -3174,7 +3174,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3174
3174
|
), !1) : !0;
|
|
3175
3175
|
}
|
|
3176
3176
|
return Ye(B, (f) => {
|
|
3177
|
-
!f || !o.value ||
|
|
3177
|
+
!f || !o.value || G();
|
|
3178
3178
|
}), Ye(
|
|
3179
3179
|
() => o.value,
|
|
3180
3180
|
(f) => {
|
|
@@ -3183,17 +3183,17 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3183
3183
|
F.value = [], S([]), n.received = le.value.map((M) => ({
|
|
3184
3184
|
...Ae && M.id ? { id: M.id } : {},
|
|
3185
3185
|
sku: M.sku,
|
|
3186
|
-
amount:
|
|
3186
|
+
amount: Re.fromNumber(0),
|
|
3187
3187
|
measurement: M.measurement
|
|
3188
3188
|
}));
|
|
3189
3189
|
return;
|
|
3190
3190
|
}
|
|
3191
3191
|
const p = le.value;
|
|
3192
3192
|
for (let M = 0; M < p.length; M++) {
|
|
3193
|
-
const ke = p[M], Y = (((U = c.purchaseOrder) == null ? void 0 : U.version) ?? je.enum[1]) === je.enum[2] ? ke.id : ke.sku._id, se = c.receivedMap[Y], Se = +Ce(ke.quantity),
|
|
3194
|
-
L.value[M].value = Math.max(0, Se -
|
|
3193
|
+
const ke = p[M], Y = (((U = c.purchaseOrder) == null ? void 0 : U.version) ?? je.enum[1]) === je.enum[2] ? ke.id : ke.sku._id, se = c.receivedMap[Y], Se = +Ce(ke.quantity), Fe = se ? +Ce(se.received) : 0;
|
|
3194
|
+
L.value[M].value = Math.max(0, Se - Fe);
|
|
3195
3195
|
}
|
|
3196
|
-
const x =
|
|
3196
|
+
const x = be.value;
|
|
3197
3197
|
if (x.length) {
|
|
3198
3198
|
for (const M of x) {
|
|
3199
3199
|
const ke = xe(M);
|
|
@@ -3206,7 +3206,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3206
3206
|
// Propagate the stable id so V2 submissions align with the existing PO line.
|
|
3207
3207
|
...Ae && M.id ? { id: M.id } : {},
|
|
3208
3208
|
sku: M.sku,
|
|
3209
|
-
amount:
|
|
3209
|
+
amount: Re.fromNumber(0),
|
|
3210
3210
|
measurement: M.measurement ?? null
|
|
3211
3211
|
});
|
|
3212
3212
|
}
|
|
@@ -3220,15 +3220,15 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3220
3220
|
}
|
|
3221
3221
|
}
|
|
3222
3222
|
), (f, p) => {
|
|
3223
|
-
const x = ue("FmButton"), U = ue("FmDatePicker"), M = ue("FmTimePicker"), ke = ue("FmIcon"), we = ue("FmStepperField"), Y = ue("FmSwitch"), se = ue("FmSelect"), Se = ue("FmTextField"),
|
|
3224
|
-
return i(), he(
|
|
3223
|
+
const x = ue("FmButton"), U = ue("FmDatePicker"), M = ue("FmTimePicker"), ke = ue("FmIcon"), we = ue("FmStepperField"), Y = ue("FmSwitch"), se = ue("FmSelect"), Se = ue("FmTextField"), Fe = ue("FmDialog");
|
|
3224
|
+
return i(), he(Fe, {
|
|
3225
3225
|
modelValue: o.value,
|
|
3226
3226
|
"onUpdate:modelValue": p[4] || (p[4] = (Ie) => o.value = Ie),
|
|
3227
3227
|
overlay: !0,
|
|
3228
3228
|
"min-width": 800
|
|
3229
3229
|
}, {
|
|
3230
3230
|
"dialog-button": me(() => [
|
|
3231
|
-
|
|
3231
|
+
T.value ? (i(), he(x, {
|
|
3232
3232
|
key: 0,
|
|
3233
3233
|
variant: "primary",
|
|
3234
3234
|
label: "Create",
|
|
@@ -3277,13 +3277,13 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3277
3277
|
e("div", ln, [
|
|
3278
3278
|
q(U, {
|
|
3279
3279
|
modelValue: ye.value,
|
|
3280
|
-
"onUpdate:modelValue": p[0] || (p[0] = (
|
|
3280
|
+
"onUpdate:modelValue": p[0] || (p[0] = (ge) => ye.value = ge)
|
|
3281
3281
|
}, null, 8, ["modelValue"])
|
|
3282
3282
|
]),
|
|
3283
3283
|
e("div", un, [
|
|
3284
3284
|
q(M, {
|
|
3285
3285
|
modelValue: P.value,
|
|
3286
|
-
"onUpdate:modelValue": p[1] || (p[1] = (
|
|
3286
|
+
"onUpdate:modelValue": p[1] || (p[1] = (ge) => P.value = ge)
|
|
3287
3287
|
}, null, 8, ["modelValue"])
|
|
3288
3288
|
])
|
|
3289
3289
|
]),
|
|
@@ -3298,24 +3298,24 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3298
3298
|
])) : V("", !0),
|
|
3299
3299
|
e("div", mn, [
|
|
3300
3300
|
p[8] || (p[8] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Items going to receive ", -1)),
|
|
3301
|
-
(i(!0), h(De, null, Te(le.value, (
|
|
3302
|
-
var
|
|
3301
|
+
(i(!0), h(De, null, Te(le.value, (ge, pe) => {
|
|
3302
|
+
var Pe;
|
|
3303
3303
|
return i(), h("div", { key: pe }, [
|
|
3304
3304
|
e("div", pn, [
|
|
3305
3305
|
e("div", fn, [
|
|
3306
|
-
e("span", vn, O(
|
|
3307
|
-
e("span", yn, O(
|
|
3306
|
+
e("span", vn, O(ge.sku.name), 1),
|
|
3307
|
+
e("span", yn, O(ge.sku.code), 1)
|
|
3308
3308
|
]),
|
|
3309
3309
|
e("div", hn, [
|
|
3310
3310
|
q(we, {
|
|
3311
3311
|
label: "Receive Quantity",
|
|
3312
3312
|
modelValue: L.value[pe].value,
|
|
3313
3313
|
"onUpdate:modelValue": (Ee) => L.value[pe].value = Ee,
|
|
3314
|
-
"helper-text": J(
|
|
3315
|
-
"append-text": ((
|
|
3314
|
+
"helper-text": J(ge),
|
|
3315
|
+
"append-text": ((Pe = ge.measurement) == null ? void 0 : Pe.abbrev) ?? ge.sku.unit.abbrev
|
|
3316
3316
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "helper-text", "append-text"]),
|
|
3317
|
-
L.value[pe].value <= 0 ? (i(), h("div",
|
|
3318
|
-
y(re) ? (i(), h("div",
|
|
3317
|
+
L.value[pe].value <= 0 ? (i(), h("div", bn, O(os))) : V("", !0),
|
|
3318
|
+
y(re) ? (i(), h("div", gn, [
|
|
3319
3319
|
q(Y, {
|
|
3320
3320
|
"model-value": X.value[pe],
|
|
3321
3321
|
"onUpdate:modelValue": (Ee) => te(pe),
|
|
@@ -3352,20 +3352,20 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3352
3352
|
})
|
|
3353
3353
|
]),
|
|
3354
3354
|
F.value.length === 0 ? (i(), h("div", kn, " No extra items added ")) : V("", !0),
|
|
3355
|
-
(i(!0), h(De, null, Te(F.value, (
|
|
3356
|
-
var
|
|
3355
|
+
(i(!0), h(De, null, Te(F.value, (ge, pe) => {
|
|
3356
|
+
var Pe, Ee;
|
|
3357
3357
|
return i(), h("div", { key: pe }, [
|
|
3358
3358
|
e("div", xn, [
|
|
3359
3359
|
e("div", wn, [
|
|
3360
3360
|
q(se, {
|
|
3361
|
-
"model-value":
|
|
3361
|
+
"model-value": ge.skuId,
|
|
3362
3362
|
"onUpdate:modelValue": (Le) => Z(pe, Le),
|
|
3363
3363
|
label: "Ingredient",
|
|
3364
|
-
items:
|
|
3364
|
+
items: b.value,
|
|
3365
3365
|
searchable: "",
|
|
3366
3366
|
searchTarget: "label",
|
|
3367
3367
|
placeholder: "Select ingredient",
|
|
3368
|
-
disabled: !!
|
|
3368
|
+
disabled: !!ge.historyItem
|
|
3369
3369
|
}, null, 8, ["model-value", "onUpdate:modelValue", "items", "disabled"])
|
|
3370
3370
|
]),
|
|
3371
3371
|
e("div", $n, [
|
|
@@ -3373,19 +3373,19 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3373
3373
|
label: "Receive Quantity",
|
|
3374
3374
|
modelValue: ve.value[pe].value,
|
|
3375
3375
|
"onUpdate:modelValue": (Le) => ve.value[pe].value = Le,
|
|
3376
|
-
"append-text":
|
|
3377
|
-
"helper-text": ne(
|
|
3376
|
+
"append-text": ge.skuId ? ((Ee = (Pe = y(D).skuById[ge.skuId]) == null ? void 0 : Pe.unit) == null ? void 0 : Ee.abbrev) ?? "" : "",
|
|
3377
|
+
"helper-text": ne(ge)
|
|
3378
3378
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text", "helper-text"]),
|
|
3379
3379
|
ve.value[pe].value <= 0 ? (i(), h("div", Cn, O(os))) : V("", !0),
|
|
3380
3380
|
y(re) ? (i(), h("div", An, [
|
|
3381
3381
|
q(Y, {
|
|
3382
|
-
"model-value":
|
|
3382
|
+
"model-value": ge.costEnabled,
|
|
3383
3383
|
"onUpdate:modelValue": (Le) => a(pe),
|
|
3384
3384
|
size: "sm"
|
|
3385
3385
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
3386
3386
|
p[10] || (p[10] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
|
|
3387
3387
|
])) : V("", !0),
|
|
3388
|
-
y(re) &&
|
|
3388
|
+
y(re) && ge.costEnabled ? (i(), he(we, {
|
|
3389
3389
|
key: 2,
|
|
3390
3390
|
modelValue: s.value[pe].value,
|
|
3391
3391
|
"onUpdate:modelValue": (Le) => s.value[pe].value = Le,
|
|
@@ -3397,13 +3397,13 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3397
3397
|
"append-text": y($e)()
|
|
3398
3398
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) : V("", !0)
|
|
3399
3399
|
]),
|
|
3400
|
-
|
|
3400
|
+
ge.historyItem ? V("", !0) : (i(), he(x, {
|
|
3401
3401
|
key: 0,
|
|
3402
3402
|
variant: "tertiary",
|
|
3403
3403
|
"prepend-icon": "delete",
|
|
3404
3404
|
size: "md",
|
|
3405
3405
|
class: "mt-6",
|
|
3406
|
-
onClick: (Le) =>
|
|
3406
|
+
onClick: (Le) => W(pe)
|
|
3407
3407
|
}, null, 8, ["onClick"]))
|
|
3408
3408
|
]),
|
|
3409
3409
|
pe < F.value.length - 1 ? (i(), h("div", Nn)) : V("", !0)
|
|
@@ -3415,7 +3415,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3415
3415
|
e("div", Rn, [
|
|
3416
3416
|
q(Se, {
|
|
3417
3417
|
modelValue: y(n).deliveryOrderNumber,
|
|
3418
|
-
"onUpdate:modelValue": p[2] || (p[2] = (
|
|
3418
|
+
"onUpdate:modelValue": p[2] || (p[2] = (ge) => y(n).deliveryOrderNumber = ge),
|
|
3419
3419
|
size: "md"
|
|
3420
3420
|
}, null, 8, ["modelValue"])
|
|
3421
3421
|
])
|
|
@@ -3425,7 +3425,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3425
3425
|
e("div", Fn, [
|
|
3426
3426
|
q(Se, {
|
|
3427
3427
|
modelValue: y(n).remark,
|
|
3428
|
-
"onUpdate:modelValue": p[3] || (p[3] = (
|
|
3428
|
+
"onUpdate:modelValue": p[3] || (p[3] = (ge) => y(n).remark = ge),
|
|
3429
3429
|
size: "md"
|
|
3430
3430
|
}, null, 8, ["modelValue"])
|
|
3431
3431
|
])
|
|
@@ -3433,7 +3433,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3433
3433
|
y(v).enablePurchaseOrderPriceAdjustment ? (i(), he(It, {
|
|
3434
3434
|
key: 1,
|
|
3435
3435
|
controller: y(R),
|
|
3436
|
-
state: y(
|
|
3436
|
+
state: y(I)
|
|
3437
3437
|
}, null, 8, ["controller", "state"])) : V("", !0)
|
|
3438
3438
|
])
|
|
3439
3439
|
];
|
|
@@ -3500,11 +3500,11 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3500
3500
|
n.value = !1;
|
|
3501
3501
|
});
|
|
3502
3502
|
}
|
|
3503
|
-
return (R,
|
|
3503
|
+
return (R, I) => {
|
|
3504
3504
|
const S = ue("FmButton"), B = ue("FmDialog");
|
|
3505
3505
|
return i(), he(B, {
|
|
3506
3506
|
modelValue: d.value,
|
|
3507
|
-
"onUpdate:modelValue":
|
|
3507
|
+
"onUpdate:modelValue": I[0] || (I[0] = (T) => d.value = T),
|
|
3508
3508
|
overlay: !0,
|
|
3509
3509
|
"min-width": 600
|
|
3510
3510
|
}, {
|
|
@@ -3594,11 +3594,11 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3594
3594
|
});
|
|
3595
3595
|
}
|
|
3596
3596
|
return (v, D) => {
|
|
3597
|
-
const R = ue("FmButton"),
|
|
3597
|
+
const R = ue("FmButton"), I = ue("FmCircularProgress"), S = ue("FmIcon"), B = ue("FmDialog");
|
|
3598
3598
|
return i(), h("div", Un, [
|
|
3599
3599
|
q(B, {
|
|
3600
3600
|
modelValue: o.value,
|
|
3601
|
-
"onUpdate:modelValue": D[2] || (D[2] = (
|
|
3601
|
+
"onUpdate:modelValue": D[2] || (D[2] = (T) => o.value = T),
|
|
3602
3602
|
overlay: !0,
|
|
3603
3603
|
"max-width": 800
|
|
3604
3604
|
}, {
|
|
@@ -3607,7 +3607,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3607
3607
|
"prepend-icon": "info",
|
|
3608
3608
|
variant: "secondary",
|
|
3609
3609
|
label: "NetSuite",
|
|
3610
|
-
onClick: D[0] || (D[0] = (
|
|
3610
|
+
onClick: D[0] || (D[0] = (T) => n()),
|
|
3611
3611
|
"text-color": "primary",
|
|
3612
3612
|
"bg-color": "transparent",
|
|
3613
3613
|
"border-color": "primary"
|
|
@@ -3619,7 +3619,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3619
3619
|
default: me(() => [
|
|
3620
3620
|
m.value ? (i(), h("div", Mn, [
|
|
3621
3621
|
D[4] || (D[4] = e("span", null, "Change Log Loading...", -1)),
|
|
3622
|
-
q(
|
|
3622
|
+
q(I, { size: "md" })
|
|
3623
3623
|
])) : V("", !0),
|
|
3624
3624
|
!m.value && d.value.length > 0 ? (i(), h("div", Bn, [
|
|
3625
3625
|
e("h3", zn, [
|
|
@@ -3649,21 +3649,21 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3649
3649
|
])
|
|
3650
3650
|
], -1)),
|
|
3651
3651
|
e("tbody", null, [
|
|
3652
|
-
(i(!0), h(De, null, Te(d.value, (
|
|
3652
|
+
(i(!0), h(De, null, Te(d.value, (T, re) => (i(), h("tr", {
|
|
3653
3653
|
key: re,
|
|
3654
3654
|
class: "border-b border-fm-color-neutral-gray-200 last:border-b-0"
|
|
3655
3655
|
}, [
|
|
3656
|
-
e("td", Gn, O(C(
|
|
3657
|
-
e("td", Wn, O(
|
|
3658
|
-
e("td", Qn, O(
|
|
3659
|
-
e("td", Yn, O(
|
|
3656
|
+
e("td", Gn, O(C(T._dateiso8601)), 1),
|
|
3657
|
+
e("td", Wn, O(T._rolename), 1),
|
|
3658
|
+
e("td", Qn, O(T._employeename), 1),
|
|
3659
|
+
e("td", Yn, O(T._contextname), 1),
|
|
3660
3660
|
e("td", {
|
|
3661
|
-
class: We(`p-3 fm-typo-en-body-sm-600 ${l(Number(
|
|
3662
|
-
}, O(y(Me)[Number(
|
|
3663
|
-
e("td", Jn, O(
|
|
3664
|
-
e("td", Xn, O(
|
|
3665
|
-
e("td", Zn, O(
|
|
3666
|
-
e("td", ea, O(
|
|
3661
|
+
class: We(`p-3 fm-typo-en-body-sm-600 ${l(Number(T.type) - 1)}`)
|
|
3662
|
+
}, O(y(Me)[Number(T.type) - 1]), 3),
|
|
3663
|
+
e("td", Jn, O(T.lineid || ""), 1),
|
|
3664
|
+
e("td", Xn, O(T._fieldname), 1),
|
|
3665
|
+
e("td", Zn, O(T.oldvalue || ""), 1),
|
|
3666
|
+
e("td", ea, O(T.newvalue || ""), 1)
|
|
3667
3667
|
]))), 128))
|
|
3668
3668
|
])
|
|
3669
3669
|
])
|
|
@@ -3678,7 +3678,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3678
3678
|
label: "Close",
|
|
3679
3679
|
size: "md",
|
|
3680
3680
|
variant: "primary",
|
|
3681
|
-
onClick: D[1] || (D[1] = (
|
|
3681
|
+
onClick: D[1] || (D[1] = (T) => o.value = !1)
|
|
3682
3682
|
})
|
|
3683
3683
|
]),
|
|
3684
3684
|
_: 1
|
|
@@ -3698,7 +3698,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3698
3698
|
}, ya = { class: "fm-typo-en-body-sm-600" }, ha = {
|
|
3699
3699
|
key: 2,
|
|
3700
3700
|
class: "flex items-start justify-between gap-6"
|
|
3701
|
-
},
|
|
3701
|
+
}, ba = { class: "text-xs font-mono text-right break-all" }, ga = {
|
|
3702
3702
|
key: 3,
|
|
3703
3703
|
class: "flex items-start justify-between gap-6"
|
|
3704
3704
|
}, _a = { class: "text-xs font-mono text-right break-all" }, Sa = { class: "flex flex-col gap-4" }, Oa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ka = { class: "flex gap-1" }, xa = { class: "fm-typo-en-body-lg-600" }, wa = {
|
|
@@ -3728,10 +3728,10 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3728
3728
|
}, ml = { key: 0 }, pl = { class: "py-8" }, fl = { class: "flex justify-end gap-4 items-center" }, vl = { class: "fm-typo-en-body-lg-600" }, yl = { class: "fm-typo-en-body-lg-600" }, hl = {
|
|
3729
3729
|
key: 0,
|
|
3730
3730
|
class: "flex justify-end"
|
|
3731
|
-
},
|
|
3731
|
+
}, bl = {
|
|
3732
3732
|
key: 1,
|
|
3733
3733
|
class: "flex-1 xs:w-screen xs:max-w-full"
|
|
3734
|
-
},
|
|
3734
|
+
}, gl = {
|
|
3735
3735
|
key: 0,
|
|
3736
3736
|
class: "flex flex-col items-center gap-8 h-full"
|
|
3737
3737
|
}, _l = ["src"], Sl = { class: "fm-typo-en-body-lg-600" }, Ol = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, kl = {
|
|
@@ -3777,7 +3777,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3777
3777
|
},
|
|
3778
3778
|
emits: ["update:show", "submitted"],
|
|
3779
3779
|
setup(u, { emit: t }) {
|
|
3780
|
-
const r = u, o = t, m =
|
|
3780
|
+
const r = u, o = t, m = gt(), c = Xe(), d = Je(), n = ze(), l = bt(), { hasOrderDraftPermission: C } = Ss(), v = gs();
|
|
3781
3781
|
function D(s) {
|
|
3782
3782
|
const a = s.isCustomCost, w = s.totalCost;
|
|
3783
3783
|
return a != null ? a === !0 : w != null;
|
|
@@ -3797,12 +3797,12 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3797
3797
|
name: ((a = l.sessionUser.value) == null ? void 0 : a.displayName) ?? ""
|
|
3798
3798
|
};
|
|
3799
3799
|
}
|
|
3800
|
-
),
|
|
3800
|
+
), I = _s(), { t: S } = ht(), B = H(
|
|
3801
3801
|
() => {
|
|
3802
3802
|
var s, a, w, A;
|
|
3803
3803
|
return ((a = (s = r.purchaseOrder) == null ? void 0 : s.supplier) == null ? void 0 : a.internal) === "restaurant" || ((A = (w = r.purchaseOrder) == null ? void 0 : w.supplier) == null ? void 0 : A.internal) === "warehouse" ? at.enum.transfer : at.enum.purchase;
|
|
3804
3804
|
}
|
|
3805
|
-
),
|
|
3805
|
+
), T = H(() => {
|
|
3806
3806
|
var w;
|
|
3807
3807
|
const s = (w = r.shipments) == null ? void 0 : w.find((A) => {
|
|
3808
3808
|
var N;
|
|
@@ -3812,12 +3812,12 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3812
3812
|
if (s != null && s.milestones && s.milestones.length > 0) {
|
|
3813
3813
|
const A = s.milestones[s.milestones.length - 1];
|
|
3814
3814
|
if (A.estimatedTime) {
|
|
3815
|
-
const N = new Date(A.estimatedTime),
|
|
3816
|
-
a = `${N.toLocaleString("en-US", { month: "short" })} ${
|
|
3815
|
+
const N = new Date(A.estimatedTime), G = N.getDate().toString().padStart(2, "0");
|
|
3816
|
+
a = `${N.toLocaleString("en-US", { month: "short" })} ${G}`;
|
|
3817
3817
|
}
|
|
3818
3818
|
}
|
|
3819
3819
|
return a;
|
|
3820
|
-
}), re = ae(!1), oe = ae(""), X = ae(!0), le = Ze(),
|
|
3820
|
+
}), re = ae(!1), oe = ae(""), X = ae(!0), le = Ze(), be = Cr(le.getWorkflowConfig), ce = ys(), xe = [
|
|
3821
3821
|
K.enum.receiveStock,
|
|
3822
3822
|
K.enum.processRequest,
|
|
3823
3823
|
K.enum.closeRequest
|
|
@@ -3825,7 +3825,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3825
3825
|
var de, f, p, x, U, M, ke, we, Y;
|
|
3826
3826
|
if (!r.purchaseOrder)
|
|
3827
3827
|
return [];
|
|
3828
|
-
const s =
|
|
3828
|
+
const s = be.result.value;
|
|
3829
3829
|
if (s.state === Nt.loading)
|
|
3830
3830
|
return [];
|
|
3831
3831
|
let a;
|
|
@@ -3869,23 +3869,23 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3869
3869
|
return se.success ? { ...se.data, purchaseOrder: null, netSuite: null } : null;
|
|
3870
3870
|
})(),
|
|
3871
3871
|
purchaseOrder: a
|
|
3872
|
-
}, N = d.useOperatePurchaseOrderV2,
|
|
3873
|
-
N && !
|
|
3874
|
-
let
|
|
3872
|
+
}, N = d.useOperatePurchaseOrderV2, G = d.poWorkflowAllowToMarkCompleted, fe = [...xe];
|
|
3873
|
+
N && !G && fe.push(K.enum.completeReceive);
|
|
3874
|
+
let E = [];
|
|
3875
3875
|
try {
|
|
3876
|
-
s.state === Nt.error ? (console.error("Error fetching workflow config:", s.error),
|
|
3876
|
+
s.state === Nt.error ? (console.error("Error fetching workflow config:", s.error), E = St.getAvailableActions({
|
|
3877
3877
|
...A,
|
|
3878
3878
|
orderConfig: St.getDefaultConfig()
|
|
3879
|
-
}).actions.filter((se) => !fe.includes(se))) :
|
|
3879
|
+
}).actions.filter((se) => !fe.includes(se))) : E = St.getAvailableActions({
|
|
3880
3880
|
...A,
|
|
3881
3881
|
orderConfig: s.data
|
|
3882
3882
|
}).actions.filter((se) => !fe.includes(se));
|
|
3883
3883
|
} catch (se) {
|
|
3884
3884
|
console.error("Error getting available actions:", se);
|
|
3885
3885
|
}
|
|
3886
|
-
return r.scope === "approval" && (
|
|
3886
|
+
return r.scope === "approval" && (E = E.filter((se) => se !== K.enum.completeReceive)), C.value || (E = E.filter(
|
|
3887
3887
|
(se) => se !== K.enum.approveDraft && se !== K.enum.rejectDraft
|
|
3888
|
-
)),
|
|
3888
|
+
)), E;
|
|
3889
3889
|
}), Q = Hs(r, "show"), ye = H(() => [
|
|
3890
3890
|
{
|
|
3891
3891
|
label: S("inventory.transfer.receiveRequest.details.overview"),
|
|
@@ -3915,9 +3915,9 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3915
3915
|
}
|
|
3916
3916
|
}));
|
|
3917
3917
|
}
|
|
3918
|
-
async function
|
|
3919
|
-
return new Promise((
|
|
3920
|
-
const
|
|
3918
|
+
async function g(s, a, w, A, N) {
|
|
3919
|
+
return new Promise((G, fe) => {
|
|
3920
|
+
const E = {
|
|
3921
3921
|
closeButton: !1,
|
|
3922
3922
|
title: A.title,
|
|
3923
3923
|
message: A.message,
|
|
@@ -3925,12 +3925,12 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3925
3925
|
secondaryActions: { text: "No", close: !1 }
|
|
3926
3926
|
};
|
|
3927
3927
|
let de = a.rejectReason ?? "";
|
|
3928
|
-
w === K.enum.rejectDraft && (
|
|
3928
|
+
w === K.enum.rejectDraft && (E.contentComponent = vs, E.contentComponentProps = {
|
|
3929
3929
|
message: A.message,
|
|
3930
3930
|
onChange: (f) => {
|
|
3931
3931
|
de = f ?? "";
|
|
3932
3932
|
}
|
|
3933
|
-
}), m.open(
|
|
3933
|
+
}), m.open(E).onPrimary(async () => {
|
|
3934
3934
|
var p, x, U, M;
|
|
3935
3935
|
const f = [];
|
|
3936
3936
|
w === K.enum.confirmDraft || w === K.enum.submitRequest ? f.push({
|
|
@@ -3984,12 +3984,12 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3984
3984
|
// add payload if action is receiveStock or processRequest
|
|
3985
3985
|
},
|
|
3986
3986
|
transferTo: (M = (U = r.poRequest) == null ? void 0 : U.to) == null ? void 0 : M.dbName
|
|
3987
|
-
}).delayed(1e3),
|
|
3987
|
+
}).delayed(1e3), G("submitted");
|
|
3988
3988
|
} catch (ke) {
|
|
3989
3989
|
fe(ke);
|
|
3990
3990
|
}
|
|
3991
3991
|
}).onSecondary(() => {
|
|
3992
|
-
|
|
3992
|
+
G("cancelled");
|
|
3993
3993
|
for (let f = 0; f < N + 2; f++)
|
|
3994
3994
|
m.close();
|
|
3995
3995
|
}).onClose(() => {
|
|
@@ -3997,7 +3997,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3997
3997
|
});
|
|
3998
3998
|
}
|
|
3999
3999
|
async function $(s) {
|
|
4000
|
-
var N,
|
|
4000
|
+
var N, G, fe, E;
|
|
4001
4001
|
if (s === K.enum.receiveStock)
|
|
4002
4002
|
return;
|
|
4003
4003
|
const a = fs[s];
|
|
@@ -4018,7 +4018,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4018
4018
|
s === K.enum.completeReceive) && d.autoReceiveWarehouse)
|
|
4019
4019
|
de.autoReceive = !0;
|
|
4020
4020
|
else if ((s === K.enum.approveRequest || s === K.enum.processRequest) && d.acceptRequireFulfillment) {
|
|
4021
|
-
const p = (
|
|
4021
|
+
const p = (G = (N = r.poRequest) == null ? void 0 : N.from) == null ? void 0 : G.dbName, x = (E = (fe = r.poRequest) == null ? void 0 : fe.to) == null ? void 0 : E.dbName;
|
|
4022
4022
|
if (p && x && (p.startsWith("warehouse_") || x.startsWith("warehouse_"))) {
|
|
4023
4023
|
const U = await new Promise((M, ke) => {
|
|
4024
4024
|
m.open({
|
|
@@ -4038,7 +4038,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4038
4038
|
}
|
|
4039
4039
|
}
|
|
4040
4040
|
try {
|
|
4041
|
-
await
|
|
4041
|
+
await g(
|
|
4042
4042
|
r.purchaseOrder,
|
|
4043
4043
|
de,
|
|
4044
4044
|
s,
|
|
@@ -4067,63 +4067,63 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4067
4067
|
const s = r.purchaseOrder;
|
|
4068
4068
|
if (!s) return { status: "", statusClass: "" };
|
|
4069
4069
|
const { partial: a, over: w } = $t(J.value), A = Ct(s.status, a, w);
|
|
4070
|
-
let N = S(`inventory.transfer.status.${A}`),
|
|
4071
|
-
return A === Oe.enum.CLOSE && (N = `${S(`inventory.transfer.status.${Oe.enum.COMPLETE}`)}`), A === "PARTIAL_RECEIVED" &&
|
|
4070
|
+
let N = S(`inventory.transfer.status.${A}`), G = `${s.status}`.toLocaleLowerCase("en-us");
|
|
4071
|
+
return A === Oe.enum.CLOSE && (N = `${S(`inventory.transfer.status.${Oe.enum.COMPLETE}`)}`), A === "PARTIAL_RECEIVED" && G === Oe.enum.PROCESSING.toLocaleLowerCase("en-us") && (G = Oe.enum.RECEIVING.toLocaleLowerCase("en-us")), {
|
|
4072
4072
|
status: N,
|
|
4073
|
-
statusClass: `fm-status-badge fm-status-badge-${
|
|
4073
|
+
statusClass: `fm-status-badge fm-status-badge-${G}`
|
|
4074
4074
|
};
|
|
4075
4075
|
}), L = H(() => {
|
|
4076
|
-
var
|
|
4077
|
-
const s = ((
|
|
4078
|
-
...s.map((
|
|
4079
|
-
createdAt:
|
|
4076
|
+
var G, fe;
|
|
4077
|
+
const s = ((G = r.purchaseOrder) == null ? void 0 : G.deliveryOrder) ?? [], a = ((fe = r.purchaseOrder) == null ? void 0 : fe.deliveryFullfillment) ?? [], w = [
|
|
4078
|
+
...s.map((E) => ({
|
|
4079
|
+
createdAt: E.createdAt,
|
|
4080
4080
|
type: "grn",
|
|
4081
|
-
doc:
|
|
4081
|
+
doc: E
|
|
4082
4082
|
})),
|
|
4083
|
-
...a.map((
|
|
4084
|
-
createdAt:
|
|
4083
|
+
...a.map((E) => ({
|
|
4084
|
+
createdAt: E.createdAt,
|
|
4085
4085
|
type: "fulfillment",
|
|
4086
|
-
doc:
|
|
4086
|
+
doc: E
|
|
4087
4087
|
}))
|
|
4088
4088
|
];
|
|
4089
|
-
w.reverse().sort((
|
|
4090
|
-
function A(
|
|
4091
|
-
var p, x, U, M, ke, we, Y, se, Se,
|
|
4092
|
-
const de = a.findIndex((pe) => pe.id ===
|
|
4089
|
+
w.reverse().sort((E, de) => E.createdAt.localeCompare(de.createdAt));
|
|
4090
|
+
function A(E) {
|
|
4091
|
+
var p, x, U, M, ke, we, Y, se, Se, Fe, Ie, ge;
|
|
4092
|
+
const de = a.findIndex((pe) => pe.id === E.fullfillmentId), f = [
|
|
4093
4093
|
(x = (p = a[de]) == null ? void 0 : p.netSuite) != null && x.id ? {
|
|
4094
4094
|
label: "Fulfillment's ref no. (Netsuite)",
|
|
4095
4095
|
values: [
|
|
4096
4096
|
`${((M = (U = a[de]) == null ? void 0 : U.netSuite) == null ? void 0 : M.refNo) ?? "N/A"} (${((we = (ke = a[de]) == null ? void 0 : ke.netSuite) == null ? void 0 : we.id) ?? "-"})`
|
|
4097
4097
|
]
|
|
4098
4098
|
} : null,
|
|
4099
|
-
(Y =
|
|
4099
|
+
(Y = E == null ? void 0 : E.netSuite) != null && Y.id ? {
|
|
4100
4100
|
label: "Netsuite ref no.",
|
|
4101
|
-
values: [`${((se =
|
|
4101
|
+
values: [`${((se = E == null ? void 0 : E.netSuite) == null ? void 0 : se.refNo) ?? "N/A"} (${((Se = E == null ? void 0 : E.netSuite) == null ? void 0 : Se.id) ?? "-"})`]
|
|
4102
4102
|
} : null,
|
|
4103
|
-
(
|
|
4103
|
+
(Fe = E == null ? void 0 : E.netSuite) != null && Fe.recordType ? {
|
|
4104
4104
|
label: "Netsuite Type",
|
|
4105
|
-
values: [is((Ie =
|
|
4105
|
+
values: [is((Ie = E == null ? void 0 : E.netSuite) == null ? void 0 : Ie.recordType)]
|
|
4106
4106
|
} : null
|
|
4107
4107
|
];
|
|
4108
4108
|
return {
|
|
4109
4109
|
header: "Received",
|
|
4110
|
-
deliveryOrder:
|
|
4111
|
-
date: et(new Date(
|
|
4110
|
+
deliveryOrder: E,
|
|
4111
|
+
date: et(new Date(E.createdAt)),
|
|
4112
4112
|
info: [
|
|
4113
4113
|
{
|
|
4114
4114
|
label: "Adjustment date",
|
|
4115
4115
|
values: [
|
|
4116
|
-
|
|
4116
|
+
E.adjustment ? et(new Date(mt(E.adjustment))) : "-"
|
|
4117
4117
|
]
|
|
4118
4118
|
},
|
|
4119
4119
|
{
|
|
4120
4120
|
label: "Received by",
|
|
4121
|
-
values: [(
|
|
4121
|
+
values: [(ge = E.createdBy) == null ? void 0 : ge.name]
|
|
4122
4122
|
},
|
|
4123
4123
|
{
|
|
4124
4124
|
label: "Received items",
|
|
4125
|
-
values:
|
|
4126
|
-
var
|
|
4125
|
+
values: E.received.map((pe) => {
|
|
4126
|
+
var Pe;
|
|
4127
4127
|
return ie("div", [
|
|
4128
4128
|
ie(
|
|
4129
4129
|
"div",
|
|
@@ -4177,7 +4177,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4177
4177
|
{
|
|
4178
4178
|
class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
4179
4179
|
},
|
|
4180
|
-
((
|
|
4180
|
+
((Pe = pe.measurement) == null ? void 0 : Pe.abbrev) ?? pe.sku.unit.abbrev
|
|
4181
4181
|
)
|
|
4182
4182
|
]
|
|
4183
4183
|
),
|
|
@@ -4197,11 +4197,11 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4197
4197
|
},
|
|
4198
4198
|
{
|
|
4199
4199
|
label: "Delivery order no.",
|
|
4200
|
-
values: [
|
|
4200
|
+
values: [E.deliveryOrderNumber || "N/A"]
|
|
4201
4201
|
},
|
|
4202
4202
|
{
|
|
4203
4203
|
label: "Remark",
|
|
4204
|
-
values: [
|
|
4204
|
+
values: [E.remark || "N/A"]
|
|
4205
4205
|
},
|
|
4206
4206
|
de > -1 ? {
|
|
4207
4207
|
label: "Fulfilment's sequence",
|
|
@@ -4211,12 +4211,12 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4211
4211
|
].filter((pe) => !!pe)
|
|
4212
4212
|
};
|
|
4213
4213
|
}
|
|
4214
|
-
function N(
|
|
4214
|
+
function N(E) {
|
|
4215
4215
|
var f, p, x;
|
|
4216
|
-
const de = a.findIndex((U) => U.id ===
|
|
4216
|
+
const de = a.findIndex((U) => U.id === E.id);
|
|
4217
4217
|
return {
|
|
4218
4218
|
header: "Fulfillment",
|
|
4219
|
-
date: et(new Date(
|
|
4219
|
+
date: et(new Date(E.createdAt)),
|
|
4220
4220
|
info: [
|
|
4221
4221
|
{
|
|
4222
4222
|
label: "Sequence",
|
|
@@ -4224,7 +4224,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4224
4224
|
},
|
|
4225
4225
|
{
|
|
4226
4226
|
label: "Receiveable items",
|
|
4227
|
-
values:
|
|
4227
|
+
values: E.items.map((U) => {
|
|
4228
4228
|
var M;
|
|
4229
4229
|
return ie("div", [
|
|
4230
4230
|
ie(
|
|
@@ -4297,15 +4297,15 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4297
4297
|
]);
|
|
4298
4298
|
})
|
|
4299
4299
|
},
|
|
4300
|
-
(f =
|
|
4300
|
+
(f = E.netSuite) != null && f.refNo ? {
|
|
4301
4301
|
label: "Netsuite Ref no. (ID)",
|
|
4302
|
-
values: [`${(p =
|
|
4302
|
+
values: [`${(p = E.netSuite) == null ? void 0 : p.refNo} (${((x = E.netSuite) == null ? void 0 : x.id) ?? "-"})`]
|
|
4303
4303
|
} : null
|
|
4304
4304
|
].filter((U) => !!U)
|
|
4305
4305
|
};
|
|
4306
4306
|
}
|
|
4307
4307
|
return w.map(
|
|
4308
|
-
(
|
|
4308
|
+
(E) => E.type === "grn" ? A(E.doc) : N(E.doc)
|
|
4309
4309
|
);
|
|
4310
4310
|
}), te = H(() => {
|
|
4311
4311
|
const s = r.purchaseOrder;
|
|
@@ -4316,8 +4316,8 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4316
4316
|
a.has(N.sku._id) || (a.add(N.sku._id), w.push(N));
|
|
4317
4317
|
return [...s.itemsAtSubmission.map(
|
|
4318
4318
|
(N) => {
|
|
4319
|
-
var
|
|
4320
|
-
return ((
|
|
4319
|
+
var G;
|
|
4320
|
+
return ((G = s.items) == null ? void 0 : G.find(
|
|
4321
4321
|
(fe) => s.version === je.enum[2] ? fe.id === N.id : fe.sku._id === N.sku._id
|
|
4322
4322
|
)) ?? N;
|
|
4323
4323
|
}
|
|
@@ -4329,24 +4329,24 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4329
4329
|
for (const N of s.items ?? [])
|
|
4330
4330
|
a[N.sku._id] || (a[N.sku._id] = []), w[N.sku._id] = N.sku.unit.precision, N.id && a[N.sku._id].push(N.id);
|
|
4331
4331
|
const A = {};
|
|
4332
|
-
for (const [N,
|
|
4333
|
-
const fe =
|
|
4332
|
+
for (const [N, G] of Object.entries(a)) {
|
|
4333
|
+
const fe = G.map((p) => r.receivedMap[p]).filter(Boolean);
|
|
4334
4334
|
if (fe.length === 0) continue;
|
|
4335
|
-
const
|
|
4335
|
+
const E = { amount: 0, precision: w[N] ?? 0 }, de = fe.reduce((p, x) => Re.add([p, x.total]), E), f = fe.reduce((p, x) => Re.add([p, x.received]), E);
|
|
4336
4336
|
A[N] = {
|
|
4337
4337
|
key: N,
|
|
4338
4338
|
total: de,
|
|
4339
4339
|
received: f,
|
|
4340
|
-
remaining:
|
|
4340
|
+
remaining: Re.subtract([de, f])
|
|
4341
4341
|
};
|
|
4342
4342
|
}
|
|
4343
4343
|
return A;
|
|
4344
4344
|
});
|
|
4345
4345
|
function F(s) {
|
|
4346
4346
|
const a = _e.value[s.sku._id], w = _(s);
|
|
4347
|
-
return a ? `<span class="${w} fm-typo-en-body-lg-600">${
|
|
4347
|
+
return a ? `<span class="${w} fm-typo-en-body-lg-600">${Re.toFormatString({ value: a.received })}</span>/${ft(s.quantity, s.sku.unit, s.measurement)}` : `<span class="fm-typo-en-body-lg-600">-</span>/${ft(s.quantity, s.sku.unit, s.measurement)}`;
|
|
4348
4348
|
}
|
|
4349
|
-
function
|
|
4349
|
+
function b(s) {
|
|
4350
4350
|
const a = r.purchaseOrder;
|
|
4351
4351
|
return a != null && a.itemsAtSubmission ? !a.itemsAtSubmission.some((w) => w.sku._id === s.sku._id) : !1;
|
|
4352
4352
|
}
|
|
@@ -4354,31 +4354,31 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4354
4354
|
const a = _e.value[s.sku._id];
|
|
4355
4355
|
if (!a)
|
|
4356
4356
|
return "text-fm-color-typo-tertiary";
|
|
4357
|
-
const { isPartialReceive: w, isNoReceive: A, isOverReceive: N, isFullReceive:
|
|
4358
|
-
return A ? "text-fm-color-typo-tertiary" : w ? "text-fm-color-system-warning-300" : N ? "text-fm-color-system-error-300" :
|
|
4357
|
+
const { isPartialReceive: w, isNoReceive: A, isOverReceive: N, isFullReceive: G } = fr(a);
|
|
4358
|
+
return A ? "text-fm-color-typo-tertiary" : w ? "text-fm-color-system-warning-300" : N ? "text-fm-color-system-error-300" : G ? "text-fm-color-system-success-300" : "";
|
|
4359
4359
|
}
|
|
4360
4360
|
const z = H(() => {
|
|
4361
4361
|
var s, a, w;
|
|
4362
4362
|
return (s = r.purchaseOrder) != null && s.itemsAtSubmission ? ((a = r.purchaseOrder) == null ? void 0 : a.version) === je.enum[2] ? r.purchaseOrder.items.reduce((A, N) => {
|
|
4363
|
-
var fe,
|
|
4364
|
-
const
|
|
4363
|
+
var fe, E;
|
|
4364
|
+
const G = (E = (fe = r.purchaseOrder) == null ? void 0 : fe.itemsAtSubmission) == null ? void 0 : E.find(
|
|
4365
4365
|
(de) => de.id === N.id
|
|
4366
4366
|
);
|
|
4367
|
-
return N.id &&
|
|
4368
|
-
originalAmount: Number(
|
|
4369
|
-
newAmount: Number(
|
|
4367
|
+
return N.id && G && !Re.equals({ a: G.quantity, b: N.quantity }) && A.set(N.id, {
|
|
4368
|
+
originalAmount: Number(Re.toFormatString({ value: G.quantity })),
|
|
4369
|
+
newAmount: Number(Re.toFormatString({ value: N.quantity }))
|
|
4370
4370
|
}), A;
|
|
4371
4371
|
}, /* @__PURE__ */ new Map()) : (w = r.purchaseOrder) == null ? void 0 : w.items.reduce((A, N) => {
|
|
4372
4372
|
var de, f;
|
|
4373
|
-
const
|
|
4373
|
+
const G = (f = (de = r.purchaseOrder) == null ? void 0 : de.itemsAtSubmission) == null ? void 0 : f.find(
|
|
4374
4374
|
(p) => p.sku._id === N.sku._id
|
|
4375
|
-
), fe =
|
|
4376
|
-
return
|
|
4375
|
+
), fe = G ? Number(Re.toFormatString({ value: G.quantity })) : 0, E = Number(Re.toFormatString({ value: N.quantity }));
|
|
4376
|
+
return G && !Re.equals({ a: G.quantity, b: N.quantity }) && A.set(N.sku.code, {
|
|
4377
4377
|
originalAmount: fe,
|
|
4378
|
-
newAmount:
|
|
4378
|
+
newAmount: E
|
|
4379
4379
|
}), A;
|
|
4380
4380
|
}, /* @__PURE__ */ new Map()) : /* @__PURE__ */ new Map();
|
|
4381
|
-
}),
|
|
4381
|
+
}), W = (s) => {
|
|
4382
4382
|
var w, A;
|
|
4383
4383
|
const a = z.value;
|
|
4384
4384
|
return ((w = r.purchaseOrder) == null ? void 0 : w.version) === je.enum[2] ? a.has(s.id) : a.has((A = s.sku) == null ? void 0 : A.code);
|
|
@@ -4400,7 +4400,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4400
4400
|
return s ? [...s.actionChangelogs ?? []].reverse() : [];
|
|
4401
4401
|
});
|
|
4402
4402
|
return (s, a) => {
|
|
4403
|
-
const w = ue("FmButton"), A = ue("FmButtonGroup"), N = ue("FmChip"),
|
|
4403
|
+
const w = ue("FmButton"), A = ue("FmButtonGroup"), N = ue("FmChip"), G = ue("FmIcon"), fe = ue("FmMenuDivider"), E = ue("FmCard"), de = ue("FmTooltip"), f = ue("FmSpacer"), p = ue("FmSideSheet");
|
|
4404
4404
|
return i(), he(p, {
|
|
4405
4405
|
modelValue: y(Q),
|
|
4406
4406
|
"onUpdate:modelValue": a[9] || (a[9] = (x) => Is(Q) ? Q.value = x : null),
|
|
@@ -4444,12 +4444,12 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4444
4444
|
e("div", aa, [
|
|
4445
4445
|
P.value.value === "overview" ? (i(), h(De, { key: 0 }, [
|
|
4446
4446
|
e("div", null, [
|
|
4447
|
-
q(
|
|
4447
|
+
q(E, {
|
|
4448
4448
|
variant: "outlined",
|
|
4449
4449
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
4450
4450
|
}, {
|
|
4451
4451
|
default: me(() => {
|
|
4452
|
-
var Y, se, Se,
|
|
4452
|
+
var Y, se, Se, Fe, Ie, ge, pe, Pe, Ee, Le;
|
|
4453
4453
|
return [
|
|
4454
4454
|
e("div", la, [
|
|
4455
4455
|
e("div", ia, O(y(S)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
|
|
@@ -4459,12 +4459,12 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4459
4459
|
class: We(ee.value.statusClass),
|
|
4460
4460
|
compact: ""
|
|
4461
4461
|
}, null, 8, ["label", "class"]),
|
|
4462
|
-
|
|
4463
|
-
q(
|
|
4462
|
+
T.value ? (i(), h("div", ca, [
|
|
4463
|
+
q(G, {
|
|
4464
4464
|
name: "local_shipping",
|
|
4465
4465
|
color: "#666666"
|
|
4466
4466
|
}),
|
|
4467
|
-
e("span", da, O(
|
|
4467
|
+
e("span", da, O(T.value), 1)
|
|
4468
4468
|
])) : V("", !0)
|
|
4469
4469
|
])
|
|
4470
4470
|
]),
|
|
@@ -4484,9 +4484,9 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4484
4484
|
])) : V("", !0),
|
|
4485
4485
|
(jt = (Lt = s.purchaseOrder) == null ? void 0 : Lt.supplier) != null && jt._id ? (i(), h("div", ha, [
|
|
4486
4486
|
a[12] || (a[12] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Source Location ID ", -1)),
|
|
4487
|
-
e("span",
|
|
4487
|
+
e("span", ba, O(((Mt = (Ut = s.purchaseOrder) == null ? void 0 : Ut.supplier) == null ? void 0 : Mt.internal) != null ? `${(zt = (Bt = s.purchaseOrder) == null ? void 0 : Bt.supplier) == null ? void 0 : zt.internal}_` : "") + O((Ht = (Kt = s.purchaseOrder) == null ? void 0 : Kt.supplier) == null ? void 0 : Ht._id), 1)
|
|
4488
4488
|
])) : V("", !0),
|
|
4489
|
-
s.transferToDbName ? (i(), h("div",
|
|
4489
|
+
s.transferToDbName ? (i(), h("div", ga, [
|
|
4490
4490
|
a[13] || (a[13] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Destination Location ID ", -1)),
|
|
4491
4491
|
e("span", _a, O(s.transferToDbName), 1)
|
|
4492
4492
|
])) : V("", !0)
|
|
@@ -4510,15 +4510,15 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4510
4510
|
`inventory.transfer.receiveRequest.details.type.${B.value.toLocaleLowerCase("en-US")}`
|
|
4511
4511
|
)), 1)
|
|
4512
4512
|
]),
|
|
4513
|
-
(Ie = (
|
|
4513
|
+
(Ie = (Fe = s.purchaseOrder) == null ? void 0 : Fe.supplier) != null && Ie.name ? (i(), h("div", Ra, [
|
|
4514
4514
|
e("div", Pa, O(y(S)("inventory.transfer.receiveRequest.details.from")), 1),
|
|
4515
|
-
e("div", Fa, O((pe = (
|
|
4515
|
+
e("div", Fa, O((pe = (ge = s.purchaseOrder) == null ? void 0 : ge.supplier) == null ? void 0 : pe.name), 1)
|
|
4516
4516
|
])) : V("", !0),
|
|
4517
4517
|
s.transferTo ? (i(), h("div", Ia, [
|
|
4518
4518
|
e("div", Ta, O(y(S)("inventory.transfer.receiveRequest.details.to")), 1),
|
|
4519
4519
|
e("div", Ea, O(s.transferTo), 1)
|
|
4520
4520
|
])) : V("", !0),
|
|
4521
|
-
(
|
|
4521
|
+
(Pe = s.purchaseOrder) != null && Pe.ref ? (i(), h("div", qa, [
|
|
4522
4522
|
e("div", Va, O(y(S)("inventory.transfer.receiveRequest.details.reference")), 1),
|
|
4523
4523
|
e("div", La, O(s.purchaseOrder.ref), 1)
|
|
4524
4524
|
])) : V("", !0),
|
|
@@ -4558,11 +4558,11 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4558
4558
|
var Y, se;
|
|
4559
4559
|
return [
|
|
4560
4560
|
e("div", Ya, [
|
|
4561
|
-
(i(!0), h(De, null, Te((se = (Y = s.purchaseOrder) == null ? void 0 : Y.netSuite) == null ? void 0 : se.missingItems, (Se,
|
|
4561
|
+
(i(!0), h(De, null, Te((se = (Y = s.purchaseOrder) == null ? void 0 : Y.netSuite) == null ? void 0 : se.missingItems, (Se, Fe) => (i(), h("div", {
|
|
4562
4562
|
class: "flex justify-center align-middle",
|
|
4563
|
-
key:
|
|
4563
|
+
key: Fe
|
|
4564
4564
|
}, [
|
|
4565
|
-
q(
|
|
4565
|
+
q(G, {
|
|
4566
4566
|
name: "arrow_right",
|
|
4567
4567
|
size: "sm"
|
|
4568
4568
|
}),
|
|
@@ -4572,7 +4572,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4572
4572
|
];
|
|
4573
4573
|
}),
|
|
4574
4574
|
default: me(() => [
|
|
4575
|
-
q(
|
|
4575
|
+
q(G, {
|
|
4576
4576
|
name: "error",
|
|
4577
4577
|
color: "#ff2c2c",
|
|
4578
4578
|
size: "sm"
|
|
@@ -4592,8 +4592,8 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4592
4592
|
e("div", Ja, [
|
|
4593
4593
|
e("div", Xa, [
|
|
4594
4594
|
e("span", Za, O(Y.name), 1),
|
|
4595
|
-
|
|
4596
|
-
|
|
4595
|
+
b(Y) || W(Y) ? (i(), h("span", el, [
|
|
4596
|
+
b(Y) ? (i(), he(de, {
|
|
4597
4597
|
key: 0,
|
|
4598
4598
|
variant: "rich",
|
|
4599
4599
|
placement: "top",
|
|
@@ -4603,7 +4603,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4603
4603
|
e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Extra item (added during delivery) ", -1)
|
|
4604
4604
|
])),
|
|
4605
4605
|
default: me(() => [
|
|
4606
|
-
q(
|
|
4606
|
+
q(G, {
|
|
4607
4607
|
name: "add_circle",
|
|
4608
4608
|
color: "#6b7280",
|
|
4609
4609
|
size: "sm"
|
|
@@ -4611,24 +4611,24 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4611
4611
|
]),
|
|
4612
4612
|
_: 1
|
|
4613
4613
|
})) : V("", !0),
|
|
4614
|
-
|
|
4614
|
+
W(Y) ? (i(), he(de, {
|
|
4615
4615
|
key: 1,
|
|
4616
4616
|
variant: "rich",
|
|
4617
4617
|
placement: "top",
|
|
4618
4618
|
"z-index": 51
|
|
4619
4619
|
}, {
|
|
4620
4620
|
content: me(() => {
|
|
4621
|
-
var
|
|
4621
|
+
var Fe, Ie;
|
|
4622
4622
|
return [
|
|
4623
4623
|
e("div", tl, [
|
|
4624
4624
|
a[15] || (a[15] = e("div", { class: "font-semibold" }, "Submission changes", -1)),
|
|
4625
|
-
e("div", null, " Original Amount: " + O((
|
|
4625
|
+
e("div", null, " Original Amount: " + O((Fe = Z(Y)) == null ? void 0 : Fe.originalAmount), 1),
|
|
4626
4626
|
e("div", null, " New Amount: " + O((Ie = Z(Y)) == null ? void 0 : Ie.newAmount), 1)
|
|
4627
4627
|
])
|
|
4628
4628
|
];
|
|
4629
4629
|
}),
|
|
4630
4630
|
default: me(() => [
|
|
4631
|
-
q(
|
|
4631
|
+
q(G, {
|
|
4632
4632
|
name: "error",
|
|
4633
4633
|
color: "#ff9500",
|
|
4634
4634
|
size: "sm"
|
|
@@ -4662,11 +4662,11 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4662
4662
|
])
|
|
4663
4663
|
]),
|
|
4664
4664
|
default: me(() => {
|
|
4665
|
-
var
|
|
4665
|
+
var Fe;
|
|
4666
4666
|
return [
|
|
4667
4667
|
e("div", ul, [
|
|
4668
4668
|
e("span", cl, O(y(ut)(
|
|
4669
|
-
(
|
|
4669
|
+
(Fe = Y.totalCost) != null && Fe.amount ? Y.totalCost : y(v).controller.value.getItemCost(Y, y($e)()).cost
|
|
4670
4670
|
)), 1),
|
|
4671
4671
|
D(Y) ? V("", !0) : (i(), h("span", dl, [
|
|
4672
4672
|
a[17] || (a[17] = e("span", { class: "w-1.5 h-1.5 rounded-full bg-gray-400" }, null, -1)),
|
|
@@ -4719,10 +4719,10 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4719
4719
|
], 64)) : V("", !0)
|
|
4720
4720
|
])
|
|
4721
4721
|
])
|
|
4722
|
-
], 64)) : P.value.value === "deliveryHistory" ? (i(), h("div",
|
|
4722
|
+
], 64)) : P.value.value === "deliveryHistory" ? (i(), h("div", bl, [
|
|
4723
4723
|
L.value.length ? (i(), h("div", kl, [
|
|
4724
4724
|
(i(!0), h(De, null, Te(L.value, (Y, se) => {
|
|
4725
|
-
var Se,
|
|
4725
|
+
var Se, Fe, Ie, ge, pe;
|
|
4726
4726
|
return i(), h(De, { key: se }, [
|
|
4727
4727
|
e("div", xl, [
|
|
4728
4728
|
e("div", wl, [
|
|
@@ -4738,7 +4738,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4738
4738
|
}, null, 2)
|
|
4739
4739
|
]),
|
|
4740
4740
|
e("div", Cl, [
|
|
4741
|
-
Y.header === "Received" ? (i(), he(
|
|
4741
|
+
Y.header === "Received" ? (i(), he(G, {
|
|
4742
4742
|
key: 0,
|
|
4743
4743
|
name: "local_shipping",
|
|
4744
4744
|
outline: "",
|
|
@@ -4772,16 +4772,16 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4772
4772
|
o("update:show", !1), o("submitted");
|
|
4773
4773
|
})
|
|
4774
4774
|
}, null, 8, ["deliveryOrder", "purchaseOrder", "received-info-map"])) : V("", !0),
|
|
4775
|
-
(
|
|
4775
|
+
(Fe = (Se = Y.deliveryOrder) == null ? void 0 : Se.netSuite) != null && Fe.id ? (i(), he(rs, {
|
|
4776
4776
|
key: 1,
|
|
4777
4777
|
title: "Admin",
|
|
4778
4778
|
class: "min-w-[140px]"
|
|
4779
4779
|
}, {
|
|
4780
4780
|
default: me(() => {
|
|
4781
|
-
var
|
|
4781
|
+
var Pe, Ee;
|
|
4782
4782
|
return [
|
|
4783
4783
|
q(sa, {
|
|
4784
|
-
"netsuite-id": (Ee = (
|
|
4784
|
+
"netsuite-id": (Ee = (Pe = Y.deliveryOrder) == null ? void 0 : Pe.netSuite) == null ? void 0 : Ee.id
|
|
4785
4785
|
}, null, 8, ["netsuite-id"])
|
|
4786
4786
|
];
|
|
4787
4787
|
}),
|
|
@@ -4789,7 +4789,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4789
4789
|
}, 1024)) : V("", !0),
|
|
4790
4790
|
s.purchaseOrder && ((Ie = Y.deliveryOrder) != null && Ie.id) ? (i(), he(Qs, {
|
|
4791
4791
|
key: 2,
|
|
4792
|
-
"purchase-order-id": (
|
|
4792
|
+
"purchase-order-id": (ge = s.purchaseOrder) == null ? void 0 : ge._id,
|
|
4793
4793
|
"delivery-order-id": (pe = Y.deliveryOrder) == null ? void 0 : pe.id
|
|
4794
4794
|
}, null, 8, ["purchase-order-id", "delivery-order-id"])) : V("", !0)
|
|
4795
4795
|
])
|
|
@@ -4810,19 +4810,19 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4810
4810
|
])
|
|
4811
4811
|
]),
|
|
4812
4812
|
e("div", ql, [
|
|
4813
|
-
q(
|
|
4813
|
+
q(E, {
|
|
4814
4814
|
variant: "outlined",
|
|
4815
4815
|
class: "py-12 px-16"
|
|
4816
4816
|
}, {
|
|
4817
4817
|
default: me(() => [
|
|
4818
4818
|
e("div", Vl, [
|
|
4819
|
-
(i(!0), h(De, null, Te(Y.info, (
|
|
4819
|
+
(i(!0), h(De, null, Te(Y.info, (Pe, Ee) => (i(), h("div", {
|
|
4820
4820
|
key: Ee,
|
|
4821
4821
|
class: "flex flex-col gap-4"
|
|
4822
4822
|
}, [
|
|
4823
|
-
e("div", Ll, O(
|
|
4823
|
+
e("div", Ll, O(Pe == null ? void 0 : Pe.label), 1),
|
|
4824
4824
|
e("div", jl, [
|
|
4825
|
-
(i(!0), h(De, null, Te(
|
|
4825
|
+
(i(!0), h(De, null, Te(Pe == null ? void 0 : Pe.values, (Le, it) => (i(), h("div", {
|
|
4826
4826
|
key: it,
|
|
4827
4827
|
class: "fm-typo-en-body-lg-600"
|
|
4828
4828
|
}, [
|
|
@@ -4840,7 +4840,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4840
4840
|
])
|
|
4841
4841
|
], 64);
|
|
4842
4842
|
}), 128))
|
|
4843
|
-
])) : (i(), h("div",
|
|
4843
|
+
])) : (i(), h("div", gl, [
|
|
4844
4844
|
q(f),
|
|
4845
4845
|
e("div", null, [
|
|
4846
4846
|
e("img", {
|
|
@@ -4855,7 +4855,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4855
4855
|
]))
|
|
4856
4856
|
])) : P.value.value === "actionLogs" ? (i(), h("div", Ul, [
|
|
4857
4857
|
ve.value.length ? (i(), h("div", Kl, [
|
|
4858
|
-
(i(!0), h(De, null, Te(ve.value, (Y, se) => (i(), he(
|
|
4858
|
+
(i(!0), h(De, null, Te(ve.value, (Y, se) => (i(), he(E, {
|
|
4859
4859
|
key: se,
|
|
4860
4860
|
variant: "outlined",
|
|
4861
4861
|
class: "py-12 px-16"
|
|
@@ -4903,21 +4903,21 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4903
4903
|
variant: y(nt)[x].buttonVariant
|
|
4904
4904
|
}, null, 8, ["label", "onClick", "loading", "disabled", "variant"])) : V("", !0)
|
|
4905
4905
|
], 64))), 256)),
|
|
4906
|
-
y(
|
|
4906
|
+
y(I).ableToMarkReceived(s.purchaseOrder) && !Ae.value.includes("completeReceive") ? (i(), he(w, {
|
|
4907
4907
|
key: 0,
|
|
4908
4908
|
label: y(S)("inventory.transfer.receiveRequest.actions.completeReceive"),
|
|
4909
4909
|
onClick: a[5] || (a[5] = (x) => $("completeReceive")),
|
|
4910
4910
|
loading: oe.value === "completeReceive",
|
|
4911
4911
|
disabled: oe.value !== "completeReceive" && re.value
|
|
4912
4912
|
}, null, 8, ["label", "loading", "disabled"])) : V("", !0),
|
|
4913
|
-
y(
|
|
4913
|
+
y(I).ableToMarkApproved(s.purchaseOrder) && s.canApprove && !Ae.value.includes("approveRequest") ? (i(), he(w, {
|
|
4914
4914
|
key: 1,
|
|
4915
4915
|
label: y(S)("inventory.transfer.approval.actions.approveRequest"),
|
|
4916
4916
|
onClick: a[6] || (a[6] = (x) => $("approveRequest")),
|
|
4917
4917
|
loading: oe.value === "approveRequest",
|
|
4918
4918
|
disabled: oe.value !== "approveRequest" && re.value
|
|
4919
4919
|
}, null, 8, ["label", "loading", "disabled"])) : V("", !0),
|
|
4920
|
-
y(
|
|
4920
|
+
y(I).ableToCreateFulfillment(s.purchaseOrder, s.poRequest) && r.scope === "approval" ? (i(), he(w, {
|
|
4921
4921
|
key: 2,
|
|
4922
4922
|
label: y(S)("inventory.transfer.receiveRequest.actions.processRequest"),
|
|
4923
4923
|
onClick: a[7] || (a[7] = (x) => $("processRequest")),
|
|
@@ -4943,7 +4943,7 @@ export {
|
|
|
4943
4943
|
cr as b,
|
|
4944
4944
|
vs as c,
|
|
4945
4945
|
fs as d,
|
|
4946
|
-
|
|
4946
|
+
gs as e,
|
|
4947
4947
|
vt as f,
|
|
4948
4948
|
ds as g,
|
|
4949
4949
|
ys as h,
|