@feedmepos/mf-inventory-portal 1.8.0-dev.16 → 1.8.0-dev.17
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-xSsyvQV_.js → App-CRmKXhRV.js} +9 -9
- package/dist/{ApprovalView-DfJ0FAiD.js → ApprovalView-tDkNN-Cd.js} +9 -9
- package/dist/{BindingsDialog-oAZyjgrN.js → BindingsDialog-DrB0U9F6.js} +2 -2
- package/dist/{BindingsPicker-CEIo7myR.js → BindingsPicker-tjjgijNe.js} +2 -2
- package/dist/{BindingsTable-BKa-JYRR.js → BindingsTable-D7EGgWxE.js} +4 -4
- package/dist/{BulkReceiveRequestPage-C6Oyg5-E.js → BulkReceiveRequestPage-B7GEE9qI.js} +21 -21
- package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-BvleQo5y.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-B4j6Acmo.js} +1 -1
- package/dist/{ClosingDraftView-tJrjqyAC.js → ClosingDraftView-DH0eBMZ8.js} +19 -19
- package/dist/{ClosingHistoryView-CJQlK4Xc.js → ClosingHistoryView-FmdYCiLI.js} +7 -7
- package/dist/{ClosingTemplateView-DYRtdK5h.js → ClosingTemplateView-BGmFG2-y.js} +18 -18
- package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DEwi7wFf.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DHboInU_.js} +1 -1
- package/dist/{DefaultView-CxTBlkln.js → DefaultView-CsNlHUlf.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-Bywdjc2U.js → DeliveryOrderPrintPreview-CMe2DpP1.js} +2 -2
- package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-DcFAUTdO.js → EmailDialog.vue_vue_type_script_setup_true_lang-Yen9u78U.js} +7759 -7654
- package/dist/{FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-C8c6rmJv.js → FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-BJy8_H2s.js} +1 -1
- package/dist/{FeatureCapabilityGate-B41dULfm.js → FeatureCapabilityGate-DN8b1697.js} +2 -2
- package/dist/{FeaturePageGate.vue_vue_type_script_setup_true_lang-D4G6i1D6.js → FeaturePageGate.vue_vue_type_script_setup_true_lang-DmNFZYam.js} +1 -1
- package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-CnqH115V.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-2zOATqzb.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-QBviJzAO.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CVBUkN02.js} +2 -2
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BqHtzo20.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BuE-1qd6.js} +2 -2
- package/dist/{FmMultiselectDialog-M6CvNFW1.js → FmMultiselectDialog-C3B8pd2Z.js} +2 -2
- package/dist/{FmMultiselectDialog-CFNZMzlC.js → FmMultiselectDialog-LI5ekHzQ.js} +2 -2
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BGco50Ma.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DQZ7aJGJ.js} +113 -106
- package/dist/{ImportView-C2GOmpuK.js → ImportView-DYoeJLdr.js} +6 -6
- package/dist/{IngredientsView-wB9kGiOK.js → IngredientsView-u3KHfALO.js} +15 -15
- package/dist/{IntegrationExplorerView-BujwGE4q.js → IntegrationExplorerView-Bl0Z8sxM.js} +6 -6
- package/dist/{IntegrationPlatformView-Wnvj6-BG.js → IntegrationPlatformView-CybBB3RA.js} +2 -2
- package/dist/{IntegrationView-C77rSbpn.js → IntegrationView-Dxy7QhCp.js} +14 -14
- package/dist/{InventoryBindingForm-Bs7Duwfj.js → InventoryBindingForm-DyUvyOsa.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DawAEeuP.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-Dmch1sfA.js} +4 -4
- package/dist/{InventoryBindingSummary-BefkYWIr.js → InventoryBindingSummary-DwY3vUf_.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BpUMK6fj.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-B2UtnJtf.js} +2 -2
- package/dist/{ProductionRunDetailPage-CVx9LS-P.js → ProductionRunDetailPage-Cdi4hv3E.js} +4 -4
- package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-4aYz5NwS.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-D5jlF5x4.js} +988 -954
- package/dist/{ProductionRunPage-CuXzmWMc.js → ProductionRunPage-RcbHy0Mj.js} +4 -4
- package/dist/{PublishView-Bu8J6ndy.js → PublishView-CyJ_rE-5.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-DaslFe8u.js → PurchaseOrderPrintPreview-ZlbV3YfE.js} +2 -2
- package/dist/{ReceiveRequestView-CKPBpN4x.js → ReceiveRequestView-BKz8N6yK.js} +13 -13
- package/dist/{RecipeView-BeZ9ljtA.js → RecipeView-D3IEyQoK.js} +15 -15
- package/dist/{SettingsView-CWhMdNfn.js → SettingsView-A0eozTq3.js} +7 -7
- package/dist/{StockView-C5IhPGxi.js → StockView-DrxkHTH4.js} +25 -25
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-B9Rx_9b7.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CD11VzXa.js} +1 -1
- package/dist/{SupplierView-BSGajl9V.js → SupplierView-Cg60vwsj.js} +15 -14
- package/dist/{SurchargeView-DtAszxTN.js → SurchargeView-Dxvg-RnC.js} +7 -7
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-CfxroS8u.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-DDLGEaa2.js} +2 -2
- package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DfYoaT5a.js +332 -0
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-B_9i5LzY.js → TransferDetails.vue_vue_type_script_setup_true_lang-D3wClK8t.js} +1264 -1232
- package/dist/{TransferTemplateView-D6_AfMja.js → TransferTemplateView-DfCJzLHt.js} +945 -941
- package/dist/{UnitCostHistoryView-kisQehVE.js → UnitCostHistoryView-BkNnwNUc.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-DKoPNZoW.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-Clufqvr_.js} +4 -4
- package/dist/{UnitView-jSLennZW.js → UnitView-D_agG3Kd.js} +7 -7
- package/dist/{WarehouseView-CUdWJCMq.js → WarehouseView-DE_CaJCb.js} +8 -8
- package/dist/{WastageTemplateView--B0LSwHa.js → WastageTemplateView-r3b6angy.js} +15 -15
- package/dist/api/inventory.d.ts +9 -9
- package/dist/{app-Bb5HLWTu.js → app-CLTXsVH_.js} +26976 -25707
- package/dist/app.d.ts +48 -0
- package/dist/app.js +1 -1
- package/dist/{closing-template-CgDMayoo.js → closing-template-yP6QT_6M.js} +4 -4
- package/dist/components/FmUnitInputProps.d.ts +1 -0
- package/dist/components/MultiLocationSelector.vue.d.ts +6 -6
- package/dist/components/TemplatePublishDialog.d.ts +2 -0
- package/dist/components/TemplatePublishDialog.spec.d.ts +1 -0
- package/dist/composable/defineApi.d.ts +1 -1
- package/dist/{date2-D9gB9BE-.js → date2-9jq_OKuv.js} +1 -1
- package/dist/{dayjs.min-CumM_kH7.js → dayjs.min-CAxu5-hQ.js} +1 -1
- package/dist/{decimal-CVF1rRoj.js → decimal-BhGvDuWQ.js} +2 -2
- package/dist/{defineDeepModel-DE-DsQjm.js → defineDeepModel-Czbczabc.js} +1 -1
- package/dist/{duplicate-template-CFYtQfQn.js → duplicate-template-X72Zob-u.js} +1 -1
- package/dist/{feature-kti8bU8q.js → feature-CC2pF6VK.js} +2 -2
- package/dist/{format-time-from-id-CWZ5VGvM.js → format-time-from-id-DhZOfLN4.js} +1 -1
- package/dist/{format-unit-display-BlxdvskN.js → format-unit-display-BalKqHYj.js} +115 -113
- package/dist/{id-to-date-BaH_1Kui.js → id-to-date-Cb9v4BtX.js} +1 -1
- package/dist/{import-export.helper-8rKrOB0E.js → import-export.helper-9D5DLoaq.js} +5 -5
- package/dist/{index-B9p_OEdk.js → index-B0T8iGU6.js} +1 -1
- package/dist/{index-BHc3cNyz.js → index-CnjRz458.js} +3 -3
- package/dist/{index-MEUJonBr.js → index-DqV626Os.js} +1768 -1741
- package/dist/{lz-string-IiazGN0W.js → lz-string-CK_kK0b8.js} +1 -1
- package/dist/{netsuite-BeDxaeKM.js → netsuite-Czq6x14E.js} +2 -2
- package/dist/{netsuite-explorer-4IluitzS.js → netsuite-explorer-BugWV6N7.js} +1 -1
- package/dist/{predefined-templates-D4qVID1q.js → predefined-templates-D5qjNE4o.js} +1 -1
- package/dist/{purchase-order-template-GTOntq3C.js → purchase-order-template-Bc0QP-bq.js} +1 -1
- package/dist/{recalculationUtils-Dye8x2TO.js → recalculationUtils-CJknKvb-.js} +1 -1
- package/dist/{row-action.enum-CVJbq_-y.js → row-action.enum-Cz1k6Kht.js} +1 -1
- package/dist/{rules-Y3zXVj3i.js → rules-BQscySfb.js} +45 -40
- package/dist/{stock-BR8x3nlx.js → stock--68mu-M1.js} +1 -1
- package/dist/{stock-BIjTQFsR.js → stock-DCz3ZTmd.js} +2 -2
- package/dist/stores/integration/netsuite.d.ts +2 -2
- package/dist/stores/location.d.ts +42 -42
- package/dist/stores/supplier.d.ts +48 -48
- package/dist/stores/warehouse.d.ts +1 -1
- package/dist/{supplier-CbdCjiIB.js → supplier-U06ZrnoC.js} +2 -2
- package/dist/{surcharge-BoXLK6o0.js → surcharge-B5DGPlf5.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-C5h1AoPJ.js → uom-rules-DfBYytl6.js} +1 -1
- package/dist/{use-ingredient-select-dialog-D196q_qk.js → use-ingredient-select-dialog-BRTxaEaQ.js} +2 -2
- package/dist/{use-inventory-binding-dialog-B4IhhCjM.js → use-inventory-binding-dialog-DQDv8yOS.js} +2 -2
- package/dist/{use-template-enabled-locations-CDKP3kTS.js → use-template-enabled-locations-DzQVNhev.js} +2 -2
- package/dist/{use-transfer-locations-DE4vxSDp.js → use-transfer-locations-CGvKssyQ.js} +2 -2
- package/dist/{useHrmPermission-D1dkveCP.js → useHrmPermission-BkOtYcLu.js} +1 -1
- package/dist/{useNavigationMenu-N5_7da8m.js → useNavigationMenu-korDNdFf.js} +4 -4
- package/dist/{useSseClient-CKpNaz5g.js → useSseClient-BjoRcYKu.js} +1 -1
- package/dist/views/adjustment-template/wastage-template/actions.d.ts +36 -36
- package/dist/views/adjustment-template/wastage-template/table.d.ts +36 -36
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftApprovalDialog.vue.d.ts +6 -6
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +12 -12
- package/dist/views/closing-draft/components/closing-draft-groups/ClosingGroupDetailSideSheet.vue.d.ts +6 -6
- package/dist/views/closing-draft/composables/use-closing-draft-import.d.ts +3 -3
- package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +18 -18
- package/dist/views/closing-draft/helpers/draft-status-to-class-name.helper.d.ts +1 -1
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +45 -45
- package/dist/views/closing-template/composables/use-closing-template-table.d.ts +36 -36
- package/dist/views/integration/components/netsuite/business/AddLocationDialog.vue.d.ts +36 -36
- package/dist/views/integration/components/netsuite/business/AddVendorDialog.vue.d.ts +24 -24
- package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +5 -5
- package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +5 -5
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +39 -39
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +35 -35
- package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.d.ts +34 -34
- package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-table.d.ts +6 -6
- package/dist/views/supplier/components/SupplierForm.vue.d.ts +4 -4
- package/dist/views/supplier/composables/use-supplier-table.d.ts +2 -2
- package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +8 -8
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +4 -4
- package/dist/views/transfer-template/composables/use-template-item-bulk-editor.d.ts +24 -24
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +48 -48
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +48 -48
- package/dist/views/transfer-template/helpers/template-item.error.helper.spec.d.ts +1 -0
- package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +2 -2
- package/dist/{vue-CxSKQOrZ.js → vue-hPU91AHR.js} +2 -2
- package/dist/{vue-i18n-CTR_IUvd.js → vue-i18n-VFYpKHHB.js} +158 -158
- package/dist/{xlsx.util-J9pxGRQD.js → xlsx.util-VlHt05TU.js} +2 -2
- package/package.json +5 -5
- package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CTj_jYK1.js +0 -299
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { f as lt, p as ks } from "./format-time-from-id-
|
|
2
|
-
import { defineComponent as Ve, ref as
|
|
1
|
+
import { f as lt, p as ks } from "./format-time-from-id-DhZOfLN4.js";
|
|
2
|
+
import { defineComponent as Ve, ref as ae, watch as Qe, createElementBlock as y, openBlock as i, createCommentVNode as V, createElementVNode as e, withDirectives as xs, toDisplayString as x, unref as b, vModelText as ws, toRaw as $s, shallowRef as dt, onUnmounted as os, triggerRef as Cs, computed as H, getCurrentScope as As, onScopeDispose as Ns, readonly as Ds, h as ie, resolveComponent as ue, createVNode as q, Fragment as De, renderList as Te, reactive as Rs, onMounted as ns, createBlock as he, withCtx as pe, createTextVNode as Xe, normalizeClass as Ge, renderSlot as Ps, isRef as Fs, resolveDynamicComponent as Is } 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 Fe, q as Ce, H as st, d as Ts, u as ze, $ as
|
|
6
|
-
import { h as Pt, a as js, t as Us, b as et } from "./date2-
|
|
7
|
-
import { l as Ms, a as $e, t as We, d as ut } from "./rules-
|
|
8
|
-
import { F as Be, u as Ye, c as Bs, d as Yt, e as St } from "./feature-
|
|
9
|
-
import { L as zs } from "./lz-string-
|
|
4
|
+
import { D as qe, R as Ne } from "./row-action.enum-Cz1k6Kht.js";
|
|
5
|
+
import { s as Fe, q as Ce, H as st, d as Ts, u as ze, $ as K, a4 as as, a5 as yt, _ as Oe, a as Dt, a6 as Wt, a7 as Es, a8 as qs, G as Vs, t as Rt, c as wt, O as Qt, a9 as ls, r as at, C as je, B as mt, aa as Ls } from "./app-CLTXsVH_.js";
|
|
6
|
+
import { h as Pt, a as js, t as Us, b as et } from "./date2-9jq_OKuv.js";
|
|
7
|
+
import { l as Ms, a as $e, t as We, d as ut } from "./rules-BQscySfb.js";
|
|
8
|
+
import { F as Be, u as Ye, c as Bs, d as Yt, e as St } from "./feature-CC2pF6VK.js";
|
|
9
|
+
import { L as zs } from "./lz-string-CK_kK0b8.js";
|
|
10
10
|
import { useI18n as ht, useCoreStore as bt } from "@feedmepos/mf-common";
|
|
11
11
|
import { useDialog as gt, useSnackbar as Je, components as pt, FmButtonVariant as Ue, useProxiedModel as Ks } from "@feedmepos/ui-library";
|
|
12
|
-
import { u as _t, a as Ft, S as Me } from "./netsuite-
|
|
12
|
+
import { u as _t, a as Ft, S as Me } from "./netsuite-Czq6x14E.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 Hs, b as Gs, f as ft } from "./format-unit-display-
|
|
16
|
-
import { u as Ze, _ as Ws } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-
|
|
17
|
-
import { F as Qs } 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 Hs, b as Gs, f as ft } from "./format-unit-display-BalKqHYj.js";
|
|
16
|
+
import { u as Ze, _ as Ws } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-DDLGEaa2.js";
|
|
17
|
+
import { F as Qs } from "./FeatureCapabilityGate-DN8b1697.js";
|
|
18
|
+
import { _ as Ys, a as Js, b as Xs } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-DQZ7aJGJ.js";
|
|
19
|
+
import { e as Zs } from "./index-CnjRz458.js";
|
|
20
|
+
import { i as er } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-2zOATqzb.js";
|
|
21
21
|
import { F as Xt } from "./form-mode.enum-BKiNVH6A.js";
|
|
22
|
-
import { u as is } 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 us } from "./defineDeepModel-
|
|
27
|
-
import { u as lr } from "./vue-i18n-
|
|
28
|
-
import { u as ir } from "./useHrmPermission-
|
|
22
|
+
import { u as is } from "./supplier-U06ZrnoC.js";
|
|
23
|
+
import { u as tr } from "./surcharge-B5DGPlf5.js";
|
|
24
|
+
import { f as sr, h as rr, r as or, s as nr } from "./predefined-templates-D5qjNE4o.js";
|
|
25
|
+
import { F as ar } from "./decimal-BhGvDuWQ.js";
|
|
26
|
+
import { d as us } from "./defineDeepModel-Czbczabc.js";
|
|
27
|
+
import { u as lr } from "./vue-i18n-VFYpKHHB.js";
|
|
28
|
+
import { u as ir } from "./useHrmPermission-BkOtYcLu.js";
|
|
29
29
|
function cs(u, t) {
|
|
30
30
|
return t.reduce(
|
|
31
31
|
(o, m) => {
|
|
@@ -58,11 +58,11 @@ function ds(u) {
|
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
function ur(u) {
|
|
61
|
-
var
|
|
62
|
-
const { po: t, currentLocation: r, business: o, fulfilling: m, por: c } = u, d = r.doc.profile || {}, { name: n, address: l, regNo:
|
|
61
|
+
var xe, Ae, Q, ye, P, O, g;
|
|
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,
|
|
65
|
-
registrationNumber:
|
|
65
|
+
registrationNumber: C || void 0,
|
|
66
66
|
line1: (l == null ? void 0 : l.line1) || "",
|
|
67
67
|
line2: (l == null ? void 0 : l.line2) || void 0,
|
|
68
68
|
postcode: (l == null ? void 0 : l.postcode) || "",
|
|
@@ -73,54 +73,54 @@ function ur(u) {
|
|
|
73
73
|
name: t.supplier.name,
|
|
74
74
|
phoneNumber: t.supplier.phoneNumber || void 0,
|
|
75
75
|
registrationNumber: t.supplier.registrationNumber || void 0,
|
|
76
|
-
line1: ((
|
|
76
|
+
line1: ((xe = t.supplier.address) == null ? void 0 : xe.line1) || "",
|
|
77
77
|
line2: ((Ae = t.supplier.address) == null ? void 0 : Ae.line2) || void 0,
|
|
78
78
|
postcode: ((Q = t.supplier.address) == null ? void 0 : Q.postcode) || "",
|
|
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
|
-
country: ((
|
|
82
|
-
}, T = ds(t),
|
|
83
|
-
var
|
|
84
|
-
const { sku:
|
|
85
|
-
cs(
|
|
81
|
+
country: ((O = t.supplier.address) == null ? void 0 : O.country) || ""
|
|
82
|
+
}, T = ds(t), S = [], B = t.items.filter(($) => $.sku).map(($) => {
|
|
83
|
+
var te;
|
|
84
|
+
const { sku: j, measurement: J } = $, ee = $e(
|
|
85
|
+
cs($.sku, t.deliveryOrder || []),
|
|
86
86
|
!1
|
|
87
|
-
),
|
|
88
|
-
return
|
|
89
|
-
code:
|
|
90
|
-
description:
|
|
91
|
-
quantity: $e(
|
|
92
|
-
unit: (
|
|
93
|
-
received:
|
|
94
|
-
unitCost:
|
|
95
|
-
value:
|
|
87
|
+
), L = T($);
|
|
88
|
+
return L && S.push(L), {
|
|
89
|
+
code: j.code,
|
|
90
|
+
description: j.name,
|
|
91
|
+
quantity: $e($.quantity, !1),
|
|
92
|
+
unit: (J == null ? void 0 : J.abbrev) || ((te = j.unit) == null ? void 0 : te.abbrev) || "",
|
|
93
|
+
received: ee,
|
|
94
|
+
unitCost: L ? `${L.currency} ${Be.toFormatString({
|
|
95
|
+
value: $.quantity.amount === 0 ? Be.fromNumber(0) : Be.divide([L, $.quantity])
|
|
96
96
|
})}` : void 0,
|
|
97
|
-
cost:
|
|
98
|
-
value:
|
|
97
|
+
cost: L ? `${L.currency} ${Be.toFormatString({
|
|
98
|
+
value: L
|
|
99
99
|
})}` : void 0
|
|
100
100
|
};
|
|
101
|
-
}), E =
|
|
102
|
-
value:
|
|
103
|
-
})}` : void 0,
|
|
104
|
-
createdAt: Pt(new Date(
|
|
105
|
-
ref:
|
|
106
|
-
remark:
|
|
107
|
-
items: (
|
|
108
|
-
var
|
|
101
|
+
}), E = S.length ? `${S[0].currency} ${Be.toFormatString({
|
|
102
|
+
value: S.reduce(($, j) => Be.add([$, j]), Be.reset())
|
|
103
|
+
})}` : void 0, re = (t.deliveryOrder || []).map(($) => ({
|
|
104
|
+
createdAt: Pt(new Date($.createdAt)),
|
|
105
|
+
ref: $.deliveryOrderNumber,
|
|
106
|
+
remark: $.remark || "",
|
|
107
|
+
items: ($.received || []).map((j) => {
|
|
108
|
+
var J, ee, L, te, _e;
|
|
109
109
|
return {
|
|
110
|
-
code: ((
|
|
111
|
-
description: ((
|
|
112
|
-
quantity: $e(
|
|
113
|
-
unit: ((
|
|
110
|
+
code: ((J = j.sku) == null ? void 0 : J.code) || "",
|
|
111
|
+
description: ((ee = j.sku) == null ? void 0 : ee.name) || "",
|
|
112
|
+
quantity: $e(j.amount),
|
|
113
|
+
unit: ((L = j.measurement) == null ? void 0 : L.abbrev) || ((_e = (te = j.sku) == null ? void 0 : te.unit) == null ? void 0 : _e.abbrev) || ""
|
|
114
114
|
};
|
|
115
115
|
})
|
|
116
116
|
}));
|
|
117
|
-
let
|
|
118
|
-
if (t.supplier.internal ? (
|
|
119
|
-
const
|
|
120
|
-
r.dbName ===
|
|
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), (g = c == null ? void 0 : c.from) != null && g.dbName) {
|
|
119
|
+
const $ = c.from.dbName;
|
|
120
|
+
r.dbName === $ || (X = "Inventory Receive Note", oe = st.Enum.goodsReceivedNote);
|
|
121
121
|
}
|
|
122
122
|
const be = {
|
|
123
|
-
title:
|
|
123
|
+
title: X,
|
|
124
124
|
businessName: o == null ? void 0 : o.name,
|
|
125
125
|
logo: o == null ? void 0 : o.thumbnail,
|
|
126
126
|
orderNumber: t.seqNumber.toString(),
|
|
@@ -129,18 +129,18 @@ function ur(u) {
|
|
|
129
129
|
remark: t.remark || "",
|
|
130
130
|
buyer: D,
|
|
131
131
|
supplier: R,
|
|
132
|
-
items:
|
|
132
|
+
items: B,
|
|
133
133
|
grandTotal: E,
|
|
134
134
|
status: t.status,
|
|
135
|
-
deliveryOrders:
|
|
136
|
-
},
|
|
137
|
-
return
|
|
135
|
+
deliveryOrders: re
|
|
136
|
+
}, ce = m && (t.deliveryFullfillment || []).length > 0;
|
|
137
|
+
return ce && (oe = st.Enum.deliveryOrder), { printData: be, templateType: oe, isDeliveryPrint: ce };
|
|
138
138
|
}
|
|
139
139
|
function ms(u) {
|
|
140
140
|
var v;
|
|
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,
|
|
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>/), T = R ? `<style>${R[1]}</style>` : "",
|
|
143
|
+
const D = or(n, t), R = D.match(/<style>([\s\S]*?)<\/style>/), T = R ? `<style>${R[1]}</style>` : "", S = D.replace(/<style>[\s\S]*?<\/style>/, "");
|
|
144
144
|
return {
|
|
145
145
|
html: `<!DOCTYPE html>
|
|
146
146
|
<html>
|
|
@@ -156,10 +156,10 @@ function ms(u) {
|
|
|
156
156
|
</style>
|
|
157
157
|
${T}
|
|
158
158
|
</head>
|
|
159
|
-
<body>${
|
|
159
|
+
<body>${S}</body>
|
|
160
160
|
</html>`,
|
|
161
161
|
templateName: l,
|
|
162
|
-
isDefault:
|
|
162
|
+
isDefault: C
|
|
163
163
|
};
|
|
164
164
|
} catch {
|
|
165
165
|
return alert("Failed to render print template. Please try recreating the template."), null;
|
|
@@ -183,7 +183,7 @@ const cr = Ts((u, t) => {
|
|
|
183
183
|
}
|
|
184
184
|
};
|
|
185
185
|
}), ps = {
|
|
186
|
-
[
|
|
186
|
+
[K.enum.confirmDraft]: {
|
|
187
187
|
primaryActions: {
|
|
188
188
|
text: "Confirm draft",
|
|
189
189
|
close: !0
|
|
@@ -192,7 +192,7 @@ const cr = Ts((u, t) => {
|
|
|
192
192
|
message: "Purchase order cannot be changed after confirm draft.",
|
|
193
193
|
successMessage: "Purchase order draft has been confirmed"
|
|
194
194
|
},
|
|
195
|
-
[
|
|
195
|
+
[K.enum.cancelDraft]: {
|
|
196
196
|
primaryActions: {
|
|
197
197
|
text: "Cancel draft",
|
|
198
198
|
close: !0,
|
|
@@ -202,7 +202,7 @@ const cr = Ts((u, t) => {
|
|
|
202
202
|
message: "Purchase order cannot be changed after cancelled draft.",
|
|
203
203
|
successMessage: "Purchase order draft has been cancelled"
|
|
204
204
|
},
|
|
205
|
-
[
|
|
205
|
+
[K.enum.approveDraft]: {
|
|
206
206
|
primaryActions: {
|
|
207
207
|
text: "Approve draft",
|
|
208
208
|
close: !0
|
|
@@ -211,7 +211,7 @@ const cr = Ts((u, t) => {
|
|
|
211
211
|
message: "Purchase order request will be accepted.",
|
|
212
212
|
successMessage: "Purchase order has been approved"
|
|
213
213
|
},
|
|
214
|
-
[
|
|
214
|
+
[K.enum.rejectDraft]: {
|
|
215
215
|
primaryActions: {
|
|
216
216
|
text: "Reject draft",
|
|
217
217
|
close: !0
|
|
@@ -220,7 +220,7 @@ const cr = Ts((u, t) => {
|
|
|
220
220
|
message: "Purchase order request will be rejected. You may provide an optional reason for rejection.",
|
|
221
221
|
successMessage: "Purchase order has been rejected"
|
|
222
222
|
},
|
|
223
|
-
[
|
|
223
|
+
[K.enum.submitRequest]: {
|
|
224
224
|
primaryActions: {
|
|
225
225
|
text: "Submit request",
|
|
226
226
|
close: !0
|
|
@@ -229,7 +229,7 @@ const cr = Ts((u, t) => {
|
|
|
229
229
|
message: "Purchase order cannot be changed after confirm draft.",
|
|
230
230
|
successMessage: "Purchase order draft has been submitted"
|
|
231
231
|
},
|
|
232
|
-
[
|
|
232
|
+
[K.enum.completeReceive]: {
|
|
233
233
|
primaryActions: {
|
|
234
234
|
text: "Mark received",
|
|
235
235
|
close: !0
|
|
@@ -238,7 +238,7 @@ const cr = Ts((u, t) => {
|
|
|
238
238
|
message: "Purchase order cannot be changed after it has complete receiving.",
|
|
239
239
|
successMessage: "Purchase order has been marked as received"
|
|
240
240
|
},
|
|
241
|
-
[
|
|
241
|
+
[K.enum.approveRequest]: {
|
|
242
242
|
primaryActions: {
|
|
243
243
|
text: "Accept request",
|
|
244
244
|
close: !0
|
|
@@ -247,7 +247,7 @@ const cr = Ts((u, t) => {
|
|
|
247
247
|
message: "Transfer out request will be accepted.",
|
|
248
248
|
successMessage: "Transfer out request has been approved"
|
|
249
249
|
},
|
|
250
|
-
[
|
|
250
|
+
[K.enum.rejectRequest]: {
|
|
251
251
|
primaryActions: {
|
|
252
252
|
text: "Reject request",
|
|
253
253
|
close: !0,
|
|
@@ -257,7 +257,7 @@ const cr = Ts((u, t) => {
|
|
|
257
257
|
message: "Purchase order will be rejected.",
|
|
258
258
|
successMessage: "Purchase order has been rejected"
|
|
259
259
|
},
|
|
260
|
-
[
|
|
260
|
+
[K.enum.processRequest]: {
|
|
261
261
|
primaryActions: {
|
|
262
262
|
text: "Process request",
|
|
263
263
|
close: !0,
|
|
@@ -278,7 +278,7 @@ const cr = Ts((u, t) => {
|
|
|
278
278
|
onChange: { type: Function }
|
|
279
279
|
},
|
|
280
280
|
setup(u) {
|
|
281
|
-
const t = u, { t: r } = ht(), o =
|
|
281
|
+
const t = u, { t: r } = ht(), o = ae("");
|
|
282
282
|
Qe(o, (c) => {
|
|
283
283
|
var d;
|
|
284
284
|
(d = t.onChange) == null || d.call(t, c ?? "");
|
|
@@ -287,8 +287,8 @@ const cr = Ts((u, t) => {
|
|
|
287
287
|
o.value = "";
|
|
288
288
|
}
|
|
289
289
|
return (c, d) => (i(), y("div", dr, [
|
|
290
|
-
t.message ? (i(), y("div", mr,
|
|
291
|
-
e("label", pr,
|
|
290
|
+
t.message ? (i(), y("div", mr, x(t.message), 1)) : V("", !0),
|
|
291
|
+
e("label", pr, x(b(r)("inventory.transfer.receiveRequest.details.rejectionReason")) + " (" + x(b(r)("inventory.common.optional")) + ")", 1),
|
|
292
292
|
xs(e("textarea", {
|
|
293
293
|
"onUpdate:modelValue": d[0] || (d[0] = (n) => o.value = n),
|
|
294
294
|
rows: "4",
|
|
@@ -331,9 +331,9 @@ function $t(u) {
|
|
|
331
331
|
});
|
|
332
332
|
}
|
|
333
333
|
function Ct(u, t, r) {
|
|
334
|
-
if (!
|
|
334
|
+
if (!Oe.safeParse(u).success)
|
|
335
335
|
throw new Error(`Invalid purchase order status: ${u}`);
|
|
336
|
-
const o =
|
|
336
|
+
const o = Oe.parse(u);
|
|
337
337
|
return yt.orderStatusCombination({
|
|
338
338
|
status: o,
|
|
339
339
|
isPOPartialReceive: t,
|
|
@@ -344,7 +344,7 @@ function vs() {
|
|
|
344
344
|
const u = ze(), t = Ze(), r = Ye();
|
|
345
345
|
async function o(c, d) {
|
|
346
346
|
const n = u.currentLocationDBName;
|
|
347
|
-
return c.doc.supplier.internal && c.operation ===
|
|
347
|
+
return c.doc.supplier.internal && c.operation === K.enum.confirmDraft && (c.operation = K.enum.submitRequest), await t.processPurchaseOrder(c, d || n);
|
|
348
348
|
}
|
|
349
349
|
async function m(c, d) {
|
|
350
350
|
const n = u.currentLocationDBName;
|
|
@@ -398,13 +398,13 @@ function hs(u) {
|
|
|
398
398
|
};
|
|
399
399
|
}
|
|
400
400
|
function es(u, t, r, o, m) {
|
|
401
|
-
const c = He(u.suppliers ?? []).map(hs), d = He(t.allLocations ?? []).map(Zt), n = t._currentLocation ? Zt(He(t._currentLocation)) : null, l = r.inventory ? [He(r.inventory)] : [],
|
|
401
|
+
const c = He(u.suppliers ?? []).map(hs), d = He(t.allLocations ?? []).map(Zt), n = t._currentLocation ? Zt(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,
|
|
405
405
|
currentLocation: n,
|
|
406
406
|
inventoryDoc: l,
|
|
407
|
-
netSuiteSetting:
|
|
407
|
+
netSuiteSetting: C,
|
|
408
408
|
surcharges: v
|
|
409
409
|
};
|
|
410
410
|
}
|
|
@@ -421,23 +421,23 @@ function bs() {
|
|
|
421
421
|
n.value = d.value.state();
|
|
422
422
|
};
|
|
423
423
|
d.value.addListener(l);
|
|
424
|
-
const
|
|
424
|
+
const C = (R, T, S) => {
|
|
425
425
|
switch (R) {
|
|
426
426
|
case Ot.set:
|
|
427
|
-
Wt(n.value, T,
|
|
427
|
+
Wt(n.value, T, S);
|
|
428
428
|
break;
|
|
429
429
|
case Ot.add:
|
|
430
|
-
qs(n.value, T,
|
|
430
|
+
qs(n.value, T, S);
|
|
431
431
|
break;
|
|
432
432
|
case Ot.delete:
|
|
433
433
|
Es(n.value, T);
|
|
434
434
|
break;
|
|
435
435
|
default:
|
|
436
|
-
console.warn(`Unknown partial update operation: ${R}, falling back to 'set'`), Wt(n.value, T,
|
|
436
|
+
console.warn(`Unknown partial update operation: ${R}, falling back to 'set'`), Wt(n.value, T, S);
|
|
437
437
|
}
|
|
438
438
|
T !== "remark" && T !== "ref" && Cs(n);
|
|
439
439
|
};
|
|
440
|
-
d.value.addPartialListener(
|
|
440
|
+
d.value.addPartialListener(C);
|
|
441
441
|
function v() {
|
|
442
442
|
const R = es(
|
|
443
443
|
u,
|
|
@@ -466,38 +466,38 @@ function bs() {
|
|
|
466
466
|
},
|
|
467
467
|
{ deep: !0 }
|
|
468
468
|
), os(() => {
|
|
469
|
-
d.value.removeListener(l), d.value.removePartialListener(
|
|
469
|
+
d.value.removeListener(l), d.value.removePartialListener(C);
|
|
470
470
|
});
|
|
471
471
|
function D(R) {
|
|
472
472
|
var T;
|
|
473
473
|
if (R != null && R._id) {
|
|
474
|
-
const
|
|
474
|
+
const S = /* @__PURE__ */ new Set(["1", "2"]), B = R, E = B.supplier, re = E != null ? hs(E) : { _id: "", name: "", registrationNumber: "", address: { ...ys } }, oe = {
|
|
475
475
|
...R,
|
|
476
|
-
version:
|
|
477
|
-
supplier:
|
|
476
|
+
version: S.has(R.version) ? R.version : null,
|
|
477
|
+
supplier: re,
|
|
478
478
|
// items/deliveryOrder may be absent or contain null/corrupted elements.
|
|
479
479
|
// The Dart bridge has no null guards on sku, sku.unit, and quantity —
|
|
480
480
|
// all three produce "Uncaught (in promise) TypeError: $index on null".
|
|
481
|
-
items: (
|
|
482
|
-
if (
|
|
483
|
-
const
|
|
484
|
-
return
|
|
481
|
+
items: (B.items ?? []).filter((X) => {
|
|
482
|
+
if (X == null || X.sku == null || typeof X.sku != "object") return !1;
|
|
483
|
+
const le = X;
|
|
484
|
+
return le.sku.unit != null && le.quantity != null && typeof le.quantity == "object";
|
|
485
485
|
}),
|
|
486
486
|
// received[].sku/sku.unit/amount have the exact same Dart-bridge null-guard
|
|
487
487
|
// gap as items[].sku/sku.unit/quantity above — filter the same way.
|
|
488
|
-
deliveryOrder: (
|
|
489
|
-
...
|
|
490
|
-
received: (
|
|
491
|
-
if (
|
|
492
|
-
const be =
|
|
488
|
+
deliveryOrder: (B.deliveryOrder ?? []).filter((X) => X != null).map((X) => ({
|
|
489
|
+
...X,
|
|
490
|
+
received: (X.received ?? []).filter((le) => {
|
|
491
|
+
if (le == null || le.sku == null || typeof le.sku != "object") return !1;
|
|
492
|
+
const be = le;
|
|
493
493
|
return be.sku.unit != null && be.amount != null && typeof be.amount == "object";
|
|
494
494
|
})
|
|
495
495
|
}))
|
|
496
496
|
};
|
|
497
497
|
try {
|
|
498
|
-
d.value.loadPurchaseOrder(
|
|
499
|
-
} catch (
|
|
500
|
-
console.error("[PurchaseOrderFormController] loadPurchaseOrder failed",
|
|
498
|
+
d.value.loadPurchaseOrder(oe);
|
|
499
|
+
} catch (X) {
|
|
500
|
+
console.error("[PurchaseOrderFormController] loadPurchaseOrder failed", X);
|
|
501
501
|
}
|
|
502
502
|
return;
|
|
503
503
|
}
|
|
@@ -514,53 +514,53 @@ function bs() {
|
|
|
514
514
|
};
|
|
515
515
|
}
|
|
516
516
|
var At = /* @__PURE__ */ ((u) => (u.RECEIVE_REQUEST = "receive/request", u.APPROVAL = "approval", u))(At || {});
|
|
517
|
-
const ot =
|
|
517
|
+
const ot = ae(), kt = ae(), xt = ae();
|
|
518
518
|
function ki(u, t) {
|
|
519
|
-
const r = gt(), o = ze(), m = Ye(), c = is(), d = bt(), n = Hs(), l = Gs(),
|
|
519
|
+
const r = gt(), o = ze(), m = Ye(), c = is(), d = bt(), n = Hs(), l = Gs(), C = ae(!1), v = Je(), D = Ze(), R = cr(), T = ae(new Array()), S = ae(new Array()), B = ae(
|
|
520
520
|
t != null && t.startDate && (t != null && t.endDate) ? t : er()
|
|
521
|
-
), E =
|
|
522
|
-
const F = new Date(
|
|
521
|
+
), E = H(() => {
|
|
522
|
+
const F = new Date(B.value.startDate), h = new Date(B.value.endDate);
|
|
523
523
|
return {
|
|
524
524
|
start: Us(F).toISOString(),
|
|
525
525
|
end: js(h).toISOString()
|
|
526
526
|
};
|
|
527
|
-
}),
|
|
528
|
-
let
|
|
527
|
+
}), re = ae(new Array()), oe = Vs(), X = ae(null);
|
|
528
|
+
let le = null, be = null;
|
|
529
529
|
As() && Ns(() => {
|
|
530
|
-
|
|
530
|
+
le == null || le.abort(), be == null || be.abort();
|
|
531
531
|
});
|
|
532
|
-
async function
|
|
533
|
-
var
|
|
532
|
+
async function ce(F) {
|
|
533
|
+
var ne, ve, s;
|
|
534
534
|
be == null || be.abort();
|
|
535
535
|
const h = new AbortController();
|
|
536
536
|
be = h;
|
|
537
|
-
const
|
|
537
|
+
const _ = (ne = o._currentLocation) == null ? void 0 : ne.dbName, z = await m.awaitLocationFeatures(_, {
|
|
538
538
|
signal: h.signal,
|
|
539
539
|
retryOnError: !0
|
|
540
540
|
});
|
|
541
|
-
if (h.signal.aborted || ((ve = o._currentLocation) == null ? void 0 : ve.dbName) !==
|
|
542
|
-
if (
|
|
543
|
-
|
|
541
|
+
if (h.signal.aborted || ((ve = o._currentLocation) == null ? void 0 : ve.dbName) !== _) return;
|
|
542
|
+
if (z !== "ready") {
|
|
543
|
+
z === "error" && ye();
|
|
544
544
|
return;
|
|
545
545
|
}
|
|
546
546
|
function G(a) {
|
|
547
|
-
var
|
|
548
|
-
if (h.signal.aborted || ((
|
|
549
|
-
const
|
|
547
|
+
var A;
|
|
548
|
+
if (h.signal.aborted || ((A = o._currentLocation) == null ? void 0 : A.dbName) !== _) return;
|
|
549
|
+
const w = {
|
|
550
550
|
mode: Xt.CREATE,
|
|
551
551
|
modelValue: F || void 0,
|
|
552
552
|
show: !0,
|
|
553
|
-
"onUpdate:show"(
|
|
554
|
-
ot.value.show =
|
|
553
|
+
"onUpdate:show"(N) {
|
|
554
|
+
ot.value.show = N;
|
|
555
555
|
},
|
|
556
556
|
templateId: a,
|
|
557
|
-
lastClosingDate:
|
|
557
|
+
lastClosingDate: X.value
|
|
558
558
|
};
|
|
559
|
-
ot.value =
|
|
559
|
+
ot.value = w;
|
|
560
560
|
}
|
|
561
|
-
let
|
|
561
|
+
let Z;
|
|
562
562
|
if (m.mustUsePoTemplate && !(F != null && F.template)) {
|
|
563
|
-
if (await l.fetchTemplates(), h.signal.aborted || ((s = o._currentLocation) == null ? void 0 : s.dbName) !==
|
|
563
|
+
if (await l.fetchTemplates(), h.signal.aborted || ((s = o._currentLocation) == null ? void 0 : s.dbName) !== _) return;
|
|
564
564
|
r.open({
|
|
565
565
|
title: "Create transfer",
|
|
566
566
|
message: "",
|
|
@@ -574,22 +574,22 @@ function ki(u, t) {
|
|
|
574
574
|
close: !0
|
|
575
575
|
}
|
|
576
576
|
}).onPrimary(async () => {
|
|
577
|
-
|
|
577
|
+
Z = await n.getTemplateId(), Z && G(Z);
|
|
578
578
|
}).onSecondary(() => {
|
|
579
579
|
G(void 0);
|
|
580
580
|
});
|
|
581
581
|
} else
|
|
582
|
-
G(
|
|
582
|
+
G(Z);
|
|
583
583
|
}
|
|
584
|
-
function
|
|
584
|
+
function xe(F) {
|
|
585
585
|
const h = {
|
|
586
586
|
mode: Xt.UPDATE,
|
|
587
587
|
modelValue: wt(F),
|
|
588
588
|
show: !0,
|
|
589
|
-
"onUpdate:show"(
|
|
590
|
-
ot.value.show =
|
|
589
|
+
"onUpdate:show"(_) {
|
|
590
|
+
ot.value.show = _;
|
|
591
591
|
},
|
|
592
|
-
lastClosingDate:
|
|
592
|
+
lastClosingDate: X.value
|
|
593
593
|
};
|
|
594
594
|
ot.value = h;
|
|
595
595
|
}
|
|
@@ -597,58 +597,58 @@ function ki(u, t) {
|
|
|
597
597
|
if (!d.currentBusiness.value) return;
|
|
598
598
|
const h = o.currentLocation;
|
|
599
599
|
if (h.type === "restaurant") {
|
|
600
|
-
const
|
|
601
|
-
|
|
600
|
+
const ne = o.locationRestaurantFromCore(h.doc._id);
|
|
601
|
+
ne !== null && (h.doc = ne);
|
|
602
602
|
}
|
|
603
|
-
const
|
|
603
|
+
const _ = ms({
|
|
604
604
|
po: F,
|
|
605
605
|
currentLocation: h,
|
|
606
606
|
business: d.currentBusiness.value,
|
|
607
607
|
fulfilling: u === "approval",
|
|
608
608
|
por: F.request
|
|
609
609
|
});
|
|
610
|
-
if (!
|
|
611
|
-
const
|
|
610
|
+
if (!_) return;
|
|
611
|
+
const z = nr(_.html), G = c.supplierById[F.supplier._id], Z = {
|
|
612
612
|
recipientName: G.name,
|
|
613
613
|
email: (G == null ? void 0 : G.email) ?? "",
|
|
614
614
|
business: d.currentBusiness.value,
|
|
615
|
-
modelValue:
|
|
615
|
+
modelValue: z,
|
|
616
616
|
show: !0,
|
|
617
|
-
"onUpdate:show"(
|
|
618
|
-
kt.value.show =
|
|
617
|
+
"onUpdate:show"(ne) {
|
|
618
|
+
kt.value.show = ne;
|
|
619
619
|
}
|
|
620
620
|
};
|
|
621
|
-
kt.value =
|
|
621
|
+
kt.value = Z;
|
|
622
622
|
}
|
|
623
623
|
async function Q() {
|
|
624
|
-
var
|
|
625
|
-
|
|
624
|
+
var _, z, G, Z, ne, ve;
|
|
625
|
+
le == null || le.abort();
|
|
626
626
|
const F = new AbortController();
|
|
627
|
-
|
|
628
|
-
const h = (
|
|
629
|
-
T.value = [],
|
|
627
|
+
le = F;
|
|
628
|
+
const h = (_ = o._currentLocation) == null ? void 0 : _.dbName;
|
|
629
|
+
T.value = [], S.value = [], C.value = !0;
|
|
630
630
|
try {
|
|
631
631
|
const s = await D.getPurchaseOrders(E.value);
|
|
632
|
-
if (F.signal.aborted || ((
|
|
633
|
-
T.value = s.sort((
|
|
634
|
-
const a = s.flatMap((
|
|
632
|
+
if (F.signal.aborted || ((z = o._currentLocation) == null ? void 0 : z.dbName) !== h) return;
|
|
633
|
+
T.value = s.sort((de, f) => f._id.localeCompare(de._id));
|
|
634
|
+
const a = s.flatMap((de) => de.shipmentIds || []).filter(Boolean), w = a.length > 0 ? await R.getShipmentsByIds(a) : [];
|
|
635
635
|
if (F.signal.aborted || ((G = o._currentLocation) == null ? void 0 : G.dbName) !== h) return;
|
|
636
|
-
|
|
637
|
-
const
|
|
638
|
-
if (F.signal.aborted || ((
|
|
639
|
-
const
|
|
640
|
-
|
|
636
|
+
S.value = w;
|
|
637
|
+
const A = await oe.readCurrentLocationLastClosing(!0);
|
|
638
|
+
if (F.signal.aborted || ((Z = o._currentLocation) == null ? void 0 : Z.dbName) !== h) return;
|
|
639
|
+
const N = A == null ? void 0 : A._id;
|
|
640
|
+
N && (X.value = ks(N));
|
|
641
641
|
const W = await m.awaitLocationFeatures(h, {
|
|
642
642
|
signal: F.signal,
|
|
643
643
|
retryOnError: !0
|
|
644
644
|
});
|
|
645
|
-
if (W === "superseded" || (W === "error" && ye(), W === "ready" && m.mustUsePoTemplate && await l.fetchTemplates(), F.signal.aborted || ((
|
|
646
|
-
const fe = T.value.map((
|
|
645
|
+
if (W === "superseded" || (W === "error" && ye(), W === "ready" && m.mustUsePoTemplate && await l.fetchTemplates(), F.signal.aborted || ((ne = o._currentLocation) == null ? void 0 : ne.dbName) !== h)) return;
|
|
646
|
+
const fe = T.value.map((de) => {
|
|
647
647
|
var f;
|
|
648
|
-
return ((f =
|
|
649
|
-
}).filter((
|
|
648
|
+
return ((f = de.request) == null ? void 0 : f.id) ?? "";
|
|
649
|
+
}).filter((de) => de), I = await D.readRequestByIds(fe);
|
|
650
650
|
if (F.signal.aborted || ((ve = o._currentLocation) == null ? void 0 : ve.dbName) !== h) return;
|
|
651
|
-
|
|
651
|
+
re.value = I;
|
|
652
652
|
} catch {
|
|
653
653
|
if (F.signal.aborted) return;
|
|
654
654
|
v.open({
|
|
@@ -657,7 +657,7 @@ function ki(u, t) {
|
|
|
657
657
|
type: "error"
|
|
658
658
|
});
|
|
659
659
|
} finally {
|
|
660
|
-
|
|
660
|
+
le === F && (le = null, C.value = !1);
|
|
661
661
|
}
|
|
662
662
|
}
|
|
663
663
|
function ye() {
|
|
@@ -668,9 +668,9 @@ function ki(u, t) {
|
|
|
668
668
|
});
|
|
669
669
|
}
|
|
670
670
|
async function P() {
|
|
671
|
-
|
|
671
|
+
re.value = [], C.value = !0;
|
|
672
672
|
try {
|
|
673
|
-
|
|
673
|
+
re.value = await D.readRequests(
|
|
674
674
|
void 0,
|
|
675
675
|
E.value.start,
|
|
676
676
|
E.value.end
|
|
@@ -682,10 +682,10 @@ function ki(u, t) {
|
|
|
682
682
|
type: "error"
|
|
683
683
|
});
|
|
684
684
|
} finally {
|
|
685
|
-
|
|
685
|
+
C.value = !1;
|
|
686
686
|
}
|
|
687
687
|
}
|
|
688
|
-
function
|
|
688
|
+
function O() {
|
|
689
689
|
switch (u) {
|
|
690
690
|
case "receive/request":
|
|
691
691
|
return Q();
|
|
@@ -693,60 +693,60 @@ function ki(u, t) {
|
|
|
693
693
|
return P();
|
|
694
694
|
}
|
|
695
695
|
}
|
|
696
|
-
function
|
|
697
|
-
|
|
696
|
+
function g(F, h) {
|
|
697
|
+
B.value = {
|
|
698
698
|
startDate: F,
|
|
699
699
|
endDate: h
|
|
700
|
-
},
|
|
700
|
+
}, O();
|
|
701
701
|
}
|
|
702
702
|
o.watchLocation(async (F) => {
|
|
703
703
|
if (!F) {
|
|
704
704
|
T.value = [];
|
|
705
705
|
return;
|
|
706
706
|
}
|
|
707
|
-
await
|
|
707
|
+
await O();
|
|
708
708
|
});
|
|
709
|
-
async function
|
|
709
|
+
async function $(F) {
|
|
710
710
|
return F;
|
|
711
711
|
}
|
|
712
|
-
const
|
|
713
|
-
async function
|
|
714
|
-
const
|
|
715
|
-
|
|
716
|
-
(
|
|
712
|
+
const j = ae(), J = ae(Math.random().toString());
|
|
713
|
+
async function ee(F, h) {
|
|
714
|
+
const _ = Math.random().toString();
|
|
715
|
+
J.value = _, h ?? (h = re.value.computeFirst(
|
|
716
|
+
(ne) => ne.purchaseOrderId === F._id ? ne : null
|
|
717
717
|
) ?? void 0);
|
|
718
|
-
const
|
|
718
|
+
const z = u === "receive/request" ? o.currentLocation : h == null ? void 0 : h.to, G = u === "approval", Z = {
|
|
719
719
|
poRequest: h,
|
|
720
720
|
purchaseOrder: {
|
|
721
721
|
...F,
|
|
722
|
-
status: G && (h != null && h.rejectedAt) ?
|
|
722
|
+
status: G && (h != null && h.rejectedAt) ? Oe.Enum.REJECT : F.status
|
|
723
723
|
},
|
|
724
|
-
transferTo:
|
|
725
|
-
transferToDbName:
|
|
724
|
+
transferTo: z == null ? void 0 : z.name,
|
|
725
|
+
transferToDbName: z == null ? void 0 : z.dbName,
|
|
726
726
|
show: !0,
|
|
727
727
|
canResubmit: !1,
|
|
728
728
|
canApprove: G,
|
|
729
|
-
"onUpdate:show"(
|
|
730
|
-
|
|
729
|
+
"onUpdate:show"(ne) {
|
|
730
|
+
j.value && (j.value = { ...j.value, show: ne });
|
|
731
731
|
},
|
|
732
732
|
scope: u,
|
|
733
733
|
receivedMap: vt(F) ?? {},
|
|
734
|
-
shipments:
|
|
734
|
+
shipments: S.value
|
|
735
735
|
};
|
|
736
|
-
|
|
736
|
+
j.value = Z;
|
|
737
737
|
}
|
|
738
|
-
async function
|
|
739
|
-
const
|
|
740
|
-
|
|
738
|
+
async function L(F, h, _, z, G) {
|
|
739
|
+
const Z = vs();
|
|
740
|
+
C.value = !0;
|
|
741
741
|
try {
|
|
742
|
-
await
|
|
742
|
+
await Z({
|
|
743
743
|
operate: {
|
|
744
744
|
operation: h,
|
|
745
745
|
doc: F,
|
|
746
746
|
options: (
|
|
747
747
|
// auto receive for supplier to warehouse
|
|
748
|
-
(h ===
|
|
749
|
-
h ===
|
|
748
|
+
(h === K.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
749
|
+
h === K.enum.completeReceive) && m.autoReceiveWarehouse ? {
|
|
750
750
|
autoReceive: !0
|
|
751
751
|
} : void 0
|
|
752
752
|
)
|
|
@@ -754,34 +754,34 @@ function ki(u, t) {
|
|
|
754
754
|
operateV2: {
|
|
755
755
|
_id: F._id,
|
|
756
756
|
_rev: F._rev ?? "",
|
|
757
|
-
action: h ===
|
|
757
|
+
action: h === K.enum.submitRequest ? K.enum.confirmDraft : h,
|
|
758
758
|
payloads: G ?? []
|
|
759
759
|
},
|
|
760
|
-
transferTo:
|
|
760
|
+
transferTo: z
|
|
761
761
|
}), await new Promise((s) => setTimeout(s, 1e3));
|
|
762
762
|
const ve = ze().currentLocationDBName.startsWith("restaurant_");
|
|
763
|
-
h ===
|
|
763
|
+
h === K.enum.confirmDraft && F.effectiveAt && ve ? v.open({
|
|
764
764
|
title: "Success",
|
|
765
|
-
message: `${
|
|
765
|
+
message: `${_}. The backdate will be reflected once your POS has received this change.`,
|
|
766
766
|
type: "success"
|
|
767
767
|
}) : v.open({
|
|
768
768
|
title: "Success",
|
|
769
|
-
message:
|
|
769
|
+
message: _,
|
|
770
770
|
type: "success"
|
|
771
771
|
});
|
|
772
|
-
} catch (
|
|
772
|
+
} catch (ne) {
|
|
773
773
|
v.open({
|
|
774
774
|
title: "Something went wrong",
|
|
775
|
-
message:
|
|
775
|
+
message: ne instanceof Error ? ne.message : "Please try again.",
|
|
776
776
|
type: "error"
|
|
777
|
-
}), console.error("Error when submitting PO operation", h, F,
|
|
777
|
+
}), console.error("Error when submitting PO operation", h, F, ne);
|
|
778
778
|
} finally {
|
|
779
|
-
|
|
779
|
+
C.value = !1, O();
|
|
780
780
|
}
|
|
781
781
|
}
|
|
782
|
-
async function
|
|
783
|
-
const
|
|
784
|
-
if (!
|
|
782
|
+
async function te(F, h, _) {
|
|
783
|
+
const z = ps[h];
|
|
784
|
+
if (!z) {
|
|
785
785
|
v.open({
|
|
786
786
|
title: "Something went wrong",
|
|
787
787
|
message: `Cannot process order: ${Rt(h)}`,
|
|
@@ -789,16 +789,16 @@ function ki(u, t) {
|
|
|
789
789
|
});
|
|
790
790
|
return;
|
|
791
791
|
}
|
|
792
|
-
const { successMessage: G, ...
|
|
793
|
-
if (h ===
|
|
792
|
+
const { successMessage: G, ...Z } = z;
|
|
793
|
+
if (h === K.enum.rejectDraft) {
|
|
794
794
|
let s = "";
|
|
795
795
|
r.open({
|
|
796
|
-
title:
|
|
797
|
-
message:
|
|
798
|
-
primaryActions:
|
|
796
|
+
title: Z.title,
|
|
797
|
+
message: Z.message,
|
|
798
|
+
primaryActions: Z.primaryActions,
|
|
799
799
|
contentComponent: fs,
|
|
800
800
|
contentComponentProps: {
|
|
801
|
-
message:
|
|
801
|
+
message: Z.message,
|
|
802
802
|
onChange: (a) => s = a
|
|
803
803
|
}
|
|
804
804
|
}).onPrimary(() => {
|
|
@@ -808,23 +808,23 @@ function ki(u, t) {
|
|
|
808
808
|
payload: {
|
|
809
809
|
rejectReason: s
|
|
810
810
|
}
|
|
811
|
-
}),
|
|
811
|
+
}), L(F, h, G, _, a);
|
|
812
812
|
});
|
|
813
813
|
return;
|
|
814
814
|
}
|
|
815
|
-
const
|
|
816
|
-
ve.init(F), (h ===
|
|
815
|
+
const ne = [], ve = bs();
|
|
816
|
+
ve.init(F), (h === K.enum.confirmDraft || h === K.enum.submitRequest) && ne.push({
|
|
817
817
|
action: "confirmDraft",
|
|
818
818
|
payload: ve.controller.value.toConfirmDraftData(Ce())
|
|
819
819
|
}), r.open({
|
|
820
|
-
title:
|
|
821
|
-
message:
|
|
822
|
-
primaryActions:
|
|
820
|
+
title: Z.title,
|
|
821
|
+
message: Z.message,
|
|
822
|
+
primaryActions: Z.primaryActions
|
|
823
823
|
}).onPrimary(() => {
|
|
824
|
-
|
|
824
|
+
L(F, h, G, _, ne);
|
|
825
825
|
});
|
|
826
826
|
}
|
|
827
|
-
async function
|
|
827
|
+
async function _e() {
|
|
828
828
|
r.open({
|
|
829
829
|
title: "Upload Transfer",
|
|
830
830
|
primaryActions: {
|
|
@@ -847,29 +847,29 @@ function ki(u, t) {
|
|
|
847
847
|
}
|
|
848
848
|
return {
|
|
849
849
|
purchaseOrders: T,
|
|
850
|
-
shipments:
|
|
851
|
-
purchaseRequests:
|
|
852
|
-
updateDateRange:
|
|
853
|
-
fetchData:
|
|
854
|
-
loading:
|
|
850
|
+
shipments: S,
|
|
851
|
+
purchaseRequests: re,
|
|
852
|
+
updateDateRange: g,
|
|
853
|
+
fetchData: O,
|
|
854
|
+
loading: C,
|
|
855
855
|
transferDialogProps: ot,
|
|
856
|
-
promptCreateTransferDialog:
|
|
857
|
-
promptUpdateTransferDialog:
|
|
858
|
-
transferDetailsProps:
|
|
859
|
-
promptShowTransferDetails:
|
|
860
|
-
resolvePO:
|
|
861
|
-
submitAction:
|
|
856
|
+
promptCreateTransferDialog: ce,
|
|
857
|
+
promptUpdateTransferDialog: xe,
|
|
858
|
+
transferDetailsProps: j,
|
|
859
|
+
promptShowTransferDetails: ee,
|
|
860
|
+
resolvePO: $,
|
|
861
|
+
submitAction: te,
|
|
862
862
|
xilnexImportDialogProps: xt,
|
|
863
|
-
promptUploadTransferDialog:
|
|
863
|
+
promptUploadTransferDialog: _e,
|
|
864
864
|
emailDialogProps: kt,
|
|
865
865
|
promptEmailDialog: Ae
|
|
866
866
|
};
|
|
867
867
|
}
|
|
868
868
|
function vr(u) {
|
|
869
|
-
var
|
|
870
|
-
const { po: t, currentLocation: r, business: o, fulfilling: m, por: c } = u, { name: d, address: n, regNo: l, legalName:
|
|
869
|
+
var ce, xe, Ae, Q, ye, P;
|
|
870
|
+
const { po: t, currentLocation: r, business: o, fulfilling: m, por: c } = u, { name: d, address: n, regNo: l, legalName: C } = r.doc.profile, v = {
|
|
871
871
|
name: d,
|
|
872
|
-
legalName:
|
|
872
|
+
legalName: C,
|
|
873
873
|
registrationNumber: l,
|
|
874
874
|
line1: n == null ? void 0 : n.line1,
|
|
875
875
|
line2: n == null ? void 0 : n.line2,
|
|
@@ -881,52 +881,52 @@ function vr(u) {
|
|
|
881
881
|
name: t.supplier.name,
|
|
882
882
|
phoneNumber: t.supplier.phoneNumber,
|
|
883
883
|
registrationNumber: t.supplier.registrationNumber,
|
|
884
|
-
line1: (
|
|
885
|
-
line2: (
|
|
884
|
+
line1: (ce = t.supplier.address) == null ? void 0 : ce.line1,
|
|
885
|
+
line2: (xe = t.supplier.address) == null ? void 0 : xe.line2,
|
|
886
886
|
postcode: (Ae = t.supplier.address) == null ? void 0 : Ae.postcode,
|
|
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 = ds(t), T = t.items.map((
|
|
891
|
-
const { sku:
|
|
892
|
-
cs(
|
|
890
|
+
}, R = ds(t), T = t.items.map((O) => {
|
|
891
|
+
const { sku: g, measurement: $ } = O, j = $e(
|
|
892
|
+
cs(O.sku, t.deliveryOrder || []),
|
|
893
893
|
!1
|
|
894
|
-
),
|
|
894
|
+
), J = R(O);
|
|
895
895
|
return {
|
|
896
|
-
code:
|
|
897
|
-
description:
|
|
898
|
-
quantity: $e(
|
|
899
|
-
unit: (
|
|
900
|
-
received:
|
|
901
|
-
cost:
|
|
902
|
-
value:
|
|
896
|
+
code: g.code,
|
|
897
|
+
description: g.name,
|
|
898
|
+
quantity: $e(O.quantity, !1),
|
|
899
|
+
unit: ($ == null ? void 0 : $.abbrev) || g.unit.abbrev,
|
|
900
|
+
received: j,
|
|
901
|
+
cost: J ? `${J.currency} ${Be.toFormatString({
|
|
902
|
+
value: J
|
|
903
903
|
})}` : void 0
|
|
904
904
|
};
|
|
905
|
-
}),
|
|
906
|
-
createdAt: Pt(new Date(
|
|
907
|
-
ref:
|
|
908
|
-
remark:
|
|
909
|
-
items:
|
|
910
|
-
var
|
|
905
|
+
}), S = t.deliveryOrder.map((O) => ({
|
|
906
|
+
createdAt: Pt(new Date(O.createdAt)),
|
|
907
|
+
ref: O.deliveryOrderNumber,
|
|
908
|
+
remark: O.remark || "",
|
|
909
|
+
items: O.received.map((g) => {
|
|
910
|
+
var $;
|
|
911
911
|
return {
|
|
912
|
-
code:
|
|
913
|
-
description:
|
|
914
|
-
quantity: $e(
|
|
915
|
-
unit: ((
|
|
912
|
+
code: g.sku.code,
|
|
913
|
+
description: g.sku.name,
|
|
914
|
+
quantity: $e(g.amount),
|
|
915
|
+
unit: (($ = g.measurement) == null ? void 0 : $.abbrev) || g.sku.unit.abbrev
|
|
916
916
|
};
|
|
917
917
|
})
|
|
918
|
-
})),
|
|
918
|
+
})), B = [
|
|
919
919
|
// Production
|
|
920
920
|
"67ca5d2c80bd0e001c5bf5bc",
|
|
921
921
|
// Dev
|
|
922
922
|
"6880b36a3054c5001db19218"
|
|
923
923
|
];
|
|
924
924
|
let E = "Inventory Receive Note";
|
|
925
|
-
if (t.supplier.internal ? (E = "Inventory Transfer Note",
|
|
926
|
-
const
|
|
927
|
-
r.dbName ===
|
|
925
|
+
if (t.supplier.internal ? (E = "Inventory Transfer Note", B.includes((o == null ? void 0 : o._id) || "") && (E = "Stock Request")) : E = "Purchase Order", c) {
|
|
926
|
+
const O = c.from.dbName;
|
|
927
|
+
r.dbName === O || (E = "Inventory Receive Note");
|
|
928
928
|
}
|
|
929
|
-
const
|
|
929
|
+
const oe = {
|
|
930
930
|
title: E,
|
|
931
931
|
businessName: o == null ? void 0 : o.name,
|
|
932
932
|
logo: o == null ? void 0 : o.thumbnail,
|
|
@@ -938,88 +938,88 @@ function vr(u) {
|
|
|
938
938
|
supplier: D,
|
|
939
939
|
items: T,
|
|
940
940
|
status: t.status,
|
|
941
|
-
deliveryOrders:
|
|
942
|
-
},
|
|
943
|
-
|
|
944
|
-
const be = zs.compressToEncodedURIComponent(JSON.stringify(
|
|
945
|
-
|
|
941
|
+
deliveryOrders: S
|
|
942
|
+
}, X = new URL(window.location.href), le = m && (t.deliveryFullfillment || []).length > 0 ? "receive-request/delivery-print-preview" : "receive-request/print-preview";
|
|
943
|
+
X.pathname = X.hostname.includes("portal.feedme") ? `/inventory/${le}` : `/${le}`;
|
|
944
|
+
const be = zs.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: {
|
|
949
949
|
translationKey: "inventory.transfer.receiveRequest.actions.submitRequest",
|
|
950
950
|
color: "text-fm-color-typo-primary",
|
|
951
|
-
value:
|
|
951
|
+
value: K.enum.submitRequest
|
|
952
952
|
},
|
|
953
953
|
confirmDraft: {
|
|
954
954
|
translationKey: "inventory.transfer.receiveRequest.actions.confirmDraft",
|
|
955
955
|
color: "text-fm-color-typo-primary",
|
|
956
|
-
value:
|
|
956
|
+
value: K.enum.confirmDraft
|
|
957
957
|
},
|
|
958
958
|
cancelDraft: {
|
|
959
959
|
translationKey: "inventory.transfer.receiveRequest.actions.cancelDraft",
|
|
960
960
|
color: "text-fm-color-typo-error",
|
|
961
|
-
value:
|
|
961
|
+
value: K.enum.cancelDraft
|
|
962
962
|
},
|
|
963
963
|
approveRequest: {
|
|
964
964
|
translationKey: "inventory.transfer.receiveRequest.actions.approveRequest",
|
|
965
965
|
color: "text-fm-color-typo-primary",
|
|
966
|
-
value:
|
|
966
|
+
value: K.enum.approveRequest
|
|
967
967
|
},
|
|
968
968
|
rejectRequest: {
|
|
969
969
|
translationKey: "inventory.transfer.receiveRequest.actions.rejectRequest",
|
|
970
970
|
color: "text-fm-color-typo-error",
|
|
971
|
-
value:
|
|
971
|
+
value: K.enum.rejectRequest
|
|
972
972
|
},
|
|
973
973
|
processRequest: {
|
|
974
974
|
translationKey: "inventory.transfer.receiveRequest.actions.processRequest",
|
|
975
975
|
color: "text-fm-color-typo-primary",
|
|
976
|
-
value:
|
|
976
|
+
value: K.enum.processRequest
|
|
977
977
|
},
|
|
978
978
|
receiveStock: {
|
|
979
979
|
translationKey: "inventory.transfer.receiveRequest.actions.receiveStock",
|
|
980
980
|
color: "text-fm-color-typo-primary",
|
|
981
|
-
value:
|
|
981
|
+
value: K.enum.receiveStock
|
|
982
982
|
},
|
|
983
983
|
completeReceive: {
|
|
984
984
|
translationKey: "inventory.transfer.receiveRequest.actions.completeReceive",
|
|
985
985
|
color: "text-fm-color-typo-primary",
|
|
986
|
-
value:
|
|
986
|
+
value: K.enum.completeReceive
|
|
987
987
|
},
|
|
988
988
|
closeRequest: {
|
|
989
989
|
translationKey: "inventory.transfer.receiveRequest.actions.closeRequest",
|
|
990
990
|
color: "system-error-300",
|
|
991
|
-
value:
|
|
991
|
+
value: K.enum.closeRequest
|
|
992
992
|
},
|
|
993
993
|
approveDraft: {
|
|
994
994
|
translationKey: "inventory.transfer.receiveRequest.actions.approveDraft",
|
|
995
995
|
color: "text-fm-color-typo-primary",
|
|
996
|
-
value:
|
|
996
|
+
value: K.enum.approveDraft
|
|
997
997
|
},
|
|
998
998
|
rejectDraft: {
|
|
999
999
|
translationKey: "inventory.transfer.receiveRequest.actions.rejectDraft",
|
|
1000
1000
|
color: "text-fm-color-typo-error",
|
|
1001
|
-
value:
|
|
1001
|
+
value: K.enum.rejectDraft
|
|
1002
1002
|
},
|
|
1003
1003
|
returnStock: {
|
|
1004
1004
|
translationKey: "inventory.transfer.receiveRequest.actions.returnStock",
|
|
1005
1005
|
color: "text-fm-color-typo-primary",
|
|
1006
|
-
value:
|
|
1006
|
+
value: K.enum.returnStock
|
|
1007
1007
|
}
|
|
1008
1008
|
};
|
|
1009
1009
|
function gs() {
|
|
1010
1010
|
const u = Ye();
|
|
1011
1011
|
return {
|
|
1012
1012
|
ableToMarkReceived(t) {
|
|
1013
|
-
if (!t || t.status !==
|
|
1013
|
+
if (!t || t.status !== Oe.enum.RECEIVING || u.useOperatePurchaseOrderV2) return !1;
|
|
1014
1014
|
const o = ze().currentLocationDBName;
|
|
1015
1015
|
return `${t.supplier.internal}_${t.supplier._id}` !== o;
|
|
1016
1016
|
},
|
|
1017
1017
|
ableToMarkApproved(t) {
|
|
1018
|
-
return !(!t || (t == null ? void 0 : t.status) !==
|
|
1018
|
+
return !(!t || (t == null ? void 0 : t.status) !== Oe.enum.REQUESTING);
|
|
1019
1019
|
},
|
|
1020
1020
|
ableToCreateFulfillment(t, r) {
|
|
1021
1021
|
var c, d;
|
|
1022
|
-
if (!u.acceptRequireFulfillment || !t || !r || t.status !==
|
|
1022
|
+
if (!u.acceptRequireFulfillment || !t || !r || t.status !== Oe.enum.PROCESSING || !r.processedAt)
|
|
1023
1023
|
return !1;
|
|
1024
1024
|
const o = (c = r == null ? void 0 : r.from) == null ? void 0 : c.dbName, m = (d = r == null ? void 0 : r.to) == null ? void 0 : d.dbName;
|
|
1025
1025
|
return !(o.startsWith("restaurant_") && m.startsWith("restaurant_"));
|
|
@@ -1027,7 +1027,7 @@ function gs() {
|
|
|
1027
1027
|
};
|
|
1028
1028
|
}
|
|
1029
1029
|
function _s() {
|
|
1030
|
-
const u =
|
|
1030
|
+
const u = H(() => [
|
|
1031
1031
|
{
|
|
1032
1032
|
action: Qt.Action.manage,
|
|
1033
1033
|
subject: Qt.Subject.Business.inventory_orderDraftApproval
|
|
@@ -1041,29 +1041,29 @@ function ts(u) {
|
|
|
1041
1041
|
return u != null && u.id ? `${u.refNo ?? "N/A"} (${u.id})` : "N/A";
|
|
1042
1042
|
}
|
|
1043
1043
|
function xi(u, t, r, o) {
|
|
1044
|
-
const m = ze(), c = _t(), d = bt(), n = gs(), { t: l } = ht(),
|
|
1044
|
+
const m = ze(), c = _t(), d = bt(), n = gs(), { t: l } = ht(), C = Je(), { hasOrderDraftPermission: v } = _s(), D = Ye(), R = H(
|
|
1045
1045
|
() => D.enablePrintTemplate ? [qe[Ne.PrintCustom]] : []
|
|
1046
|
-
), T =
|
|
1046
|
+
), T = H(
|
|
1047
1047
|
() => D.enablePurchaseOrderEmail ? [qe[Ne.Email]] : []
|
|
1048
1048
|
);
|
|
1049
|
-
function
|
|
1050
|
-
const ye =
|
|
1049
|
+
function S(Q) {
|
|
1050
|
+
const ye = B(Q), P = o == null ? void 0 : o.excludeRowActions;
|
|
1051
1051
|
return P != null && P.length ? ye.filter(
|
|
1052
|
-
(
|
|
1052
|
+
(O) => !P.includes(O.value)
|
|
1053
1053
|
) : ye;
|
|
1054
1054
|
}
|
|
1055
|
-
function
|
|
1055
|
+
function B(Q) {
|
|
1056
1056
|
switch (Q.status) {
|
|
1057
1057
|
case "DRAFT":
|
|
1058
1058
|
return [
|
|
1059
1059
|
qe[Ne.Update],
|
|
1060
1060
|
qe[Ne.Details],
|
|
1061
|
-
Q.supplier.internal === "restaurant" || Q.supplier.internal === "warehouse" ? Ke[
|
|
1062
|
-
Ke[
|
|
1061
|
+
Q.supplier.internal === "restaurant" || Q.supplier.internal === "warehouse" ? Ke[K.enum.submitRequest] : Ke[K.enum.confirmDraft],
|
|
1062
|
+
Ke[K.enum.cancelDraft]
|
|
1063
1063
|
];
|
|
1064
1064
|
case "RECEIVING":
|
|
1065
1065
|
return [
|
|
1066
|
-
...n.ableToMarkReceived(Q) ? [Ke[
|
|
1066
|
+
...n.ableToMarkReceived(Q) ? [Ke[K.enum.completeReceive]] : [],
|
|
1067
1067
|
qe[Ne.Details],
|
|
1068
1068
|
qe[Ne.Print],
|
|
1069
1069
|
...R.value,
|
|
@@ -1073,8 +1073,8 @@ function xi(u, t, r, o) {
|
|
|
1073
1073
|
const P = [qe[Ne.Details]];
|
|
1074
1074
|
return v.value && P.push(
|
|
1075
1075
|
qe[Ne.Update],
|
|
1076
|
-
Ke[
|
|
1077
|
-
Ke[
|
|
1076
|
+
Ke[K.enum.approveDraft],
|
|
1077
|
+
Ke[K.enum.rejectDraft]
|
|
1078
1078
|
), P;
|
|
1079
1079
|
}
|
|
1080
1080
|
case "REQUESTING":
|
|
@@ -1083,8 +1083,8 @@ function xi(u, t, r, o) {
|
|
|
1083
1083
|
qe[Ne.Print],
|
|
1084
1084
|
...R.value
|
|
1085
1085
|
] : [
|
|
1086
|
-
Ke[
|
|
1087
|
-
Ke[
|
|
1086
|
+
Ke[K.enum.approveRequest],
|
|
1087
|
+
Ke[K.enum.rejectRequest],
|
|
1088
1088
|
qe[Ne.Details]
|
|
1089
1089
|
// DefaultRowActions[RowActionEnum.Print]
|
|
1090
1090
|
];
|
|
@@ -1105,69 +1105,69 @@ function xi(u, t, r, o) {
|
|
|
1105
1105
|
}
|
|
1106
1106
|
}
|
|
1107
1107
|
function E(Q) {
|
|
1108
|
-
return Object.values(
|
|
1108
|
+
return Object.values(K.enum).includes(Q);
|
|
1109
1109
|
}
|
|
1110
|
-
async function
|
|
1111
|
-
var
|
|
1112
|
-
let
|
|
1110
|
+
async function re(Q, ye, P) {
|
|
1111
|
+
var $, j, J, ee, L, te, _e, F, h;
|
|
1112
|
+
let O;
|
|
1113
1113
|
try {
|
|
1114
|
-
|
|
1115
|
-
} catch (
|
|
1116
|
-
console.error("Failed to load full purchase order for action",
|
|
1114
|
+
O = t.resolvePO ? await t.resolvePO(ye) : ye;
|
|
1115
|
+
} catch (_) {
|
|
1116
|
+
console.error("Failed to load full purchase order for action", _), C.open({
|
|
1117
1117
|
title: l("inventory.common.somethingWentWrong"),
|
|
1118
|
-
message: (
|
|
1118
|
+
message: (_ == null ? void 0 : _.message) || l("inventory.common.tryAgain"),
|
|
1119
1119
|
type: "error"
|
|
1120
1120
|
});
|
|
1121
1121
|
return;
|
|
1122
1122
|
}
|
|
1123
|
-
const
|
|
1124
|
-
if (!(o != null && o.onCustomAction && await o.onCustomAction(Q,
|
|
1123
|
+
const g = wt(O);
|
|
1124
|
+
if (!(o != null && o.onCustomAction && await o.onCustomAction(Q, g))) {
|
|
1125
1125
|
if (Q === Ne.Print || Q === Ne.PrintCustom) {
|
|
1126
|
-
let
|
|
1127
|
-
if (
|
|
1128
|
-
const s = await o.fetchFullPo(
|
|
1126
|
+
let _ = g;
|
|
1127
|
+
if (_.items == null && (o != null && o.fetchFullPo)) {
|
|
1128
|
+
const s = await o.fetchFullPo(g);
|
|
1129
1129
|
if (s == null) return;
|
|
1130
|
-
|
|
1130
|
+
_ = wt(s);
|
|
1131
1131
|
}
|
|
1132
|
-
const
|
|
1133
|
-
if (
|
|
1134
|
-
const s = m.locationRestaurantFromCore(
|
|
1135
|
-
s !== null && (
|
|
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
|
+
if (Z.type === "restaurant") {
|
|
1134
|
+
const s = m.locationRestaurantFromCore(Z.doc._id);
|
|
1135
|
+
s !== null && (Z.doc = s);
|
|
1136
1136
|
}
|
|
1137
|
-
((
|
|
1138
|
-
const
|
|
1139
|
-
po:
|
|
1140
|
-
currentLocation:
|
|
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, g)), ve = {
|
|
1139
|
+
po: _,
|
|
1140
|
+
currentLocation: Z,
|
|
1141
1141
|
business: d.currentBusiness.value,
|
|
1142
1142
|
fulfilling: u === "approval",
|
|
1143
|
-
por:
|
|
1143
|
+
por: ne
|
|
1144
1144
|
};
|
|
1145
1145
|
if (Q === Ne.PrintCustom) {
|
|
1146
1146
|
const s = ms(ve);
|
|
1147
|
-
s && (
|
|
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
|
-
(
|
|
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
1164
|
if (E(Q)) {
|
|
1165
|
-
t.submitAction(
|
|
1165
|
+
t.submitAction(O, Q, (h = P == null ? void 0 : P.to) == null ? void 0 : h.dbName);
|
|
1166
1166
|
return;
|
|
1167
1167
|
}
|
|
1168
1168
|
}
|
|
1169
1169
|
}
|
|
1170
|
-
function
|
|
1170
|
+
function oe() {
|
|
1171
1171
|
var ye;
|
|
1172
1172
|
const Q = [
|
|
1173
1173
|
{
|
|
@@ -1195,26 +1195,26 @@ function xi(u, t, r, o) {
|
|
|
1195
1195
|
// Bulk-view summary rows carry itemCount instead of the items array
|
|
1196
1196
|
id: "noOfItems",
|
|
1197
1197
|
accessorFn: (P) => {
|
|
1198
|
-
var
|
|
1199
|
-
return P.itemCount ?? ((
|
|
1198
|
+
var O;
|
|
1199
|
+
return P.itemCount ?? ((O = P.items) == null ? void 0 : O.length) ?? 0;
|
|
1200
1200
|
},
|
|
1201
1201
|
header: () => l("inventory.transfer.table.noOfItems"),
|
|
1202
1202
|
cell: (P) => {
|
|
1203
|
-
const
|
|
1204
|
-
return
|
|
1205
|
-
|
|
1206
|
-
|
|
1203
|
+
const O = P.row.original.version || "1", g = P.getValue();
|
|
1204
|
+
return ie("div", { class: "flex items-center gap-2" }, [
|
|
1205
|
+
g,
|
|
1206
|
+
O !== "1" ? ie(
|
|
1207
1207
|
"div",
|
|
1208
1208
|
{ class: "py-3" },
|
|
1209
|
-
|
|
1209
|
+
ie(
|
|
1210
1210
|
tt,
|
|
1211
1211
|
{},
|
|
1212
|
-
() =>
|
|
1212
|
+
() => ie(
|
|
1213
1213
|
"div",
|
|
1214
1214
|
{
|
|
1215
1215
|
class: ["fm-status-badge", "fm-status-badge-draft"].join(" ")
|
|
1216
1216
|
},
|
|
1217
|
-
`v${
|
|
1217
|
+
`v${O}`
|
|
1218
1218
|
)
|
|
1219
1219
|
)
|
|
1220
1220
|
) : null
|
|
@@ -1234,7 +1234,7 @@ function xi(u, t, r, o) {
|
|
|
1234
1234
|
...(ye = d.sessionUser.value) != null && ye.role.isAdmin ? [
|
|
1235
1235
|
{
|
|
1236
1236
|
id: "statusForAdmin",
|
|
1237
|
-
header: () =>
|
|
1237
|
+
header: () => ie(tt, {}, () => `${l("inventory.transfer.table.status")}`),
|
|
1238
1238
|
cell(P) {
|
|
1239
1239
|
return P.row.original.status;
|
|
1240
1240
|
},
|
|
@@ -1246,55 +1246,55 @@ function xi(u, t, r, o) {
|
|
|
1246
1246
|
accessorKey: "status",
|
|
1247
1247
|
header: () => l("inventory.transfer.table.status"),
|
|
1248
1248
|
cell(P) {
|
|
1249
|
-
const
|
|
1250
|
-
let
|
|
1251
|
-
|
|
1252
|
-
let
|
|
1253
|
-
const
|
|
1254
|
-
if (
|
|
1255
|
-
const F =
|
|
1249
|
+
const O = P.getValue(), g = P.row.original, { partial: $, over: j } = g.items == null ? { partial: !!g.partialReceived, over: !!g.overReceived } : $t(vt(g)), J = Ct(O ?? "", $, j);
|
|
1250
|
+
let ee = l(`inventory.transfer.status.${J}`), L = `${O ?? ""}`.toLocaleLowerCase("en-us");
|
|
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
|
+
let te = null;
|
|
1253
|
+
const _e = r.value.find((F) => F.ref === P.row.original._id);
|
|
1254
|
+
if (_e != null && _e.milestones && _e.milestones.length > 0) {
|
|
1255
|
+
const F = _e.milestones[_e.milestones.length - 1];
|
|
1256
1256
|
if (F.estimatedTime) {
|
|
1257
|
-
const h = new Date(F.estimatedTime),
|
|
1258
|
-
|
|
1257
|
+
const h = new Date(F.estimatedTime), _ = h.getDate().toString().padStart(2, "0");
|
|
1258
|
+
te = `${h.toLocaleString("en-US", { month: "short" })} ${_}`;
|
|
1259
1259
|
}
|
|
1260
1260
|
}
|
|
1261
|
-
return
|
|
1261
|
+
return ie(
|
|
1262
1262
|
"div",
|
|
1263
1263
|
{
|
|
1264
1264
|
class: "flex"
|
|
1265
1265
|
},
|
|
1266
1266
|
[
|
|
1267
|
-
|
|
1267
|
+
ie(
|
|
1268
1268
|
"div",
|
|
1269
1269
|
{ class: "flex items-center" },
|
|
1270
|
-
|
|
1270
|
+
ie(
|
|
1271
1271
|
"div",
|
|
1272
1272
|
{
|
|
1273
1273
|
class: [
|
|
1274
1274
|
"fm-status-badge",
|
|
1275
|
-
`fm-status-badge-${
|
|
1276
|
-
|
|
1275
|
+
`fm-status-badge-${L}`,
|
|
1276
|
+
j && "fm-status-badge-error"
|
|
1277
1277
|
].filter(Boolean).join(" ")
|
|
1278
1278
|
},
|
|
1279
|
-
`${
|
|
1279
|
+
`${ee}`
|
|
1280
1280
|
)
|
|
1281
1281
|
),
|
|
1282
|
-
...
|
|
1283
|
-
|
|
1282
|
+
...te ? [
|
|
1283
|
+
ie(
|
|
1284
1284
|
"div",
|
|
1285
1285
|
{
|
|
1286
1286
|
class: "flex items-center gap-1 ml-2"
|
|
1287
1287
|
},
|
|
1288
1288
|
[
|
|
1289
|
-
|
|
1289
|
+
ie(pt.FmIcon, {
|
|
1290
1290
|
name: "local_shipping",
|
|
1291
1291
|
size: "md",
|
|
1292
1292
|
color: "neutral-gray-400"
|
|
1293
1293
|
}),
|
|
1294
|
-
|
|
1294
|
+
ie(
|
|
1295
1295
|
"span",
|
|
1296
1296
|
{ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
|
|
1297
|
-
|
|
1297
|
+
te
|
|
1298
1298
|
)
|
|
1299
1299
|
]
|
|
1300
1300
|
)
|
|
@@ -1308,12 +1308,12 @@ function xi(u, t, r, o) {
|
|
|
1308
1308
|
{
|
|
1309
1309
|
id: "action",
|
|
1310
1310
|
cell(P) {
|
|
1311
|
-
var
|
|
1312
|
-
const
|
|
1313
|
-
...
|
|
1314
|
-
...((
|
|
1311
|
+
var $;
|
|
1312
|
+
const O = P.row.original, g = [
|
|
1313
|
+
...S(O),
|
|
1314
|
+
...(($ = o == null ? void 0 : o.appendRowActions) == null ? void 0 : $.call(o, O)) ?? []
|
|
1315
1315
|
];
|
|
1316
|
-
return Gt(
|
|
1316
|
+
return Gt(g, (j) => re(j, O));
|
|
1317
1317
|
},
|
|
1318
1318
|
enableSorting: !1,
|
|
1319
1319
|
size: 40,
|
|
@@ -1327,15 +1327,15 @@ function xi(u, t, r, o) {
|
|
|
1327
1327
|
const P = [
|
|
1328
1328
|
{
|
|
1329
1329
|
id: "netsuiteTransferOrder",
|
|
1330
|
-
accessorFn: (
|
|
1331
|
-
var
|
|
1332
|
-
return (
|
|
1330
|
+
accessorFn: (O) => {
|
|
1331
|
+
var g;
|
|
1332
|
+
return (g = O.netSuite) != null && g.id ? `${O.netSuite.refNo ?? "N/A"} (${O.netSuite.id})` : "N/A";
|
|
1333
1333
|
},
|
|
1334
1334
|
header: () => "NetSuite Order (ID)",
|
|
1335
|
-
cell(
|
|
1336
|
-
var
|
|
1337
|
-
const
|
|
1338
|
-
return (
|
|
1335
|
+
cell(O) {
|
|
1336
|
+
var $;
|
|
1337
|
+
const g = O.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,
|
|
@@ -1346,14 +1346,14 @@ function xi(u, t, r, o) {
|
|
|
1346
1346
|
},
|
|
1347
1347
|
{
|
|
1348
1348
|
id: "netsuiteTransactionNumber",
|
|
1349
|
-
accessorFn: (
|
|
1350
|
-
var
|
|
1351
|
-
return ((
|
|
1349
|
+
accessorFn: (O) => {
|
|
1350
|
+
var g, $;
|
|
1351
|
+
return (($ = (g = O.netSuite) == null ? void 0 : g.additionalInfo) == null ? void 0 : $.transactionnumber) ?? "N/A";
|
|
1352
1352
|
},
|
|
1353
1353
|
header: () => "NetSuite Transaction No.",
|
|
1354
|
-
cell(
|
|
1355
|
-
var
|
|
1356
|
-
return ((
|
|
1354
|
+
cell(O) {
|
|
1355
|
+
var $, j;
|
|
1356
|
+
return ((j = ($ = O.row.original.netSuite) == null ? void 0 : $.additionalInfo) == null ? void 0 : j.transactionnumber) ?? "N/A";
|
|
1357
1357
|
},
|
|
1358
1358
|
enableSorting: !1,
|
|
1359
1359
|
size: 200,
|
|
@@ -1364,28 +1364,28 @@ function xi(u, t, r, o) {
|
|
|
1364
1364
|
},
|
|
1365
1365
|
{
|
|
1366
1366
|
id: "netsuiteRefNo",
|
|
1367
|
-
accessorFn: (
|
|
1368
|
-
var
|
|
1369
|
-
const
|
|
1370
|
-
var
|
|
1371
|
-
return (
|
|
1367
|
+
accessorFn: (O) => {
|
|
1368
|
+
var $, j;
|
|
1369
|
+
const g = ($ = O.deliveryOrder) == null ? void 0 : $.filter((J) => {
|
|
1370
|
+
var ee;
|
|
1371
|
+
return (ee = J.netSuite) == null ? void 0 : ee.id;
|
|
1372
1372
|
});
|
|
1373
|
-
return
|
|
1374
|
-
var
|
|
1375
|
-
return `${((
|
|
1376
|
-
}).join(", ") : (
|
|
1373
|
+
return g != null && g.length ? g.map((J) => {
|
|
1374
|
+
var ee, L;
|
|
1375
|
+
return `${((ee = J.netSuite) == null ? void 0 : ee.refNo) ?? "N/A"} (${((L = J.netSuite) == null ? void 0 : L.id) ?? "-"})`;
|
|
1376
|
+
}).join(", ") : (j = O.netSuite) != null && j.id ? `${O.netSuite.refNo ?? "N/A"} (${O.netSuite.id})` : "N/A";
|
|
1377
1377
|
},
|
|
1378
1378
|
header: () => "Netsuite ref no.",
|
|
1379
|
-
cell(
|
|
1380
|
-
var
|
|
1381
|
-
const
|
|
1382
|
-
var
|
|
1383
|
-
return (
|
|
1379
|
+
cell(O) {
|
|
1380
|
+
var j, J;
|
|
1381
|
+
const g = O.row.original, $ = (j = g.deliveryOrder) == null ? void 0 : j.filter((ee) => {
|
|
1382
|
+
var L;
|
|
1383
|
+
return (L = ee.netSuite) == null ? void 0 : L.id;
|
|
1384
1384
|
});
|
|
1385
|
-
return
|
|
1386
|
-
var
|
|
1387
|
-
return `${((
|
|
1388
|
-
}).join(", ") : (
|
|
1385
|
+
return $ != null && $.length ? $.map((ee) => {
|
|
1386
|
+
var L, te;
|
|
1387
|
+
return `${((L = ee.netSuite) == null ? void 0 : L.refNo) ?? "N/A"} (${((te = ee.netSuite) == null ? void 0 : te.id) ?? "-"})`;
|
|
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,
|
|
@@ -1399,7 +1399,7 @@ function xi(u, t, r, o) {
|
|
|
1399
1399
|
}
|
|
1400
1400
|
return Q;
|
|
1401
1401
|
}
|
|
1402
|
-
function
|
|
1402
|
+
function X() {
|
|
1403
1403
|
var ye;
|
|
1404
1404
|
const Q = [
|
|
1405
1405
|
{
|
|
@@ -1437,7 +1437,7 @@ function xi(u, t, r, o) {
|
|
|
1437
1437
|
...(ye = d.sessionUser.value) != null && ye.role.isAdmin ? [
|
|
1438
1438
|
{
|
|
1439
1439
|
id: "statusForAdmin",
|
|
1440
|
-
header: () =>
|
|
1440
|
+
header: () => ie(tt, {}, () => `${l("inventory.transfer.table.status")}`),
|
|
1441
1441
|
cell(P) {
|
|
1442
1442
|
return P.row.original.status;
|
|
1443
1443
|
},
|
|
@@ -1449,29 +1449,29 @@ function xi(u, t, r, o) {
|
|
|
1449
1449
|
accessorKey: "purchaseOrder.status",
|
|
1450
1450
|
header: () => l("inventory.transfer.table.status"),
|
|
1451
1451
|
cell(P) {
|
|
1452
|
-
const
|
|
1453
|
-
if (!
|
|
1454
|
-
return
|
|
1452
|
+
const O = P.row.original, g = P.getValue();
|
|
1453
|
+
if (!O.purchaseOrder)
|
|
1454
|
+
return ie(pt.FmChip, {
|
|
1455
1455
|
label: "N/A",
|
|
1456
1456
|
compact: !0
|
|
1457
1457
|
});
|
|
1458
|
-
const
|
|
1459
|
-
let
|
|
1460
|
-
return
|
|
1458
|
+
const $ = vt(O.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
|
+
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")), O.rejectedAt && (L = l("inventory.transfer.status.REJECT"), te = Oe.enum.REJECT.toLocaleLowerCase("en-us")), ie(
|
|
1461
1461
|
"div",
|
|
1462
1462
|
{
|
|
1463
1463
|
class: "flex"
|
|
1464
1464
|
},
|
|
1465
|
-
|
|
1465
|
+
ie(
|
|
1466
1466
|
"div",
|
|
1467
1467
|
{
|
|
1468
1468
|
class: [
|
|
1469
1469
|
"fm-status-badge",
|
|
1470
|
-
`fm-status-badge-${
|
|
1471
|
-
|
|
1470
|
+
`fm-status-badge-${te}`,
|
|
1471
|
+
J && "fm-status-badge-error"
|
|
1472
1472
|
].filter(Boolean).join(" ")
|
|
1473
1473
|
},
|
|
1474
|
-
`${
|
|
1474
|
+
`${L}`
|
|
1475
1475
|
)
|
|
1476
1476
|
);
|
|
1477
1477
|
},
|
|
@@ -1480,13 +1480,13 @@ function xi(u, t, r, o) {
|
|
|
1480
1480
|
{
|
|
1481
1481
|
id: "action",
|
|
1482
1482
|
cell(P) {
|
|
1483
|
-
const
|
|
1484
|
-
...
|
|
1483
|
+
const O = P.row.original, $ = (O.purchaseOrder ? S(O.purchaseOrder) : []).map((j) => j.value === Ne.Print ? {
|
|
1484
|
+
...j,
|
|
1485
1485
|
translationKey: "inventory.transfer.receiveRequest.details.printDeliveryOrder"
|
|
1486
|
-
} :
|
|
1486
|
+
} : j);
|
|
1487
1487
|
return Gt(
|
|
1488
|
-
|
|
1489
|
-
(
|
|
1488
|
+
$,
|
|
1489
|
+
(j) => O.purchaseOrder ? re(j, O.purchaseOrder, O) : void 0
|
|
1490
1490
|
);
|
|
1491
1491
|
},
|
|
1492
1492
|
enableSorting: !1,
|
|
@@ -1506,15 +1506,15 @@ function xi(u, t, r, o) {
|
|
|
1506
1506
|
// which is why this column read N/A on the warehouse's Transfer out while the
|
|
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
|
-
accessorFn: (
|
|
1510
|
-
var
|
|
1511
|
-
return ts(((
|
|
1509
|
+
accessorFn: (O) => {
|
|
1510
|
+
var g;
|
|
1511
|
+
return ts(((g = O.purchaseOrder) == null ? void 0 : g.netSuite) ?? O.netSuite);
|
|
1512
1512
|
},
|
|
1513
1513
|
header: () => "NetSuite Order (ID)",
|
|
1514
|
-
cell(
|
|
1515
|
-
var
|
|
1516
|
-
const
|
|
1517
|
-
return ts(((
|
|
1514
|
+
cell(O) {
|
|
1515
|
+
var $;
|
|
1516
|
+
const g = O.row.original;
|
|
1517
|
+
return ts((($ = g.purchaseOrder) == null ? void 0 : $.netSuite) ?? g.netSuite);
|
|
1518
1518
|
},
|
|
1519
1519
|
enableSorting: !1,
|
|
1520
1520
|
size: 200,
|
|
@@ -1525,15 +1525,15 @@ function xi(u, t, r, o) {
|
|
|
1525
1525
|
},
|
|
1526
1526
|
{
|
|
1527
1527
|
id: "netsuiteTransactionNumber",
|
|
1528
|
-
accessorFn: (
|
|
1529
|
-
var $,
|
|
1530
|
-
return ((
|
|
1528
|
+
accessorFn: (O) => {
|
|
1529
|
+
var g, $, j;
|
|
1530
|
+
return ((j = ($ = ((g = O.purchaseOrder) == null ? void 0 : g.netSuite) ?? O.netSuite) == null ? void 0 : $.additionalInfo) == null ? void 0 : j.transactionnumber) ?? "N/A";
|
|
1531
1531
|
},
|
|
1532
1532
|
header: () => "NetSuite Transaction No.",
|
|
1533
|
-
cell(
|
|
1534
|
-
var
|
|
1535
|
-
const
|
|
1536
|
-
return ((
|
|
1533
|
+
cell(O) {
|
|
1534
|
+
var $, j, J;
|
|
1535
|
+
const g = O.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,
|
|
@@ -1544,28 +1544,60 @@ function xi(u, t, r, o) {
|
|
|
1544
1544
|
},
|
|
1545
1545
|
{
|
|
1546
1546
|
id: "netsuiteRefNo",
|
|
1547
|
-
accessorFn: (
|
|
1548
|
-
var
|
|
1549
|
-
const
|
|
1550
|
-
var
|
|
1551
|
-
return (
|
|
1547
|
+
accessorFn: (O) => {
|
|
1548
|
+
var $, j, J;
|
|
1549
|
+
const g = (j = ($ = O.purchaseOrder) == null ? void 0 : $.deliveryOrder) == null ? void 0 : j.filter((ee) => {
|
|
1550
|
+
var L;
|
|
1551
|
+
return (L = ee.netSuite) == null ? void 0 : L.id;
|
|
1552
1552
|
});
|
|
1553
|
-
return
|
|
1554
|
-
var
|
|
1555
|
-
return `${((
|
|
1556
|
-
}).join(", ") : (
|
|
1553
|
+
return g != null && g.length ? g.map((ee) => {
|
|
1554
|
+
var L, te;
|
|
1555
|
+
return `${((L = ee.netSuite) == null ? void 0 : L.refNo) ?? "N/A"} (${((te = ee.netSuite) == null ? void 0 : te.id) ?? "-"})`;
|
|
1556
|
+
}).join(", ") : (J = O.netSuite) != null && J.id ? `${O.netSuite.refNo ?? "N/A"} (${O.netSuite.id})` : "N/A";
|
|
1557
1557
|
},
|
|
1558
1558
|
header: () => "Netsuite ref no.",
|
|
1559
|
-
cell(
|
|
1560
|
-
var
|
|
1561
|
-
const
|
|
1562
|
-
var
|
|
1563
|
-
return (
|
|
1559
|
+
cell(O) {
|
|
1560
|
+
var j, J, ee;
|
|
1561
|
+
const g = O.row.original, $ = (J = (j = g.purchaseOrder) == null ? void 0 : j.deliveryOrder) == null ? void 0 : J.filter((L) => {
|
|
1562
|
+
var te;
|
|
1563
|
+
return (te = L.netSuite) == null ? void 0 : te.id;
|
|
1564
1564
|
});
|
|
1565
|
-
return
|
|
1566
|
-
var
|
|
1567
|
-
return `${((
|
|
1568
|
-
}).join(", ") : (
|
|
1565
|
+
return $ != null && $.length ? $.map((L) => {
|
|
1566
|
+
var te, _e;
|
|
1567
|
+
return `${((te = L.netSuite) == null ? void 0 : te.refNo) ?? "N/A"} (${((_e = L.netSuite) == null ? void 0 : _e.id) ?? "-"})`;
|
|
1568
|
+
}).join(", ") : (ee = g.netSuite) != null && ee.id ? `${g.netSuite.refNo ?? "N/A"} (${g.netSuite.id})` : "N/A";
|
|
1569
|
+
},
|
|
1570
|
+
enableSorting: !1,
|
|
1571
|
+
size: 200,
|
|
1572
|
+
meta: {
|
|
1573
|
+
cellClass: "",
|
|
1574
|
+
headerClass: ""
|
|
1575
|
+
}
|
|
1576
|
+
},
|
|
1577
|
+
{
|
|
1578
|
+
id: "netsuiteRefNo",
|
|
1579
|
+
accessorFn: (O) => {
|
|
1580
|
+
var $, j, J;
|
|
1581
|
+
const g = (j = ($ = O.purchaseOrder) == null ? void 0 : $.deliveryOrder) == null ? void 0 : j.filter((ee) => {
|
|
1582
|
+
var L;
|
|
1583
|
+
return (L = ee.netSuite) == null ? void 0 : L.id;
|
|
1584
|
+
});
|
|
1585
|
+
return g != null && g.length ? g.map((ee) => {
|
|
1586
|
+
var L, te;
|
|
1587
|
+
return `${((L = ee.netSuite) == null ? void 0 : L.refNo) ?? "N/A"} (${((te = ee.netSuite) == null ? void 0 : te.id) ?? "-"})`;
|
|
1588
|
+
}).join(", ") : (J = O.netSuite) != null && J.id ? `${O.netSuite.refNo} (${O.netSuite.id})` : "N/A";
|
|
1589
|
+
},
|
|
1590
|
+
header: () => "Netsuite ref no.",
|
|
1591
|
+
cell(O) {
|
|
1592
|
+
var j, J, ee;
|
|
1593
|
+
const g = O.row.original, $ = (J = (j = g.purchaseOrder) == null ? void 0 : j.deliveryOrder) == null ? void 0 : J.filter((L) => {
|
|
1594
|
+
var te;
|
|
1595
|
+
return (te = L.netSuite) == null ? void 0 : te.id;
|
|
1596
|
+
});
|
|
1597
|
+
return $ != null && $.length ? $.map((L) => {
|
|
1598
|
+
var te, _e;
|
|
1599
|
+
return `${((te = L.netSuite) == null ? void 0 : te.refNo) ?? "N/A"} (${((_e = L.netSuite) == null ? void 0 : _e.id) ?? "-"})`;
|
|
1600
|
+
}).join(", ") : (ee = g.netSuite) != null && ee.id ? `${g.netSuite.refNo} (${g.netSuite.id})` : "N/A";
|
|
1569
1601
|
},
|
|
1570
1602
|
enableSorting: !1,
|
|
1571
1603
|
size: 200,
|
|
@@ -1579,12 +1611,12 @@ function xi(u, t, r, o) {
|
|
|
1579
1611
|
}
|
|
1580
1612
|
return Q;
|
|
1581
1613
|
}
|
|
1582
|
-
const
|
|
1614
|
+
const le = H(() => u === "receive/request" ? oe() : X()), be = ae(!1), ce = ae(""), xe = ae(""), Ae = ae(!1);
|
|
1583
1615
|
return {
|
|
1584
|
-
columnDefs:
|
|
1616
|
+
columnDefs: le,
|
|
1585
1617
|
showCustomPrintDialog: be,
|
|
1586
|
-
customPrintHtml:
|
|
1587
|
-
customPrintTemplateName:
|
|
1618
|
+
customPrintHtml: ce,
|
|
1619
|
+
customPrintTemplateName: xe,
|
|
1588
1620
|
customPrintIsDefault: Ae
|
|
1589
1621
|
};
|
|
1590
1622
|
}
|
|
@@ -1601,27 +1633,27 @@ const yr = { class: "flex flex-col gap-4 border border-fm-color-neutral-gray-200
|
|
|
1601
1633
|
state: {}
|
|
1602
1634
|
},
|
|
1603
1635
|
setup(u) {
|
|
1604
|
-
const t = u, r =
|
|
1636
|
+
const t = u, r = H(() => t.state.adjustments ?? []);
|
|
1605
1637
|
function o(l) {
|
|
1606
1638
|
return +$e(l.dinero);
|
|
1607
1639
|
}
|
|
1608
1640
|
function m() {
|
|
1609
1641
|
t.controller.addAdjustment();
|
|
1610
1642
|
}
|
|
1611
|
-
function c(l,
|
|
1612
|
-
t.controller.updateAdjustment(l,
|
|
1643
|
+
function c(l, C) {
|
|
1644
|
+
t.controller.updateAdjustment(l, C);
|
|
1613
1645
|
}
|
|
1614
|
-
function d(l,
|
|
1615
|
-
t.controller.updateAdjustment(l, null,
|
|
1646
|
+
function d(l, C) {
|
|
1647
|
+
t.controller.updateAdjustment(l, null, C);
|
|
1616
1648
|
}
|
|
1617
1649
|
function n(l) {
|
|
1618
1650
|
t.controller.removeAdjustment(l);
|
|
1619
1651
|
}
|
|
1620
|
-
return (l,
|
|
1621
|
-
const v =
|
|
1652
|
+
return (l, C) => {
|
|
1653
|
+
const v = ue("FmButton"), D = ue("FmTextField"), R = ue("FmStepperField");
|
|
1622
1654
|
return i(), y("div", yr, [
|
|
1623
1655
|
e("div", hr, [
|
|
1624
|
-
|
|
1656
|
+
C[0] || (C[0] = e("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-secondary" }, "Price adjustments", -1)),
|
|
1625
1657
|
q(v, {
|
|
1626
1658
|
variant: "tertiary",
|
|
1627
1659
|
label: "Add adjustment",
|
|
@@ -1631,14 +1663,14 @@ const yr = { class: "flex flex-col gap-4 border border-fm-color-neutral-gray-200
|
|
|
1631
1663
|
})
|
|
1632
1664
|
]),
|
|
1633
1665
|
r.value.length === 0 ? (i(), y("div", br, " No price adjustments ")) : V("", !0),
|
|
1634
|
-
(i(!0), y(De, null, Te(r.value, (T,
|
|
1666
|
+
(i(!0), y(De, null, Te(r.value, (T, S) => (i(), y("div", {
|
|
1635
1667
|
key: T.id
|
|
1636
1668
|
}, [
|
|
1637
1669
|
e("div", gr, [
|
|
1638
1670
|
e("div", _r, [
|
|
1639
1671
|
q(D, {
|
|
1640
1672
|
"model-value": T.name,
|
|
1641
|
-
"onUpdate:modelValue": (
|
|
1673
|
+
"onUpdate:modelValue": (B) => c(T.id, B),
|
|
1642
1674
|
label: "Name",
|
|
1643
1675
|
placeholder: "e.g. Freight, Discount",
|
|
1644
1676
|
size: "md"
|
|
@@ -1647,7 +1679,7 @@ const yr = { class: "flex flex-col gap-4 border border-fm-color-neutral-gray-200
|
|
|
1647
1679
|
e("div", Sr, [
|
|
1648
1680
|
q(R, {
|
|
1649
1681
|
"model-value": o(T),
|
|
1650
|
-
"onUpdate:modelValue": (
|
|
1682
|
+
"onUpdate:modelValue": (B) => d(T.id, B),
|
|
1651
1683
|
label: "Amount (+/-)",
|
|
1652
1684
|
step: 0.01,
|
|
1653
1685
|
placeholder: "0.00",
|
|
@@ -1660,10 +1692,10 @@ const yr = { class: "flex flex-col gap-4 border border-fm-color-neutral-gray-200
|
|
|
1660
1692
|
"prepend-icon": "delete",
|
|
1661
1693
|
size: "md",
|
|
1662
1694
|
class: "mt-6",
|
|
1663
|
-
onClick: (
|
|
1695
|
+
onClick: (B) => n(T.id)
|
|
1664
1696
|
}, null, 8, ["onClick"])
|
|
1665
1697
|
]),
|
|
1666
|
-
|
|
1698
|
+
S < r.value.length - 1 ? (i(), y("div", Or)) : V("", !0)
|
|
1667
1699
|
]))), 128))
|
|
1668
1700
|
]);
|
|
1669
1701
|
};
|
|
@@ -1703,7 +1735,7 @@ const kr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1703
1735
|
id: "",
|
|
1704
1736
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1705
1737
|
items: []
|
|
1706
|
-
}), m =
|
|
1738
|
+
}), m = ae(), c = t, d = (l) => l != null && l !== "";
|
|
1707
1739
|
ns(() => {
|
|
1708
1740
|
r.purchaseOrder && (o.items = r.purchaseOrder.items.map((l) => ({
|
|
1709
1741
|
id: l.id,
|
|
@@ -1712,18 +1744,18 @@ const kr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1712
1744
|
amount: l.quantity ?? { amount: 1, precision: 0 }
|
|
1713
1745
|
})));
|
|
1714
1746
|
});
|
|
1715
|
-
const n =
|
|
1716
|
-
return (l,
|
|
1717
|
-
const v =
|
|
1747
|
+
const n = H(() => o.items.length <= 10);
|
|
1748
|
+
return (l, C) => {
|
|
1749
|
+
const v = ue("FmTable"), D = ue("FmButton"), R = ue("FmForm");
|
|
1718
1750
|
return i(), he(R, {
|
|
1719
1751
|
ref_key: "formRef",
|
|
1720
1752
|
ref: m,
|
|
1721
1753
|
class: "bg-white flex flex-col gap-32 rounded-3xl p-24 w-[800px]",
|
|
1722
1754
|
onValidationFailed: console.log,
|
|
1723
|
-
onValidationSuccess:
|
|
1755
|
+
onValidationSuccess: C[1] || (C[1] = () => r.confirm(o))
|
|
1724
1756
|
}, {
|
|
1725
1757
|
default: pe(() => [
|
|
1726
|
-
|
|
1758
|
+
C[2] || (C[2] = e("div", { class: "fm-typo-en-title-sm-600" }, "Confirm the transfer amount", -1)),
|
|
1727
1759
|
e("div", kr, [
|
|
1728
1760
|
e("div", xr, [
|
|
1729
1761
|
q(v, {
|
|
@@ -1731,21 +1763,21 @@ const kr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1731
1763
|
{
|
|
1732
1764
|
header: "Code",
|
|
1733
1765
|
cell: (T) => {
|
|
1734
|
-
const
|
|
1735
|
-
return
|
|
1766
|
+
const S = r.purchaseOrder.items.find((B) => d(T.row.original.id) ? B.id === T.row.original.id : B.sku._id === T.row.original.sku._id);
|
|
1767
|
+
return ie(
|
|
1736
1768
|
b(pt).FmTooltip,
|
|
1737
1769
|
{
|
|
1738
|
-
content:
|
|
1770
|
+
content: S.code,
|
|
1739
1771
|
placement: "top",
|
|
1740
1772
|
variant: "plain",
|
|
1741
1773
|
zIndex: 50
|
|
1742
1774
|
},
|
|
1743
|
-
|
|
1775
|
+
ie(
|
|
1744
1776
|
"span",
|
|
1745
1777
|
{
|
|
1746
1778
|
class: "flex-auto line-clamp-2 text-ellipsis break-all"
|
|
1747
1779
|
},
|
|
1748
|
-
|
|
1780
|
+
S.code
|
|
1749
1781
|
)
|
|
1750
1782
|
);
|
|
1751
1783
|
}
|
|
@@ -1753,21 +1785,21 @@ const kr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1753
1785
|
{
|
|
1754
1786
|
header: "Name",
|
|
1755
1787
|
cell: (T) => {
|
|
1756
|
-
const
|
|
1757
|
-
return
|
|
1788
|
+
const S = r.purchaseOrder.items.find((B) => d(T.row.original.id) ? B.id === T.row.original.id : B.sku._id === T.row.original.sku._id);
|
|
1789
|
+
return ie(
|
|
1758
1790
|
b(pt).FmTooltip,
|
|
1759
1791
|
{
|
|
1760
|
-
content:
|
|
1792
|
+
content: S.name,
|
|
1761
1793
|
placement: "top",
|
|
1762
1794
|
variant: "plain",
|
|
1763
1795
|
zIndex: 50
|
|
1764
1796
|
},
|
|
1765
|
-
|
|
1797
|
+
ie(
|
|
1766
1798
|
"span",
|
|
1767
1799
|
{
|
|
1768
1800
|
class: "flex-auto line-clamp-2 text-ellipsis break-all"
|
|
1769
1801
|
},
|
|
1770
|
-
|
|
1802
|
+
S.name
|
|
1771
1803
|
)
|
|
1772
1804
|
);
|
|
1773
1805
|
}
|
|
@@ -1775,31 +1807,31 @@ const kr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1775
1807
|
{
|
|
1776
1808
|
header: "Amount",
|
|
1777
1809
|
cell: (T) => {
|
|
1778
|
-
const
|
|
1810
|
+
const S = T.row.original, B = r.purchaseOrder.items.find((re) => d(S.id) ? re.id === S.id : re.sku._id === S.sku._id), E = S.amount ?? {
|
|
1779
1811
|
amount: 1,
|
|
1780
1812
|
precision: 0
|
|
1781
1813
|
};
|
|
1782
|
-
return
|
|
1814
|
+
return ie(Ys, {
|
|
1783
1815
|
style: {
|
|
1784
1816
|
flex: "1 1 0%"
|
|
1785
1817
|
},
|
|
1786
1818
|
modelValue: {
|
|
1787
1819
|
amount: E,
|
|
1788
|
-
measurement:
|
|
1820
|
+
measurement: S.measurement ?? null
|
|
1789
1821
|
},
|
|
1790
|
-
key: d(
|
|
1791
|
-
unit:
|
|
1792
|
-
"onUpdate:modelValue": (
|
|
1793
|
-
if (!
|
|
1794
|
-
const
|
|
1795
|
-
|
|
1822
|
+
key: d(S.id) ? S.id : S.sku._id,
|
|
1823
|
+
unit: S.sku.unit,
|
|
1824
|
+
"onUpdate:modelValue": (re) => {
|
|
1825
|
+
if (!re) return;
|
|
1826
|
+
const oe = o.items.find((X) => d(S.id) ? X.id === S.id : X.sku._id === S.sku._id);
|
|
1827
|
+
oe && (oe.amount = re.amount);
|
|
1796
1828
|
},
|
|
1797
1829
|
disableUnit: !0,
|
|
1798
1830
|
rules: [
|
|
1799
1831
|
b(Js)(
|
|
1800
1832
|
+b($e)({ amount: 0, precision: 0 })
|
|
1801
1833
|
),
|
|
1802
|
-
b(Xs)(+b($e)(
|
|
1834
|
+
b(Xs)(+b($e)(B.quantity))
|
|
1803
1835
|
],
|
|
1804
1836
|
applyDefaultRules: !0
|
|
1805
1837
|
});
|
|
@@ -1824,7 +1856,7 @@ const kr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1824
1856
|
label: "Cancel",
|
|
1825
1857
|
size: "md",
|
|
1826
1858
|
variant: "secondary",
|
|
1827
|
-
onClick:
|
|
1859
|
+
onClick: C[0] || (C[0] = () => c("update:show", !1))
|
|
1828
1860
|
})
|
|
1829
1861
|
])
|
|
1830
1862
|
]),
|
|
@@ -1835,7 +1867,7 @@ const kr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1835
1867
|
});
|
|
1836
1868
|
var Nt = /* @__PURE__ */ ((u) => (u.loading = "loading", u.error = "error", u.success = "success", u))(Nt || {});
|
|
1837
1869
|
function Cr(u) {
|
|
1838
|
-
const t =
|
|
1870
|
+
const t = ae({
|
|
1839
1871
|
state: "loading"
|
|
1840
1872
|
/* loading */
|
|
1841
1873
|
}), r = async (o) => {
|
|
@@ -1930,21 +1962,21 @@ const nt = {
|
|
|
1930
1962
|
scope: {}
|
|
1931
1963
|
},
|
|
1932
1964
|
setup(u) {
|
|
1933
|
-
const t = u, r = _t(), o = Je(), m = gt(), c =
|
|
1934
|
-
|
|
1965
|
+
const t = u, r = _t(), o = Je(), m = gt(), c = ae(!1);
|
|
1966
|
+
H(() => {
|
|
1935
1967
|
var v, D, R, T;
|
|
1936
1968
|
let n = !0;
|
|
1937
1969
|
r.isEnabled || (n = !1);
|
|
1938
|
-
const l = t.purchaseOrder,
|
|
1939
|
-
return l && ((v = l == null ? void 0 : l.supplier) != null && v.internal ? (!
|
|
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 && ((T = l == null ? void 0 : l.netSuite) != null && T.id) && (l == null ? void 0 : l.status) == Oe.enum.REQUESTING && (n = !1))), n;
|
|
1940
1972
|
});
|
|
1941
1973
|
async function d() {
|
|
1942
1974
|
c.value || m.open({
|
|
1943
1975
|
title: "Sync with NetSuite",
|
|
1944
|
-
contentComponent:
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1976
|
+
contentComponent: ie("div", [
|
|
1977
|
+
ie("p", "Are you sure you want to sync now?"),
|
|
1978
|
+
ie("br"),
|
|
1979
|
+
ie(
|
|
1948
1980
|
"p",
|
|
1949
1981
|
{ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
1950
1982
|
"Please wait a moment before syncing manually to avoid unnecessary actions."
|
|
@@ -1957,21 +1989,21 @@ const nt = {
|
|
|
1957
1989
|
},
|
|
1958
1990
|
secondaryActions: { text: "Not now", close: !0 }
|
|
1959
1991
|
}).onPrimary(async () => {
|
|
1960
|
-
var n, l,
|
|
1992
|
+
var n, l, C, v, D, R, T;
|
|
1961
1993
|
try {
|
|
1962
1994
|
c.value = !0;
|
|
1963
|
-
const
|
|
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;
|
|
1964
1996
|
await r.syncPurchaseOrder({
|
|
1965
|
-
purchaseOrderId:
|
|
1966
|
-
locationId: t.scope === "approval" ?
|
|
1997
|
+
purchaseOrderId: S,
|
|
1998
|
+
locationId: t.scope === "approval" ? B : void 0,
|
|
1967
1999
|
netsuiteId: ((D = (v = t.purchaseOrder) == null ? void 0 : v.netSuite) == null ? void 0 : D.id) || ((T = (R = t.poRequest) == null ? void 0 : R.netSuite) == null ? void 0 : T.id)
|
|
1968
2000
|
}), o.open({
|
|
1969
2001
|
title: "Sync with NetSuite",
|
|
1970
2002
|
message: "Requested to sync with NetSuite. Please wait a moment.",
|
|
1971
2003
|
type: "success"
|
|
1972
2004
|
}), await new Promise((E) => setTimeout(E, 5e3)), c.value = !1;
|
|
1973
|
-
} catch (
|
|
1974
|
-
console.log("Failed to sync with NetSuite",
|
|
2005
|
+
} catch (S) {
|
|
2006
|
+
console.log("Failed to sync with NetSuite", S), o.open({
|
|
1975
2007
|
title: "Error",
|
|
1976
2008
|
message: "Failed to sync with NetSuite",
|
|
1977
2009
|
type: "error"
|
|
@@ -1980,9 +2012,9 @@ const nt = {
|
|
|
1980
2012
|
});
|
|
1981
2013
|
}
|
|
1982
2014
|
return (n, l) => {
|
|
1983
|
-
const
|
|
2015
|
+
const C = ue("FmButton");
|
|
1984
2016
|
return i(), y("div", Ar, [
|
|
1985
|
-
q(
|
|
2017
|
+
q(C, {
|
|
1986
2018
|
"prepend-icon": "sync",
|
|
1987
2019
|
variant: "secondary",
|
|
1988
2020
|
label: "Sync",
|
|
@@ -2021,59 +2053,59 @@ const nt = {
|
|
|
2021
2053
|
scope: {}
|
|
2022
2054
|
},
|
|
2023
2055
|
setup(u) {
|
|
2024
|
-
const t = u, r = _t(), o = Ze(), m =
|
|
2056
|
+
const t = u, r = _t(), o = Ze(), m = ae(t.poRequest);
|
|
2025
2057
|
ns(async () => {
|
|
2026
2058
|
var l;
|
|
2027
2059
|
if (!t.poRequest && ((l = t.purchaseOrder) != null && l._id)) {
|
|
2028
|
-
const
|
|
2029
|
-
m.value =
|
|
2060
|
+
const C = await o.getLatestPurchaseOrderRequest(t.purchaseOrder._id);
|
|
2061
|
+
m.value = C;
|
|
2030
2062
|
}
|
|
2031
2063
|
});
|
|
2032
|
-
const c =
|
|
2064
|
+
const c = H(
|
|
2033
2065
|
() => {
|
|
2034
|
-
var l,
|
|
2066
|
+
var l, C, v, D, R, T;
|
|
2035
2067
|
return r.getSubsidiaryFullName(
|
|
2036
|
-
((v = (
|
|
2068
|
+
((v = (C = (l = t.purchaseOrder) == null ? void 0 : l.netSuite) == null ? void 0 : C.subsidiary) == null ? void 0 : v.id) || ((T = (R = (D = t.poRequest) == null ? void 0 : D.netSuite) == null ? void 0 : R.subsidiary) == null ? void 0 : T.id)
|
|
2037
2069
|
).fullName;
|
|
2038
2070
|
}
|
|
2039
|
-
), d =
|
|
2040
|
-
var l,
|
|
2041
|
-
return (v = (
|
|
2042
|
-
}), n =
|
|
2043
|
-
var l,
|
|
2044
|
-
return (
|
|
2045
|
-
(
|
|
2046
|
-
var
|
|
2047
|
-
return `${((
|
|
2071
|
+
), d = H(() => {
|
|
2072
|
+
var l, C, v, D, R, T, S, B, E, re, oe, X;
|
|
2073
|
+
return (v = (C = (l = t.purchaseOrder) == null ? void 0 : l.netSuite) == null ? void 0 : C.additionalInfo) != null && v.transactionnumber ? (T = (R = (D = t.purchaseOrder) == null ? void 0 : D.netSuite) == null ? void 0 : R.additionalInfo) == null ? void 0 : T.transactionnumber : (E = (B = (S = m.value) == null ? void 0 : S.netSuite) == null ? void 0 : B.additionalInfo) != null && E.transactionnumber ? (X = (oe = (re = m.value) == null ? void 0 : re.netSuite) == null ? void 0 : oe.additionalInfo) == null ? void 0 : X.transactionnumber : null;
|
|
2074
|
+
}), n = H(() => {
|
|
2075
|
+
var l, C, v, D, R, T;
|
|
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 ? (T = (R = t.purchaseOrder) == null ? void 0 : R.deliveryFullfillment) == null ? void 0 : T.map(
|
|
2077
|
+
(S) => {
|
|
2078
|
+
var B, E;
|
|
2079
|
+
return `${((B = S.netSuite) == null ? void 0 : B.refNo) ?? "N/A"} (${((E = S.netSuite) == null ? void 0 : E.id) ?? "-"})`;
|
|
2048
2080
|
}
|
|
2049
2081
|
).join(", ") : "N/A";
|
|
2050
2082
|
});
|
|
2051
|
-
return (l,
|
|
2052
|
-
var v, D, R, T,
|
|
2083
|
+
return (l, C) => {
|
|
2084
|
+
var v, D, R, T, S, B, E, re, oe, X, le, be, ce, xe, Ae, Q;
|
|
2053
2085
|
return b(r).isEnabled ? (i(), y("div", Dr, [
|
|
2054
2086
|
e("div", Rr, [
|
|
2055
|
-
|
|
2056
|
-
e("div", Pr,
|
|
2087
|
+
C[0] || (C[0] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "NetSuite subsidiary", -1)),
|
|
2088
|
+
e("div", Pr, x(c.value || "N/A"), 1)
|
|
2057
2089
|
]),
|
|
2058
2090
|
!l.isTransferBetweenOutlets && l.scope === b(At).RECEIVE_REQUEST ? (i(), y("div", Fr, [
|
|
2059
|
-
e("div", Ir, " NetSuite " +
|
|
2091
|
+
e("div", Ir, " NetSuite " + x((D = (v = l.purchaseOrder) == null ? void 0 : v.netSuite) != null && D.recordType ? b(ls)((T = (R = l.purchaseOrder) == null ? void 0 : R.netSuite) == null ? void 0 : T.recordType) : l.transferType === b(at).enum.purchase ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
|
|
2060
2092
|
e("div", Tr, [
|
|
2061
|
-
(
|
|
2093
|
+
(B = (S = l.purchaseOrder) == null ? void 0 : S.netSuite) != null && B.id ? (i(), y("span", Er, x((re = (E = l.purchaseOrder) == null ? void 0 : E.netSuite) == null ? void 0 : re.refNo) + " (" + x((X = (oe = l.purchaseOrder) == null ? void 0 : oe.netSuite) == null ? void 0 : X.id) + ") ", 1)) : (i(), y("span", qr, "N/A"))
|
|
2062
2094
|
])
|
|
2063
2095
|
])) : V("", !0),
|
|
2064
2096
|
!l.isTransferBetweenOutlets && m.value || l.scope === b(At).APPROVAL ? (i(), y("div", Vr, [
|
|
2065
|
-
e("div", Lr, " (Request) NetSuite " +
|
|
2097
|
+
e("div", Lr, " (Request) NetSuite " + x(l.transferType === b(at).enum.purchase ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
|
|
2066
2098
|
e("div", jr, [
|
|
2067
|
-
(be = (
|
|
2099
|
+
(be = (le = m.value) == null ? void 0 : le.netSuite) != null && be.id ? (i(), y("span", Ur, x((xe = (ce = m.value) == null ? void 0 : ce.netSuite) == null ? void 0 : xe.refNo) + " (" + x((Q = (Ae = m.value) == null ? void 0 : Ae.netSuite) == null ? void 0 : Q.id) + ") ", 1)) : (i(), y("span", Mr, "N/A"))
|
|
2068
2100
|
])
|
|
2069
2101
|
])) : V("", !0),
|
|
2070
2102
|
d.value ? (i(), y("div", Br, [
|
|
2071
|
-
|
|
2072
|
-
e("div", zr,
|
|
2103
|
+
C[1] || (C[1] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite Transaction Number ", -1)),
|
|
2104
|
+
e("div", zr, x(d.value), 1)
|
|
2073
2105
|
])) : V("", !0),
|
|
2074
2106
|
b(r).isEnabled && l.transferType === b(at).enum.transfer && !l.isTransferBetweenOutlets ? (i(), y("div", Kr, [
|
|
2075
|
-
|
|
2076
|
-
e("div", Hr,
|
|
2107
|
+
C[2] || (C[2] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite fulfillment IDs ", -1)),
|
|
2108
|
+
e("div", Hr, x(n.value), 1)
|
|
2077
2109
|
])) : V("", !0)
|
|
2078
2110
|
])) : V("", !0);
|
|
2079
2111
|
};
|
|
@@ -2099,17 +2131,17 @@ const nt = {
|
|
|
2099
2131
|
});
|
|
2100
2132
|
return;
|
|
2101
2133
|
}
|
|
2102
|
-
const l = `attributes.pod:netsuite* AND (${d.join(" OR ")})`, { url:
|
|
2134
|
+
const l = `attributes.pod:netsuite* AND (${d.join(" OR ")})`, { url: C } = await r.getSyncLogs(l);
|
|
2103
2135
|
t.open(
|
|
2104
2136
|
{
|
|
2105
2137
|
message: "Opening NetSuite logs...",
|
|
2106
2138
|
type: "info"
|
|
2107
2139
|
},
|
|
2108
2140
|
800
|
|
2109
|
-
), await new Promise((v) => setTimeout(v, 800)), window.open(
|
|
2141
|
+
), await new Promise((v) => setTimeout(v, 800)), window.open(C, "_blank");
|
|
2110
2142
|
}
|
|
2111
2143
|
return (m, c) => {
|
|
2112
|
-
const d =
|
|
2144
|
+
const d = ue("FmButton");
|
|
2113
2145
|
return i(), y("div", Wr, [
|
|
2114
2146
|
q(d, {
|
|
2115
2147
|
"prepend-icon": "history",
|
|
@@ -2139,17 +2171,17 @@ const nt = {
|
|
|
2139
2171
|
purchaseOrderId: {}
|
|
2140
2172
|
},
|
|
2141
2173
|
setup(u) {
|
|
2142
|
-
const t = u, r = Ft(), o =
|
|
2174
|
+
const t = u, r = Ft(), o = ae(!1), m = ze(), c = ae(!0), d = ae(!1), n = ae(!1), l = ae(!1), C = ae(null), v = ae([]);
|
|
2143
2175
|
async function D() {
|
|
2144
|
-
if (!
|
|
2176
|
+
if (!C.value) {
|
|
2145
2177
|
o.value = !0;
|
|
2146
2178
|
try {
|
|
2147
2179
|
c.value = !0;
|
|
2148
|
-
const
|
|
2180
|
+
const B = await r.getMoreInfo(
|
|
2149
2181
|
m.currentLocation.dbName,
|
|
2150
2182
|
t.purchaseOrderId
|
|
2151
2183
|
);
|
|
2152
|
-
|
|
2184
|
+
C.value = B, d.value = !1;
|
|
2153
2185
|
} catch {
|
|
2154
2186
|
d.value = !0;
|
|
2155
2187
|
} finally {
|
|
@@ -2162,16 +2194,16 @@ const nt = {
|
|
|
2162
2194
|
if (!(v.value.length > 0))
|
|
2163
2195
|
try {
|
|
2164
2196
|
n.value = !0;
|
|
2165
|
-
const
|
|
2166
|
-
v.value =
|
|
2197
|
+
const B = await r.getChangeLogs(t.netsuiteId);
|
|
2198
|
+
v.value = B, l.value = !1;
|
|
2167
2199
|
} catch {
|
|
2168
2200
|
l.value = !0;
|
|
2169
2201
|
} finally {
|
|
2170
2202
|
n.value = !1;
|
|
2171
2203
|
}
|
|
2172
2204
|
}
|
|
2173
|
-
function T(
|
|
2174
|
-
switch (
|
|
2205
|
+
function T(B) {
|
|
2206
|
+
switch (B) {
|
|
2175
2207
|
case Me.Create:
|
|
2176
2208
|
return "text-green-600 bg-green-100";
|
|
2177
2209
|
case Me.Set:
|
|
@@ -2184,8 +2216,8 @@ const nt = {
|
|
|
2184
2216
|
return "text-gray-600 bg-gray-100";
|
|
2185
2217
|
}
|
|
2186
2218
|
}
|
|
2187
|
-
function
|
|
2188
|
-
return new Date(
|
|
2219
|
+
function S(B) {
|
|
2220
|
+
return new Date(B).toLocaleDateString("en-US", {
|
|
2189
2221
|
year: "numeric",
|
|
2190
2222
|
month: "short",
|
|
2191
2223
|
day: "numeric",
|
|
@@ -2193,21 +2225,21 @@ const nt = {
|
|
|
2193
2225
|
minute: "2-digit"
|
|
2194
2226
|
});
|
|
2195
2227
|
}
|
|
2196
|
-
return (
|
|
2197
|
-
const
|
|
2228
|
+
return (B, E) => {
|
|
2229
|
+
const re = ue("FmButton"), oe = ue("FmLabel"), X = ue("FmCircularProgress"), le = ue("FmIcon"), be = ue("FmDialog");
|
|
2198
2230
|
return i(), y("div", Yr, [
|
|
2199
2231
|
q(be, {
|
|
2200
2232
|
modelValue: o.value,
|
|
2201
|
-
"onUpdate:modelValue": E[2] || (E[2] = (
|
|
2233
|
+
"onUpdate:modelValue": E[2] || (E[2] = (ce) => o.value = ce),
|
|
2202
2234
|
overlay: !0,
|
|
2203
2235
|
"max-width": 800
|
|
2204
2236
|
}, {
|
|
2205
2237
|
"dialog-button": pe(() => [
|
|
2206
|
-
q(
|
|
2238
|
+
q(re, {
|
|
2207
2239
|
"prepend-icon": "info",
|
|
2208
2240
|
variant: "secondary",
|
|
2209
2241
|
label: "Latest Info",
|
|
2210
|
-
onClick: E[0] || (E[0] = (
|
|
2242
|
+
onClick: E[0] || (E[0] = (ce) => D()),
|
|
2211
2243
|
"text-color": "primary",
|
|
2212
2244
|
"bg-color": "transparent",
|
|
2213
2245
|
"border-color": "primary"
|
|
@@ -2221,27 +2253,27 @@ const nt = {
|
|
|
2221
2253
|
d.value ? (i(), y("p", bo, "Something went wrong.")) : (i(), y(De, { key: 0 }, [
|
|
2222
2254
|
e("div", Zr, [
|
|
2223
2255
|
E[4] || (E[4] = e("h3", { class: "fm-typo-en-body-lg-600 mb-4" }, "NetSuite Order Details", -1)),
|
|
2224
|
-
(i(!0), y(De, null, Te(
|
|
2225
|
-
key:
|
|
2256
|
+
(i(!0), y(De, null, Te(C.value, (ce, xe) => (i(), y("div", {
|
|
2257
|
+
key: xe,
|
|
2226
2258
|
class: "mb-2"
|
|
2227
2259
|
}, [
|
|
2228
2260
|
e("div", null, [
|
|
2229
|
-
q(
|
|
2230
|
-
label: b(Rt)(
|
|
2261
|
+
q(oe, {
|
|
2262
|
+
label: b(Rt)(xe)
|
|
2231
2263
|
}, null, 8, ["label"]),
|
|
2232
2264
|
e("div", eo, [
|
|
2233
|
-
Array.isArray(
|
|
2265
|
+
Array.isArray(ce) ? (i(), y("span", to, x(ce.length > 0 ? ce.join(", ") : "N/A"), 1)) : (i(), y("span", so, x(ce), 1))
|
|
2234
2266
|
])
|
|
2235
2267
|
])
|
|
2236
2268
|
]))), 128))
|
|
2237
2269
|
]),
|
|
2238
2270
|
n.value ? (i(), y("div", ro, [
|
|
2239
2271
|
E[5] || (E[5] = e("span", null, "Change Log Loading...", -1)),
|
|
2240
|
-
q(
|
|
2272
|
+
q(X, { size: "md" })
|
|
2241
2273
|
])) : V("", !0),
|
|
2242
2274
|
!n.value && v.value.length > 0 ? (i(), y("div", oo, [
|
|
2243
2275
|
e("h3", no, [
|
|
2244
|
-
q(
|
|
2276
|
+
q(le, {
|
|
2245
2277
|
name: "error",
|
|
2246
2278
|
color: "#ff9500",
|
|
2247
2279
|
size: "sm"
|
|
@@ -2267,21 +2299,21 @@ const nt = {
|
|
|
2267
2299
|
])
|
|
2268
2300
|
], -1)),
|
|
2269
2301
|
e("tbody", null, [
|
|
2270
|
-
(i(!0), y(De, null, Te(v.value, (
|
|
2271
|
-
key:
|
|
2302
|
+
(i(!0), y(De, null, Te(v.value, (ce, xe) => (i(), y("tr", {
|
|
2303
|
+
key: xe,
|
|
2272
2304
|
class: "border-b border-fm-color-neutral-gray-200 last:border-b-0"
|
|
2273
2305
|
}, [
|
|
2274
|
-
e("td", io,
|
|
2275
|
-
e("td", uo,
|
|
2276
|
-
e("td", co,
|
|
2277
|
-
e("td", mo,
|
|
2306
|
+
e("td", io, x(S(ce._dateiso8601)), 1),
|
|
2307
|
+
e("td", uo, x(ce._rolename), 1),
|
|
2308
|
+
e("td", co, x(ce._employeename), 1),
|
|
2309
|
+
e("td", mo, x(ce._contextname), 1),
|
|
2278
2310
|
e("td", {
|
|
2279
|
-
class: Ge(`p-3 fm-typo-en-body-sm-600 ${T(Number(
|
|
2280
|
-
},
|
|
2281
|
-
e("td", po,
|
|
2282
|
-
e("td", fo,
|
|
2283
|
-
e("td", vo,
|
|
2284
|
-
e("td", yo,
|
|
2311
|
+
class: Ge(`p-3 fm-typo-en-body-sm-600 ${T(Number(ce.type) - 1)}`)
|
|
2312
|
+
}, x(b(Me)[Number(ce.type) - 1]), 3),
|
|
2313
|
+
e("td", po, x(ce.lineid || ""), 1),
|
|
2314
|
+
e("td", fo, x(ce._fieldname), 1),
|
|
2315
|
+
e("td", vo, x(ce.oldvalue || ""), 1),
|
|
2316
|
+
e("td", yo, x(ce.newvalue || ""), 1)
|
|
2285
2317
|
]))), 128))
|
|
2286
2318
|
])
|
|
2287
2319
|
])
|
|
@@ -2293,12 +2325,12 @@ const nt = {
|
|
|
2293
2325
|
]))
|
|
2294
2326
|
]),
|
|
2295
2327
|
"dialog-footer": pe(() => [
|
|
2296
|
-
q(
|
|
2328
|
+
q(re, {
|
|
2297
2329
|
class: "ml-auto sm:w-full xs:w-full",
|
|
2298
2330
|
label: "Close",
|
|
2299
2331
|
size: "md",
|
|
2300
2332
|
variant: "primary",
|
|
2301
|
-
onClick: E[1] || (E[1] = (
|
|
2333
|
+
onClick: E[1] || (E[1] = (ce) => o.value = !1)
|
|
2302
2334
|
})
|
|
2303
2335
|
]),
|
|
2304
2336
|
_: 1
|
|
@@ -2319,10 +2351,10 @@ const nt = {
|
|
|
2319
2351
|
scope: {}
|
|
2320
2352
|
},
|
|
2321
2353
|
setup(u) {
|
|
2322
|
-
const t = u, r = Zs(), o =
|
|
2354
|
+
const t = u, r = Zs(), o = H(() => r.isNetSuiteEnabled);
|
|
2323
2355
|
return (m, c) => {
|
|
2324
2356
|
var n, l;
|
|
2325
|
-
const d =
|
|
2357
|
+
const d = ue("FmMenuDivider");
|
|
2326
2358
|
return o.value ? (i(), y("div", _o, [
|
|
2327
2359
|
e("div", So, [
|
|
2328
2360
|
c[0] || (c[0] = e("span", { class: "flex-1 fm-typo-en-body-lg-600" }, "NetSuite Info", -1)),
|
|
@@ -2330,10 +2362,10 @@ const nt = {
|
|
|
2330
2362
|
e("div", ko, [
|
|
2331
2363
|
(l = (n = t.purchaseOrder) == null ? void 0 : n.netSuite) != null && l.id ? (i(), he(tt, { key: 0 }, {
|
|
2332
2364
|
default: pe(() => {
|
|
2333
|
-
var
|
|
2365
|
+
var C, v, D;
|
|
2334
2366
|
return [
|
|
2335
2367
|
q(go, {
|
|
2336
|
-
"netsuite-id": (v = (
|
|
2368
|
+
"netsuite-id": (v = (C = m.purchaseOrder) == null ? void 0 : C.netSuite) == null ? void 0 : v.id,
|
|
2337
2369
|
"purchase-order-id": (D = m.purchaseOrder) == null ? void 0 : D._id
|
|
2338
2370
|
}, null, 8, ["netsuite-id", "purchase-order-id"])
|
|
2339
2371
|
];
|
|
@@ -2342,10 +2374,10 @@ const nt = {
|
|
|
2342
2374
|
})) : V("", !0),
|
|
2343
2375
|
q(tt, null, {
|
|
2344
2376
|
default: pe(() => {
|
|
2345
|
-
var
|
|
2377
|
+
var C, v, D;
|
|
2346
2378
|
return [
|
|
2347
2379
|
q(Qr, {
|
|
2348
|
-
"netsuite-id": (v = (
|
|
2380
|
+
"netsuite-id": (v = (C = m.purchaseOrder) == null ? void 0 : C.netSuite) == null ? void 0 : v.id,
|
|
2349
2381
|
"purchase-order-id": (D = m.purchaseOrder) == null ? void 0 : D._id
|
|
2350
2382
|
}, null, 8, ["netsuite-id", "purchase-order-id"])
|
|
2351
2383
|
];
|
|
@@ -2393,7 +2425,7 @@ const nt = {
|
|
|
2393
2425
|
open: t.open,
|
|
2394
2426
|
class: "w-full"
|
|
2395
2427
|
}, [
|
|
2396
|
-
e("summary", $o,
|
|
2428
|
+
e("summary", $o, x(t.title), 1),
|
|
2397
2429
|
e("div", {
|
|
2398
2430
|
class: Ge(["mt-4 flex flex-col gap-2", t.contentClass])
|
|
2399
2431
|
}, [
|
|
@@ -2426,12 +2458,12 @@ function Os(u, t) {
|
|
|
2426
2458
|
return t.reduce(
|
|
2427
2459
|
(c, d) => {
|
|
2428
2460
|
var D, R;
|
|
2429
|
-
const n = d.sku._id ?? "", l = ((D = d.quantity) == null ? void 0 : D.amount) ?? 0,
|
|
2461
|
+
const n = d.sku._id ?? "", l = ((D = d.quantity) == null ? void 0 : D.amount) ?? 0, C = o[n] ?? 0, v = ((R = d.quantity) == null ? void 0 : R.precision) ?? 0;
|
|
2430
2462
|
return c[n] = {
|
|
2431
2463
|
key: n,
|
|
2432
2464
|
total: { amount: l, precision: v },
|
|
2433
|
-
received: { amount:
|
|
2434
|
-
remaining: { amount: l -
|
|
2465
|
+
received: { amount: C, precision: v },
|
|
2466
|
+
remaining: { amount: l - C, precision: v }
|
|
2435
2467
|
}, c;
|
|
2436
2468
|
},
|
|
2437
2469
|
{}
|
|
@@ -2465,64 +2497,64 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
2465
2497
|
emits: ["submitted"],
|
|
2466
2498
|
setup(u, { emit: t }) {
|
|
2467
2499
|
var F;
|
|
2468
|
-
const { t: r } = lr(), o = Ye(), m = Je(), c =
|
|
2500
|
+
const { t: r } = lr(), o = Ye(), m = Je(), 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 = us("deliveryOrder"), D = Ze(), {
|
|
2469
2501
|
controller: R,
|
|
2470
2502
|
state: T,
|
|
2471
|
-
reset:
|
|
2503
|
+
reset: S
|
|
2472
2504
|
} = Tt({
|
|
2473
2505
|
currency: Ce(),
|
|
2474
2506
|
adjustments: n.deliveryOrder.priceAdjustments
|
|
2475
|
-
}),
|
|
2507
|
+
}), B = H(
|
|
2476
2508
|
() => {
|
|
2477
2509
|
var h;
|
|
2478
2510
|
return ((h = n.purchaseOrder.deliveryFullfillment) == null ? void 0 : h.findIndex(
|
|
2479
|
-
(
|
|
2511
|
+
(_) => n.deliveryOrder.fullfillmentId && _.id === n.deliveryOrder.fullfillmentId
|
|
2480
2512
|
)) ?? -1;
|
|
2481
2513
|
}
|
|
2482
|
-
), E = o.enablePurchaseOrderReceiveWithCustomCost,
|
|
2514
|
+
), E = o.enablePurchaseOrderReceiveWithCustomCost, re = o.enablePortalDeliveryOrderWrite, oe = ae({}), X = H(
|
|
2483
2515
|
() => (n.purchaseOrder.itemsAtSubmission ?? n.purchaseOrder.items).length
|
|
2484
|
-
),
|
|
2485
|
-
() => Os(n.purchaseOrder,
|
|
2486
|
-
),
|
|
2516
|
+
), le = H(() => Ss(n.purchaseOrder)), be = H(
|
|
2517
|
+
() => Os(n.purchaseOrder, le.value)
|
|
2518
|
+
), ce = H(
|
|
2487
2519
|
() => n.purchaseOrder.items.map(
|
|
2488
|
-
(h,
|
|
2520
|
+
(h, _) => H({
|
|
2489
2521
|
get: () => {
|
|
2490
2522
|
var G;
|
|
2491
|
-
const
|
|
2492
|
-
return
|
|
2523
|
+
const z = (G = v.received[_]) == null ? void 0 : G.amount;
|
|
2524
|
+
return z ? +$e(z) : 0;
|
|
2493
2525
|
},
|
|
2494
|
-
set: (
|
|
2495
|
-
v.received[
|
|
2526
|
+
set: (z) => {
|
|
2527
|
+
v.received[_].amount = We(z, h.sku.unit.precision);
|
|
2496
2528
|
}
|
|
2497
2529
|
})
|
|
2498
2530
|
)
|
|
2499
|
-
),
|
|
2531
|
+
), xe = H(
|
|
2500
2532
|
() => n.purchaseOrder.items.map(
|
|
2501
|
-
(h,
|
|
2533
|
+
(h, _) => H({
|
|
2502
2534
|
get: () => {
|
|
2503
2535
|
var G;
|
|
2504
|
-
const
|
|
2505
|
-
return
|
|
2536
|
+
const z = (G = v.received[_]) == null ? void 0 : G.cost;
|
|
2537
|
+
return z ? +$e(z) : 0;
|
|
2506
2538
|
},
|
|
2507
|
-
set: (
|
|
2508
|
-
v.received[
|
|
2539
|
+
set: (z) => {
|
|
2540
|
+
v.received[_].cost = {
|
|
2509
2541
|
currency: Ce(),
|
|
2510
|
-
...We(
|
|
2542
|
+
...We(z, 4)
|
|
2511
2543
|
};
|
|
2512
2544
|
}
|
|
2513
2545
|
})
|
|
2514
2546
|
)
|
|
2515
2547
|
);
|
|
2516
2548
|
function Ae(h) {
|
|
2517
|
-
var
|
|
2518
|
-
const
|
|
2519
|
-
if (
|
|
2520
|
-
const G = (
|
|
2549
|
+
var z;
|
|
2550
|
+
const _ = !oe.value[h];
|
|
2551
|
+
if (oe.value[h] = _, _) {
|
|
2552
|
+
const G = (z = v.received[h]) == null ? void 0 : z.cost;
|
|
2521
2553
|
v.received[h].cost = G ? { ...G, precision: 4 } : { currency: Ce(), amount: 0, precision: 4 };
|
|
2522
2554
|
} else
|
|
2523
2555
|
delete v.received[h].cost;
|
|
2524
2556
|
}
|
|
2525
|
-
const Q =
|
|
2557
|
+
const Q = ae([]), ye = H(
|
|
2526
2558
|
() => d.skus.filter((h) => !h.isInactive).map((h) => ({ label: `${h.name} (${h.code})`, value: h._id }))
|
|
2527
2559
|
);
|
|
2528
2560
|
function P() {
|
|
@@ -2532,56 +2564,56 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
2532
2564
|
measurement: null
|
|
2533
2565
|
});
|
|
2534
2566
|
}
|
|
2535
|
-
function
|
|
2536
|
-
Q.value.splice(h, 1), v.received.splice(
|
|
2567
|
+
function O(h) {
|
|
2568
|
+
Q.value.splice(h, 1), v.received.splice(X.value + h, 1);
|
|
2537
2569
|
}
|
|
2538
|
-
function
|
|
2539
|
-
Q.value[h].skuId =
|
|
2540
|
-
const
|
|
2541
|
-
v.received[
|
|
2570
|
+
function g(h, _) {
|
|
2571
|
+
Q.value[h].skuId = _;
|
|
2572
|
+
const z = _ ? d.skuById[_] : null;
|
|
2573
|
+
v.received[X.value + h].sku = z;
|
|
2542
2574
|
}
|
|
2543
|
-
function
|
|
2544
|
-
var
|
|
2545
|
-
const
|
|
2546
|
-
return (((ve =
|
|
2575
|
+
function $(h, _) {
|
|
2576
|
+
var ne, ve;
|
|
2577
|
+
const z = (ne = n.receivedInfoMap) == null ? void 0 : ne[_.sku._id], G = z ? `${r("inventory.transfer.receiveRequest.details.received")} ${Fe.toFormatString({ value: z.received })} / ${ft(_.quantity, _.sku.unit, _.measurement)}` : void 0;
|
|
2578
|
+
return (((ve = ce.value[h]) == null ? void 0 : ve.value) ?? 0) > 0 ? G : G ? `${G} · ${ct}` : ct;
|
|
2547
2579
|
}
|
|
2548
|
-
function
|
|
2549
|
-
var
|
|
2550
|
-
const G = (((
|
|
2551
|
-
let
|
|
2580
|
+
function j(h, _) {
|
|
2581
|
+
var ne;
|
|
2582
|
+
const G = (((ne = J.value[_]) == null ? void 0 : ne.value) ?? 0) <= 0;
|
|
2583
|
+
let Z;
|
|
2552
2584
|
if (h.skuId && be.value[h.skuId]) {
|
|
2553
2585
|
const ve = be.value[h.skuId], s = Fe.toFormatString({ value: ve.received });
|
|
2554
|
-
|
|
2586
|
+
Z = `${r("inventory.transfer.receiveRequest.details.received")} ${s}`;
|
|
2555
2587
|
}
|
|
2556
|
-
return G ?
|
|
2588
|
+
return G ? Z ? `${Z} · ${ct}` : ct : Z;
|
|
2557
2589
|
}
|
|
2558
|
-
const
|
|
2559
|
-
() => Q.value.map((h,
|
|
2560
|
-
const
|
|
2561
|
-
return
|
|
2590
|
+
const J = H(
|
|
2591
|
+
() => Q.value.map((h, _) => {
|
|
2592
|
+
const z = X.value + _;
|
|
2593
|
+
return H({
|
|
2562
2594
|
get: () => {
|
|
2563
|
-
var
|
|
2564
|
-
const G = (
|
|
2595
|
+
var Z;
|
|
2596
|
+
const G = (Z = v.received[z]) == null ? void 0 : Z.amount;
|
|
2565
2597
|
return G ? +$e(G) : 0;
|
|
2566
2598
|
},
|
|
2567
2599
|
set: (G) => {
|
|
2568
|
-
var
|
|
2569
|
-
const
|
|
2570
|
-
v.received[
|
|
2600
|
+
var ne, ve, s;
|
|
2601
|
+
const Z = ((ne = h.historyItem) == null ? void 0 : ne.sku.unit.precision) ?? (h.skuId ? (s = (ve = d.skuById[h.skuId]) == null ? void 0 : ve.unit) == null ? void 0 : s.precision : void 0) ?? 2;
|
|
2602
|
+
v.received[z].amount = We(G, Z);
|
|
2571
2603
|
}
|
|
2572
2604
|
});
|
|
2573
2605
|
})
|
|
2574
|
-
),
|
|
2575
|
-
() => Q.value.map((h,
|
|
2576
|
-
const
|
|
2577
|
-
return
|
|
2606
|
+
), ee = H(
|
|
2607
|
+
() => Q.value.map((h, _) => {
|
|
2608
|
+
const z = X.value + _;
|
|
2609
|
+
return H({
|
|
2578
2610
|
get: () => {
|
|
2579
|
-
var
|
|
2580
|
-
const G = (
|
|
2611
|
+
var Z;
|
|
2612
|
+
const G = (Z = v.received[z]) == null ? void 0 : Z.cost;
|
|
2581
2613
|
return G ? +$e(G) : 0;
|
|
2582
2614
|
},
|
|
2583
2615
|
set: (G) => {
|
|
2584
|
-
v.received[
|
|
2616
|
+
v.received[z].cost = {
|
|
2585
2617
|
currency: Ce(),
|
|
2586
2618
|
...We(G, 4)
|
|
2587
2619
|
};
|
|
@@ -2589,76 +2621,76 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
2589
2621
|
});
|
|
2590
2622
|
})
|
|
2591
2623
|
);
|
|
2592
|
-
function
|
|
2593
|
-
const
|
|
2594
|
-
|
|
2624
|
+
function L(h) {
|
|
2625
|
+
const _ = Q.value[h], z = X.value + h;
|
|
2626
|
+
_.costEnabled = !_.costEnabled, _.costEnabled ? v.received[z].cost = { currency: Ce(), amount: 0, precision: 4 } : delete v.received[z].cost;
|
|
2595
2627
|
}
|
|
2596
2628
|
Qe(
|
|
2597
2629
|
() => c.value,
|
|
2598
2630
|
(h) => {
|
|
2599
|
-
var s, a,
|
|
2631
|
+
var s, a, w;
|
|
2600
2632
|
if (!h) {
|
|
2601
|
-
Q.value = [],
|
|
2633
|
+
Q.value = [], oe.value = {};
|
|
2602
2634
|
return;
|
|
2603
2635
|
}
|
|
2604
|
-
|
|
2605
|
-
const
|
|
2606
|
-
for (const
|
|
2607
|
-
const
|
|
2608
|
-
|
|
2636
|
+
S(n.deliveryOrder.priceAdjustments);
|
|
2637
|
+
const _ = n.purchaseOrder.itemsAtSubmission ?? n.purchaseOrder.items, z = new Set(_.map((A) => A.sku._id)), G = {}, Z = [];
|
|
2638
|
+
for (const A of n.deliveryOrder.received ?? []) {
|
|
2639
|
+
const N = (s = A.sku) == null ? void 0 : s._id;
|
|
2640
|
+
N && (z.has(N) ? G[N] = A : Z.push(A));
|
|
2609
2641
|
}
|
|
2610
|
-
v.received =
|
|
2611
|
-
const
|
|
2612
|
-
return
|
|
2642
|
+
v.received = _.map((A) => {
|
|
2643
|
+
const N = G[A.sku._id];
|
|
2644
|
+
return N ? { ...N } : {
|
|
2613
2645
|
// Propagate the stable id so V2 submissions match this existing PO line
|
|
2614
2646
|
// instead of the backend treating it as a new extra item (see CreateForm.vue).
|
|
2615
|
-
...l &&
|
|
2616
|
-
sku:
|
|
2647
|
+
...l && A.id ? { id: A.id } : {},
|
|
2648
|
+
sku: A.sku,
|
|
2617
2649
|
amount: Fe.fromNumber(0),
|
|
2618
|
-
measurement:
|
|
2650
|
+
measurement: A.measurement ?? null
|
|
2619
2651
|
};
|
|
2620
2652
|
});
|
|
2621
|
-
const
|
|
2622
|
-
for (let
|
|
2623
|
-
(a = G[
|
|
2624
|
-
|
|
2625
|
-
const ve =
|
|
2626
|
-
for (const
|
|
2627
|
-
const
|
|
2653
|
+
const ne = {};
|
|
2654
|
+
for (let A = 0; A < _.length; A++)
|
|
2655
|
+
(a = G[_[A].sku._id]) != null && a.cost && (ne[A] = !0);
|
|
2656
|
+
oe.value = ne, Q.value = [];
|
|
2657
|
+
const ve = le.value;
|
|
2658
|
+
for (const A of Z) {
|
|
2659
|
+
const N = ve.find((W) => {
|
|
2628
2660
|
var fe;
|
|
2629
|
-
return W.sku._id === ((fe =
|
|
2661
|
+
return W.sku._id === ((fe = A.sku) == null ? void 0 : fe._id);
|
|
2630
2662
|
});
|
|
2631
2663
|
Q.value.push({
|
|
2632
|
-
skuId: ((
|
|
2633
|
-
costEnabled: !!
|
|
2664
|
+
skuId: ((w = A.sku) == null ? void 0 : w._id) ?? null,
|
|
2665
|
+
costEnabled: !!A.cost,
|
|
2634
2666
|
locked: !0,
|
|
2635
2667
|
quantityLocked: !0,
|
|
2636
|
-
historyItem:
|
|
2637
|
-
}), v.received.push({ ...
|
|
2668
|
+
historyItem: N
|
|
2669
|
+
}), v.received.push({ ...A });
|
|
2638
2670
|
}
|
|
2639
2671
|
if (ve.length) {
|
|
2640
|
-
const
|
|
2672
|
+
const A = new Set(Z.map((N) => {
|
|
2641
2673
|
var W;
|
|
2642
|
-
return (W =
|
|
2674
|
+
return (W = N.sku) == null ? void 0 : W._id;
|
|
2643
2675
|
}));
|
|
2644
|
-
for (const
|
|
2645
|
-
|
|
2646
|
-
skuId:
|
|
2676
|
+
for (const N of ve)
|
|
2677
|
+
A.has(N.sku._id) || (Q.value.push({
|
|
2678
|
+
skuId: N.sku._id,
|
|
2647
2679
|
costEnabled: !1,
|
|
2648
2680
|
locked: !0,
|
|
2649
|
-
historyItem:
|
|
2681
|
+
historyItem: N
|
|
2650
2682
|
}), v.received.push({
|
|
2651
|
-
...l &&
|
|
2652
|
-
sku:
|
|
2683
|
+
...l && N.id ? { id: N.id } : {},
|
|
2684
|
+
sku: N.sku,
|
|
2653
2685
|
amount: Fe.fromNumber(0),
|
|
2654
|
-
measurement:
|
|
2686
|
+
measurement: N.measurement ?? null
|
|
2655
2687
|
}));
|
|
2656
2688
|
}
|
|
2657
2689
|
}
|
|
2658
2690
|
);
|
|
2659
|
-
const
|
|
2660
|
-
function
|
|
2661
|
-
|
|
2691
|
+
const te = ae(!1);
|
|
2692
|
+
function _e() {
|
|
2693
|
+
te.value = !0, D.updateDeliveryOrder({
|
|
2662
2694
|
deliveryOrder: {
|
|
2663
2695
|
...n.deliveryOrder,
|
|
2664
2696
|
...v,
|
|
@@ -2674,21 +2706,21 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
2674
2706
|
type: "success"
|
|
2675
2707
|
},
|
|
2676
2708
|
1e4
|
|
2677
|
-
), c.value = !1,
|
|
2709
|
+
), c.value = !1, C("submitted");
|
|
2678
2710
|
}).finally(() => {
|
|
2679
|
-
|
|
2711
|
+
te.value = !1;
|
|
2680
2712
|
});
|
|
2681
2713
|
}
|
|
2682
|
-
return (h,
|
|
2683
|
-
const
|
|
2714
|
+
return (h, _) => {
|
|
2715
|
+
const z = ue("FmButton"), G = ue("FmStepperField"), Z = ue("FmSwitch"), ne = ue("FmSelect"), ve = ue("FmTextField"), s = ue("FmDialog");
|
|
2684
2716
|
return i(), he(s, {
|
|
2685
2717
|
modelValue: c.value,
|
|
2686
|
-
"onUpdate:modelValue":
|
|
2718
|
+
"onUpdate:modelValue": _[1] || (_[1] = (a) => c.value = a),
|
|
2687
2719
|
overlay: !0,
|
|
2688
2720
|
"min-width": 800
|
|
2689
2721
|
}, {
|
|
2690
2722
|
"dialog-button": pe(() => [
|
|
2691
|
-
b(
|
|
2723
|
+
b(re) ? (i(), he(z, {
|
|
2692
2724
|
key: 0,
|
|
2693
2725
|
variant: "plain",
|
|
2694
2726
|
label: "Edit",
|
|
@@ -2697,55 +2729,55 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
2697
2729
|
})) : V("", !0)
|
|
2698
2730
|
]),
|
|
2699
2731
|
"dialog-header": pe(() => [
|
|
2700
|
-
e("div", null, "Received on " +
|
|
2732
|
+
e("div", null, "Received on " + x(b(et)(n.deliveryOrder.createdAt)), 1)
|
|
2701
2733
|
]),
|
|
2702
2734
|
"dialog-footer": pe(() => [
|
|
2703
|
-
q(
|
|
2735
|
+
q(z, {
|
|
2704
2736
|
class: "ml-auto",
|
|
2705
2737
|
label: "Apply changes",
|
|
2706
2738
|
size: "md",
|
|
2707
2739
|
variant: "destructive",
|
|
2708
|
-
disabled:
|
|
2709
|
-
loading:
|
|
2710
|
-
onClick:
|
|
2740
|
+
disabled: te.value,
|
|
2741
|
+
loading: te.value,
|
|
2742
|
+
onClick: _e
|
|
2711
2743
|
}, null, 8, ["disabled", "loading"])
|
|
2712
2744
|
]),
|
|
2713
2745
|
default: pe(() => [
|
|
2714
2746
|
e("div", Co, [
|
|
2715
2747
|
e("div", Ao, [
|
|
2716
|
-
|
|
2717
|
-
e("div", No,
|
|
2748
|
+
_[2] || (_[2] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Adjustment date", -1)),
|
|
2749
|
+
e("div", No, x(n.deliveryOrder.adjustment ? b(et)(new Date(b(mt)(n.deliveryOrder.adjustment))) : "-"), 1)
|
|
2718
2750
|
]),
|
|
2719
2751
|
e("div", Do, [
|
|
2720
|
-
|
|
2721
|
-
(i(!0), y(De, null, Te(n.purchaseOrder.items, (a,
|
|
2722
|
-
var
|
|
2723
|
-
return i(), y("div", { key:
|
|
2752
|
+
_[4] || (_[4] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Items going to receive ", -1)),
|
|
2753
|
+
(i(!0), y(De, null, Te(n.purchaseOrder.items, (a, w) => {
|
|
2754
|
+
var A;
|
|
2755
|
+
return i(), y("div", { key: w }, [
|
|
2724
2756
|
e("div", Ro, [
|
|
2725
2757
|
e("div", Po, [
|
|
2726
|
-
e("span", Fo,
|
|
2727
|
-
e("span", Io,
|
|
2758
|
+
e("span", Fo, x(a.sku.name), 1),
|
|
2759
|
+
e("span", Io, x(a.sku.code), 1)
|
|
2728
2760
|
]),
|
|
2729
2761
|
e("div", To, [
|
|
2730
2762
|
q(G, {
|
|
2731
2763
|
label: "Receive Quantity",
|
|
2732
|
-
modelValue:
|
|
2733
|
-
"onUpdate:modelValue": (
|
|
2734
|
-
"append-text": ((
|
|
2735
|
-
"helper-text":
|
|
2764
|
+
modelValue: ce.value[w].value,
|
|
2765
|
+
"onUpdate:modelValue": (N) => ce.value[w].value = N,
|
|
2766
|
+
"append-text": ((A = a.measurement) == null ? void 0 : A.abbrev) ?? a.sku.unit.abbrev,
|
|
2767
|
+
"helper-text": $(w, a)
|
|
2736
2768
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text", "helper-text"]),
|
|
2737
2769
|
b(E) ? (i(), y("div", Eo, [
|
|
2738
|
-
q(
|
|
2739
|
-
"model-value":
|
|
2740
|
-
"onUpdate:modelValue": (
|
|
2770
|
+
q(Z, {
|
|
2771
|
+
"model-value": oe.value[w],
|
|
2772
|
+
"onUpdate:modelValue": (N) => Ae(w),
|
|
2741
2773
|
size: "sm"
|
|
2742
2774
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
2743
|
-
|
|
2775
|
+
_[3] || (_[3] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
|
|
2744
2776
|
])) : V("", !0),
|
|
2745
|
-
b(E) &&
|
|
2777
|
+
b(E) && oe.value[w] ? (i(), he(G, {
|
|
2746
2778
|
key: 1,
|
|
2747
|
-
modelValue:
|
|
2748
|
-
"onUpdate:modelValue": (
|
|
2779
|
+
modelValue: xe.value[w].value,
|
|
2780
|
+
"onUpdate:modelValue": (N) => xe.value[w].value = N,
|
|
2749
2781
|
label: "Total Cost",
|
|
2750
2782
|
step: 1e-4,
|
|
2751
2783
|
min: 0,
|
|
@@ -2755,14 +2787,14 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
2755
2787
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) : V("", !0)
|
|
2756
2788
|
])
|
|
2757
2789
|
]),
|
|
2758
|
-
|
|
2790
|
+
w < n.purchaseOrder.items.length - 1 ? (i(), y("div", qo)) : V("", !0)
|
|
2759
2791
|
]);
|
|
2760
2792
|
}), 128))
|
|
2761
2793
|
]),
|
|
2762
2794
|
e("div", Vo, [
|
|
2763
2795
|
e("div", Lo, [
|
|
2764
|
-
|
|
2765
|
-
q(
|
|
2796
|
+
_[5] || (_[5] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Extra items", -1)),
|
|
2797
|
+
q(z, {
|
|
2766
2798
|
variant: "tertiary",
|
|
2767
2799
|
label: "Add item",
|
|
2768
2800
|
"prepend-icon": "add",
|
|
@@ -2771,14 +2803,14 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
2771
2803
|
})
|
|
2772
2804
|
]),
|
|
2773
2805
|
Q.value.length === 0 ? (i(), y("div", jo, " No extra items added ")) : V("", !0),
|
|
2774
|
-
(i(!0), y(De, null, Te(Q.value, (a,
|
|
2775
|
-
var
|
|
2776
|
-
return i(), y("div", { key:
|
|
2806
|
+
(i(!0), y(De, null, Te(Q.value, (a, w) => {
|
|
2807
|
+
var A, N;
|
|
2808
|
+
return i(), y("div", { key: w }, [
|
|
2777
2809
|
e("div", Uo, [
|
|
2778
2810
|
e("div", Mo, [
|
|
2779
|
-
q(
|
|
2811
|
+
q(ne, {
|
|
2780
2812
|
"model-value": a.skuId,
|
|
2781
|
-
"onUpdate:modelValue": (W) =>
|
|
2813
|
+
"onUpdate:modelValue": (W) => g(w, W),
|
|
2782
2814
|
label: "Ingredient",
|
|
2783
2815
|
items: ye.value,
|
|
2784
2816
|
searchable: "",
|
|
@@ -2790,24 +2822,24 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
2790
2822
|
e("div", Bo, [
|
|
2791
2823
|
q(G, {
|
|
2792
2824
|
label: "Receive Quantity",
|
|
2793
|
-
modelValue:
|
|
2794
|
-
"onUpdate:modelValue": (W) =>
|
|
2795
|
-
"append-text": a.skuId ? ((
|
|
2796
|
-
"helper-text":
|
|
2825
|
+
modelValue: J.value[w].value,
|
|
2826
|
+
"onUpdate:modelValue": (W) => J.value[w].value = W,
|
|
2827
|
+
"append-text": a.skuId ? ((N = (A = b(d).skuById[a.skuId]) == null ? void 0 : A.unit) == null ? void 0 : N.abbrev) ?? "" : "",
|
|
2828
|
+
"helper-text": j(a, w),
|
|
2797
2829
|
disabled: a.quantityLocked || !a.skuId
|
|
2798
2830
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text", "helper-text", "disabled"]),
|
|
2799
2831
|
b(E) ? (i(), y("div", zo, [
|
|
2800
|
-
q(
|
|
2832
|
+
q(Z, {
|
|
2801
2833
|
"model-value": a.costEnabled,
|
|
2802
|
-
"onUpdate:modelValue": (W) =>
|
|
2834
|
+
"onUpdate:modelValue": (W) => L(w),
|
|
2803
2835
|
size: "sm"
|
|
2804
2836
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
2805
|
-
|
|
2837
|
+
_[6] || (_[6] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
|
|
2806
2838
|
])) : V("", !0),
|
|
2807
2839
|
b(E) && a.costEnabled ? (i(), he(G, {
|
|
2808
2840
|
key: 1,
|
|
2809
|
-
modelValue:
|
|
2810
|
-
"onUpdate:modelValue": (W) =>
|
|
2841
|
+
modelValue: ee.value[w].value,
|
|
2842
|
+
"onUpdate:modelValue": (W) => ee.value[w].value = W,
|
|
2811
2843
|
label: "Total Cost",
|
|
2812
2844
|
step: 1e-4,
|
|
2813
2845
|
min: 0,
|
|
@@ -2816,42 +2848,42 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
2816
2848
|
"append-text": b(Ce)()
|
|
2817
2849
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) : V("", !0)
|
|
2818
2850
|
]),
|
|
2819
|
-
a.locked ? V("", !0) : (i(), he(
|
|
2851
|
+
a.locked ? V("", !0) : (i(), he(z, {
|
|
2820
2852
|
key: 0,
|
|
2821
2853
|
variant: "tertiary",
|
|
2822
2854
|
"prepend-icon": "delete",
|
|
2823
2855
|
size: "md",
|
|
2824
2856
|
class: "mt-6",
|
|
2825
|
-
onClick: (W) => w
|
|
2857
|
+
onClick: (W) => O(w)
|
|
2826
2858
|
}, null, 8, ["onClick"]))
|
|
2827
2859
|
]),
|
|
2828
|
-
|
|
2860
|
+
w < Q.value.length - 1 ? (i(), y("div", Ko)) : V("", !0)
|
|
2829
2861
|
]);
|
|
2830
2862
|
}), 128))
|
|
2831
2863
|
]),
|
|
2832
2864
|
e("div", Ho, [
|
|
2833
|
-
|
|
2865
|
+
_[7] || (_[7] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Delivery order no.", -1)),
|
|
2834
2866
|
e("div", Go, [
|
|
2835
2867
|
q(ve, {
|
|
2836
2868
|
modelValue: b(v).deliveryOrderNumber,
|
|
2837
|
-
"onUpdate:modelValue":
|
|
2869
|
+
"onUpdate:modelValue": _[0] || (_[0] = (a) => b(v).deliveryOrderNumber = a),
|
|
2838
2870
|
size: "md",
|
|
2839
2871
|
placeholder: n.deliveryOrder.deliveryOrderNumber
|
|
2840
2872
|
}, null, 8, ["modelValue", "placeholder"])
|
|
2841
2873
|
])
|
|
2842
2874
|
]),
|
|
2843
2875
|
e("div", Wo, [
|
|
2844
|
-
|
|
2845
|
-
e("div", Qo,
|
|
2876
|
+
_[8] || (_[8] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Remark", -1)),
|
|
2877
|
+
e("div", Qo, x(n.deliveryOrder.remark || "N/A"), 1)
|
|
2846
2878
|
]),
|
|
2847
2879
|
b(o).enablePurchaseOrderPriceAdjustment ? (i(), he(It, {
|
|
2848
2880
|
key: 0,
|
|
2849
2881
|
controller: b(R),
|
|
2850
2882
|
state: b(T)
|
|
2851
2883
|
}, null, 8, ["controller", "state"])) : V("", !0),
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
e("div", Jo,
|
|
2884
|
+
B.value >= 0 ? (i(), y("div", Yo, [
|
|
2885
|
+
_[9] || (_[9] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Fulfilment's sequence", -1)),
|
|
2886
|
+
e("div", Jo, x(B.value + 1), 1)
|
|
2855
2887
|
])) : V("", !0)
|
|
2856
2888
|
])
|
|
2857
2889
|
]),
|
|
@@ -2898,8 +2930,8 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
2898
2930
|
},
|
|
2899
2931
|
emits: ["submitted"],
|
|
2900
2932
|
setup(u, { emit: t }) {
|
|
2901
|
-
var fe, I,
|
|
2902
|
-
const { t: r } = ht(), o =
|
|
2933
|
+
var fe, I, de;
|
|
2934
|
+
const { t: r } = ht(), o = ae(!1), m = bt(), c = u, d = t, n = us("", {
|
|
2903
2935
|
default: {
|
|
2904
2936
|
deliveryOrderNumber: "",
|
|
2905
2937
|
remark: "",
|
|
@@ -2922,92 +2954,92 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
2922
2954
|
},
|
|
2923
2955
|
createdAt: ""
|
|
2924
2956
|
}
|
|
2925
|
-
}), l = Ze(),
|
|
2957
|
+
}), l = Ze(), C = gt(), v = Ye(), D = Dt(), {
|
|
2926
2958
|
controller: R,
|
|
2927
2959
|
state: T,
|
|
2928
|
-
reset:
|
|
2929
|
-
} = Tt({ currency: Ce() }),
|
|
2960
|
+
reset: S
|
|
2961
|
+
} = Tt({ currency: Ce() }), B = H(
|
|
2930
2962
|
() => c.purchaseOrder.deliveryFullfillment != null
|
|
2931
|
-
), E =
|
|
2932
|
-
() => v.enablePortalDeliveryOrderWrite && (c.purchaseOrder.status ===
|
|
2933
|
-
),
|
|
2963
|
+
), E = H(
|
|
2964
|
+
() => v.enablePortalDeliveryOrderWrite && (c.purchaseOrder.status === Oe.Enum.RECEIVING || c.purchaseOrder.status === Oe.Enum.COMPLETE) && !B.value
|
|
2965
|
+
), re = v.enablePurchaseOrderReceiveWithCustomCost, oe = v.enableBackdateReceive, X = ae({}), le = H(
|
|
2934
2966
|
() => c.purchaseOrder.itemsAtSubmission ?? c.purchaseOrder.items
|
|
2935
|
-
), be =
|
|
2967
|
+
), be = H(() => Ss(c.purchaseOrder)), ce = H(
|
|
2936
2968
|
() => Os(c.purchaseOrder, be.value)
|
|
2937
2969
|
);
|
|
2938
|
-
function
|
|
2970
|
+
function xe(f) {
|
|
2939
2971
|
return f.sku._id ?? null;
|
|
2940
2972
|
}
|
|
2941
|
-
const Ae = (((
|
|
2973
|
+
const Ae = (((de = c.purchaseOrder) == null ? void 0 : de.version) ?? je.enum[1]) === je.enum[2], Q = Je(), ye = H({
|
|
2942
2974
|
get() {
|
|
2943
2975
|
if (!n.createdAt) return "";
|
|
2944
|
-
const f = new Date(n.createdAt), p = f.getFullYear(),
|
|
2945
|
-
return `${p}-${
|
|
2976
|
+
const f = new Date(n.createdAt), p = f.getFullYear(), k = String(f.getMonth() + 1).padStart(2, "0"), U = String(f.getDate()).padStart(2, "0");
|
|
2977
|
+
return `${p}-${k}-${U}`;
|
|
2946
2978
|
},
|
|
2947
2979
|
set(f) {
|
|
2948
2980
|
if (f) {
|
|
2949
|
-
const p = n.createdAt ? new Date(n.createdAt) : /* @__PURE__ */ new Date(), [
|
|
2950
|
-
p.setFullYear(parseInt(
|
|
2981
|
+
const p = n.createdAt ? new Date(n.createdAt) : /* @__PURE__ */ new Date(), [k, U, M] = f.split("-");
|
|
2982
|
+
p.setFullYear(parseInt(k)), p.setMonth(parseInt(U) - 1), p.setDate(parseInt(M)), n.createdAt = p.toISOString();
|
|
2951
2983
|
}
|
|
2952
2984
|
}
|
|
2953
|
-
}), P =
|
|
2985
|
+
}), P = H({
|
|
2954
2986
|
get() {
|
|
2955
2987
|
if (!n.createdAt) return "";
|
|
2956
|
-
const f = new Date(n.createdAt), p = String(f.getHours()).padStart(2, "0"),
|
|
2957
|
-
return `${p}:${
|
|
2988
|
+
const f = new Date(n.createdAt), p = String(f.getHours()).padStart(2, "0"), k = String(f.getMinutes()).padStart(2, "0");
|
|
2989
|
+
return `${p}:${k}`;
|
|
2958
2990
|
},
|
|
2959
2991
|
set(f) {
|
|
2960
2992
|
if (f) {
|
|
2961
|
-
const p = n.createdAt ? new Date(n.createdAt) : /* @__PURE__ */ new Date(), [
|
|
2962
|
-
p.setHours(parseInt(
|
|
2993
|
+
const p = n.createdAt ? new Date(n.createdAt) : /* @__PURE__ */ new Date(), [k, U] = f.split(":");
|
|
2994
|
+
p.setHours(parseInt(k)), p.setMinutes(parseInt(U)), n.createdAt = p.toISOString();
|
|
2963
2995
|
}
|
|
2964
2996
|
}
|
|
2965
|
-
}),
|
|
2997
|
+
}), O = H(() => {
|
|
2966
2998
|
const f = mt(c.purchaseOrder._id);
|
|
2967
2999
|
if (!f) return "";
|
|
2968
|
-
const p = new Date(f),
|
|
2969
|
-
return `${
|
|
2970
|
-
}),
|
|
3000
|
+
const p = new Date(f), k = p.getFullYear(), U = String(p.getMonth() + 1).padStart(2, "0"), M = String(p.getDate()).padStart(2, "0");
|
|
3001
|
+
return `${k}-${U}-${M}`;
|
|
3002
|
+
}), g = H(() => {
|
|
2971
3003
|
const f = mt(c.purchaseOrder._id);
|
|
2972
3004
|
return f ? new Date(f) : null;
|
|
2973
|
-
}),
|
|
2974
|
-
if (!ye.value || !P.value ||
|
|
2975
|
-
if (/* @__PURE__ */ new Date(`${ye.value}T${P.value}:00`) <
|
|
2976
|
-
const p =
|
|
3005
|
+
}), $ = H(() => {
|
|
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 = O.value, k = g.value.getHours(), U = g.value.getMinutes(), M = k >= 12 ? "PM" : "AM", ke = k % 12 || 12, we = `${String(ke).padStart(2, "0")}:${String(U).padStart(2, "0")} ${M}`;
|
|
2977
3009
|
return `Delivery date & time cannot be earlier than order creation (${p} ${we})`;
|
|
2978
3010
|
}
|
|
2979
3011
|
return null;
|
|
2980
|
-
}),
|
|
2981
|
-
const
|
|
2982
|
-
return
|
|
3012
|
+
}), j = H(() => $.value || F.value.some((p) => !p.skuId) ? !1 : n.received.some((p) => {
|
|
3013
|
+
const k = p.amount;
|
|
3014
|
+
return k ? +$e(k) > 0 : !1;
|
|
2983
3015
|
}));
|
|
2984
|
-
function
|
|
2985
|
-
var
|
|
2986
|
-
const p = (
|
|
2987
|
-
return `${r("inventory.transfer.receiveRequest.details.received")} ${
|
|
3016
|
+
function J(f) {
|
|
3017
|
+
var U;
|
|
3018
|
+
const p = (U = c.receivedInfoMap[f.sku._id]) == null ? void 0 : U.received, k = p != null ? Fe.toFormatString({ value: p }) : "0";
|
|
3019
|
+
return `${r("inventory.transfer.receiveRequest.details.received")} ${k} / ${ft(f.quantity, f.sku.unit, f.measurement)}`;
|
|
2988
3020
|
}
|
|
2989
|
-
function
|
|
3021
|
+
function ee() {
|
|
2990
3022
|
n.createdAt = "";
|
|
2991
3023
|
}
|
|
2992
|
-
const
|
|
3024
|
+
const L = H(() => le.value.map((f, p) => H({
|
|
2993
3025
|
get: () => {
|
|
2994
|
-
var
|
|
2995
|
-
const
|
|
2996
|
-
return
|
|
3026
|
+
var U;
|
|
3027
|
+
const k = (U = n.received[p]) == null ? void 0 : U.amount;
|
|
3028
|
+
return k ? +$e(k) : 0;
|
|
2997
3029
|
},
|
|
2998
|
-
set: (
|
|
2999
|
-
var
|
|
3000
|
-
const
|
|
3001
|
-
n.received[p].amount = We(
|
|
3030
|
+
set: (k) => {
|
|
3031
|
+
var M;
|
|
3032
|
+
const U = ((M = le.value[p]) == null ? void 0 : M.sku.unit.precision) ?? 2;
|
|
3033
|
+
n.received[p].amount = We(k, U);
|
|
3002
3034
|
}
|
|
3003
3035
|
})));
|
|
3004
|
-
function
|
|
3005
|
-
const p = !
|
|
3006
|
-
if (
|
|
3007
|
-
const
|
|
3008
|
-
|
|
3009
|
-
currency:
|
|
3010
|
-
amount:
|
|
3036
|
+
function te(f) {
|
|
3037
|
+
const p = !X.value[f];
|
|
3038
|
+
if (X.value[f] = p, p) {
|
|
3039
|
+
const k = le.value[f];
|
|
3040
|
+
k.totalCost ? n.received[f].cost = {
|
|
3041
|
+
currency: k.totalCost.currency,
|
|
3042
|
+
amount: k.totalCost.amount,
|
|
3011
3043
|
precision: 4
|
|
3012
3044
|
// Standardize to 4 decimals
|
|
3013
3045
|
} : n.received[f].cost = {
|
|
@@ -3018,22 +3050,22 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3018
3050
|
} else
|
|
3019
3051
|
delete n.received[f].cost;
|
|
3020
3052
|
}
|
|
3021
|
-
const
|
|
3053
|
+
const _e = H(() => le.value.map((f, p) => H({
|
|
3022
3054
|
get: () => {
|
|
3023
|
-
var
|
|
3024
|
-
const
|
|
3025
|
-
return
|
|
3055
|
+
var U;
|
|
3056
|
+
const k = (U = n.received[p]) == null ? void 0 : U.cost;
|
|
3057
|
+
return k ? +$e(k) : 0;
|
|
3026
3058
|
},
|
|
3027
|
-
set: (
|
|
3059
|
+
set: (k) => {
|
|
3028
3060
|
n.received[p].cost = {
|
|
3029
3061
|
currency: Ce(),
|
|
3030
|
-
...We(
|
|
3062
|
+
...We(k, 4)
|
|
3031
3063
|
};
|
|
3032
3064
|
}
|
|
3033
|
-
}))), F =
|
|
3065
|
+
}))), F = ae([]), h = H(
|
|
3034
3066
|
() => D.skus.filter((f) => !f.isInactive).map((f) => ({ label: `${f.name} (${f.code})`, value: f._id }))
|
|
3035
|
-
),
|
|
3036
|
-
function
|
|
3067
|
+
), _ = H(() => le.value.length);
|
|
3068
|
+
function z() {
|
|
3037
3069
|
F.value.push({ skuId: null, stableKey: null, costEnabled: !1 }), n.received.push({
|
|
3038
3070
|
sku: null,
|
|
3039
3071
|
amount: Fe.fromNumber(0),
|
|
@@ -3041,60 +3073,60 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3041
3073
|
});
|
|
3042
3074
|
}
|
|
3043
3075
|
function G(f) {
|
|
3044
|
-
F.value.splice(f, 1), n.received.splice(
|
|
3076
|
+
F.value.splice(f, 1), n.received.splice(_.value + f, 1);
|
|
3045
3077
|
}
|
|
3046
|
-
function
|
|
3078
|
+
function Z(f, p) {
|
|
3047
3079
|
F.value[f].skuId = p;
|
|
3048
|
-
const
|
|
3049
|
-
n.received[
|
|
3080
|
+
const k = p ? D.skuById[p] : null;
|
|
3081
|
+
n.received[_.value + f].sku = k;
|
|
3050
3082
|
}
|
|
3051
|
-
function
|
|
3083
|
+
function ne(f) {
|
|
3052
3084
|
const p = f.stableKey;
|
|
3053
|
-
if (p &&
|
|
3054
|
-
const
|
|
3055
|
-
return `${r("inventory.transfer.receiveRequest.details.received")} ${
|
|
3085
|
+
if (p && ce.value[p]) {
|
|
3086
|
+
const k = ce.value[p], U = Fe.toFormatString({ value: k.received });
|
|
3087
|
+
return `${r("inventory.transfer.receiveRequest.details.received")} ${U}`;
|
|
3056
3088
|
}
|
|
3057
3089
|
}
|
|
3058
|
-
const ve =
|
|
3090
|
+
const ve = H(
|
|
3059
3091
|
() => F.value.map((f, p) => {
|
|
3060
|
-
const
|
|
3061
|
-
return
|
|
3092
|
+
const k = _.value + p;
|
|
3093
|
+
return H({
|
|
3062
3094
|
get: () => {
|
|
3063
|
-
var
|
|
3064
|
-
const
|
|
3065
|
-
return
|
|
3095
|
+
var M;
|
|
3096
|
+
const U = (M = n.received[k]) == null ? void 0 : M.amount;
|
|
3097
|
+
return U ? +$e(U) : 0;
|
|
3066
3098
|
},
|
|
3067
|
-
set: (
|
|
3068
|
-
var we, Y,
|
|
3069
|
-
const
|
|
3070
|
-
n.received[
|
|
3099
|
+
set: (U) => {
|
|
3100
|
+
var we, Y, se;
|
|
3101
|
+
const M = F.value[p], ke = ((we = M == null ? void 0 : M.historyItem) == null ? void 0 : we.sku.unit.precision) ?? (M != null && M.skuId ? (se = (Y = D.skuById[M.skuId]) == null ? void 0 : Y.unit) == null ? void 0 : se.precision : void 0) ?? 2;
|
|
3102
|
+
n.received[k].amount = We(U, ke);
|
|
3071
3103
|
}
|
|
3072
3104
|
});
|
|
3073
3105
|
})
|
|
3074
|
-
), s =
|
|
3106
|
+
), s = H(
|
|
3075
3107
|
() => F.value.map((f, p) => {
|
|
3076
|
-
const
|
|
3077
|
-
return
|
|
3108
|
+
const k = _.value + p;
|
|
3109
|
+
return H({
|
|
3078
3110
|
get: () => {
|
|
3079
|
-
var
|
|
3080
|
-
const
|
|
3081
|
-
return
|
|
3111
|
+
var M;
|
|
3112
|
+
const U = (M = n.received[k]) == null ? void 0 : M.cost;
|
|
3113
|
+
return U ? +$e(U) : 0;
|
|
3082
3114
|
},
|
|
3083
|
-
set: (
|
|
3084
|
-
n.received[
|
|
3115
|
+
set: (U) => {
|
|
3116
|
+
n.received[k].cost = {
|
|
3085
3117
|
currency: Ce(),
|
|
3086
|
-
...We(
|
|
3118
|
+
...We(U, 4)
|
|
3087
3119
|
};
|
|
3088
3120
|
}
|
|
3089
3121
|
});
|
|
3090
3122
|
})
|
|
3091
3123
|
);
|
|
3092
3124
|
function a(f) {
|
|
3093
|
-
const p = F.value[f],
|
|
3094
|
-
p.costEnabled = !p.costEnabled, p.costEnabled ? n.received[
|
|
3125
|
+
const p = F.value[f], k = _.value + f;
|
|
3126
|
+
p.costEnabled = !p.costEnabled, p.costEnabled ? n.received[k].cost = { currency: Ce(), amount: 0, precision: 4 } : delete n.received[k].cost;
|
|
3095
3127
|
}
|
|
3096
|
-
function
|
|
3097
|
-
W() &&
|
|
3128
|
+
function w() {
|
|
3129
|
+
W() && C.open({
|
|
3098
3130
|
title: "Confirm Create Delivery Order",
|
|
3099
3131
|
message: `Are you sure you want to create delivery order for PO# ${c.purchaseOrder.seqNumber}?`,
|
|
3100
3132
|
primaryActions: {
|
|
@@ -3106,11 +3138,11 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3106
3138
|
text: "Cancel",
|
|
3107
3139
|
close: !0
|
|
3108
3140
|
}
|
|
3109
|
-
}).onPrimary(() =>
|
|
3141
|
+
}).onPrimary(() => N());
|
|
3110
3142
|
}
|
|
3111
|
-
const
|
|
3112
|
-
function
|
|
3113
|
-
W() && (
|
|
3143
|
+
const A = ae(!1);
|
|
3144
|
+
function N() {
|
|
3145
|
+
W() && (A.value = !0, l.createDeliveryOrder({
|
|
3114
3146
|
deliveryOrder: {
|
|
3115
3147
|
...n,
|
|
3116
3148
|
priceAdjustments: R.value.state().adjustments
|
|
@@ -3128,11 +3160,11 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3128
3160
|
1e4
|
|
3129
3161
|
), o.value = !1, d("submitted");
|
|
3130
3162
|
}).finally(() => {
|
|
3131
|
-
|
|
3163
|
+
A.value = !1;
|
|
3132
3164
|
}));
|
|
3133
3165
|
}
|
|
3134
3166
|
function W() {
|
|
3135
|
-
return
|
|
3167
|
+
return B.value ? (o.value = !1, Q.open(
|
|
3136
3168
|
{
|
|
3137
3169
|
title: "Purchase order updated",
|
|
3138
3170
|
message: "This purchase order now uses fulfillment receiving. Refresh and receive stock from the fulfillment section.",
|
|
@@ -3141,54 +3173,54 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3141
3173
|
1e4
|
|
3142
3174
|
), !1) : !0;
|
|
3143
3175
|
}
|
|
3144
|
-
return Qe(
|
|
3176
|
+
return Qe(B, (f) => {
|
|
3145
3177
|
!f || !o.value || W();
|
|
3146
3178
|
}), Qe(
|
|
3147
3179
|
() => o.value,
|
|
3148
3180
|
(f) => {
|
|
3149
|
-
var
|
|
3181
|
+
var U;
|
|
3150
3182
|
if (!f) {
|
|
3151
|
-
F.value = [],
|
|
3152
|
-
...Ae &&
|
|
3153
|
-
sku:
|
|
3183
|
+
F.value = [], S([]), n.received = le.value.map((M) => ({
|
|
3184
|
+
...Ae && M.id ? { id: M.id } : {},
|
|
3185
|
+
sku: M.sku,
|
|
3154
3186
|
amount: Fe.fromNumber(0),
|
|
3155
|
-
measurement:
|
|
3187
|
+
measurement: M.measurement
|
|
3156
3188
|
}));
|
|
3157
3189
|
return;
|
|
3158
3190
|
}
|
|
3159
|
-
const p =
|
|
3160
|
-
for (let
|
|
3161
|
-
const
|
|
3162
|
-
|
|
3191
|
+
const p = le.value;
|
|
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 = +$e(ke.quantity), Pe = se ? +$e(se.received) : 0;
|
|
3194
|
+
L.value[M].value = Math.max(0, Se - Pe);
|
|
3163
3195
|
}
|
|
3164
|
-
const
|
|
3165
|
-
if (
|
|
3166
|
-
for (const
|
|
3167
|
-
const
|
|
3196
|
+
const k = be.value;
|
|
3197
|
+
if (k.length) {
|
|
3198
|
+
for (const M of k) {
|
|
3199
|
+
const ke = xe(M);
|
|
3168
3200
|
F.value.push({
|
|
3169
|
-
skuId:
|
|
3170
|
-
stableKey:
|
|
3201
|
+
skuId: M.sku._id,
|
|
3202
|
+
stableKey: ke,
|
|
3171
3203
|
costEnabled: !1,
|
|
3172
|
-
historyItem:
|
|
3204
|
+
historyItem: M
|
|
3173
3205
|
}), n.received.push({
|
|
3174
3206
|
// Propagate the stable id so V2 submissions align with the existing PO line.
|
|
3175
|
-
...Ae &&
|
|
3176
|
-
sku:
|
|
3207
|
+
...Ae && M.id ? { id: M.id } : {},
|
|
3208
|
+
sku: M.sku,
|
|
3177
3209
|
amount: Fe.fromNumber(0),
|
|
3178
|
-
measurement:
|
|
3210
|
+
measurement: M.measurement ?? null
|
|
3179
3211
|
});
|
|
3180
3212
|
}
|
|
3181
|
-
for (let
|
|
3182
|
-
const
|
|
3213
|
+
for (let M = 0; M < k.length; M++) {
|
|
3214
|
+
const ke = xe(k[M]), we = ke ? ce.value[ke] : void 0;
|
|
3183
3215
|
if (we) {
|
|
3184
3216
|
const Y = Math.pow(10, we.remaining.precision ?? 2);
|
|
3185
|
-
ve.value[
|
|
3217
|
+
ve.value[M].value = Math.max(0, we.remaining.amount / Y);
|
|
3186
3218
|
}
|
|
3187
3219
|
}
|
|
3188
3220
|
}
|
|
3189
3221
|
}
|
|
3190
3222
|
), (f, p) => {
|
|
3191
|
-
const
|
|
3223
|
+
const k = ue("FmButton"), U = ue("FmDatePicker"), M = ue("FmTimePicker"), ke = ue("FmIcon"), we = ue("FmStepperField"), Y = ue("FmSwitch"), se = ue("FmSelect"), Se = ue("FmTextField"), Pe = ue("FmDialog");
|
|
3192
3224
|
return i(), he(Pe, {
|
|
3193
3225
|
modelValue: o.value,
|
|
3194
3226
|
"onUpdate:modelValue": p[4] || (p[4] = (Ie) => o.value = Ie),
|
|
@@ -3196,7 +3228,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3196
3228
|
"min-width": 800
|
|
3197
3229
|
}, {
|
|
3198
3230
|
"dialog-button": pe(() => [
|
|
3199
|
-
E.value ? (i(), he(
|
|
3231
|
+
E.value ? (i(), he(k, {
|
|
3200
3232
|
key: 0,
|
|
3201
3233
|
variant: "primary",
|
|
3202
3234
|
label: "Create",
|
|
@@ -3206,17 +3238,17 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3206
3238
|
})) : V("", !0)
|
|
3207
3239
|
]),
|
|
3208
3240
|
"dialog-header": pe(() => [
|
|
3209
|
-
e("div", null, "Order #" +
|
|
3241
|
+
e("div", null, "Order #" + x(c.purchaseOrder.seqNumber) + " (New Delivery Order)", 1)
|
|
3210
3242
|
]),
|
|
3211
3243
|
"dialog-footer": pe(() => [
|
|
3212
|
-
q(
|
|
3244
|
+
q(k, {
|
|
3213
3245
|
class: "ml-auto",
|
|
3214
3246
|
label: "Create",
|
|
3215
3247
|
size: "md",
|
|
3216
3248
|
variant: "destructive",
|
|
3217
|
-
disabled: !
|
|
3218
|
-
loading:
|
|
3219
|
-
onClick:
|
|
3249
|
+
disabled: !j.value || A.value,
|
|
3250
|
+
loading: A.value,
|
|
3251
|
+
onClick: w
|
|
3220
3252
|
}, null, 8, ["disabled", "loading"])
|
|
3221
3253
|
]),
|
|
3222
3254
|
default: pe(() => {
|
|
@@ -3225,76 +3257,76 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3225
3257
|
e("div", Zo, [
|
|
3226
3258
|
e("div", en, [
|
|
3227
3259
|
p[5] || (p[5] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Received by", -1)),
|
|
3228
|
-
e("div", tn,
|
|
3260
|
+
e("div", tn, x((Ie = b(m).sessionUser.value) == null ? void 0 : Ie.displayName), 1)
|
|
3229
3261
|
]),
|
|
3230
|
-
b(
|
|
3262
|
+
b(oe) ? (i(), y("div", sn, [
|
|
3231
3263
|
e("div", rn, [
|
|
3232
3264
|
e("div", on, [
|
|
3233
3265
|
p[6] || (p[6] = Xe(" Delivery Date & Time ")),
|
|
3234
3266
|
!ye.value && !P.value ? (i(), y("div", nn, " Leave blank to use current date & time ")) : V("", !0)
|
|
3235
3267
|
]),
|
|
3236
|
-
ye.value || P.value ? (i(), he(
|
|
3268
|
+
ye.value || P.value ? (i(), he(k, {
|
|
3237
3269
|
key: 0,
|
|
3238
3270
|
variant: "tertiary",
|
|
3239
3271
|
label: "Clear",
|
|
3240
3272
|
"prepend-icon": "close",
|
|
3241
|
-
onClick:
|
|
3273
|
+
onClick: ee
|
|
3242
3274
|
})) : V("", !0)
|
|
3243
3275
|
]),
|
|
3244
3276
|
e("div", an, [
|
|
3245
3277
|
e("div", ln, [
|
|
3246
|
-
q(
|
|
3278
|
+
q(U, {
|
|
3247
3279
|
modelValue: ye.value,
|
|
3248
3280
|
"onUpdate:modelValue": p[0] || (p[0] = (ge) => ye.value = ge)
|
|
3249
3281
|
}, null, 8, ["modelValue"])
|
|
3250
3282
|
]),
|
|
3251
3283
|
e("div", un, [
|
|
3252
|
-
q(
|
|
3284
|
+
q(M, {
|
|
3253
3285
|
modelValue: P.value,
|
|
3254
3286
|
"onUpdate:modelValue": p[1] || (p[1] = (ge) => P.value = ge)
|
|
3255
3287
|
}, null, 8, ["modelValue"])
|
|
3256
3288
|
])
|
|
3257
3289
|
]),
|
|
3258
|
-
|
|
3259
|
-
q(
|
|
3290
|
+
$.value ? (i(), y("div", cn, [
|
|
3291
|
+
q(ke, {
|
|
3260
3292
|
name: "error",
|
|
3261
3293
|
class: "inline-block mr-1",
|
|
3262
3294
|
size: "sm"
|
|
3263
3295
|
}),
|
|
3264
|
-
e("div", dn,
|
|
3296
|
+
e("div", dn, x($.value), 1)
|
|
3265
3297
|
])) : V("", !0)
|
|
3266
3298
|
])) : V("", !0),
|
|
3267
3299
|
e("div", mn, [
|
|
3268
3300
|
p[8] || (p[8] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Items going to receive ", -1)),
|
|
3269
|
-
(i(!0), y(De, null, Te(
|
|
3301
|
+
(i(!0), y(De, null, Te(le.value, (ge, me) => {
|
|
3270
3302
|
var Re;
|
|
3271
3303
|
return i(), y("div", { key: me }, [
|
|
3272
3304
|
e("div", pn, [
|
|
3273
3305
|
e("div", fn, [
|
|
3274
|
-
e("span", vn,
|
|
3275
|
-
e("span", yn,
|
|
3306
|
+
e("span", vn, x(ge.sku.name), 1),
|
|
3307
|
+
e("span", yn, x(ge.sku.code), 1)
|
|
3276
3308
|
]),
|
|
3277
3309
|
e("div", hn, [
|
|
3278
3310
|
q(we, {
|
|
3279
3311
|
label: "Receive Quantity",
|
|
3280
|
-
modelValue:
|
|
3281
|
-
"onUpdate:modelValue": (Ee) =>
|
|
3282
|
-
"helper-text":
|
|
3312
|
+
modelValue: L.value[me].value,
|
|
3313
|
+
"onUpdate:modelValue": (Ee) => L.value[me].value = Ee,
|
|
3314
|
+
"helper-text": J(ge),
|
|
3283
3315
|
"append-text": ((Re = ge.measurement) == null ? void 0 : Re.abbrev) ?? ge.sku.unit.abbrev
|
|
3284
3316
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "helper-text", "append-text"]),
|
|
3285
|
-
|
|
3286
|
-
b(
|
|
3317
|
+
L.value[me].value <= 0 ? (i(), y("div", bn, x(rs))) : V("", !0),
|
|
3318
|
+
b(re) ? (i(), y("div", gn, [
|
|
3287
3319
|
q(Y, {
|
|
3288
|
-
"model-value":
|
|
3289
|
-
"onUpdate:modelValue": (Ee) =>
|
|
3320
|
+
"model-value": X.value[me],
|
|
3321
|
+
"onUpdate:modelValue": (Ee) => te(me),
|
|
3290
3322
|
size: "sm"
|
|
3291
3323
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
3292
3324
|
p[7] || (p[7] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
|
|
3293
3325
|
])) : V("", !0),
|
|
3294
|
-
b(
|
|
3326
|
+
b(re) && X.value[me] ? (i(), he(we, {
|
|
3295
3327
|
key: 2,
|
|
3296
|
-
modelValue:
|
|
3297
|
-
"onUpdate:modelValue": (Ee) =>
|
|
3328
|
+
modelValue: _e.value[me].value,
|
|
3329
|
+
"onUpdate:modelValue": (Ee) => _e.value[me].value = Ee,
|
|
3298
3330
|
label: "Total Cost",
|
|
3299
3331
|
step: 1e-4,
|
|
3300
3332
|
min: 0,
|
|
@@ -3304,19 +3336,19 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3304
3336
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) : V("", !0)
|
|
3305
3337
|
])
|
|
3306
3338
|
]),
|
|
3307
|
-
me <
|
|
3339
|
+
me < le.value.length - 1 ? (i(), y("div", _n)) : V("", !0)
|
|
3308
3340
|
]);
|
|
3309
3341
|
}), 128))
|
|
3310
3342
|
]),
|
|
3311
3343
|
e("div", Sn, [
|
|
3312
3344
|
e("div", On, [
|
|
3313
3345
|
p[9] || (p[9] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Extra items", -1)),
|
|
3314
|
-
q(
|
|
3346
|
+
q(k, {
|
|
3315
3347
|
variant: "tertiary",
|
|
3316
3348
|
label: "Add item",
|
|
3317
3349
|
"prepend-icon": "add",
|
|
3318
3350
|
size: "md",
|
|
3319
|
-
onClick:
|
|
3351
|
+
onClick: z
|
|
3320
3352
|
})
|
|
3321
3353
|
]),
|
|
3322
3354
|
F.value.length === 0 ? (i(), y("div", kn, " No extra items added ")) : V("", !0),
|
|
@@ -3325,9 +3357,9 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3325
3357
|
return i(), y("div", { key: me }, [
|
|
3326
3358
|
e("div", xn, [
|
|
3327
3359
|
e("div", wn, [
|
|
3328
|
-
q(
|
|
3360
|
+
q(se, {
|
|
3329
3361
|
"model-value": ge.skuId,
|
|
3330
|
-
"onUpdate:modelValue": (Le) =>
|
|
3362
|
+
"onUpdate:modelValue": (Le) => Z(me, Le),
|
|
3331
3363
|
label: "Ingredient",
|
|
3332
3364
|
items: h.value,
|
|
3333
3365
|
searchable: "",
|
|
@@ -3342,10 +3374,10 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3342
3374
|
modelValue: ve.value[me].value,
|
|
3343
3375
|
"onUpdate:modelValue": (Le) => ve.value[me].value = Le,
|
|
3344
3376
|
"append-text": ge.skuId ? ((Ee = (Re = b(D).skuById[ge.skuId]) == null ? void 0 : Re.unit) == null ? void 0 : Ee.abbrev) ?? "" : "",
|
|
3345
|
-
"helper-text":
|
|
3377
|
+
"helper-text": ne(ge)
|
|
3346
3378
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text", "helper-text"]),
|
|
3347
|
-
ve.value[me].value <= 0 ? (i(), y("div", Cn,
|
|
3348
|
-
b(
|
|
3379
|
+
ve.value[me].value <= 0 ? (i(), y("div", Cn, x(rs))) : V("", !0),
|
|
3380
|
+
b(re) ? (i(), y("div", An, [
|
|
3349
3381
|
q(Y, {
|
|
3350
3382
|
"model-value": ge.costEnabled,
|
|
3351
3383
|
"onUpdate:modelValue": (Le) => a(me),
|
|
@@ -3353,7 +3385,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3353
3385
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
3354
3386
|
p[10] || (p[10] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
|
|
3355
3387
|
])) : V("", !0),
|
|
3356
|
-
b(
|
|
3388
|
+
b(re) && ge.costEnabled ? (i(), he(we, {
|
|
3357
3389
|
key: 2,
|
|
3358
3390
|
modelValue: s.value[me].value,
|
|
3359
3391
|
"onUpdate:modelValue": (Le) => s.value[me].value = Le,
|
|
@@ -3365,7 +3397,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3365
3397
|
"append-text": b(Ce)()
|
|
3366
3398
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) : V("", !0)
|
|
3367
3399
|
]),
|
|
3368
|
-
ge.historyItem ? V("", !0) : (i(), he(
|
|
3400
|
+
ge.historyItem ? V("", !0) : (i(), he(k, {
|
|
3369
3401
|
key: 0,
|
|
3370
3402
|
variant: "tertiary",
|
|
3371
3403
|
"prepend-icon": "delete",
|
|
@@ -3381,7 +3413,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3381
3413
|
e("div", Dn, [
|
|
3382
3414
|
p[11] || (p[11] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Delivery order no.", -1)),
|
|
3383
3415
|
e("div", Rn, [
|
|
3384
|
-
q(
|
|
3416
|
+
q(Se, {
|
|
3385
3417
|
modelValue: b(n).deliveryOrderNumber,
|
|
3386
3418
|
"onUpdate:modelValue": p[2] || (p[2] = (ge) => b(n).deliveryOrderNumber = ge),
|
|
3387
3419
|
size: "md"
|
|
@@ -3391,7 +3423,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3391
3423
|
e("div", Pn, [
|
|
3392
3424
|
p[12] || (p[12] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Remark", -1)),
|
|
3393
3425
|
e("div", Fn, [
|
|
3394
|
-
q(
|
|
3426
|
+
q(Se, {
|
|
3395
3427
|
modelValue: b(n).remark,
|
|
3396
3428
|
"onUpdate:modelValue": p[3] || (p[3] = (ge) => b(n).remark = ge),
|
|
3397
3429
|
size: "md"
|
|
@@ -3419,7 +3451,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3419
3451
|
adjustments: {}
|
|
3420
3452
|
},
|
|
3421
3453
|
setup(u) {
|
|
3422
|
-
const t = u, r =
|
|
3454
|
+
const t = u, r = H(() => t.adjustments ?? []);
|
|
3423
3455
|
function o(m) {
|
|
3424
3456
|
const c = m.amount < 0 ? "-" : "+", d = $e({ ...m, amount: Math.abs(m.amount) });
|
|
3425
3457
|
return `${c}${m.currency} ${d}`;
|
|
@@ -3429,8 +3461,8 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3429
3461
|
key: d.id,
|
|
3430
3462
|
class: "flex justify-between gap-4 fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
3431
3463
|
}, [
|
|
3432
|
-
e("span", En,
|
|
3433
|
-
e("span", qn,
|
|
3464
|
+
e("span", En, x(d.name), 1),
|
|
3465
|
+
e("span", qn, x(o(d.dinero)), 1)
|
|
3434
3466
|
]))), 128))
|
|
3435
3467
|
])) : V("", !0);
|
|
3436
3468
|
}
|
|
@@ -3441,7 +3473,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3441
3473
|
},
|
|
3442
3474
|
emits: ["submitted"],
|
|
3443
3475
|
setup(u, { emit: t }) {
|
|
3444
|
-
const r = u, o = t, m = Ze(), c = Je(), d =
|
|
3476
|
+
const r = u, o = t, m = Ze(), c = Je(), d = ae(!1), n = ae(!1), { controller: l, state: C, reset: v } = Tt({
|
|
3445
3477
|
currency: Ce(),
|
|
3446
3478
|
adjustments: r.purchaseOrder.priceAdjustments
|
|
3447
3479
|
});
|
|
@@ -3469,15 +3501,15 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3469
3501
|
});
|
|
3470
3502
|
}
|
|
3471
3503
|
return (R, T) => {
|
|
3472
|
-
const
|
|
3473
|
-
return i(), he(
|
|
3504
|
+
const S = ue("FmButton"), B = ue("FmDialog");
|
|
3505
|
+
return i(), he(B, {
|
|
3474
3506
|
modelValue: d.value,
|
|
3475
3507
|
"onUpdate:modelValue": T[0] || (T[0] = (E) => d.value = E),
|
|
3476
3508
|
overlay: !0,
|
|
3477
3509
|
"min-width": 600
|
|
3478
3510
|
}, {
|
|
3479
3511
|
"dialog-button": pe(() => [
|
|
3480
|
-
q(
|
|
3512
|
+
q(S, {
|
|
3481
3513
|
variant: "plain",
|
|
3482
3514
|
label: "Edit price adjustments",
|
|
3483
3515
|
size: "md",
|
|
@@ -3485,10 +3517,10 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3485
3517
|
})
|
|
3486
3518
|
]),
|
|
3487
3519
|
"dialog-header": pe(() => [
|
|
3488
|
-
e("div", null, "Price adjustments — PO# " +
|
|
3520
|
+
e("div", null, "Price adjustments — PO# " + x(r.purchaseOrder.seqNumber), 1)
|
|
3489
3521
|
]),
|
|
3490
3522
|
"dialog-footer": pe(() => [
|
|
3491
|
-
q(
|
|
3523
|
+
q(S, {
|
|
3492
3524
|
class: "ml-auto",
|
|
3493
3525
|
label: "Apply changes",
|
|
3494
3526
|
size: "md",
|
|
@@ -3502,7 +3534,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3502
3534
|
e("div", Ln, [
|
|
3503
3535
|
q(It, {
|
|
3504
3536
|
controller: b(l),
|
|
3505
|
-
state: b(
|
|
3537
|
+
state: b(C)
|
|
3506
3538
|
}, null, 8, ["controller", "state"])
|
|
3507
3539
|
])
|
|
3508
3540
|
]),
|
|
@@ -3525,7 +3557,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3525
3557
|
netsuiteId: {}
|
|
3526
3558
|
},
|
|
3527
3559
|
setup(u) {
|
|
3528
|
-
const t = u, r = Ft(), o =
|
|
3560
|
+
const t = u, r = Ft(), o = ae(!1), m = ae(!1), c = ae(!1), d = ae([]);
|
|
3529
3561
|
async function n() {
|
|
3530
3562
|
if (!(d.value.length > 0))
|
|
3531
3563
|
try {
|
|
@@ -3552,7 +3584,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3552
3584
|
return "text-gray-600 bg-gray-100";
|
|
3553
3585
|
}
|
|
3554
3586
|
}
|
|
3555
|
-
function
|
|
3587
|
+
function C(v) {
|
|
3556
3588
|
return new Date(v).toLocaleDateString("en-US", {
|
|
3557
3589
|
year: "numeric",
|
|
3558
3590
|
month: "short",
|
|
@@ -3562,9 +3594,9 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3562
3594
|
});
|
|
3563
3595
|
}
|
|
3564
3596
|
return (v, D) => {
|
|
3565
|
-
const R =
|
|
3597
|
+
const R = ue("FmButton"), T = ue("FmCircularProgress"), S = ue("FmIcon"), B = ue("FmDialog");
|
|
3566
3598
|
return i(), y("div", Un, [
|
|
3567
|
-
q(
|
|
3599
|
+
q(B, {
|
|
3568
3600
|
modelValue: o.value,
|
|
3569
3601
|
"onUpdate:modelValue": D[2] || (D[2] = (E) => o.value = E),
|
|
3570
3602
|
overlay: !0,
|
|
@@ -3591,7 +3623,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3591
3623
|
])) : V("", !0),
|
|
3592
3624
|
!m.value && d.value.length > 0 ? (i(), y("div", Bn, [
|
|
3593
3625
|
e("h3", zn, [
|
|
3594
|
-
q(
|
|
3626
|
+
q(S, {
|
|
3595
3627
|
name: "error",
|
|
3596
3628
|
color: "#ff9500",
|
|
3597
3629
|
size: "sm"
|
|
@@ -3617,21 +3649,21 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3617
3649
|
])
|
|
3618
3650
|
], -1)),
|
|
3619
3651
|
e("tbody", null, [
|
|
3620
|
-
(i(!0), y(De, null, Te(d.value, (E,
|
|
3621
|
-
key:
|
|
3652
|
+
(i(!0), y(De, null, Te(d.value, (E, re) => (i(), y("tr", {
|
|
3653
|
+
key: re,
|
|
3622
3654
|
class: "border-b border-fm-color-neutral-gray-200 last:border-b-0"
|
|
3623
3655
|
}, [
|
|
3624
|
-
e("td", Gn,
|
|
3625
|
-
e("td", Wn,
|
|
3626
|
-
e("td", Qn,
|
|
3627
|
-
e("td", Yn,
|
|
3656
|
+
e("td", Gn, x(C(E._dateiso8601)), 1),
|
|
3657
|
+
e("td", Wn, x(E._rolename), 1),
|
|
3658
|
+
e("td", Qn, x(E._employeename), 1),
|
|
3659
|
+
e("td", Yn, x(E._contextname), 1),
|
|
3628
3660
|
e("td", {
|
|
3629
3661
|
class: Ge(`p-3 fm-typo-en-body-sm-600 ${l(Number(E.type) - 1)}`)
|
|
3630
|
-
},
|
|
3631
|
-
e("td", Jn,
|
|
3632
|
-
e("td", Xn,
|
|
3633
|
-
e("td", Zn,
|
|
3634
|
-
e("td", ea,
|
|
3662
|
+
}, x(b(Me)[Number(E.type) - 1]), 3),
|
|
3663
|
+
e("td", Jn, x(E.lineid || ""), 1),
|
|
3664
|
+
e("td", Xn, x(E._fieldname), 1),
|
|
3665
|
+
e("td", Zn, x(E.oldvalue || ""), 1),
|
|
3666
|
+
e("td", ea, x(E.newvalue || ""), 1)
|
|
3635
3667
|
]))), 128))
|
|
3636
3668
|
])
|
|
3637
3669
|
])
|
|
@@ -3745,10 +3777,10 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3745
3777
|
},
|
|
3746
3778
|
emits: ["update:show", "submitted"],
|
|
3747
3779
|
setup(u, { emit: t }) {
|
|
3748
|
-
const r = u, o = t, m = gt(), c = Je(), d = Ye(), n = ze(), l = bt(), { hasOrderDraftPermission:
|
|
3780
|
+
const r = u, o = t, m = gt(), c = Je(), d = Ye(), n = ze(), l = bt(), { hasOrderDraftPermission: C } = _s(), v = bs();
|
|
3749
3781
|
function D(s) {
|
|
3750
|
-
const a = s.isCustomCost,
|
|
3751
|
-
return a != null ? a === !0 :
|
|
3782
|
+
const a = s.isCustomCost, w = s.totalCost;
|
|
3783
|
+
return a != null ? a === !0 : w != null;
|
|
3752
3784
|
}
|
|
3753
3785
|
Qe(
|
|
3754
3786
|
() => r.purchaseOrder,
|
|
@@ -3757,7 +3789,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3757
3789
|
},
|
|
3758
3790
|
{ immediate: !0 }
|
|
3759
3791
|
);
|
|
3760
|
-
const R =
|
|
3792
|
+
const R = H(
|
|
3761
3793
|
() => {
|
|
3762
3794
|
var s, a;
|
|
3763
3795
|
return {
|
|
@@ -3765,63 +3797,63 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3765
3797
|
name: ((a = l.sessionUser.value) == null ? void 0 : a.displayName) ?? ""
|
|
3766
3798
|
};
|
|
3767
3799
|
}
|
|
3768
|
-
), T = gs(), { t:
|
|
3800
|
+
), T = gs(), { t: S } = ht(), B = H(
|
|
3769
3801
|
() => {
|
|
3770
|
-
var s, a,
|
|
3771
|
-
return ((a = (s = r.purchaseOrder) == null ? void 0 : s.supplier) == null ? void 0 : a.internal) === "restaurant" || ((
|
|
3802
|
+
var s, a, w, A;
|
|
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;
|
|
3772
3804
|
}
|
|
3773
|
-
), E =
|
|
3774
|
-
var
|
|
3775
|
-
const s = (
|
|
3776
|
-
var
|
|
3777
|
-
return
|
|
3805
|
+
), E = H(() => {
|
|
3806
|
+
var w;
|
|
3807
|
+
const s = (w = r.shipments) == null ? void 0 : w.find((A) => {
|
|
3808
|
+
var N;
|
|
3809
|
+
return A.ref === ((N = r.purchaseOrder) == null ? void 0 : N._id);
|
|
3778
3810
|
});
|
|
3779
3811
|
let a = null;
|
|
3780
3812
|
if (s != null && s.milestones && s.milestones.length > 0) {
|
|
3781
|
-
const
|
|
3782
|
-
if (
|
|
3783
|
-
const
|
|
3784
|
-
a = `${
|
|
3813
|
+
const A = s.milestones[s.milestones.length - 1];
|
|
3814
|
+
if (A.estimatedTime) {
|
|
3815
|
+
const N = new Date(A.estimatedTime), W = N.getDate().toString().padStart(2, "0");
|
|
3816
|
+
a = `${N.toLocaleString("en-US", { month: "short" })} ${W}`;
|
|
3785
3817
|
}
|
|
3786
3818
|
}
|
|
3787
3819
|
return a;
|
|
3788
|
-
}),
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
], Ae =
|
|
3793
|
-
var
|
|
3820
|
+
}), re = ae(!1), oe = ae(""), X = ae(!0), le = Ze(), be = Cr(le.getWorkflowConfig), ce = vs(), xe = [
|
|
3821
|
+
K.enum.receiveStock,
|
|
3822
|
+
K.enum.processRequest,
|
|
3823
|
+
K.enum.closeRequest
|
|
3824
|
+
], Ae = H(() => {
|
|
3825
|
+
var de, f, p, k, U, M, ke, we, Y;
|
|
3794
3826
|
if (!r.purchaseOrder)
|
|
3795
3827
|
return [];
|
|
3796
3828
|
const s = be.result.value;
|
|
3797
3829
|
if (s.state === Nt.loading)
|
|
3798
3830
|
return [];
|
|
3799
3831
|
let a;
|
|
3800
|
-
const
|
|
3801
|
-
if (
|
|
3802
|
-
a =
|
|
3832
|
+
const w = as.safeParse(r.purchaseOrder);
|
|
3833
|
+
if (w.success)
|
|
3834
|
+
a = w.data;
|
|
3803
3835
|
else {
|
|
3804
|
-
const
|
|
3836
|
+
const se = /* @__PURE__ */ new Set(["1", "2"]), Se = { line1: "", state: "", city: "", postcode: "", country: "" };
|
|
3805
3837
|
a = {
|
|
3806
|
-
_id: ((
|
|
3807
|
-
status: ((f = r.purchaseOrder) == null ? void 0 : f.status) ??
|
|
3808
|
-
version:
|
|
3809
|
-
seqNumber: typeof ((
|
|
3838
|
+
_id: ((de = r.purchaseOrder) == null ? void 0 : de._id) ?? "",
|
|
3839
|
+
status: ((f = r.purchaseOrder) == null ? void 0 : f.status) ?? Oe.enum.DRAFT,
|
|
3840
|
+
version: se.has((p = r.purchaseOrder) == null ? void 0 : p.version) ? (k = r.purchaseOrder) == null ? void 0 : k.version : null,
|
|
3841
|
+
seqNumber: typeof ((U = r.purchaseOrder) == null ? void 0 : U.seqNumber) == "number" ? r.purchaseOrder.seqNumber : 0,
|
|
3810
3842
|
supplier: {
|
|
3811
|
-
_id: ((
|
|
3843
|
+
_id: ((ke = (M = r.purchaseOrder) == null ? void 0 : M.supplier) == null ? void 0 : ke._id) ?? "",
|
|
3812
3844
|
name: ((Y = (we = r.purchaseOrder) == null ? void 0 : we.supplier) == null ? void 0 : Y.name) ?? "",
|
|
3813
|
-
address:
|
|
3845
|
+
address: Se
|
|
3814
3846
|
},
|
|
3815
3847
|
items: [],
|
|
3816
3848
|
deliveryOrder: []
|
|
3817
3849
|
};
|
|
3818
3850
|
}
|
|
3819
|
-
const
|
|
3851
|
+
const A = {
|
|
3820
3852
|
user: R.value,
|
|
3821
3853
|
executedAt: n.locations.computeFirst(
|
|
3822
|
-
(
|
|
3823
|
-
var
|
|
3824
|
-
return
|
|
3854
|
+
(se) => {
|
|
3855
|
+
var Se;
|
|
3856
|
+
return se.dbName === ((Se = n._currentLocation) == null ? void 0 : Se.dbName) ? se : null;
|
|
3825
3857
|
}
|
|
3826
3858
|
),
|
|
3827
3859
|
// Strip purchaseOrder and netSuite from the POR before passing to the Dart
|
|
@@ -3833,48 +3865,48 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3833
3865
|
// null for an unvalidatable POR yields the same available actions.
|
|
3834
3866
|
purchaseOrderRequest: (() => {
|
|
3835
3867
|
if (r.poRequest == null) return r.poRequest;
|
|
3836
|
-
const
|
|
3837
|
-
return
|
|
3868
|
+
const se = Ls.safeParse(r.poRequest);
|
|
3869
|
+
return se.success ? { ...se.data, purchaseOrder: null, netSuite: null } : null;
|
|
3838
3870
|
})(),
|
|
3839
3871
|
purchaseOrder: a
|
|
3840
|
-
},
|
|
3841
|
-
|
|
3872
|
+
}, N = d.useOperatePurchaseOrderV2, W = d.poWorkflowAllowToMarkCompleted, fe = [...xe];
|
|
3873
|
+
N && !W && fe.push(K.enum.completeReceive);
|
|
3842
3874
|
let I = [];
|
|
3843
3875
|
try {
|
|
3844
3876
|
s.state === Nt.error ? (console.error("Error fetching workflow config:", s.error), I = St.getAvailableActions({
|
|
3845
|
-
...
|
|
3877
|
+
...A,
|
|
3846
3878
|
orderConfig: St.getDefaultConfig()
|
|
3847
|
-
}).actions.filter((
|
|
3848
|
-
...
|
|
3879
|
+
}).actions.filter((se) => !fe.includes(se))) : I = St.getAvailableActions({
|
|
3880
|
+
...A,
|
|
3849
3881
|
orderConfig: s.data
|
|
3850
|
-
}).actions.filter((
|
|
3851
|
-
} catch (
|
|
3852
|
-
console.error("Error getting available actions:",
|
|
3882
|
+
}).actions.filter((se) => !fe.includes(se));
|
|
3883
|
+
} catch (se) {
|
|
3884
|
+
console.error("Error getting available actions:", se);
|
|
3853
3885
|
}
|
|
3854
|
-
return r.scope === "approval" && (I = I.filter((
|
|
3855
|
-
(
|
|
3886
|
+
return r.scope === "approval" && (I = I.filter((se) => se !== K.enum.completeReceive)), C.value || (I = I.filter(
|
|
3887
|
+
(se) => se !== K.enum.approveDraft && se !== K.enum.rejectDraft
|
|
3856
3888
|
)), I;
|
|
3857
|
-
}), Q = Ks(r, "show"), ye =
|
|
3889
|
+
}), Q = Ks(r, "show"), ye = H(() => [
|
|
3858
3890
|
{
|
|
3859
|
-
label:
|
|
3891
|
+
label: S("inventory.transfer.receiveRequest.details.overview"),
|
|
3860
3892
|
value: "overview"
|
|
3861
3893
|
},
|
|
3862
3894
|
{
|
|
3863
|
-
label:
|
|
3895
|
+
label: S("inventory.transfer.receiveRequest.details.deliveryHistory"),
|
|
3864
3896
|
value: "deliveryHistory"
|
|
3865
3897
|
},
|
|
3866
3898
|
{
|
|
3867
|
-
label:
|
|
3899
|
+
label: S("inventory.transfer.receiveRequest.details.actionLogs"),
|
|
3868
3900
|
value: "actionLogs"
|
|
3869
3901
|
}
|
|
3870
|
-
]), P =
|
|
3902
|
+
]), P = ae(ye.value[0]);
|
|
3871
3903
|
Qe(
|
|
3872
3904
|
() => r.show,
|
|
3873
3905
|
(s) => {
|
|
3874
3906
|
s && (P.value = ye.value[0]);
|
|
3875
3907
|
}
|
|
3876
3908
|
);
|
|
3877
|
-
function
|
|
3909
|
+
function O(s) {
|
|
3878
3910
|
return s.map((a) => ({
|
|
3879
3911
|
...a,
|
|
3880
3912
|
amount: {
|
|
@@ -3883,28 +3915,28 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3883
3915
|
}
|
|
3884
3916
|
}));
|
|
3885
3917
|
}
|
|
3886
|
-
async function
|
|
3918
|
+
async function g(s, a, w, A, N) {
|
|
3887
3919
|
return new Promise((W, fe) => {
|
|
3888
3920
|
const I = {
|
|
3889
3921
|
closeButton: !1,
|
|
3890
|
-
title:
|
|
3891
|
-
message:
|
|
3892
|
-
primaryActions:
|
|
3922
|
+
title: A.title,
|
|
3923
|
+
message: A.message,
|
|
3924
|
+
primaryActions: A.primaryActions,
|
|
3893
3925
|
secondaryActions: { text: "No", close: !1 }
|
|
3894
3926
|
};
|
|
3895
|
-
let
|
|
3896
|
-
|
|
3897
|
-
message:
|
|
3927
|
+
let de = a.rejectReason ?? "";
|
|
3928
|
+
w === K.enum.rejectDraft && (I.contentComponent = fs, I.contentComponentProps = {
|
|
3929
|
+
message: A.message,
|
|
3898
3930
|
onChange: (f) => {
|
|
3899
|
-
|
|
3931
|
+
de = f ?? "";
|
|
3900
3932
|
}
|
|
3901
3933
|
}), m.open(I).onPrimary(async () => {
|
|
3902
|
-
var p,
|
|
3934
|
+
var p, k, U, M;
|
|
3903
3935
|
const f = [];
|
|
3904
|
-
|
|
3936
|
+
w === K.enum.confirmDraft || w === K.enum.submitRequest ? f.push({
|
|
3905
3937
|
action: "confirmDraft",
|
|
3906
3938
|
payload: v.controller.value.toConfirmDraftData(Ce())
|
|
3907
|
-
}) :
|
|
3939
|
+
}) : w === K.enum.approveRequest ? (f.push({
|
|
3908
3940
|
action: "approveRequest",
|
|
3909
3941
|
payload: null
|
|
3910
3942
|
}), a.fulfillment && f.push({
|
|
@@ -3913,60 +3945,60 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3913
3945
|
fulfillmentId: "",
|
|
3914
3946
|
deliveryOrderNumber: "",
|
|
3915
3947
|
deliveryRemark: null,
|
|
3916
|
-
items:
|
|
3948
|
+
items: O(a.fulfillment.items),
|
|
3917
3949
|
createdBy: R.value
|
|
3918
3950
|
}
|
|
3919
|
-
})) :
|
|
3951
|
+
})) : w === K.enum.processRequest ? a.fulfillment && f.push({
|
|
3920
3952
|
action: "processRequest",
|
|
3921
3953
|
payload: {
|
|
3922
3954
|
fulfillmentId: "",
|
|
3923
3955
|
deliveryOrderNumber: "",
|
|
3924
3956
|
deliveryRemark: null,
|
|
3925
|
-
items:
|
|
3957
|
+
items: O(a.fulfillment.items),
|
|
3926
3958
|
createdBy: R.value
|
|
3927
3959
|
}
|
|
3928
|
-
}) :
|
|
3960
|
+
}) : w === K.enum.rejectRequest ? f.push({
|
|
3929
3961
|
action: "rejectRequest",
|
|
3930
3962
|
payload: null
|
|
3931
|
-
}) :
|
|
3963
|
+
}) : w === K.enum.closeRequest ? f.push({
|
|
3932
3964
|
action: "closeRequest",
|
|
3933
3965
|
payload: null
|
|
3934
|
-
}) :
|
|
3966
|
+
}) : w === K.enum.rejectDraft && f.push({
|
|
3935
3967
|
action: "rejectDraft",
|
|
3936
3968
|
payload: {
|
|
3937
|
-
rejectReason:
|
|
3969
|
+
rejectReason: de ?? ""
|
|
3938
3970
|
}
|
|
3939
3971
|
});
|
|
3940
3972
|
try {
|
|
3941
|
-
await
|
|
3973
|
+
await ce({
|
|
3942
3974
|
operate: {
|
|
3943
|
-
operation:
|
|
3975
|
+
operation: w,
|
|
3944
3976
|
doc: s,
|
|
3945
3977
|
options: a
|
|
3946
3978
|
},
|
|
3947
3979
|
operateV2: {
|
|
3948
3980
|
_id: ((p = r.purchaseOrder) == null ? void 0 : p._id) ?? "",
|
|
3949
|
-
_rev: ((
|
|
3950
|
-
action:
|
|
3981
|
+
_rev: ((k = r.purchaseOrder) == null ? void 0 : k._rev) ?? "",
|
|
3982
|
+
action: w === K.enum.submitRequest ? K.enum.confirmDraft : w,
|
|
3951
3983
|
payloads: f
|
|
3952
3984
|
// add payload if action is receiveStock or processRequest
|
|
3953
3985
|
},
|
|
3954
|
-
transferTo: (
|
|
3986
|
+
transferTo: (M = (U = r.poRequest) == null ? void 0 : U.to) == null ? void 0 : M.dbName
|
|
3955
3987
|
}).delayed(1e3), W("submitted");
|
|
3956
|
-
} catch (
|
|
3957
|
-
fe(
|
|
3988
|
+
} catch (ke) {
|
|
3989
|
+
fe(ke);
|
|
3958
3990
|
}
|
|
3959
3991
|
}).onSecondary(() => {
|
|
3960
3992
|
W("cancelled");
|
|
3961
|
-
for (let f = 0; f <
|
|
3993
|
+
for (let f = 0; f < N + 2; f++)
|
|
3962
3994
|
m.close();
|
|
3963
3995
|
}).onClose(() => {
|
|
3964
3996
|
});
|
|
3965
3997
|
});
|
|
3966
3998
|
}
|
|
3967
|
-
async function
|
|
3968
|
-
var
|
|
3969
|
-
if (s ===
|
|
3999
|
+
async function $(s) {
|
|
4000
|
+
var N, W, fe, I;
|
|
4001
|
+
if (s === K.enum.receiveStock)
|
|
3970
4002
|
return;
|
|
3971
4003
|
const a = ps[s];
|
|
3972
4004
|
if (!a) {
|
|
@@ -3977,44 +4009,44 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
3977
4009
|
});
|
|
3978
4010
|
return;
|
|
3979
4011
|
}
|
|
3980
|
-
const { successMessage:
|
|
4012
|
+
const { successMessage: w, ...A } = a;
|
|
3981
4013
|
if (r.purchaseOrder) {
|
|
3982
|
-
|
|
3983
|
-
const
|
|
4014
|
+
oe.value = `${s}`, re.value = !0, X.value = !1;
|
|
4015
|
+
const de = {};
|
|
3984
4016
|
let f = 0;
|
|
3985
|
-
if ((s ===
|
|
3986
|
-
s ===
|
|
3987
|
-
|
|
3988
|
-
else if ((s ===
|
|
3989
|
-
const p = (W = (
|
|
3990
|
-
if (p &&
|
|
3991
|
-
const
|
|
4017
|
+
if ((s === K.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
4018
|
+
s === K.enum.completeReceive) && d.autoReceiveWarehouse)
|
|
4019
|
+
de.autoReceive = !0;
|
|
4020
|
+
else if ((s === K.enum.approveRequest || s === K.enum.processRequest) && d.acceptRequireFulfillment) {
|
|
4021
|
+
const p = (W = (N = r.poRequest) == null ? void 0 : N.from) == null ? void 0 : W.dbName, k = (I = (fe = r.poRequest) == null ? void 0 : fe.to) == null ? void 0 : I.dbName;
|
|
4022
|
+
if (p && k && (p.startsWith("warehouse_") || k.startsWith("warehouse_"))) {
|
|
4023
|
+
const U = await new Promise((M, ke) => {
|
|
3992
4024
|
m.open({
|
|
3993
4025
|
closeButton: !1,
|
|
3994
4026
|
title: "Confirm transfer amount",
|
|
3995
4027
|
dialogComponent: $r,
|
|
3996
4028
|
dialogComponentProps: {
|
|
3997
4029
|
purchaseOrder: r.purchaseOrder,
|
|
3998
|
-
confirm:
|
|
4030
|
+
confirm: M,
|
|
3999
4031
|
"onUpdate:show": (we) => {
|
|
4000
|
-
we || (
|
|
4032
|
+
we || (oe.value = "", re.value = !1, X.value = !0, f++, m.close()), ke("cancelled");
|
|
4001
4033
|
}
|
|
4002
4034
|
}
|
|
4003
4035
|
});
|
|
4004
4036
|
});
|
|
4005
|
-
|
|
4037
|
+
de.fulfillment = U;
|
|
4006
4038
|
}
|
|
4007
4039
|
}
|
|
4008
4040
|
try {
|
|
4009
|
-
await
|
|
4041
|
+
await g(
|
|
4010
4042
|
r.purchaseOrder,
|
|
4011
|
-
|
|
4043
|
+
de,
|
|
4012
4044
|
s,
|
|
4013
4045
|
a,
|
|
4014
4046
|
f
|
|
4015
4047
|
) === "submitted" && (c.open({
|
|
4016
4048
|
title: "Success",
|
|
4017
|
-
message:
|
|
4049
|
+
message: w,
|
|
4018
4050
|
type: "success"
|
|
4019
4051
|
}), o("update:show", !1), o("submitted"));
|
|
4020
4052
|
} catch (p) {
|
|
@@ -4024,25 +4056,25 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4024
4056
|
type: "error"
|
|
4025
4057
|
}), console.error("Error when submitting PO operation", s, r.purchaseOrder, p);
|
|
4026
4058
|
} finally {
|
|
4027
|
-
|
|
4059
|
+
oe.value = "", re.value = !1, X.value = !0;
|
|
4028
4060
|
}
|
|
4029
4061
|
}
|
|
4030
4062
|
}
|
|
4031
|
-
const
|
|
4063
|
+
const j = H(() => {
|
|
4032
4064
|
var s, a;
|
|
4033
|
-
return ((s = r.purchaseOrder) == null ? void 0 : s.status) ===
|
|
4034
|
-
}),
|
|
4065
|
+
return ((s = r.purchaseOrder) == null ? void 0 : s.status) === Oe.enum.RECEIVING || ((a = r.purchaseOrder) == null ? void 0 : a.status) === Oe.enum.COMPLETE;
|
|
4066
|
+
}), J = H(() => r.purchaseOrder ? vt(r.purchaseOrder) : {}), ee = H(() => {
|
|
4035
4067
|
const s = r.purchaseOrder;
|
|
4036
4068
|
if (!s) return { status: "", statusClass: "" };
|
|
4037
|
-
const { partial: a, over:
|
|
4038
|
-
let
|
|
4039
|
-
return
|
|
4040
|
-
status:
|
|
4069
|
+
const { partial: a, over: w } = $t(J.value), A = Ct(s.status, a, w);
|
|
4070
|
+
let N = S(`inventory.transfer.status.${A}`), W = `${s.status}`.toLocaleLowerCase("en-us");
|
|
4071
|
+
return A === Oe.enum.CLOSE && (N = `${S(`inventory.transfer.status.${Oe.enum.COMPLETE}`)}`), A === "PARTIAL_RECEIVED" && W === Oe.enum.PROCESSING.toLocaleLowerCase("en-us") && (W = Oe.enum.RECEIVING.toLocaleLowerCase("en-us")), {
|
|
4072
|
+
status: N,
|
|
4041
4073
|
statusClass: `fm-status-badge fm-status-badge-${W}`
|
|
4042
4074
|
};
|
|
4043
|
-
}),
|
|
4075
|
+
}), L = H(() => {
|
|
4044
4076
|
var W, fe;
|
|
4045
|
-
const s = ((W = r.purchaseOrder) == null ? void 0 : W.deliveryOrder) ?? [], a = ((fe = r.purchaseOrder) == null ? void 0 : fe.deliveryFullfillment) ?? [],
|
|
4077
|
+
const s = ((W = r.purchaseOrder) == null ? void 0 : W.deliveryOrder) ?? [], a = ((fe = r.purchaseOrder) == null ? void 0 : fe.deliveryFullfillment) ?? [], w = [
|
|
4046
4078
|
...s.map((I) => ({
|
|
4047
4079
|
createdAt: I.createdAt,
|
|
4048
4080
|
type: "grn",
|
|
@@ -4054,19 +4086,19 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4054
4086
|
doc: I
|
|
4055
4087
|
}))
|
|
4056
4088
|
];
|
|
4057
|
-
|
|
4058
|
-
function
|
|
4059
|
-
var p,
|
|
4060
|
-
const
|
|
4061
|
-
(
|
|
4089
|
+
w.reverse().sort((I, de) => I.createdAt.localeCompare(de.createdAt));
|
|
4090
|
+
function A(I) {
|
|
4091
|
+
var p, k, U, M, ke, we, Y, se, Se, Pe, Ie, ge;
|
|
4092
|
+
const de = a.findIndex((me) => me.id === I.fullfillmentId), f = [
|
|
4093
|
+
(k = (p = a[de]) == null ? void 0 : p.netSuite) != null && k.id ? {
|
|
4062
4094
|
label: "Fulfillment's ref no. (Netsuite)",
|
|
4063
4095
|
values: [
|
|
4064
|
-
`${((
|
|
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) ?? "-"})`
|
|
4065
4097
|
]
|
|
4066
4098
|
} : null,
|
|
4067
4099
|
(Y = I == null ? void 0 : I.netSuite) != null && Y.id ? {
|
|
4068
4100
|
label: "Netsuite ref no.",
|
|
4069
|
-
values: [`${((
|
|
4101
|
+
values: [`${((se = I == null ? void 0 : I.netSuite) == null ? void 0 : se.refNo) ?? "N/A"} (${((Se = I == null ? void 0 : I.netSuite) == null ? void 0 : Se.id) ?? "-"})`]
|
|
4070
4102
|
} : null,
|
|
4071
4103
|
(Pe = I == null ? void 0 : I.netSuite) != null && Pe.recordType ? {
|
|
4072
4104
|
label: "Netsuite Type",
|
|
@@ -4092,27 +4124,27 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4092
4124
|
label: "Received items",
|
|
4093
4125
|
values: I.received.map((me) => {
|
|
4094
4126
|
var Re;
|
|
4095
|
-
return
|
|
4096
|
-
|
|
4127
|
+
return ie("div", [
|
|
4128
|
+
ie(
|
|
4097
4129
|
"div",
|
|
4098
4130
|
{
|
|
4099
4131
|
class: "flex gap-4"
|
|
4100
4132
|
},
|
|
4101
4133
|
[
|
|
4102
|
-
|
|
4134
|
+
ie(
|
|
4103
4135
|
"div",
|
|
4104
4136
|
{
|
|
4105
4137
|
class: "flex flex-col"
|
|
4106
4138
|
},
|
|
4107
4139
|
[
|
|
4108
|
-
|
|
4140
|
+
ie(
|
|
4109
4141
|
"span",
|
|
4110
4142
|
{
|
|
4111
4143
|
class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
|
|
4112
4144
|
},
|
|
4113
4145
|
`${me.sku.name}`
|
|
4114
4146
|
),
|
|
4115
|
-
|
|
4147
|
+
ie(
|
|
4116
4148
|
"span",
|
|
4117
4149
|
{
|
|
4118
4150
|
class: "fm-typo-en-body-md-400"
|
|
@@ -4121,26 +4153,26 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4121
4153
|
)
|
|
4122
4154
|
]
|
|
4123
4155
|
),
|
|
4124
|
-
|
|
4156
|
+
ie(
|
|
4125
4157
|
"div",
|
|
4126
4158
|
{
|
|
4127
4159
|
class: "ml-auto flex flex-col"
|
|
4128
4160
|
},
|
|
4129
4161
|
[
|
|
4130
|
-
|
|
4162
|
+
ie(
|
|
4131
4163
|
"div",
|
|
4132
4164
|
{
|
|
4133
4165
|
class: "ml-auto flex gap-1"
|
|
4134
4166
|
},
|
|
4135
4167
|
[
|
|
4136
|
-
|
|
4168
|
+
ie(
|
|
4137
4169
|
"span",
|
|
4138
4170
|
{
|
|
4139
4171
|
class: "fm-typo-en-body-lg-600 self-end"
|
|
4140
4172
|
},
|
|
4141
4173
|
$e(me.amount, !1)
|
|
4142
4174
|
),
|
|
4143
|
-
|
|
4175
|
+
ie(
|
|
4144
4176
|
"span",
|
|
4145
4177
|
{
|
|
4146
4178
|
class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
@@ -4149,7 +4181,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4149
4181
|
)
|
|
4150
4182
|
]
|
|
4151
4183
|
),
|
|
4152
|
-
|
|
4184
|
+
ie(
|
|
4153
4185
|
"div",
|
|
4154
4186
|
{
|
|
4155
4187
|
class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
@@ -4171,92 +4203,92 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4171
4203
|
label: "Remark",
|
|
4172
4204
|
values: [I.remark || "N/A"]
|
|
4173
4205
|
},
|
|
4174
|
-
|
|
4206
|
+
de > -1 ? {
|
|
4175
4207
|
label: "Fulfilment's sequence",
|
|
4176
|
-
values: [`${
|
|
4208
|
+
values: [`${de + 1}`]
|
|
4177
4209
|
} : null,
|
|
4178
4210
|
...f
|
|
4179
4211
|
].filter((me) => !!me)
|
|
4180
4212
|
};
|
|
4181
4213
|
}
|
|
4182
|
-
function
|
|
4183
|
-
var f, p,
|
|
4184
|
-
const
|
|
4214
|
+
function N(I) {
|
|
4215
|
+
var f, p, k;
|
|
4216
|
+
const de = a.findIndex((U) => U.id === I.id);
|
|
4185
4217
|
return {
|
|
4186
4218
|
header: "Fulfillment",
|
|
4187
4219
|
date: et(new Date(I.createdAt)),
|
|
4188
4220
|
info: [
|
|
4189
4221
|
{
|
|
4190
4222
|
label: "Sequence",
|
|
4191
|
-
values: [String(
|
|
4223
|
+
values: [String(de + 1)]
|
|
4192
4224
|
},
|
|
4193
4225
|
{
|
|
4194
4226
|
label: "Receiveable items",
|
|
4195
|
-
values: I.items.map((
|
|
4196
|
-
var
|
|
4197
|
-
return
|
|
4198
|
-
|
|
4227
|
+
values: I.items.map((U) => {
|
|
4228
|
+
var M;
|
|
4229
|
+
return ie("div", [
|
|
4230
|
+
ie(
|
|
4199
4231
|
"div",
|
|
4200
4232
|
{
|
|
4201
4233
|
class: "flex gap-4"
|
|
4202
4234
|
},
|
|
4203
4235
|
[
|
|
4204
|
-
|
|
4236
|
+
ie(
|
|
4205
4237
|
"div",
|
|
4206
4238
|
{
|
|
4207
4239
|
class: "flex flex-col"
|
|
4208
4240
|
},
|
|
4209
4241
|
[
|
|
4210
|
-
|
|
4242
|
+
ie(
|
|
4211
4243
|
"span",
|
|
4212
4244
|
{
|
|
4213
4245
|
class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
|
|
4214
4246
|
},
|
|
4215
|
-
`${
|
|
4247
|
+
`${U.sku.name}`
|
|
4216
4248
|
),
|
|
4217
|
-
|
|
4249
|
+
ie(
|
|
4218
4250
|
"span",
|
|
4219
4251
|
{
|
|
4220
4252
|
class: "fm-typo-en-body-md-400"
|
|
4221
4253
|
},
|
|
4222
|
-
`${
|
|
4254
|
+
`${U.sku.code} `
|
|
4223
4255
|
)
|
|
4224
4256
|
]
|
|
4225
4257
|
),
|
|
4226
|
-
|
|
4258
|
+
ie(
|
|
4227
4259
|
"div",
|
|
4228
4260
|
{
|
|
4229
4261
|
class: "ml-auto flex flex-col"
|
|
4230
4262
|
},
|
|
4231
4263
|
[
|
|
4232
|
-
|
|
4264
|
+
ie(
|
|
4233
4265
|
"div",
|
|
4234
4266
|
{
|
|
4235
4267
|
class: "ml-auto flex gap-1"
|
|
4236
4268
|
},
|
|
4237
4269
|
[
|
|
4238
|
-
|
|
4270
|
+
ie(
|
|
4239
4271
|
"span",
|
|
4240
4272
|
{
|
|
4241
4273
|
class: "fm-typo-en-body-lg-600 self-end"
|
|
4242
4274
|
},
|
|
4243
|
-
$e(
|
|
4275
|
+
$e(U.amount, !1)
|
|
4244
4276
|
),
|
|
4245
|
-
|
|
4277
|
+
ie(
|
|
4246
4278
|
"span",
|
|
4247
4279
|
{
|
|
4248
4280
|
class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
4249
4281
|
},
|
|
4250
|
-
((
|
|
4282
|
+
((M = U.measurement) == null ? void 0 : M.abbrev) ?? U.sku.unit.abbrev
|
|
4251
4283
|
)
|
|
4252
4284
|
]
|
|
4253
4285
|
),
|
|
4254
|
-
|
|
4286
|
+
ie(
|
|
4255
4287
|
"div",
|
|
4256
4288
|
{
|
|
4257
4289
|
class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
4258
4290
|
},
|
|
4259
|
-
`${
|
|
4291
|
+
`${U.cost ? `(${ut(U.cost)})` : ""}`
|
|
4260
4292
|
)
|
|
4261
4293
|
]
|
|
4262
4294
|
)
|
|
@@ -4267,137 +4299,137 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4267
4299
|
},
|
|
4268
4300
|
(f = I.netSuite) != null && f.refNo ? {
|
|
4269
4301
|
label: "Netsuite Ref no. (ID)",
|
|
4270
|
-
values: [`${(p = I.netSuite) == null ? void 0 : p.refNo} (${((
|
|
4302
|
+
values: [`${(p = I.netSuite) == null ? void 0 : p.refNo} (${((k = I.netSuite) == null ? void 0 : k.id) ?? "-"})`]
|
|
4271
4303
|
} : null
|
|
4272
|
-
].filter((
|
|
4304
|
+
].filter((U) => !!U)
|
|
4273
4305
|
};
|
|
4274
4306
|
}
|
|
4275
|
-
return
|
|
4276
|
-
(I) => I.type === "grn" ?
|
|
4307
|
+
return w.map(
|
|
4308
|
+
(I) => I.type === "grn" ? A(I.doc) : N(I.doc)
|
|
4277
4309
|
);
|
|
4278
|
-
}),
|
|
4310
|
+
}), te = H(() => {
|
|
4279
4311
|
const s = r.purchaseOrder;
|
|
4280
4312
|
if (!s) return [];
|
|
4281
4313
|
if (!s.itemsAtSubmission) return s.items ?? [];
|
|
4282
|
-
const a = new Set(s.itemsAtSubmission.map((
|
|
4283
|
-
for (const
|
|
4284
|
-
a.has(
|
|
4314
|
+
const a = new Set(s.itemsAtSubmission.map((N) => N.sku._id)), w = [];
|
|
4315
|
+
for (const N of s.items ?? [])
|
|
4316
|
+
a.has(N.sku._id) || (a.add(N.sku._id), w.push(N));
|
|
4285
4317
|
return [...s.itemsAtSubmission.map(
|
|
4286
|
-
(
|
|
4318
|
+
(N) => {
|
|
4287
4319
|
var W;
|
|
4288
4320
|
return ((W = s.items) == null ? void 0 : W.find(
|
|
4289
|
-
(fe) => s.version === je.enum[2] ? fe.id ===
|
|
4290
|
-
)) ??
|
|
4321
|
+
(fe) => s.version === je.enum[2] ? fe.id === N.id : fe.sku._id === N.sku._id
|
|
4322
|
+
)) ?? N;
|
|
4291
4323
|
}
|
|
4292
|
-
), ...
|
|
4293
|
-
}),
|
|
4324
|
+
), ...w];
|
|
4325
|
+
}), _e = H(() => {
|
|
4294
4326
|
const s = r.purchaseOrder;
|
|
4295
4327
|
if (!s || s.version !== je.enum[2]) return r.receivedMap;
|
|
4296
|
-
const a = {},
|
|
4297
|
-
for (const
|
|
4298
|
-
a[
|
|
4299
|
-
const
|
|
4300
|
-
for (const [
|
|
4328
|
+
const a = {}, w = {};
|
|
4329
|
+
for (const N of s.items ?? [])
|
|
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
|
+
const A = {};
|
|
4332
|
+
for (const [N, W] of Object.entries(a)) {
|
|
4301
4333
|
const fe = W.map((p) => r.receivedMap[p]).filter(Boolean);
|
|
4302
4334
|
if (fe.length === 0) continue;
|
|
4303
|
-
const I = { amount: 0, precision:
|
|
4304
|
-
|
|
4305
|
-
key:
|
|
4306
|
-
total:
|
|
4335
|
+
const I = { amount: 0, precision: w[N] ?? 0 }, de = fe.reduce((p, k) => Fe.add([p, k.total]), I), f = fe.reduce((p, k) => Fe.add([p, k.received]), I);
|
|
4336
|
+
A[N] = {
|
|
4337
|
+
key: N,
|
|
4338
|
+
total: de,
|
|
4307
4339
|
received: f,
|
|
4308
|
-
remaining: Fe.subtract([
|
|
4340
|
+
remaining: Fe.subtract([de, f])
|
|
4309
4341
|
};
|
|
4310
4342
|
}
|
|
4311
|
-
return
|
|
4343
|
+
return A;
|
|
4312
4344
|
});
|
|
4313
4345
|
function F(s) {
|
|
4314
|
-
const a =
|
|
4315
|
-
return a ? `<span class="${
|
|
4346
|
+
const a = _e.value[s.sku._id], w = _(s);
|
|
4347
|
+
return a ? `<span class="${w} fm-typo-en-body-lg-600">${Fe.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)}`;
|
|
4316
4348
|
}
|
|
4317
4349
|
function h(s) {
|
|
4318
4350
|
const a = r.purchaseOrder;
|
|
4319
|
-
return a != null && a.itemsAtSubmission ? !a.itemsAtSubmission.some((
|
|
4351
|
+
return a != null && a.itemsAtSubmission ? !a.itemsAtSubmission.some((w) => w.sku._id === s.sku._id) : !1;
|
|
4320
4352
|
}
|
|
4321
|
-
function
|
|
4322
|
-
const a =
|
|
4353
|
+
function _(s) {
|
|
4354
|
+
const a = _e.value[s.sku._id];
|
|
4323
4355
|
if (!a)
|
|
4324
4356
|
return "text-fm-color-typo-tertiary";
|
|
4325
|
-
const { isPartialReceive:
|
|
4326
|
-
return
|
|
4357
|
+
const { isPartialReceive: w, isNoReceive: A, isOverReceive: N, isFullReceive: W } = fr(a);
|
|
4358
|
+
return A ? "text-fm-color-typo-tertiary" : w ? "text-fm-color-system-warning-300" : N ? "text-fm-color-system-error-300" : W ? "text-fm-color-system-success-300" : "";
|
|
4327
4359
|
}
|
|
4328
|
-
const
|
|
4329
|
-
var s, a,
|
|
4330
|
-
return (s = r.purchaseOrder) != null && s.itemsAtSubmission ? ((a = r.purchaseOrder) == null ? void 0 : a.version) === je.enum[2] ? r.purchaseOrder.items.reduce((
|
|
4360
|
+
const z = H(() => {
|
|
4361
|
+
var s, a, w;
|
|
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) => {
|
|
4331
4363
|
var fe, I;
|
|
4332
4364
|
const W = (I = (fe = r.purchaseOrder) == null ? void 0 : fe.itemsAtSubmission) == null ? void 0 : I.find(
|
|
4333
|
-
(
|
|
4365
|
+
(de) => de.id === N.id
|
|
4334
4366
|
);
|
|
4335
|
-
return
|
|
4367
|
+
return N.id && W && W.quantity !== N.quantity && A.set(N.id, {
|
|
4336
4368
|
originalAmount: Number(Fe.toFormatString({ value: W.quantity })),
|
|
4337
|
-
newAmount: Number(Fe.toFormatString({ value:
|
|
4338
|
-
}),
|
|
4339
|
-
}, /* @__PURE__ */ new Map()) : (
|
|
4340
|
-
var
|
|
4341
|
-
const W = (f = (
|
|
4342
|
-
(p) => p.sku._id ===
|
|
4343
|
-
), fe = W ? Number(Fe.toFormatString({ value: W.quantity })) : 0, I = Number(Fe.toFormatString({ value:
|
|
4344
|
-
return W && fe !== I &&
|
|
4369
|
+
newAmount: Number(Fe.toFormatString({ value: N.quantity }))
|
|
4370
|
+
}), A;
|
|
4371
|
+
}, /* @__PURE__ */ new Map()) : (w = r.purchaseOrder) == null ? void 0 : w.items.reduce((A, N) => {
|
|
4372
|
+
var de, f;
|
|
4373
|
+
const W = (f = (de = r.purchaseOrder) == null ? void 0 : de.itemsAtSubmission) == null ? void 0 : f.find(
|
|
4374
|
+
(p) => p.sku._id === N.sku._id
|
|
4375
|
+
), fe = W ? Number(Fe.toFormatString({ value: W.quantity })) : 0, I = Number(Fe.toFormatString({ value: N.quantity }));
|
|
4376
|
+
return W && fe !== I && A.set(N.sku.code, {
|
|
4345
4377
|
originalAmount: fe,
|
|
4346
4378
|
newAmount: I
|
|
4347
|
-
}),
|
|
4379
|
+
}), A;
|
|
4348
4380
|
}, /* @__PURE__ */ new Map()) : /* @__PURE__ */ new Map();
|
|
4349
4381
|
}), G = (s) => {
|
|
4350
|
-
var
|
|
4351
|
-
const a =
|
|
4352
|
-
return ((
|
|
4353
|
-
},
|
|
4354
|
-
var
|
|
4355
|
-
const a =
|
|
4356
|
-
return ((
|
|
4357
|
-
},
|
|
4382
|
+
var w, A;
|
|
4383
|
+
const a = z.value;
|
|
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);
|
|
4385
|
+
}, Z = (s) => {
|
|
4386
|
+
var w, A;
|
|
4387
|
+
const a = z.value;
|
|
4388
|
+
return ((w = r.purchaseOrder) == null ? void 0 : w.version) === je.enum[2] ? a.get(s.id) : a.get((A = s.sku) == null ? void 0 : A.code);
|
|
4389
|
+
}, ne = H(() => {
|
|
4358
4390
|
const s = r.purchaseOrder;
|
|
4359
4391
|
if (!s) return "";
|
|
4360
|
-
const a = s.actionChangelogs ?? [],
|
|
4361
|
-
if (
|
|
4362
|
-
const
|
|
4363
|
-
return
|
|
4392
|
+
const a = s.actionChangelogs ?? [], w = a.length ? a[a.length - 1] : null;
|
|
4393
|
+
if (w && w.action === "rejectDraft") {
|
|
4394
|
+
const A = w.remarks ?? "";
|
|
4395
|
+
return A && A.toString().trim() !== "" ? A.toString() : "-";
|
|
4364
4396
|
}
|
|
4365
4397
|
return "";
|
|
4366
|
-
}), ve =
|
|
4398
|
+
}), ve = H(() => {
|
|
4367
4399
|
const s = r.purchaseOrder;
|
|
4368
4400
|
return s ? [...s.actionChangelogs ?? []].reverse() : [];
|
|
4369
4401
|
});
|
|
4370
4402
|
return (s, a) => {
|
|
4371
|
-
const
|
|
4403
|
+
const w = ue("FmButton"), A = ue("FmButtonGroup"), N = ue("FmChip"), W = ue("FmIcon"), fe = ue("FmMenuDivider"), I = ue("FmCard"), de = ue("FmTooltip"), f = ue("FmSpacer"), p = ue("FmSideSheet");
|
|
4372
4404
|
return i(), he(p, {
|
|
4373
4405
|
modelValue: b(Q),
|
|
4374
|
-
"onUpdate:modelValue": a[9] || (a[9] = (
|
|
4375
|
-
"dismiss-away":
|
|
4406
|
+
"onUpdate:modelValue": a[9] || (a[9] = (k) => Fs(Q) ? Q.value = k : null),
|
|
4407
|
+
"dismiss-away": X.value,
|
|
4376
4408
|
"max-width": 600,
|
|
4377
4409
|
"close-button": !1
|
|
4378
4410
|
}, {
|
|
4379
4411
|
"side-sheet-header": pe(() => {
|
|
4380
|
-
var
|
|
4412
|
+
var k, U;
|
|
4381
4413
|
return [
|
|
4382
4414
|
e("div", ra, [
|
|
4383
4415
|
e("div", oa, [
|
|
4384
|
-
e("div", na,
|
|
4385
|
-
q(
|
|
4416
|
+
e("div", na, x(b(S)("inventory.transfer.receiveRequest.details.title") + ((k = s.purchaseOrder) != null && k.seqNumber ? ` #${(U = s.purchaseOrder) == null ? void 0 : U.seqNumber}` : "")), 1),
|
|
4417
|
+
q(w, {
|
|
4386
4418
|
class: "ml-auto -m-2",
|
|
4387
4419
|
variant: "tertiary",
|
|
4388
4420
|
"prepend-icon": "close",
|
|
4389
|
-
onClick: a[0] || (a[0] = (
|
|
4421
|
+
onClick: a[0] || (a[0] = (M) => o("update:show", !1))
|
|
4390
4422
|
})
|
|
4391
4423
|
]),
|
|
4392
|
-
q(
|
|
4424
|
+
q(A, {
|
|
4393
4425
|
items: ye.value,
|
|
4394
4426
|
modelValue: P.value,
|
|
4395
|
-
"onUpdate:modelValue": a[1] || (a[1] = (
|
|
4427
|
+
"onUpdate:modelValue": a[1] || (a[1] = (M) => P.value = M)
|
|
4396
4428
|
}, null, 8, ["items", "modelValue"]),
|
|
4397
4429
|
s.purchaseOrder && P.value.value === "deliveryHistory" ? (i(), he(In, {
|
|
4398
4430
|
key: 0,
|
|
4399
4431
|
"purchase-order": s.purchaseOrder,
|
|
4400
|
-
"received-info-map":
|
|
4432
|
+
"received-info-map": J.value,
|
|
4401
4433
|
"received-map": s.receivedMap,
|
|
4402
4434
|
onSubmitted: a[2] || (a[2] = () => {
|
|
4403
4435
|
o("update:show", !1), o("submitted");
|
|
@@ -4407,7 +4439,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4407
4439
|
];
|
|
4408
4440
|
}),
|
|
4409
4441
|
default: pe(() => {
|
|
4410
|
-
var
|
|
4442
|
+
var k, U, M, ke, we;
|
|
4411
4443
|
return [
|
|
4412
4444
|
e("div", aa, [
|
|
4413
4445
|
P.value.value === "overview" ? (i(), y(De, { key: 0 }, [
|
|
@@ -4417,14 +4449,14 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4417
4449
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
4418
4450
|
}, {
|
|
4419
4451
|
default: pe(() => {
|
|
4420
|
-
var Y,
|
|
4452
|
+
var Y, se, Se, Pe, Ie, ge, me, Re, Ee, Le;
|
|
4421
4453
|
return [
|
|
4422
4454
|
e("div", la, [
|
|
4423
|
-
e("div", ia,
|
|
4455
|
+
e("div", ia, x(b(S)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
|
|
4424
4456
|
e("div", ua, [
|
|
4425
|
-
q(
|
|
4426
|
-
label:
|
|
4427
|
-
class: Ge(
|
|
4457
|
+
q(N, {
|
|
4458
|
+
label: ee.value.status,
|
|
4459
|
+
class: Ge(ee.value.statusClass),
|
|
4428
4460
|
compact: ""
|
|
4429
4461
|
}, null, 8, ["label", "class"]),
|
|
4430
4462
|
E.value ? (i(), y("div", ca, [
|
|
@@ -4432,7 +4464,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4432
4464
|
name: "local_shipping",
|
|
4433
4465
|
color: "#666666"
|
|
4434
4466
|
}),
|
|
4435
|
-
e("span", da,
|
|
4467
|
+
e("span", da, x(E.value), 1)
|
|
4436
4468
|
])) : V("", !0)
|
|
4437
4469
|
])
|
|
4438
4470
|
]),
|
|
@@ -4444,19 +4476,19 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4444
4476
|
return [
|
|
4445
4477
|
(it = s.purchaseOrder) != null && it._id ? (i(), y("div", pa, [
|
|
4446
4478
|
a[10] || (a[10] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Purchase Order ID ", -1)),
|
|
4447
|
-
e("span", fa,
|
|
4479
|
+
e("span", fa, x((Et = s.purchaseOrder) == null ? void 0 : Et._id), 1)
|
|
4448
4480
|
])) : V("", !0),
|
|
4449
4481
|
(qt = s.purchaseOrder) != null && qt.status ? (i(), y("div", va, [
|
|
4450
4482
|
a[11] || (a[11] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Purchase Order Status ", -1)),
|
|
4451
|
-
e("span", ya,
|
|
4483
|
+
e("span", ya, x((Vt = s.purchaseOrder) == null ? void 0 : Vt.status), 1)
|
|
4452
4484
|
])) : V("", !0),
|
|
4453
4485
|
(jt = (Lt = s.purchaseOrder) == null ? void 0 : Lt.supplier) != null && jt._id ? (i(), y("div", ha, [
|
|
4454
4486
|
a[12] || (a[12] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Source Location ID ", -1)),
|
|
4455
|
-
e("span", ba,
|
|
4487
|
+
e("span", ba, x(((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}_` : "") + x((Ht = (Kt = s.purchaseOrder) == null ? void 0 : Kt.supplier) == null ? void 0 : Ht._id), 1)
|
|
4456
4488
|
])) : V("", !0),
|
|
4457
4489
|
s.transferToDbName ? (i(), y("div", ga, [
|
|
4458
4490
|
a[13] || (a[13] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Destination Location ID ", -1)),
|
|
4459
|
-
e("span", _a,
|
|
4491
|
+
e("span", _a, x(s.transferToDbName), 1)
|
|
4460
4492
|
])) : V("", !0)
|
|
4461
4493
|
];
|
|
4462
4494
|
}),
|
|
@@ -4464,39 +4496,39 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4464
4496
|
}),
|
|
4465
4497
|
e("div", Sa, [
|
|
4466
4498
|
e("div", Oa, [
|
|
4467
|
-
e("div", ka,
|
|
4499
|
+
e("div", ka, x(b(S)("inventory.transfer.receiveRequest.details.createdAt")), 1)
|
|
4468
4500
|
]),
|
|
4469
|
-
e("div", xa,
|
|
4501
|
+
e("div", xa, x(b(lt)(((Y = s.purchaseOrder) == null ? void 0 : Y._id) ?? "")), 1)
|
|
4470
4502
|
]),
|
|
4471
|
-
(
|
|
4472
|
-
e("div", $a,
|
|
4473
|
-
e("div", Ca,
|
|
4503
|
+
(se = s.purchaseOrder) != null && se.effectiveAt ? (i(), y("div", wa, [
|
|
4504
|
+
e("div", $a, x(b(S)("inventory.transfer.receiveRequest.details.date")), 1),
|
|
4505
|
+
e("div", Ca, x(b(Pt)(new Date((Se = s.purchaseOrder) == null ? void 0 : Se.effectiveAt))), 1)
|
|
4474
4506
|
])) : V("", !0),
|
|
4475
4507
|
e("div", Aa, [
|
|
4476
|
-
e("div", Na,
|
|
4477
|
-
e("div", Da,
|
|
4478
|
-
`inventory.transfer.receiveRequest.details.type.${
|
|
4508
|
+
e("div", Na, x(b(S)("inventory.transfer.receiveRequest.details.type.title")), 1),
|
|
4509
|
+
e("div", Da, x(b(S)(
|
|
4510
|
+
`inventory.transfer.receiveRequest.details.type.${B.value.toLocaleLowerCase("en-US")}`
|
|
4479
4511
|
)), 1)
|
|
4480
4512
|
]),
|
|
4481
4513
|
(Ie = (Pe = s.purchaseOrder) == null ? void 0 : Pe.supplier) != null && Ie.name ? (i(), y("div", Ra, [
|
|
4482
|
-
e("div", Pa,
|
|
4483
|
-
e("div", Fa,
|
|
4514
|
+
e("div", Pa, x(b(S)("inventory.transfer.receiveRequest.details.from")), 1),
|
|
4515
|
+
e("div", Fa, x((me = (ge = s.purchaseOrder) == null ? void 0 : ge.supplier) == null ? void 0 : me.name), 1)
|
|
4484
4516
|
])) : V("", !0),
|
|
4485
4517
|
s.transferTo ? (i(), y("div", Ia, [
|
|
4486
|
-
e("div", Ta,
|
|
4487
|
-
e("div", Ea,
|
|
4518
|
+
e("div", Ta, x(b(S)("inventory.transfer.receiveRequest.details.to")), 1),
|
|
4519
|
+
e("div", Ea, x(s.transferTo), 1)
|
|
4488
4520
|
])) : V("", !0),
|
|
4489
4521
|
(Re = s.purchaseOrder) != null && Re.ref ? (i(), y("div", qa, [
|
|
4490
|
-
e("div", Va,
|
|
4491
|
-
e("div", La,
|
|
4522
|
+
e("div", Va, x(b(S)("inventory.transfer.receiveRequest.details.reference")), 1),
|
|
4523
|
+
e("div", La, x(s.purchaseOrder.ref), 1)
|
|
4492
4524
|
])) : V("", !0),
|
|
4493
4525
|
(Ee = s.purchaseOrder) != null && Ee.remark ? (i(), y("div", ja, [
|
|
4494
|
-
e("div", Ua,
|
|
4495
|
-
e("div", Ma,
|
|
4526
|
+
e("div", Ua, x(b(S)("inventory.transfer.receiveRequest.details.remark")), 1),
|
|
4527
|
+
e("div", Ma, x(s.purchaseOrder.remark), 1)
|
|
4496
4528
|
])) : V("", !0),
|
|
4497
|
-
((Le = s.purchaseOrder) == null ? void 0 : Le.status) === b(
|
|
4498
|
-
e("div", za,
|
|
4499
|
-
e("div", Ka,
|
|
4529
|
+
((Le = s.purchaseOrder) == null ? void 0 : Le.status) === b(Oe).enum.DRAFT && ne.value ? (i(), y("div", Ba, [
|
|
4530
|
+
e("div", za, x(b(S)("inventory.transfer.receiveRequest.details.rejectionReason")), 1),
|
|
4531
|
+
e("div", Ka, x(ne.value !== "" ? ne.value : "-"), 1)
|
|
4500
4532
|
])) : V("", !0)
|
|
4501
4533
|
])
|
|
4502
4534
|
];
|
|
@@ -4507,7 +4539,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4507
4539
|
q(xo, {
|
|
4508
4540
|
"po-request": s.poRequest,
|
|
4509
4541
|
purchaseOrder: s.purchaseOrder,
|
|
4510
|
-
transferType:
|
|
4542
|
+
transferType: B.value,
|
|
4511
4543
|
transferToDbName: s.transferToDbName,
|
|
4512
4544
|
scope: s.scope
|
|
4513
4545
|
}, null, 8, ["po-request", "purchaseOrder", "transferType", "transferToDbName", "scope"]),
|
|
@@ -4515,18 +4547,18 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4515
4547
|
e("div", Ga, [
|
|
4516
4548
|
e("div", Wa, [
|
|
4517
4549
|
e("span", Qa, [
|
|
4518
|
-
Xe(
|
|
4519
|
-
(
|
|
4550
|
+
Xe(x(j.value ? b(S)("inventory.transfer.receiveRequest.details.receivedItems") : b(S)("inventory.transfer.receiveRequest.details.requestedItems")) + " ", 1),
|
|
4551
|
+
(U = (k = s.purchaseOrder) == null ? void 0 : k.netSuite) != null && U.missingItems && ((ke = (M = s.purchaseOrder) == null ? void 0 : M.netSuite) == null ? void 0 : ke.missingItems.length) > 0 ? (i(), he(de, {
|
|
4520
4552
|
key: 0,
|
|
4521
4553
|
variant: "rich",
|
|
4522
4554
|
placement: "top",
|
|
4523
4555
|
"z-index": 51
|
|
4524
4556
|
}, {
|
|
4525
4557
|
content: pe(() => {
|
|
4526
|
-
var Y,
|
|
4558
|
+
var Y, se;
|
|
4527
4559
|
return [
|
|
4528
4560
|
e("div", Ya, [
|
|
4529
|
-
(i(!0), y(De, null, Te((
|
|
4561
|
+
(i(!0), y(De, null, Te((se = (Y = s.purchaseOrder) == null ? void 0 : Y.netSuite) == null ? void 0 : se.missingItems, (Se, Pe) => (i(), y("div", {
|
|
4530
4562
|
class: "flex justify-center align-middle",
|
|
4531
4563
|
key: Pe
|
|
4532
4564
|
}, [
|
|
@@ -4534,7 +4566,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4534
4566
|
name: "arrow_right",
|
|
4535
4567
|
size: "sm"
|
|
4536
4568
|
}),
|
|
4537
|
-
Xe(" " +
|
|
4569
|
+
Xe(" " + x(`(${Se.netSuiteId}) ${Se.name}: ${Se.reason}`), 1)
|
|
4538
4570
|
]))), 128))
|
|
4539
4571
|
])
|
|
4540
4572
|
];
|
|
@@ -4551,17 +4583,17 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4551
4583
|
])
|
|
4552
4584
|
]),
|
|
4553
4585
|
q(fe),
|
|
4554
|
-
(i(!0), y(De, null, Te(
|
|
4555
|
-
var
|
|
4586
|
+
(i(!0), y(De, null, Te(te.value, (Y, se) => {
|
|
4587
|
+
var Se;
|
|
4556
4588
|
return i(), y("div", {
|
|
4557
|
-
key:
|
|
4589
|
+
key: se,
|
|
4558
4590
|
class: "flex flex-col"
|
|
4559
4591
|
}, [
|
|
4560
4592
|
e("div", Ja, [
|
|
4561
4593
|
e("div", Xa, [
|
|
4562
|
-
e("span", Za,
|
|
4594
|
+
e("span", Za, x(Y.name), 1),
|
|
4563
4595
|
h(Y) || G(Y) ? (i(), y("span", el, [
|
|
4564
|
-
h(Y) ? (i(), he(
|
|
4596
|
+
h(Y) ? (i(), he(de, {
|
|
4565
4597
|
key: 0,
|
|
4566
4598
|
variant: "rich",
|
|
4567
4599
|
placement: "top",
|
|
@@ -4579,7 +4611,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4579
4611
|
]),
|
|
4580
4612
|
_: 1
|
|
4581
4613
|
})) : V("", !0),
|
|
4582
|
-
G(Y) ? (i(), he(
|
|
4614
|
+
G(Y) ? (i(), he(de, {
|
|
4583
4615
|
key: 1,
|
|
4584
4616
|
variant: "rich",
|
|
4585
4617
|
placement: "top",
|
|
@@ -4590,8 +4622,8 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4590
4622
|
return [
|
|
4591
4623
|
e("div", tl, [
|
|
4592
4624
|
a[15] || (a[15] = e("div", { class: "font-semibold" }, "Submission changes", -1)),
|
|
4593
|
-
e("div", null, " Original Amount: " +
|
|
4594
|
-
e("div", null, " New Amount: " +
|
|
4625
|
+
e("div", null, " Original Amount: " + x((Pe = Z(Y)) == null ? void 0 : Pe.originalAmount), 1),
|
|
4626
|
+
e("div", null, " New Amount: " + x((Ie = Z(Y)) == null ? void 0 : Ie.newAmount), 1)
|
|
4595
4627
|
])
|
|
4596
4628
|
];
|
|
4597
4629
|
}),
|
|
@@ -4613,8 +4645,8 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4613
4645
|
])
|
|
4614
4646
|
]),
|
|
4615
4647
|
e("div", ol, [
|
|
4616
|
-
e("div", nl,
|
|
4617
|
-
(
|
|
4648
|
+
e("div", nl, x(Y.code), 1),
|
|
4649
|
+
(Se = Y.totalCost) != null && Se.amount || typeof Y.sku == "object" && Y.sku != null ? (i(), he(Qs, {
|
|
4618
4650
|
key: 0,
|
|
4619
4651
|
"feature-key": "total-cost",
|
|
4620
4652
|
compact: "",
|
|
@@ -4624,12 +4656,12 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4624
4656
|
var Pe;
|
|
4625
4657
|
return [
|
|
4626
4658
|
e("div", al, [
|
|
4627
|
-
e("span", ll,
|
|
4659
|
+
e("span", ll, x(b(ut)(
|
|
4628
4660
|
(Pe = Y.totalCost) != null && Pe.amount ? Y.totalCost : b(v).controller.value.getItemCost(Y, b(Ce)()).cost
|
|
4629
4661
|
)), 1),
|
|
4630
4662
|
D(Y) ? V("", !0) : (i(), y("span", il, [
|
|
4631
4663
|
a[16] || (a[16] = e("span", { class: "w-1.5 h-1.5 rounded-full bg-gray-400" }, null, -1)),
|
|
4632
|
-
Xe(" " +
|
|
4664
|
+
Xe(" " + x(b(S)("inventory.transfer.form.items.autoCalculated")), 1)
|
|
4633
4665
|
]))
|
|
4634
4666
|
])
|
|
4635
4667
|
];
|
|
@@ -4645,7 +4677,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4645
4677
|
]),
|
|
4646
4678
|
e("div", dl, [
|
|
4647
4679
|
a[17] || (a[17] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Total:", -1)),
|
|
4648
|
-
e("div", ml,
|
|
4680
|
+
e("div", ml, x(b(Ce)()) + " " + x(b(ut)({
|
|
4649
4681
|
...b(v).controller.value.getTotalCosts(),
|
|
4650
4682
|
currency: b(Ce)()
|
|
4651
4683
|
}).replace(/[^0-9.,]/g, "")), 1)
|
|
@@ -4667,18 +4699,18 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4667
4699
|
])
|
|
4668
4700
|
])
|
|
4669
4701
|
], 64)) : P.value.value === "deliveryHistory" ? (i(), y("div", fl, [
|
|
4670
|
-
|
|
4671
|
-
(i(!0), y(De, null, Te(
|
|
4672
|
-
var
|
|
4673
|
-
return i(), y(De, { key:
|
|
4702
|
+
L.value.length ? (i(), y("div", gl, [
|
|
4703
|
+
(i(!0), y(De, null, Te(L.value, (Y, se) => {
|
|
4704
|
+
var Se, Pe, Ie, ge, me;
|
|
4705
|
+
return i(), y(De, { key: se }, [
|
|
4674
4706
|
e("div", _l, [
|
|
4675
4707
|
e("div", Sl, [
|
|
4676
4708
|
e("div", Ol, [
|
|
4677
4709
|
e("div", {
|
|
4678
4710
|
class: Ge([
|
|
4679
4711
|
{
|
|
4680
|
-
"bg-fm-color-primary":
|
|
4681
|
-
"bg-white":
|
|
4712
|
+
"bg-fm-color-primary": se !== 0,
|
|
4713
|
+
"bg-white": se === 0
|
|
4682
4714
|
},
|
|
4683
4715
|
"w-[2px] h-full"
|
|
4684
4716
|
])
|
|
@@ -4696,8 +4728,8 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4696
4728
|
e("div", {
|
|
4697
4729
|
class: Ge([
|
|
4698
4730
|
{
|
|
4699
|
-
"bg-fm-color-primary":
|
|
4700
|
-
"bg-white":
|
|
4731
|
+
"bg-fm-color-primary": se < L.value.length - 1,
|
|
4732
|
+
"bg-white": se >= L.value.length - 1
|
|
4701
4733
|
},
|
|
4702
4734
|
"w-[2px] h-full"
|
|
4703
4735
|
])
|
|
@@ -4706,20 +4738,20 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4706
4738
|
]),
|
|
4707
4739
|
e("div", wl, [
|
|
4708
4740
|
e("div", $l, [
|
|
4709
|
-
e("div", Cl,
|
|
4710
|
-
e("div", Al,
|
|
4741
|
+
e("div", Cl, x(Y.header), 1),
|
|
4742
|
+
e("div", Al, x(Y.date), 1)
|
|
4711
4743
|
]),
|
|
4712
4744
|
e("div", Nl, [
|
|
4713
4745
|
Y.header === "Received" && Y.deliveryOrder && s.purchaseOrder ? (i(), he(Xo, {
|
|
4714
4746
|
key: 0,
|
|
4715
4747
|
deliveryOrder: Y.deliveryOrder,
|
|
4716
4748
|
purchaseOrder: s.purchaseOrder,
|
|
4717
|
-
"received-info-map":
|
|
4749
|
+
"received-info-map": J.value,
|
|
4718
4750
|
onSubmitted: a[4] || (a[4] = () => {
|
|
4719
4751
|
o("update:show", !1), o("submitted");
|
|
4720
4752
|
})
|
|
4721
4753
|
}, null, 8, ["deliveryOrder", "purchaseOrder", "received-info-map"])) : V("", !0),
|
|
4722
|
-
(Pe = (
|
|
4754
|
+
(Pe = (Se = Y.deliveryOrder) == null ? void 0 : Se.netSuite) != null && Pe.id ? (i(), he(ss, {
|
|
4723
4755
|
key: 1,
|
|
4724
4756
|
title: "Admin",
|
|
4725
4757
|
class: "min-w-[140px]"
|
|
@@ -4748,8 +4780,8 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4748
4780
|
e("div", {
|
|
4749
4781
|
class: Ge([
|
|
4750
4782
|
{
|
|
4751
|
-
"bg-fm-color-primary":
|
|
4752
|
-
"bg-white":
|
|
4783
|
+
"bg-fm-color-primary": se < L.value.length - 1,
|
|
4784
|
+
"bg-white": se >= L.value.length - 1
|
|
4753
4785
|
},
|
|
4754
4786
|
"w-[2px] h-full"
|
|
4755
4787
|
])
|
|
@@ -4767,14 +4799,14 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4767
4799
|
key: Ee,
|
|
4768
4800
|
class: "flex flex-col gap-4"
|
|
4769
4801
|
}, [
|
|
4770
|
-
e("div", Tl,
|
|
4802
|
+
e("div", Tl, x(Re == null ? void 0 : Re.label), 1),
|
|
4771
4803
|
e("div", El, [
|
|
4772
4804
|
(i(!0), y(De, null, Te(Re == null ? void 0 : Re.values, (Le, it) => (i(), y("div", {
|
|
4773
4805
|
key: it,
|
|
4774
4806
|
class: "fm-typo-en-body-lg-600"
|
|
4775
4807
|
}, [
|
|
4776
4808
|
typeof Le == "string" ? (i(), y(De, { key: 0 }, [
|
|
4777
|
-
Xe(
|
|
4809
|
+
Xe(x(Le), 1)
|
|
4778
4810
|
], 64)) : (i(), he(Is(Le), { key: 1 }))
|
|
4779
4811
|
]))), 128))
|
|
4780
4812
|
])
|
|
@@ -4795,28 +4827,28 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4795
4827
|
alt: "List is empty"
|
|
4796
4828
|
}, null, 8, yl)
|
|
4797
4829
|
]),
|
|
4798
|
-
e("div", hl,
|
|
4799
|
-
e("div", bl,
|
|
4830
|
+
e("div", hl, x(b(S)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
|
|
4831
|
+
e("div", bl, x(b(S)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
|
|
4800
4832
|
q(f),
|
|
4801
4833
|
q(f)
|
|
4802
4834
|
]))
|
|
4803
4835
|
])) : P.value.value === "actionLogs" ? (i(), y("div", ql, [
|
|
4804
4836
|
ve.value.length ? (i(), y("div", Ul, [
|
|
4805
|
-
(i(!0), y(De, null, Te(ve.value, (Y,
|
|
4806
|
-
key:
|
|
4837
|
+
(i(!0), y(De, null, Te(ve.value, (Y, se) => (i(), he(I, {
|
|
4838
|
+
key: se,
|
|
4807
4839
|
variant: "outlined",
|
|
4808
4840
|
class: "py-12 px-16"
|
|
4809
4841
|
}, {
|
|
4810
4842
|
default: pe(() => {
|
|
4811
|
-
var
|
|
4843
|
+
var Se;
|
|
4812
4844
|
return [
|
|
4813
4845
|
e("div", Ml, [
|
|
4814
4846
|
e("div", Bl, [
|
|
4815
|
-
e("div", zl,
|
|
4816
|
-
e("div", Kl,
|
|
4847
|
+
e("div", zl, x(b(nt)[Y.action] ? b(S)(b(nt)[Y.action].translationKey) : Y.action), 1),
|
|
4848
|
+
e("div", Kl, x(b(et)(Y.changedAt)), 1)
|
|
4817
4849
|
]),
|
|
4818
|
-
e("div", Hl,
|
|
4819
|
-
Y.remarks ? (i(), y("div", Gl,
|
|
4850
|
+
e("div", Hl, x((Se = Y.changedBy) == null ? void 0 : Se.name), 1),
|
|
4851
|
+
Y.remarks ? (i(), y("div", Gl, x(Y.remarks), 1)) : V("", !0)
|
|
4820
4852
|
])
|
|
4821
4853
|
];
|
|
4822
4854
|
}),
|
|
@@ -4830,7 +4862,7 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4830
4862
|
alt: "List is empty"
|
|
4831
4863
|
}, null, 8, Ll)
|
|
4832
4864
|
]),
|
|
4833
|
-
e("div", jl,
|
|
4865
|
+
e("div", jl, x(b(S)("inventory.transfer.receiveRequest.details.noActionLogs")), 1),
|
|
4834
4866
|
q(f),
|
|
4835
4867
|
q(f)
|
|
4836
4868
|
]))
|
|
@@ -4840,41 +4872,41 @@ const Co = { class: "flex flex-col gap-3" }, Ao = { class: "flex flex-col gap-4"
|
|
|
4840
4872
|
}),
|
|
4841
4873
|
"side-sheet-footer": pe(() => [
|
|
4842
4874
|
e("div", Wl, [
|
|
4843
|
-
(i(!0), y(De, null, Te(Ae.value, (
|
|
4844
|
-
b(nt)[
|
|
4845
|
-
key:
|
|
4846
|
-
label: b(
|
|
4847
|
-
onClick: (
|
|
4848
|
-
loading:
|
|
4849
|
-
disabled:
|
|
4850
|
-
variant: b(nt)[
|
|
4875
|
+
(i(!0), y(De, null, Te(Ae.value, (k) => (i(), y(De, null, [
|
|
4876
|
+
b(nt)[k].available != !1 ? (i(), he(w, {
|
|
4877
|
+
key: k,
|
|
4878
|
+
label: b(S)(b(nt)[k].translationKey),
|
|
4879
|
+
onClick: (U) => $(k),
|
|
4880
|
+
loading: oe.value === k,
|
|
4881
|
+
disabled: oe.value !== k && re.value,
|
|
4882
|
+
variant: b(nt)[k].buttonVariant
|
|
4851
4883
|
}, null, 8, ["label", "onClick", "loading", "disabled", "variant"])) : V("", !0)
|
|
4852
4884
|
], 64))), 256)),
|
|
4853
|
-
b(T).ableToMarkReceived(s.purchaseOrder) && !Ae.value.includes("completeReceive") ? (i(), he(
|
|
4885
|
+
b(T).ableToMarkReceived(s.purchaseOrder) && !Ae.value.includes("completeReceive") ? (i(), he(w, {
|
|
4854
4886
|
key: 0,
|
|
4855
|
-
label: b(
|
|
4856
|
-
onClick: a[5] || (a[5] = (
|
|
4857
|
-
loading:
|
|
4858
|
-
disabled:
|
|
4887
|
+
label: b(S)("inventory.transfer.receiveRequest.actions.completeReceive"),
|
|
4888
|
+
onClick: a[5] || (a[5] = (k) => $("completeReceive")),
|
|
4889
|
+
loading: oe.value === "completeReceive",
|
|
4890
|
+
disabled: oe.value !== "completeReceive" && re.value
|
|
4859
4891
|
}, null, 8, ["label", "loading", "disabled"])) : V("", !0),
|
|
4860
|
-
b(T).ableToMarkApproved(s.purchaseOrder) && s.canApprove && !Ae.value.includes("approveRequest") ? (i(), he(
|
|
4892
|
+
b(T).ableToMarkApproved(s.purchaseOrder) && s.canApprove && !Ae.value.includes("approveRequest") ? (i(), he(w, {
|
|
4861
4893
|
key: 1,
|
|
4862
|
-
label: b(
|
|
4863
|
-
onClick: a[6] || (a[6] = (
|
|
4864
|
-
loading:
|
|
4865
|
-
disabled:
|
|
4894
|
+
label: b(S)("inventory.transfer.approval.actions.approveRequest"),
|
|
4895
|
+
onClick: a[6] || (a[6] = (k) => $("approveRequest")),
|
|
4896
|
+
loading: oe.value === "approveRequest",
|
|
4897
|
+
disabled: oe.value !== "approveRequest" && re.value
|
|
4866
4898
|
}, null, 8, ["label", "loading", "disabled"])) : V("", !0),
|
|
4867
|
-
b(T).ableToCreateFulfillment(s.purchaseOrder, s.poRequest) && r.scope === "approval" ? (i(), he(
|
|
4899
|
+
b(T).ableToCreateFulfillment(s.purchaseOrder, s.poRequest) && r.scope === "approval" ? (i(), he(w, {
|
|
4868
4900
|
key: 2,
|
|
4869
|
-
label: b(
|
|
4870
|
-
onClick: a[7] || (a[7] = (
|
|
4871
|
-
loading:
|
|
4872
|
-
disabled:
|
|
4901
|
+
label: b(S)("inventory.transfer.receiveRequest.actions.processRequest"),
|
|
4902
|
+
onClick: a[7] || (a[7] = (k) => $("processRequest")),
|
|
4903
|
+
loading: oe.value === "processRequest",
|
|
4904
|
+
disabled: oe.value !== "processRequest" && re.value
|
|
4873
4905
|
}, null, 8, ["label", "loading", "disabled"])) : V("", !0),
|
|
4874
|
-
q(
|
|
4875
|
-
label: b(
|
|
4906
|
+
q(w, {
|
|
4907
|
+
label: b(S)("common.close"),
|
|
4876
4908
|
variant: "tertiary",
|
|
4877
|
-
onClick: a[8] || (a[8] = (
|
|
4909
|
+
onClick: a[8] || (a[8] = (k) => o("update:show", !1))
|
|
4878
4910
|
}, null, 8, ["label"])
|
|
4879
4911
|
])
|
|
4880
4912
|
]),
|