@feedmepos/mf-inventory-portal 1.8.0-dev.3 → 1.8.0-dev.5
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-DEbWEOwe.js +1537 -0
- package/dist/{ApprovalView-hV1msz5Y.js → ApprovalView-BEnYHIlU.js} +9 -9
- package/dist/{BindingsDialog-BX1Lopf0.js → BindingsDialog-CJVkMoBS.js} +2 -2
- package/dist/{BindingsPicker-BNKW8-XY.js → BindingsPicker-CX9o-xdQ.js} +2 -2
- package/dist/{BindingsTable-DiLDsL83.js → BindingsTable-Cil4LJ7l.js} +4 -4
- package/dist/{BulkReceiveRequestView-oQh6kFLc.js → BulkReceiveRequestView-DYEc2jPw.js} +21 -22
- package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-BaMcGU-x.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-DoAv2mHA.js} +1 -1
- package/dist/{ClosingDraftView-sgLoaSf4.js → ClosingDraftView-Bz94Iejf.js} +20 -20
- package/dist/{ClosingHistoryView-BnE9HrzA.js → ClosingHistoryView-B479Y-mH.js} +5 -5
- package/dist/{ClosingTemplateView-BD3Pa11r.js → ClosingTemplateView-F_nx43n6.js} +18 -18
- package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DlbyxkMQ.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DddYGHxQ.js} +1 -1
- package/dist/{DefaultView-CuzvVkfE.js → DefaultView-CkZOl0ov.js} +5 -5
- package/dist/{DeliveryOrderPrintPreview-w-1aAOY1.js → DeliveryOrderPrintPreview-BJEpwAX6.js} +2 -2
- package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-CxD12Qct.js → EmailDialog.vue_vue_type_script_setup_true_lang-BW988AoC.js} +29 -30
- package/dist/{FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-CMoQKl_a.js → FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-Izn-hTjK.js} +107 -118
- package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-BqCh_vTP.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-CoUWxHlj.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CAXnmdUy.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Ci81xTbl.js} +2 -2
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-NhOdW33O.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CnaHTAUZ.js} +2 -2
- package/dist/{FmMultiselectDialog-CULwA_hi.js → FmMultiselectDialog-BE8BlO6_.js} +2 -2
- package/dist/FmMultiselectDialog-COKgBmPZ.js +123 -0
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CI3Y9kDl.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BQHd3NjM.js} +6 -6
- package/dist/ImportView-Crb_yrNb.js +1291 -0
- package/dist/{IngredientsView-pzpP6oXT.js → IngredientsView-lDypeR4c.js} +34 -35
- package/dist/{IntegrationExplorerView-C5aAhB6e.js → IntegrationExplorerView-DgOFGj7H.js} +4 -4
- package/dist/{IntegrationView-Bqun7nX0.js → IntegrationView-0sbjINo5.js} +973 -974
- package/dist/{InventoryBindingForm-r_Ua1C4a.js → InventoryBindingForm-BhyrjIXJ.js} +1 -1
- package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-KCz_BQ6T.js +472 -0
- package/dist/{InventoryBindingSummary-BQuZLohR.js → InventoryBindingSummary-CsfNKd1r.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-7r-QcJdU.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-C32OoIBz.js} +1 -1
- package/dist/{ProductionRunDetailView-95fu_CfH.js → ProductionRunDetailView-BxbDtGMo.js} +4 -4
- package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-CdOca1tV.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-BdJVvwSP.js} +9 -9
- package/dist/{ProductionRunView-DIjor_Ix.js → ProductionRunView-CJhNEIzT.js} +3 -3
- package/dist/{PublishView-DYObyHQq.js → PublishView-vkt6-D6P.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-C0jCmI9L.js → PurchaseOrderPrintPreview-25dHfVKp.js} +2 -2
- package/dist/{ReceiveRequestView-i7ibPfIE.js → ReceiveRequestView-BO4Z2dZu.js} +15 -16
- package/dist/RecipeView-B_AE7QQv.js +3428 -0
- package/dist/{SettingsView-CdBloj9k.js → SettingsView-qTUvQCuu.js} +163 -168
- package/dist/{StockView-g_6eJ62R.js → StockView-yh6qkYUS.js} +269 -270
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-C1rKc7MA.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Cn_fx9qG.js} +1 -1
- package/dist/{SupplierView-DkYp_Frj.js → SupplierView-Dqzu1Bvh.js} +14 -14
- package/dist/{SurchargeView-CfkV4Y3y.js → SurchargeView-CDosn36c.js} +7 -7
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-2MtN1p5t.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-DZ3Gdlp9.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CYMjKXq4.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CWoh2FqQ.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-D0zNr_vQ.js → TransferDetails.vue_vue_type_script_setup_true_lang-BtjKnIwf.js} +867 -844
- package/dist/{TransferTemplateView-Ne2gYUSn.js → TransferTemplateView-fDZcC9i4.js} +22 -23
- package/dist/{UnitCostHistoryView-Db0_otOb.js → UnitCostHistoryView-CmTTIXAp.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-BzO1lq7j.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-DZihCM0T.js} +4 -4
- package/dist/{UnitView-CiCeQ63i.js → UnitView-BTx59sFK.js} +8 -8
- package/dist/{WarehouseView-BcuJSOMF.js → WarehouseView-BIFe08FJ.js} +8 -8
- package/dist/{WastageTemplateView-CPQmtOKQ.js → WastageTemplateView-B_oJqm0_.js} +15 -15
- package/dist/api/feature-flags.d.ts +2 -0
- package/dist/api/license.d.ts +0 -2
- package/dist/{app-DqJp3dcI.js → app-DyEvx3Em.js} +1628 -1817
- package/dist/app.d.ts +0 -150
- package/dist/app.js +1 -1
- package/dist/{closing-template-BNlgZviN.js → closing-template-FgcLy4RT.js} +1 -1
- package/dist/components/FeatureCapabilityBadge.vue.d.ts +1 -1
- package/dist/{date2-Ci7521dn.js → date2-Rv4IwT9a.js} +1 -1
- package/dist/{dayjs.min-Cyp32v4J.js → dayjs.min-DOq1QM_M.js} +1 -1
- package/dist/{decimal-BGdm5R3A.js → decimal-7vA05AaD.js} +2 -2
- package/dist/{defineDeepModel-B2cJ-rtd.js → defineDeepModel-22Md2SKY.js} +1 -1
- package/dist/{duplicate-template-By5WeKZ0.js → duplicate-template-D2tjCY7C.js} +1 -1
- package/dist/{core-Js7d-3Pv.js → feature-BMTKl6PK.js} +732 -389
- package/dist/feature-flags/core.d.ts +3 -2
- package/dist/feature-flags/portal-feature-catalog.d.ts +0 -5
- package/dist/feature-flags/vue.d.ts +2 -0
- package/dist/{format-time-from-id-Q8C2P96H.js → format-time-from-id-DXhm_Ji1.js} +1 -1
- package/dist/{format-unit-display-CICrmm8r.js → format-unit-display-DxWLjFPz.js} +13 -13
- package/dist/helper/menu-usage-module.d.ts +1 -1
- package/dist/{id-to-date-DeN5x0LR.js → id-to-date-VKlOL3mN.js} +1 -1
- package/dist/{import-export.helper-BOTQWxr6.js → import-export.helper-BiF5aKUp.js} +28 -28
- package/dist/{index-BbbqCCfp.js → index-DEl_gZn0.js} +3 -3
- package/dist/{index-tCYhLCKP.js → index-DdtsVAcv.js} +1 -1
- package/dist/{index-Cxm3Sgfv.js → index-DoBWE4Ci.js} +1 -1
- package/dist/{lz-string-Dy4Pg8mh.js → lz-string-BwQj8QRN.js} +1 -1
- package/dist/{netsuite-BaJjkDM8.js → netsuite-s1S33-lP.js} +2 -2
- package/dist/{number-CB36d2PQ.js → number-BmKjsNrc.js} +3 -3
- package/dist/{predefined-templates-DLm93Bpx.js → predefined-templates-BZ2KqNix.js} +1 -1
- package/dist/{purchase-order-template-CDhn9ZIF.js → purchase-order-template-CINU4my1.js} +1 -1
- package/dist/{recalculationUtils-Cqvefakh.js → recalculationUtils-R5tFu_ts.js} +1 -1
- package/dist/router/name.d.ts +0 -1
- package/dist/{row-action.enum-NTfVmGY8.js → row-action.enum-ePO-Py0V.js} +1 -1
- package/dist/{rules-C8dfM84-.js → rules-BZrZVzw7.js} +2 -2
- package/dist/{stock-BGB0Siue.js → stock-C2HOKq0k.js} +8 -8
- package/dist/{stock-Qu5IiN2_.js → stock-Ce1UvAZ3.js} +1 -1
- package/dist/stores/feature.d.ts +10 -9
- package/dist/stores/inventory.d.ts +0 -47
- package/dist/stores/supplier.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/{supplier-CZdNOSMN.js → supplier-DgT66emI.js} +17 -17
- package/dist/{surcharge-Cm40oJvU.js → surcharge-CsVMuzPM.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-L-IW4Nwk.js → uom-rules-CR1XukyM.js} +1 -1
- package/dist/{use-ingredient-select-dialog-B2TDVJM6.js → use-ingredient-select-dialog-CJkG4hEX.js} +2 -2
- package/dist/use-inventory-binding-dialog-B36kPj4V.js +113 -0
- package/dist/{use-template-enabled-locations-DYAPMvo9.js → use-template-enabled-locations-Boa9QLPV.js} +2 -2
- package/dist/{use-transfer-locations-w-9tymYS.js → use-transfer-locations-BxOygSUg.js} +2 -2
- package/dist/{useHrmPermission-BFCIo5sA.js → useHrmPermission-DLHAqbLV.js} +1 -1
- package/dist/{useNavigationMenu-BPHAH5sJ.js → useNavigationMenu-D6abZMGz.js} +102 -109
- package/dist/{useSseClient-CWjRacRs.js → useSseClient-C7pff-EW.js} +1 -1
- package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +0 -1
- package/dist/views/ingredients/components/inventory-binding/composables/use-inventory-binding-dialog.d.ts +0 -1
- package/dist/views/ingredients/components/inventory-binding/v2/InventoryBindingFormV2.vue.d.ts +0 -1
- package/dist/views/ingredients/components/inventory-binding/v2/composables/use-inventory-binding-dialog.d.ts +0 -1
- package/dist/views/ingredients/helper/is-linked-ingredient-error.d.ts +1 -1
- package/dist/views/integration/components/IntegrationCard.vue.d.ts +3 -3
- package/dist/views/recipe/helper/bulk-edit-simulation.helper.d.ts +0 -1
- package/dist/views/recipe/helper/import-recipe.d.ts +2 -2
- package/dist/{vue-i18n-S4YQ9w6a.js → vue-i18n-CpOOFhVU.js} +219 -219
- package/dist/{xlsx.util-CP8_VajN.js → xlsx.util-xwI5tVz6.js} +2 -2
- package/package.json +5 -5
- package/dist/App-DRXADP0k.js +0 -1498
- package/dist/DeprecateSoonWarningDialog.vue_vue_type_script_setup_true_lang-Bp8bjDU1.js +0 -58
- package/dist/FmMultiselectDialog-BqZgHP8s.js +0 -77
- package/dist/ImportView-DqQG673_.js +0 -1302
- package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-DfvNUu80.js +0 -51
- package/dist/IngredientGroupView-CyngKxPo.js +0 -1000
- package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-CYDuu4kU.js +0 -563
- package/dist/RecipeView-C5VO7yr3.js +0 -3625
- package/dist/feature-fG7d73oi.js +0 -371
- package/dist/index-Dqf27vLH.js +0 -841
- package/dist/random-CSbEbElR.js +0 -10
- package/dist/use-inventory-binding-dialog-BJ00hl5f.js +0 -152
- package/dist/usePromise-CbVUCxhj.js +0 -29
- package/dist/views/ingredient-group/IngredientGroupView.vue.d.ts +0 -3
- package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialog.vue.d.ts +0 -31
- package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialogProps.d.ts +0 -10
- package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupForm.vue.d.ts +0 -21
- package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupFormProps.d.ts +0 -12
- package/dist/views/ingredient-group/components/ingredient-group-rule-field/IngredientGroupRuleField.vue.d.ts +0 -37
- package/dist/views/ingredient-group/composables/use-ingredient-group-actions.d.ts +0 -24
- package/dist/views/ingredient-group/composables/use-ingredient-group-rule-item.d.ts +0 -31
- package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +0 -77
|
@@ -1,67 +1,65 @@
|
|
|
1
|
-
import { f as lt, p as ks } from "./format-time-from-id-
|
|
2
|
-
import { defineComponent as Ve, ref as
|
|
3
|
-
import { c as
|
|
4
|
-
import { D as qe, R as
|
|
5
|
-
import { q as Ae, H as st, d as Ps, u as ze, _ as z, a3 as ns, a4 as yt, Z as
|
|
6
|
-
import { h as
|
|
7
|
-
import { j as Ls, c as js, a as $e, t as Qe, d as ut } from "./number-
|
|
8
|
-
import { F as Be, c as Us,
|
|
9
|
-
import { L as Ms } from "./lz-string-
|
|
10
|
-
import { useI18n as ht, useCoreStore as
|
|
11
|
-
import { useDialog as
|
|
12
|
-
import { u as _t, a as
|
|
1
|
+
import { f as lt, p as ks } from "./format-time-from-id-DXhm_Ji1.js";
|
|
2
|
+
import { defineComponent as Ve, ref as re, watch as Ye, createElementBlock as v, openBlock as i, createCommentVNode as V, createElementVNode as e, withDirectives as Os, toDisplayString as k, unref as h, vModelText as xs, toRaw as ws, shallowRef as dt, onUnmounted as rs, triggerRef as $s, computed as H, readonly as Cs, h as oe, resolveComponent as ne, createVNode as T, Fragment as Ce, renderList as Te, reactive as As, onMounted as os, createBlock as he, withCtx as ce, createTextVNode as Ge, normalizeClass as We, renderSlot as Ds, isRef as Ns, resolveDynamicComponent as Rs } from "vue";
|
|
3
|
+
import { c as Gt } from "./component-BmLAdDiY.js";
|
|
4
|
+
import { D as qe, R as Ne } from "./row-action.enum-ePO-Py0V.js";
|
|
5
|
+
import { q as Ae, H as st, d as Ps, u as ze, _ as z, a3 as ns, a4 as yt, Z as be, a as Nt, a5 as Wt, a6 as Fs, a7 as Is, G as Ts, s as Rt, c as wt, M as Qt, a8 as as, r as at, C as Ue, w as Pe, B as mt, a9 as Es } from "./app-DyEvx3Em.js";
|
|
6
|
+
import { h as Pt, a as qs, t as Vs, b as et } from "./date2-Rv4IwT9a.js";
|
|
7
|
+
import { j as Ls, c as js, a as $e, t as Qe, d as ut } from "./number-BmKjsNrc.js";
|
|
8
|
+
import { F as Be, u as Je, c as Us, b as Yt, d as St } from "./feature-BMTKl6PK.js";
|
|
9
|
+
import { L as Ms } from "./lz-string-BwQj8QRN.js";
|
|
10
|
+
import { useI18n as ht, useCoreStore as gt } from "@feedmepos/mf-common";
|
|
11
|
+
import { useDialog as bt, useSnackbar as Ze, components as pt, FmButtonVariant as je, useProxiedModel as Bs } from "@feedmepos/ui-library";
|
|
12
|
+
import { u as _t, a as Ft, S as Me } from "./netsuite-s1S33-lP.js";
|
|
13
13
|
import { F as tt } from "./FmAdminBadge-DlplQOHb.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { e as Js } from "./index-BbbqCCfp.js";
|
|
21
|
-
import { i as Zs } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-BqCh_vTP.js";
|
|
14
|
+
import { _ as Jt } from "./empty-placeholder-B0QU467o.js";
|
|
15
|
+
import { a as zs, b as Ks, f as ft } from "./format-unit-display-DxWLjFPz.js";
|
|
16
|
+
import { u as Xe, _ as Hs } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-DZ3Gdlp9.js";
|
|
17
|
+
import { _ as Gs, a as Ws, b as Qs } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-BQHd3NjM.js";
|
|
18
|
+
import { e as Ys } from "./index-DEl_gZn0.js";
|
|
19
|
+
import { i as Js } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-CoUWxHlj.js";
|
|
22
20
|
import { F as Zt } from "./form-mode.enum-BKiNVH6A.js";
|
|
23
|
-
import { u as ls } from "./supplier-
|
|
24
|
-
import { u as
|
|
25
|
-
import { f as
|
|
26
|
-
import { F as
|
|
27
|
-
import { d as is } from "./defineDeepModel-
|
|
28
|
-
import { u as
|
|
29
|
-
import { u as
|
|
30
|
-
function us(
|
|
21
|
+
import { u as ls } from "./supplier-DgT66emI.js";
|
|
22
|
+
import { u as Zs } from "./surcharge-CsVMuzPM.js";
|
|
23
|
+
import { f as Xs, h as er, r as tr, s as sr } from "./predefined-templates-BZ2KqNix.js";
|
|
24
|
+
import { F as rr } from "./decimal-7vA05AaD.js";
|
|
25
|
+
import { d as is } from "./defineDeepModel-22Md2SKY.js";
|
|
26
|
+
import { u as or } from "./vue-i18n-CpOOFhVU.js";
|
|
27
|
+
import { u as nr } from "./useHrmPermission-DLHAqbLV.js";
|
|
28
|
+
function us(c, t) {
|
|
31
29
|
return t.reduce(
|
|
32
30
|
(n, m) => {
|
|
33
|
-
const u = m.received.find((
|
|
31
|
+
const u = m.received.find((d) => d.sku._id === c._id);
|
|
34
32
|
return u && (n = Ls(n, u.amount)), n;
|
|
35
33
|
},
|
|
36
|
-
|
|
34
|
+
rr.toPrecision(js(0), c.unit.precision)
|
|
37
35
|
);
|
|
38
36
|
}
|
|
39
|
-
function cs(
|
|
37
|
+
function cs(c) {
|
|
40
38
|
var n;
|
|
41
|
-
const t = Ae(),
|
|
39
|
+
const t = Ae(), s = (n = c.supplier.supplyItems) != null && n.length ? { ...c.supplier, registrationNumber: c.supplier.registrationNumber ?? "" } : void 0;
|
|
42
40
|
return (m) => {
|
|
43
|
-
var u,
|
|
41
|
+
var u, d;
|
|
44
42
|
if ((u = m.totalCost) != null && u.amount) return m.totalCost;
|
|
45
43
|
if (!m.isCustomCost)
|
|
46
44
|
try {
|
|
47
|
-
const { cost:
|
|
45
|
+
const { cost: r } = Be.calculateDefaultCost({
|
|
48
46
|
item: m.sku,
|
|
49
47
|
amount: m.quantity,
|
|
50
48
|
measurement: m.measurement,
|
|
51
|
-
overrides:
|
|
49
|
+
overrides: s ? { supplier: s } : void 0,
|
|
52
50
|
defaultCurrency: t
|
|
53
51
|
});
|
|
54
|
-
return
|
|
55
|
-
} catch (
|
|
56
|
-
console.warn("[print] cost auto-calculation failed for item", (
|
|
52
|
+
return r.amount ? r : void 0;
|
|
53
|
+
} catch (r) {
|
|
54
|
+
console.warn("[print] cost auto-calculation failed for item", (d = m.sku) == null ? void 0 : d._id, r);
|
|
57
55
|
return;
|
|
58
56
|
}
|
|
59
57
|
};
|
|
60
58
|
}
|
|
61
|
-
function
|
|
59
|
+
function ar(c) {
|
|
62
60
|
var Se, De, K, ve, P, x, w;
|
|
63
|
-
const { po: t, currentLocation:
|
|
64
|
-
name:
|
|
61
|
+
const { po: t, currentLocation: s, business: n, fulfilling: m, por: u } = c, d = s.doc.profile || {}, { name: r, address: a, regNo: O, legalName: f } = d, N = {
|
|
62
|
+
name: r || s.name || "",
|
|
65
63
|
legalName: f || void 0,
|
|
66
64
|
registrationNumber: O || void 0,
|
|
67
65
|
line1: (a == null ? void 0 : a.line1) || "",
|
|
@@ -70,7 +68,7 @@ function lr(d) {
|
|
|
70
68
|
city: (a == null ? void 0 : a.city) || "",
|
|
71
69
|
state: (a == null ? void 0 : a.state) || "",
|
|
72
70
|
country: (a == null ? void 0 : a.country) || ""
|
|
73
|
-
},
|
|
71
|
+
}, R = {
|
|
74
72
|
name: t.supplier.name,
|
|
75
73
|
phoneNumber: t.supplier.phoneNumber || void 0,
|
|
76
74
|
registrationNumber: t.supplier.registrationNumber || void 0,
|
|
@@ -85,40 +83,40 @@ function lr(d) {
|
|
|
85
83
|
const { sku: G, measurement: X } = A, le = $e(
|
|
86
84
|
us(A.sku, t.deliveryOrder || []),
|
|
87
85
|
!1
|
|
88
|
-
),
|
|
89
|
-
return
|
|
86
|
+
), g = F(A);
|
|
87
|
+
return g && _.push(g), {
|
|
90
88
|
code: G.code,
|
|
91
89
|
description: G.name,
|
|
92
90
|
quantity: $e(A.quantity, !1),
|
|
93
91
|
unit: (X == null ? void 0 : X.abbrev) || ((D = G.unit) == null ? void 0 : D.abbrev) || "",
|
|
94
92
|
received: le,
|
|
95
|
-
unitCost:
|
|
96
|
-
value: A.quantity.amount === 0 ? Be.fromNumber(0) : Be.divide([
|
|
93
|
+
unitCost: g ? `${g.currency} ${Be.toFormatString({
|
|
94
|
+
value: A.quantity.amount === 0 ? Be.fromNumber(0) : Be.divide([g, A.quantity])
|
|
97
95
|
})}` : void 0,
|
|
98
|
-
cost:
|
|
99
|
-
value:
|
|
96
|
+
cost: g ? `${g.currency} ${Be.toFormatString({
|
|
97
|
+
value: g
|
|
100
98
|
})}` : void 0
|
|
101
99
|
};
|
|
102
100
|
}), E = _.length ? `${_[0].currency} ${Be.toFormatString({
|
|
103
101
|
value: _.reduce((A, G) => Be.add([A, G]), Be.reset())
|
|
104
102
|
})}` : void 0, te = (t.deliveryOrder || []).map((A) => ({
|
|
105
|
-
createdAt:
|
|
103
|
+
createdAt: Pt(new Date(A.createdAt)),
|
|
106
104
|
ref: A.deliveryOrderNumber,
|
|
107
105
|
remark: A.remark || "",
|
|
108
106
|
items: (A.received || []).map((G) => {
|
|
109
|
-
var X, le,
|
|
107
|
+
var X, le, g, D, ie;
|
|
110
108
|
return {
|
|
111
109
|
code: ((X = G.sku) == null ? void 0 : X.code) || "",
|
|
112
110
|
description: ((le = G.sku) == null ? void 0 : le.name) || "",
|
|
113
111
|
quantity: $e(G.amount),
|
|
114
|
-
unit: ((
|
|
112
|
+
unit: ((g = G.measurement) == null ? void 0 : g.abbrev) || ((ie = (D = G.sku) == null ? void 0 : D.unit) == null ? void 0 : ie.abbrev) || ""
|
|
115
113
|
};
|
|
116
114
|
})
|
|
117
115
|
}));
|
|
118
116
|
let se = st.Enum.purchaseOrder, Q = "Inventory Receive Note";
|
|
119
117
|
if (t.supplier.internal ? (Q = "Inventory Transfer Note", se = st.Enum.transferOrder) : (Q = "Purchase Order", se = st.Enum.purchaseOrder), (w = u == null ? void 0 : u.from) != null && w.dbName) {
|
|
120
118
|
const A = u.from.dbName;
|
|
121
|
-
|
|
119
|
+
s.dbName === A || (Q = "Inventory Receive Note", se = st.Enum.goodsReceivedNote);
|
|
122
120
|
}
|
|
123
121
|
const Oe = {
|
|
124
122
|
title: Q,
|
|
@@ -128,8 +126,8 @@ function lr(d) {
|
|
|
128
126
|
createdAt: lt(t._id),
|
|
129
127
|
ref: t.ref || "",
|
|
130
128
|
remark: t.remark || "",
|
|
131
|
-
buyer:
|
|
132
|
-
supplier:
|
|
129
|
+
buyer: N,
|
|
130
|
+
supplier: R,
|
|
133
131
|
items: B,
|
|
134
132
|
grandTotal: E,
|
|
135
133
|
status: t.status,
|
|
@@ -137,11 +135,11 @@ function lr(d) {
|
|
|
137
135
|
}, ae = m && (t.deliveryFullfillment || []).length > 0;
|
|
138
136
|
return ae && (se = st.Enum.deliveryOrder), { printData: Oe, templateType: se, isDeliveryPrint: ae };
|
|
139
137
|
}
|
|
140
|
-
function ds(
|
|
138
|
+
function ds(c) {
|
|
141
139
|
var f;
|
|
142
|
-
const { printData: t, templateType:
|
|
140
|
+
const { printData: t, templateType: s } = ar(c), m = Xs().getTemplateByType(s), u = !!((f = m == null ? void 0 : m.blocks) != null && f.length), d = er(s), r = u ? m.blocks : d.blocks, a = u ? m.name : d.name, O = !u;
|
|
143
141
|
try {
|
|
144
|
-
const
|
|
142
|
+
const N = tr(r, t), R = N.match(/<style>([\s\S]*?)<\/style>/), F = R ? `<style>${R[1]}</style>` : "", _ = N.replace(/<style>[\s\S]*?<\/style>/, "");
|
|
145
143
|
return {
|
|
146
144
|
html: `<!DOCTYPE html>
|
|
147
145
|
<html>
|
|
@@ -166,20 +164,20 @@ ${F}
|
|
|
166
164
|
return alert("Failed to render print template. Please try recreating the template."), null;
|
|
167
165
|
}
|
|
168
166
|
}
|
|
169
|
-
const
|
|
170
|
-
const
|
|
167
|
+
const lr = Ps((c, t) => {
|
|
168
|
+
const s = ze();
|
|
171
169
|
return {
|
|
172
170
|
async getShipments({
|
|
173
171
|
start: n,
|
|
174
172
|
end: m
|
|
175
173
|
}) {
|
|
176
|
-
const u =
|
|
177
|
-
return await t.get(`${
|
|
174
|
+
const u = s.currentLocationDBName, d = `${c.inventoryBackendUrl}/${u}/shipments`;
|
|
175
|
+
return await t.get(`${d}?start=${n}&end=${m}`);
|
|
178
176
|
},
|
|
179
177
|
async getShipmentsByIds(n) {
|
|
180
178
|
if (n.length === 0)
|
|
181
179
|
return [];
|
|
182
|
-
const m =
|
|
180
|
+
const m = s.currentLocationDBName, u = `${c.inventoryBackendUrl}/${m}/shipments/get`;
|
|
183
181
|
return await t.post(u, { shipmentIds: n });
|
|
184
182
|
}
|
|
185
183
|
};
|
|
@@ -268,30 +266,30 @@ const ir = Ps((d, t) => {
|
|
|
268
266
|
message: "Purchase order will be processed.",
|
|
269
267
|
successMessage: "Purchase order has been processed"
|
|
270
268
|
}
|
|
271
|
-
},
|
|
269
|
+
}, ir = { class: "p-4" }, ur = {
|
|
272
270
|
key: 0,
|
|
273
271
|
class: "fm-typo-en-body-md-400 mb-3"
|
|
274
|
-
},
|
|
272
|
+
}, cr = { class: "fm-typo-en-body-md-400" }, ps = /* @__PURE__ */ Ve({
|
|
275
273
|
__name: "RejectDraftForm",
|
|
276
274
|
props: {
|
|
277
275
|
message: {},
|
|
278
276
|
confirm: { type: Function },
|
|
279
277
|
onChange: { type: Function }
|
|
280
278
|
},
|
|
281
|
-
setup(
|
|
282
|
-
const t =
|
|
279
|
+
setup(c) {
|
|
280
|
+
const t = c, { t: s } = ht(), n = re("");
|
|
283
281
|
Ye(n, (u) => {
|
|
284
|
-
var
|
|
285
|
-
(
|
|
282
|
+
var d;
|
|
283
|
+
(d = t.onChange) == null || d.call(t, u ?? "");
|
|
286
284
|
});
|
|
287
285
|
function m() {
|
|
288
286
|
n.value = "";
|
|
289
287
|
}
|
|
290
|
-
return (u,
|
|
291
|
-
t.message ? (i(), v("div",
|
|
292
|
-
e("label",
|
|
288
|
+
return (u, d) => (i(), v("div", ir, [
|
|
289
|
+
t.message ? (i(), v("div", ur, k(t.message), 1)) : V("", !0),
|
|
290
|
+
e("label", cr, k(h(s)("inventory.transfer.receiveRequest.details.rejectionReason")) + " (" + k(h(s)("inventory.common.optional")) + ")", 1),
|
|
293
291
|
Os(e("textarea", {
|
|
294
|
-
"onUpdate:modelValue":
|
|
292
|
+
"onUpdate:modelValue": d[0] || (d[0] = (r) => n.value = r),
|
|
295
293
|
rows: "4",
|
|
296
294
|
class: "w-full mt-2 p-2 border rounded"
|
|
297
295
|
}, null, 512), [
|
|
@@ -307,61 +305,61 @@ const ir = Ps((d, t) => {
|
|
|
307
305
|
]));
|
|
308
306
|
}
|
|
309
307
|
});
|
|
310
|
-
function vt(
|
|
311
|
-
if (
|
|
308
|
+
function vt(c) {
|
|
309
|
+
if (c.items == null)
|
|
312
310
|
return {};
|
|
313
|
-
const t = ns.safeParse(
|
|
311
|
+
const t = ns.safeParse(c);
|
|
314
312
|
if (!t.success) {
|
|
315
|
-
const
|
|
313
|
+
const s = t.error.issues.map((n) => `${n.path.join(".") || "(root)"}: ${n.message}`).join("; ");
|
|
316
314
|
return console.error(
|
|
317
|
-
`Cannot compute receive status for PO ${
|
|
315
|
+
`Cannot compute receive status for PO ${c == null ? void 0 : c._id}: invalid shape at ${s}`
|
|
318
316
|
), {};
|
|
319
317
|
}
|
|
320
318
|
return yt.generatedPOReceivedMap({
|
|
321
|
-
purchaseOrder:
|
|
319
|
+
purchaseOrder: c
|
|
322
320
|
});
|
|
323
321
|
}
|
|
324
|
-
function
|
|
322
|
+
function dr(c) {
|
|
325
323
|
return yt.validatePOItemReceivedStatus({
|
|
326
|
-
dto:
|
|
324
|
+
dto: c
|
|
327
325
|
});
|
|
328
326
|
}
|
|
329
|
-
function $t(
|
|
327
|
+
function $t(c) {
|
|
330
328
|
return yt.validatePOReceivedStatus({
|
|
331
|
-
receivedMap:
|
|
329
|
+
receivedMap: c
|
|
332
330
|
});
|
|
333
331
|
}
|
|
334
|
-
function Ct(
|
|
335
|
-
if (!
|
|
336
|
-
throw new Error(`Invalid purchase order status: ${
|
|
337
|
-
const n =
|
|
332
|
+
function Ct(c, t, s) {
|
|
333
|
+
if (!be.safeParse(c).success)
|
|
334
|
+
throw new Error(`Invalid purchase order status: ${c}`);
|
|
335
|
+
const n = be.parse(c);
|
|
338
336
|
return yt.orderStatusCombination({
|
|
339
337
|
status: n,
|
|
340
338
|
isPOPartialReceive: t,
|
|
341
|
-
isPOOverReceive:
|
|
339
|
+
isPOOverReceive: s
|
|
342
340
|
});
|
|
343
341
|
}
|
|
344
342
|
function fs() {
|
|
345
|
-
const
|
|
346
|
-
async function n(u,
|
|
347
|
-
const
|
|
348
|
-
return u.doc.supplier.internal && u.operation === z.enum.confirmDraft && (u.operation = z.enum.submitRequest), await t.processPurchaseOrder(u,
|
|
343
|
+
const c = ze(), t = Xe(), s = Je();
|
|
344
|
+
async function n(u, d) {
|
|
345
|
+
const r = c.currentLocationDBName;
|
|
346
|
+
return u.doc.supplier.internal && u.operation === z.enum.confirmDraft && (u.operation = z.enum.submitRequest), await t.processPurchaseOrder(u, d || r);
|
|
349
347
|
}
|
|
350
|
-
async function m(u,
|
|
351
|
-
const
|
|
352
|
-
return await t.processPurchaseOrderV2(u,
|
|
348
|
+
async function m(u, d) {
|
|
349
|
+
const r = c.currentLocationDBName;
|
|
350
|
+
return await t.processPurchaseOrderV2(u, d || r);
|
|
353
351
|
}
|
|
354
|
-
return (u) =>
|
|
352
|
+
return (u) => s.useOperatePurchaseOrderV2 ? m(u.operateV2, u.transferTo) : n(u.operate, u.transferTo);
|
|
355
353
|
}
|
|
356
|
-
function He(
|
|
357
|
-
const t = ws(
|
|
354
|
+
function He(c) {
|
|
355
|
+
const t = ws(c);
|
|
358
356
|
if (Array.isArray(t))
|
|
359
357
|
return t.map(He);
|
|
360
358
|
if (t !== null && typeof t == "object") {
|
|
361
|
-
const
|
|
359
|
+
const s = {};
|
|
362
360
|
for (const n in t)
|
|
363
|
-
Object.prototype.hasOwnProperty.call(t, n) && (
|
|
364
|
-
return
|
|
361
|
+
Object.prototype.hasOwnProperty.call(t, n) && (s[n] = He(t[n]));
|
|
362
|
+
return s;
|
|
365
363
|
}
|
|
366
364
|
return t;
|
|
367
365
|
}
|
|
@@ -370,21 +368,21 @@ const kt = {
|
|
|
370
368
|
add: "add",
|
|
371
369
|
delete: "delete"
|
|
372
370
|
};
|
|
373
|
-
function Xt(
|
|
371
|
+
function Xt(c) {
|
|
374
372
|
return {
|
|
375
|
-
dbName:
|
|
376
|
-
type:
|
|
377
|
-
name:
|
|
378
|
-
acceptRequest:
|
|
379
|
-
doc:
|
|
373
|
+
dbName: c.dbName,
|
|
374
|
+
type: c.type,
|
|
375
|
+
name: c.name,
|
|
376
|
+
acceptRequest: c.acceptRequest ?? !1,
|
|
377
|
+
doc: c.doc
|
|
380
378
|
};
|
|
381
379
|
}
|
|
382
380
|
const vs = { line1: "", state: "", city: "", postcode: "", country: "" };
|
|
383
|
-
function rt(
|
|
384
|
-
return
|
|
381
|
+
function rt(c) {
|
|
382
|
+
return c == null ? "" : String(c);
|
|
385
383
|
}
|
|
386
|
-
function ys(
|
|
387
|
-
const t =
|
|
384
|
+
function ys(c) {
|
|
385
|
+
const t = c.address, s = t != null ? {
|
|
388
386
|
...t,
|
|
389
387
|
line1: rt(t.line1),
|
|
390
388
|
state: rt(t.state),
|
|
@@ -393,72 +391,72 @@ function ys(d) {
|
|
|
393
391
|
country: rt(t.country)
|
|
394
392
|
} : { ...vs };
|
|
395
393
|
return {
|
|
396
|
-
...
|
|
397
|
-
registrationNumber:
|
|
398
|
-
address:
|
|
394
|
+
...c,
|
|
395
|
+
registrationNumber: c.registrationNumber ?? "",
|
|
396
|
+
address: s
|
|
399
397
|
};
|
|
400
398
|
}
|
|
401
|
-
function es(
|
|
402
|
-
const u = He(
|
|
399
|
+
function es(c, t, s, n, m) {
|
|
400
|
+
const u = He(c.suppliers ?? []).map(ys), d = He(t.allLocations ?? []).map(Xt), r = t._currentLocation ? Xt(He(t._currentLocation)) : null, a = s.inventory ? [He(s.inventory)] : [], O = n.state.setting ? He(n.state.setting) : null, f = He(m.surcharges ?? []);
|
|
403
401
|
return {
|
|
404
402
|
suppliers: u,
|
|
405
|
-
locations:
|
|
406
|
-
currentLocation:
|
|
403
|
+
locations: d,
|
|
404
|
+
currentLocation: r,
|
|
407
405
|
inventoryDoc: a,
|
|
408
406
|
netSuiteSetting: O,
|
|
409
407
|
surcharges: f
|
|
410
408
|
};
|
|
411
409
|
}
|
|
412
410
|
function hs() {
|
|
413
|
-
const
|
|
414
|
-
|
|
411
|
+
const c = ls(), t = ze(), s = Nt(), n = _t(), m = Zs(), u = es(
|
|
412
|
+
c,
|
|
415
413
|
t,
|
|
416
|
-
|
|
414
|
+
s,
|
|
417
415
|
n,
|
|
418
416
|
m
|
|
419
|
-
),
|
|
420
|
-
|
|
421
|
-
const
|
|
422
|
-
|
|
417
|
+
), d = dt(Us({ env: u }));
|
|
418
|
+
d.value.setUsePartialUpdates(!0);
|
|
419
|
+
const r = dt(d.value.state()), a = (R) => {
|
|
420
|
+
r.value = d.value.state();
|
|
423
421
|
};
|
|
424
|
-
|
|
425
|
-
const O = (
|
|
426
|
-
switch (
|
|
422
|
+
d.value.addListener(a);
|
|
423
|
+
const O = (R, F, _) => {
|
|
424
|
+
switch (R) {
|
|
427
425
|
case kt.set:
|
|
428
|
-
|
|
426
|
+
Wt(r.value, F, _);
|
|
429
427
|
break;
|
|
430
428
|
case kt.add:
|
|
431
|
-
Is(
|
|
429
|
+
Is(r.value, F, _);
|
|
432
430
|
break;
|
|
433
431
|
case kt.delete:
|
|
434
|
-
Fs(
|
|
432
|
+
Fs(r.value, F);
|
|
435
433
|
break;
|
|
436
434
|
default:
|
|
437
|
-
console.warn(`Unknown partial update operation: ${
|
|
435
|
+
console.warn(`Unknown partial update operation: ${R}, falling back to 'set'`), Wt(r.value, F, _);
|
|
438
436
|
}
|
|
439
|
-
F !== "remark" && F !== "ref" && $s(
|
|
437
|
+
F !== "remark" && F !== "ref" && $s(r);
|
|
440
438
|
};
|
|
441
|
-
|
|
439
|
+
d.value.addPartialListener(O);
|
|
442
440
|
function f() {
|
|
443
|
-
const
|
|
444
|
-
|
|
441
|
+
const R = es(
|
|
442
|
+
c,
|
|
445
443
|
t,
|
|
446
|
-
|
|
444
|
+
s,
|
|
447
445
|
n,
|
|
448
446
|
m
|
|
449
447
|
);
|
|
450
448
|
try {
|
|
451
|
-
|
|
449
|
+
d.value.updateFullEnv(R), r.value = d.value.state();
|
|
452
450
|
} catch (F) {
|
|
453
451
|
console.error("[PurchaseOrderFormController] updateFullEnv failed", F);
|
|
454
452
|
}
|
|
455
453
|
}
|
|
456
454
|
Ye(
|
|
457
455
|
[
|
|
458
|
-
() =>
|
|
456
|
+
() => c.suppliers,
|
|
459
457
|
() => t.allLocations,
|
|
460
458
|
() => t._currentLocation,
|
|
461
|
-
() =>
|
|
459
|
+
() => s.inventory,
|
|
462
460
|
() => n.state.setting,
|
|
463
461
|
() => m.surcharges
|
|
464
462
|
],
|
|
@@ -467,14 +465,14 @@ function hs() {
|
|
|
467
465
|
},
|
|
468
466
|
{ deep: !0 }
|
|
469
467
|
), rs(() => {
|
|
470
|
-
|
|
468
|
+
d.value.removeListener(a), d.value.removePartialListener(O);
|
|
471
469
|
});
|
|
472
|
-
function R
|
|
470
|
+
function N(R) {
|
|
473
471
|
var F;
|
|
474
|
-
if (
|
|
475
|
-
const _ = /* @__PURE__ */ new Set(["1", "2"]), B =
|
|
476
|
-
...
|
|
477
|
-
version: _.has(
|
|
472
|
+
if (R != null && R._id) {
|
|
473
|
+
const _ = /* @__PURE__ */ new Set(["1", "2"]), B = R, E = B.supplier, te = E != null ? ys(E) : { _id: "", name: "", registrationNumber: "", address: { ...vs } }, se = {
|
|
474
|
+
...R,
|
|
475
|
+
version: _.has(R.version) ? R.version : null,
|
|
478
476
|
supplier: te,
|
|
479
477
|
// items/deliveryOrder may be absent or contain null/corrupted elements.
|
|
480
478
|
// The Dart bridge has no null guards on sku, sku.unit, and quantity —
|
|
@@ -496,44 +494,44 @@ function hs() {
|
|
|
496
494
|
}))
|
|
497
495
|
};
|
|
498
496
|
try {
|
|
499
|
-
|
|
497
|
+
d.value.loadPurchaseOrder(se);
|
|
500
498
|
} catch (Q) {
|
|
501
499
|
console.error("[PurchaseOrderFormController] loadPurchaseOrder failed", Q);
|
|
502
500
|
}
|
|
503
501
|
return;
|
|
504
502
|
}
|
|
505
|
-
if (!
|
|
506
|
-
|
|
503
|
+
if (!Je().mustUsePoTemplate) {
|
|
504
|
+
d.value.init();
|
|
507
505
|
return;
|
|
508
506
|
}
|
|
509
|
-
|
|
507
|
+
R != null && R.template && ((F = R.templateDoc) != null && F.purchaseOrder) ? (R.items = R.templateDoc.purchaseOrder.items, d.value.initFromTemplate(R)) : d.value.initOutletToOutlet();
|
|
510
508
|
}
|
|
511
509
|
return {
|
|
512
|
-
controller:
|
|
513
|
-
state:
|
|
514
|
-
init:
|
|
510
|
+
controller: d,
|
|
511
|
+
state: r,
|
|
512
|
+
init: N
|
|
515
513
|
};
|
|
516
514
|
}
|
|
517
|
-
var At = /* @__PURE__ */ ((
|
|
518
|
-
const ot =
|
|
519
|
-
function
|
|
520
|
-
const
|
|
521
|
-
t != null && t.startDate && (t != null && t.endDate) ? t :
|
|
515
|
+
var At = /* @__PURE__ */ ((c) => (c.RECEIVE_REQUEST = "receive/request", c.APPROVAL = "approval", c))(At || {});
|
|
516
|
+
const ot = re(), Ot = re(), xt = re();
|
|
517
|
+
function yi(c, t) {
|
|
518
|
+
const s = bt(), n = ze(), m = Je(), u = ls(), d = gt(), r = zs(), a = Ks(), O = re(!1), f = Ze(), N = Xe(), R = lr(), F = re(new Array()), _ = re(new Array()), B = re(
|
|
519
|
+
t != null && t.startDate && (t != null && t.endDate) ? t : Js()
|
|
522
520
|
), E = H(() => {
|
|
523
|
-
const
|
|
521
|
+
const g = new Date(B.value.startDate), D = new Date(B.value.endDate);
|
|
524
522
|
return {
|
|
525
|
-
start: Vs(
|
|
523
|
+
start: Vs(g).toISOString(),
|
|
526
524
|
end: qs(D).toISOString()
|
|
527
525
|
};
|
|
528
|
-
}), te =
|
|
529
|
-
async function de(
|
|
526
|
+
}), te = re(new Array()), se = Ts(), Q = re(null);
|
|
527
|
+
async function de(g) {
|
|
530
528
|
function D(ee) {
|
|
531
529
|
const L = {
|
|
532
530
|
mode: Zt.CREATE,
|
|
533
|
-
modelValue:
|
|
531
|
+
modelValue: g || void 0,
|
|
534
532
|
show: !0,
|
|
535
|
-
"onUpdate:show"(
|
|
536
|
-
ot.value.show =
|
|
533
|
+
"onUpdate:show"(b) {
|
|
534
|
+
ot.value.show = b;
|
|
537
535
|
},
|
|
538
536
|
templateId: ee,
|
|
539
537
|
lastClosingDate: Q.value
|
|
@@ -541,7 +539,7 @@ function bi(d, t) {
|
|
|
541
539
|
ot.value = L;
|
|
542
540
|
}
|
|
543
541
|
let ie;
|
|
544
|
-
m.mustUsePoTemplate && !(
|
|
542
|
+
m.mustUsePoTemplate && !(g != null && g.template) ? s.open({
|
|
545
543
|
title: "Create transfer",
|
|
546
544
|
message: "",
|
|
547
545
|
primaryActions: {
|
|
@@ -554,15 +552,15 @@ function bi(d, t) {
|
|
|
554
552
|
close: !0
|
|
555
553
|
}
|
|
556
554
|
}).onPrimary(async () => {
|
|
557
|
-
ie = await
|
|
555
|
+
ie = await r.getTemplateId(), ie && D(ie);
|
|
558
556
|
}).onSecondary(() => {
|
|
559
557
|
D(void 0);
|
|
560
558
|
}) : D(ie);
|
|
561
559
|
}
|
|
562
|
-
function Oe(
|
|
560
|
+
function Oe(g) {
|
|
563
561
|
const D = {
|
|
564
562
|
mode: Zt.UPDATE,
|
|
565
|
-
modelValue: wt(
|
|
563
|
+
modelValue: wt(g),
|
|
566
564
|
show: !0,
|
|
567
565
|
"onUpdate:show"(ie) {
|
|
568
566
|
ot.value.show = ie;
|
|
@@ -571,47 +569,47 @@ function bi(d, t) {
|
|
|
571
569
|
};
|
|
572
570
|
ot.value = D;
|
|
573
571
|
}
|
|
574
|
-
function ae(
|
|
575
|
-
if (!
|
|
572
|
+
function ae(g) {
|
|
573
|
+
if (!d.currentBusiness.value) return;
|
|
576
574
|
const D = n.currentLocation;
|
|
577
575
|
if (D.type === "restaurant") {
|
|
578
576
|
const j = n.locationRestaurantFromCore(D.doc._id);
|
|
579
577
|
j !== null && (D.doc = j);
|
|
580
578
|
}
|
|
581
579
|
const ie = ds({
|
|
582
|
-
po:
|
|
580
|
+
po: g,
|
|
583
581
|
currentLocation: D,
|
|
584
|
-
business:
|
|
585
|
-
fulfilling:
|
|
586
|
-
por:
|
|
582
|
+
business: d.currentBusiness.value,
|
|
583
|
+
fulfilling: c === "approval",
|
|
584
|
+
por: g.request
|
|
587
585
|
});
|
|
588
586
|
if (!ie) return;
|
|
589
|
-
const ee =
|
|
587
|
+
const ee = sr(ie.html), L = u.supplierById[g.supplier._id], b = {
|
|
590
588
|
recipientName: L.name,
|
|
591
589
|
email: (L == null ? void 0 : L.email) ?? "",
|
|
592
|
-
business:
|
|
590
|
+
business: d.currentBusiness.value,
|
|
593
591
|
modelValue: ee,
|
|
594
592
|
show: !0,
|
|
595
593
|
"onUpdate:show"(j) {
|
|
596
594
|
Ot.value.show = j;
|
|
597
595
|
}
|
|
598
596
|
};
|
|
599
|
-
Ot.value =
|
|
597
|
+
Ot.value = b;
|
|
600
598
|
}
|
|
601
599
|
async function Se() {
|
|
602
600
|
F.value = [], _.value = [], O.value = !0;
|
|
603
601
|
try {
|
|
604
|
-
const
|
|
605
|
-
F.value =
|
|
606
|
-
const D =
|
|
602
|
+
const g = await N.getPurchaseOrders(E.value);
|
|
603
|
+
F.value = g.sort((j, J) => J._id.localeCompare(j._id));
|
|
604
|
+
const D = g.flatMap((j) => j.shipmentIds || []).filter(Boolean), ie = D.length > 0 ? await R.getShipmentsByIds(D) : [];
|
|
607
605
|
_.value = ie;
|
|
608
606
|
const ee = await se.readCurrentLocationLastClosing(!0), L = ee == null ? void 0 : ee._id;
|
|
609
607
|
L && (Q.value = ks(L)), await m.awaitFeatureLoaded(() => m.mustUsePoTemplate) && await a.fetchTemplates();
|
|
610
|
-
const
|
|
608
|
+
const b = F.value.map((j) => {
|
|
611
609
|
var J;
|
|
612
610
|
return ((J = j.request) == null ? void 0 : J.id) ?? "";
|
|
613
611
|
}).filter((j) => j);
|
|
614
|
-
te.value = await
|
|
612
|
+
te.value = await N.readRequestByIds(b);
|
|
615
613
|
} catch {
|
|
616
614
|
f.open({
|
|
617
615
|
title: "Something went wrong",
|
|
@@ -625,11 +623,11 @@ function bi(d, t) {
|
|
|
625
623
|
async function De() {
|
|
626
624
|
te.value = [], O.value = !0;
|
|
627
625
|
try {
|
|
628
|
-
te.value = await
|
|
626
|
+
te.value = await N.readRequests(
|
|
629
627
|
void 0,
|
|
630
628
|
E.value.start,
|
|
631
629
|
E.value.end
|
|
632
|
-
).then((
|
|
630
|
+
).then((g) => g.reverse());
|
|
633
631
|
} catch {
|
|
634
632
|
f.open({
|
|
635
633
|
title: "Something went wrong",
|
|
@@ -641,40 +639,40 @@ function bi(d, t) {
|
|
|
641
639
|
}
|
|
642
640
|
}
|
|
643
641
|
function K() {
|
|
644
|
-
switch (
|
|
642
|
+
switch (c) {
|
|
645
643
|
case "receive/request":
|
|
646
644
|
return Se();
|
|
647
645
|
case "approval":
|
|
648
646
|
return De();
|
|
649
647
|
}
|
|
650
648
|
}
|
|
651
|
-
function ve(
|
|
649
|
+
function ve(g, D) {
|
|
652
650
|
B.value = {
|
|
653
|
-
startDate:
|
|
651
|
+
startDate: g,
|
|
654
652
|
endDate: D
|
|
655
653
|
}, K();
|
|
656
654
|
}
|
|
657
|
-
n.watchLocation(async (
|
|
658
|
-
if (!
|
|
655
|
+
n.watchLocation(async (g) => {
|
|
656
|
+
if (!g) {
|
|
659
657
|
F.value = [];
|
|
660
658
|
return;
|
|
661
659
|
}
|
|
662
660
|
await K();
|
|
663
661
|
});
|
|
664
|
-
async function P(
|
|
665
|
-
return
|
|
662
|
+
async function P(g) {
|
|
663
|
+
return g;
|
|
666
664
|
}
|
|
667
|
-
const x =
|
|
668
|
-
async function A(
|
|
665
|
+
const x = re(), w = re(Math.random().toString());
|
|
666
|
+
async function A(g, D) {
|
|
669
667
|
const ie = Math.random().toString();
|
|
670
668
|
w.value = ie, D ?? (D = te.value.computeFirst(
|
|
671
|
-
(j) => j.purchaseOrderId ===
|
|
669
|
+
(j) => j.purchaseOrderId === g._id ? j : null
|
|
672
670
|
) ?? void 0);
|
|
673
|
-
const ee =
|
|
671
|
+
const ee = c === "receive/request" ? n.currentLocation : D == null ? void 0 : D.to, L = c === "approval", b = {
|
|
674
672
|
poRequest: D,
|
|
675
673
|
purchaseOrder: {
|
|
676
|
-
...
|
|
677
|
-
status: L && (D != null && D.rejectedAt) ?
|
|
674
|
+
...g,
|
|
675
|
+
status: L && (D != null && D.rejectedAt) ? be.Enum.REJECT : g.status
|
|
678
676
|
},
|
|
679
677
|
transferTo: ee == null ? void 0 : ee.name,
|
|
680
678
|
transferToDbName: ee == null ? void 0 : ee.dbName,
|
|
@@ -684,20 +682,20 @@ function bi(d, t) {
|
|
|
684
682
|
"onUpdate:show"(j) {
|
|
685
683
|
x.value && (x.value = { ...x.value, show: j });
|
|
686
684
|
},
|
|
687
|
-
scope:
|
|
688
|
-
receivedMap: vt(
|
|
685
|
+
scope: c,
|
|
686
|
+
receivedMap: vt(g) ?? {},
|
|
689
687
|
shipments: _.value
|
|
690
688
|
};
|
|
691
|
-
x.value =
|
|
689
|
+
x.value = b;
|
|
692
690
|
}
|
|
693
|
-
async function G(
|
|
694
|
-
const
|
|
691
|
+
async function G(g, D, ie, ee, L) {
|
|
692
|
+
const b = fs();
|
|
695
693
|
O.value = !0;
|
|
696
694
|
try {
|
|
697
|
-
await
|
|
695
|
+
await b({
|
|
698
696
|
operate: {
|
|
699
697
|
operation: D,
|
|
700
|
-
doc:
|
|
698
|
+
doc: g,
|
|
701
699
|
options: (
|
|
702
700
|
// auto receive for supplier to warehouse
|
|
703
701
|
(D === z.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
@@ -707,15 +705,15 @@ function bi(d, t) {
|
|
|
707
705
|
)
|
|
708
706
|
},
|
|
709
707
|
operateV2: {
|
|
710
|
-
_id:
|
|
711
|
-
_rev:
|
|
708
|
+
_id: g._id,
|
|
709
|
+
_rev: g._rev ?? "",
|
|
712
710
|
action: D === z.enum.submitRequest ? z.enum.confirmDraft : D,
|
|
713
711
|
payloads: L ?? []
|
|
714
712
|
},
|
|
715
713
|
transferTo: ee
|
|
716
714
|
}), await new Promise((me) => setTimeout(me, 1e3));
|
|
717
715
|
const J = ze().currentLocationDBName.startsWith("restaurant_");
|
|
718
|
-
D === z.enum.confirmDraft &&
|
|
716
|
+
D === z.enum.confirmDraft && g.effectiveAt && J ? f.open({
|
|
719
717
|
title: "Success",
|
|
720
718
|
message: `${ie}. The backdate will be reflected once your POS has received this change.`,
|
|
721
719
|
type: "success"
|
|
@@ -729,12 +727,12 @@ function bi(d, t) {
|
|
|
729
727
|
title: "Something went wrong",
|
|
730
728
|
message: j instanceof Error ? j.message : "Please try again.",
|
|
731
729
|
type: "error"
|
|
732
|
-
}), console.error("Error when submitting PO operation", D,
|
|
730
|
+
}), console.error("Error when submitting PO operation", D, g, j);
|
|
733
731
|
} finally {
|
|
734
732
|
O.value = !1, K();
|
|
735
733
|
}
|
|
736
734
|
}
|
|
737
|
-
async function X(
|
|
735
|
+
async function X(g, D, ie) {
|
|
738
736
|
const ee = ms[D];
|
|
739
737
|
if (!ee) {
|
|
740
738
|
f.open({
|
|
@@ -744,16 +742,16 @@ function bi(d, t) {
|
|
|
744
742
|
});
|
|
745
743
|
return;
|
|
746
744
|
}
|
|
747
|
-
const { successMessage: L, ...
|
|
745
|
+
const { successMessage: L, ...b } = ee;
|
|
748
746
|
if (D === z.enum.rejectDraft) {
|
|
749
747
|
let me = "";
|
|
750
|
-
|
|
751
|
-
title:
|
|
752
|
-
message:
|
|
753
|
-
primaryActions:
|
|
748
|
+
s.open({
|
|
749
|
+
title: b.title,
|
|
750
|
+
message: b.message,
|
|
751
|
+
primaryActions: b.primaryActions,
|
|
754
752
|
contentComponent: ps,
|
|
755
753
|
contentComponentProps: {
|
|
756
|
-
message:
|
|
754
|
+
message: b.message,
|
|
757
755
|
onChange: (ke) => me = ke
|
|
758
756
|
}
|
|
759
757
|
}).onPrimary(() => {
|
|
@@ -763,24 +761,24 @@ function bi(d, t) {
|
|
|
763
761
|
payload: {
|
|
764
762
|
rejectReason: me
|
|
765
763
|
}
|
|
766
|
-
}), G(
|
|
764
|
+
}), G(g, D, L, ie, ke);
|
|
767
765
|
});
|
|
768
766
|
return;
|
|
769
767
|
}
|
|
770
768
|
const j = [], J = hs();
|
|
771
|
-
J.init(
|
|
769
|
+
J.init(g), (D === z.enum.confirmDraft || D === z.enum.submitRequest) && j.push({
|
|
772
770
|
action: "confirmDraft",
|
|
773
771
|
payload: J.controller.value.toConfirmDraftData(Ae())
|
|
774
|
-
}),
|
|
775
|
-
title:
|
|
776
|
-
message:
|
|
777
|
-
primaryActions:
|
|
772
|
+
}), s.open({
|
|
773
|
+
title: b.title,
|
|
774
|
+
message: b.message,
|
|
775
|
+
primaryActions: b.primaryActions
|
|
778
776
|
}).onPrimary(() => {
|
|
779
|
-
G(
|
|
777
|
+
G(g, D, L, ie, j);
|
|
780
778
|
});
|
|
781
779
|
}
|
|
782
780
|
async function le() {
|
|
783
|
-
|
|
781
|
+
s.open({
|
|
784
782
|
title: "Upload Transfer",
|
|
785
783
|
primaryActions: {
|
|
786
784
|
text: "Xilnex transfer note",
|
|
@@ -791,13 +789,13 @@ function bi(d, t) {
|
|
|
791
789
|
close: !0
|
|
792
790
|
}
|
|
793
791
|
}).onPrimary(() => {
|
|
794
|
-
const
|
|
792
|
+
const g = {
|
|
795
793
|
show: !0,
|
|
796
794
|
"onUpdate:show"(D) {
|
|
797
795
|
xt.value.show = D;
|
|
798
796
|
}
|
|
799
797
|
};
|
|
800
|
-
xt.value =
|
|
798
|
+
xt.value = g;
|
|
801
799
|
});
|
|
802
800
|
}
|
|
803
801
|
return {
|
|
@@ -820,19 +818,19 @@ function bi(d, t) {
|
|
|
820
818
|
promptEmailDialog: ae
|
|
821
819
|
};
|
|
822
820
|
}
|
|
823
|
-
function
|
|
821
|
+
function mr(c) {
|
|
824
822
|
var ae, Se, De, K, ve, P;
|
|
825
|
-
const { po: t, currentLocation:
|
|
826
|
-
name:
|
|
823
|
+
const { po: t, currentLocation: s, business: n, fulfilling: m, por: u } = c, { name: d, address: r, regNo: a, legalName: O } = s.doc.profile, f = {
|
|
824
|
+
name: d,
|
|
827
825
|
legalName: O,
|
|
828
826
|
registrationNumber: a,
|
|
829
|
-
line1:
|
|
830
|
-
line2:
|
|
831
|
-
postcode:
|
|
832
|
-
city:
|
|
833
|
-
state:
|
|
834
|
-
country:
|
|
835
|
-
},
|
|
827
|
+
line1: r == null ? void 0 : r.line1,
|
|
828
|
+
line2: r == null ? void 0 : r.line2,
|
|
829
|
+
postcode: r == null ? void 0 : r.postcode,
|
|
830
|
+
city: r == null ? void 0 : r.city,
|
|
831
|
+
state: r == null ? void 0 : r.state,
|
|
832
|
+
country: r == null ? void 0 : r.country
|
|
833
|
+
}, N = {
|
|
836
834
|
name: t.supplier.name,
|
|
837
835
|
phoneNumber: t.supplier.phoneNumber,
|
|
838
836
|
registrationNumber: t.supplier.registrationNumber,
|
|
@@ -842,11 +840,11 @@ function pr(d) {
|
|
|
842
840
|
city: (K = t.supplier.address) == null ? void 0 : K.city,
|
|
843
841
|
state: (ve = t.supplier.address) == null ? void 0 : ve.state,
|
|
844
842
|
country: (P = t.supplier.address) == null ? void 0 : P.country
|
|
845
|
-
},
|
|
843
|
+
}, R = cs(t), F = t.items.map((x) => {
|
|
846
844
|
const { sku: w, measurement: A } = x, G = $e(
|
|
847
845
|
us(x.sku, t.deliveryOrder || []),
|
|
848
846
|
!1
|
|
849
|
-
), X =
|
|
847
|
+
), X = R(x);
|
|
850
848
|
return {
|
|
851
849
|
code: w.code,
|
|
852
850
|
description: w.name,
|
|
@@ -858,7 +856,7 @@ function pr(d) {
|
|
|
858
856
|
})}` : void 0
|
|
859
857
|
};
|
|
860
858
|
}), _ = t.deliveryOrder.map((x) => ({
|
|
861
|
-
createdAt:
|
|
859
|
+
createdAt: Pt(new Date(x.createdAt)),
|
|
862
860
|
ref: x.deliveryOrderNumber,
|
|
863
861
|
remark: x.remark || "",
|
|
864
862
|
items: x.received.map((w) => {
|
|
@@ -879,7 +877,7 @@ function pr(d) {
|
|
|
879
877
|
let E = "Inventory Receive Note";
|
|
880
878
|
if (t.supplier.internal ? (E = "Inventory Transfer Note", B.includes((n == null ? void 0 : n._id) || "") && (E = "Stock Request")) : E = "Purchase Order", u) {
|
|
881
879
|
const x = u.from.dbName;
|
|
882
|
-
|
|
880
|
+
s.dbName === x || (E = "Inventory Receive Note");
|
|
883
881
|
}
|
|
884
882
|
const se = {
|
|
885
883
|
title: E,
|
|
@@ -890,7 +888,7 @@ function pr(d) {
|
|
|
890
888
|
ref: t.ref || "",
|
|
891
889
|
remark: t.remark || "",
|
|
892
890
|
buyer: f,
|
|
893
|
-
supplier:
|
|
891
|
+
supplier: N,
|
|
894
892
|
items: F,
|
|
895
893
|
status: t.status,
|
|
896
894
|
deliveryOrders: _
|
|
@@ -961,42 +959,42 @@ const Ke = {
|
|
|
961
959
|
value: z.enum.returnStock
|
|
962
960
|
}
|
|
963
961
|
};
|
|
964
|
-
function
|
|
965
|
-
const
|
|
962
|
+
function gs() {
|
|
963
|
+
const c = Je();
|
|
966
964
|
return {
|
|
967
965
|
ableToMarkReceived(t) {
|
|
968
|
-
if (!t || t.status !==
|
|
966
|
+
if (!t || t.status !== be.enum.RECEIVING || c.useOperatePurchaseOrderV2) return !1;
|
|
969
967
|
const n = ze().currentLocationDBName;
|
|
970
968
|
return `${t.supplier.internal}_${t.supplier._id}` !== n;
|
|
971
969
|
},
|
|
972
970
|
ableToMarkApproved(t) {
|
|
973
|
-
return !(!t || (t == null ? void 0 : t.status) !==
|
|
971
|
+
return !(!t || (t == null ? void 0 : t.status) !== be.enum.REQUESTING);
|
|
974
972
|
},
|
|
975
|
-
ableToCreateFulfillment(t,
|
|
976
|
-
var u,
|
|
977
|
-
if (!
|
|
973
|
+
ableToCreateFulfillment(t, s) {
|
|
974
|
+
var u, d;
|
|
975
|
+
if (!c.acceptRequireFulfillment || !t || !s || t.status !== be.enum.PROCESSING || !s.processedAt)
|
|
978
976
|
return !1;
|
|
979
|
-
const n = (u =
|
|
977
|
+
const n = (u = s == null ? void 0 : s.from) == null ? void 0 : u.dbName, m = (d = s == null ? void 0 : s.to) == null ? void 0 : d.dbName;
|
|
980
978
|
return !(n.startsWith("restaurant_") && m.startsWith("restaurant_"));
|
|
981
979
|
}
|
|
982
980
|
};
|
|
983
981
|
}
|
|
984
|
-
function
|
|
985
|
-
const
|
|
982
|
+
function bs() {
|
|
983
|
+
const c = H(() => [
|
|
986
984
|
{
|
|
987
|
-
action:
|
|
988
|
-
subject:
|
|
985
|
+
action: Qt.Action.manage,
|
|
986
|
+
subject: Qt.Subject.Business.inventory_orderDraftApproval
|
|
989
987
|
}
|
|
990
|
-
]), { hasPermission: t } =
|
|
988
|
+
]), { hasPermission: t } = nr(c);
|
|
991
989
|
return {
|
|
992
990
|
hasOrderDraftPermission: Cs(t)
|
|
993
991
|
};
|
|
994
992
|
}
|
|
995
|
-
function
|
|
996
|
-
const m = ze(), u = _t(),
|
|
997
|
-
() =>
|
|
993
|
+
function hi(c, t, s, n) {
|
|
994
|
+
const m = ze(), u = _t(), d = gt(), r = gs(), { t: a } = ht(), O = Ze(), { hasOrderDraftPermission: f } = bs(), N = Je(), R = H(
|
|
995
|
+
() => N.enablePrintTemplate ? [qe[Ne.PrintCustom]] : []
|
|
998
996
|
), F = H(
|
|
999
|
-
() =>
|
|
997
|
+
() => N.enablePurchaseOrderEmail ? [qe[Ne.Email]] : []
|
|
1000
998
|
);
|
|
1001
999
|
function _(K) {
|
|
1002
1000
|
const ve = B(K), P = n == null ? void 0 : n.excludeRowActions;
|
|
@@ -1008,51 +1006,51 @@ function gi(d, t, r, n) {
|
|
|
1008
1006
|
switch (K.status) {
|
|
1009
1007
|
case "DRAFT":
|
|
1010
1008
|
return [
|
|
1011
|
-
qe[
|
|
1012
|
-
qe[
|
|
1009
|
+
qe[Ne.Update],
|
|
1010
|
+
qe[Ne.Details],
|
|
1013
1011
|
K.supplier.internal === "restaurant" || K.supplier.internal === "warehouse" ? Ke[z.enum.submitRequest] : Ke[z.enum.confirmDraft],
|
|
1014
1012
|
Ke[z.enum.cancelDraft]
|
|
1015
1013
|
];
|
|
1016
1014
|
case "RECEIVING":
|
|
1017
1015
|
return [
|
|
1018
|
-
...
|
|
1019
|
-
qe[
|
|
1020
|
-
qe[
|
|
1021
|
-
...
|
|
1016
|
+
...r.ableToMarkReceived(K) ? [Ke[z.enum.completeReceive]] : [],
|
|
1017
|
+
qe[Ne.Details],
|
|
1018
|
+
qe[Ne.Print],
|
|
1019
|
+
...R.value,
|
|
1022
1020
|
...F.value
|
|
1023
1021
|
];
|
|
1024
1022
|
case "PENDING_APPROVAL": {
|
|
1025
|
-
const P = [qe[
|
|
1023
|
+
const P = [qe[Ne.Details]];
|
|
1026
1024
|
return f.value && P.push(
|
|
1027
|
-
qe[
|
|
1025
|
+
qe[Ne.Update],
|
|
1028
1026
|
Ke[z.enum.approveDraft],
|
|
1029
1027
|
Ke[z.enum.rejectDraft]
|
|
1030
1028
|
), P;
|
|
1031
1029
|
}
|
|
1032
1030
|
case "REQUESTING":
|
|
1033
|
-
return
|
|
1034
|
-
qe[
|
|
1035
|
-
qe[
|
|
1036
|
-
...
|
|
1031
|
+
return c === "receive/request" ? [
|
|
1032
|
+
qe[Ne.Details],
|
|
1033
|
+
qe[Ne.Print],
|
|
1034
|
+
...R.value
|
|
1037
1035
|
] : [
|
|
1038
1036
|
Ke[z.enum.approveRequest],
|
|
1039
1037
|
Ke[z.enum.rejectRequest],
|
|
1040
|
-
qe[
|
|
1038
|
+
qe[Ne.Details]
|
|
1041
1039
|
// DefaultRowActions[RowActionEnum.Print]
|
|
1042
1040
|
];
|
|
1043
1041
|
case "PROCESSING":
|
|
1044
1042
|
return [
|
|
1045
|
-
qe[
|
|
1046
|
-
qe[
|
|
1047
|
-
...
|
|
1043
|
+
qe[Ne.Details],
|
|
1044
|
+
qe[Ne.Print],
|
|
1045
|
+
...R.value
|
|
1048
1046
|
];
|
|
1049
1047
|
case "COMPLETE":
|
|
1050
1048
|
case "CANCEL":
|
|
1051
1049
|
default:
|
|
1052
1050
|
return [
|
|
1053
|
-
qe[
|
|
1054
|
-
qe[
|
|
1055
|
-
...
|
|
1051
|
+
qe[Ne.Details],
|
|
1052
|
+
qe[Ne.Print],
|
|
1053
|
+
...R.value
|
|
1056
1054
|
];
|
|
1057
1055
|
}
|
|
1058
1056
|
}
|
|
@@ -1060,56 +1058,56 @@ function gi(d, t, r, n) {
|
|
|
1060
1058
|
return Object.values(z.enum).includes(K);
|
|
1061
1059
|
}
|
|
1062
1060
|
async function te(K, ve, P) {
|
|
1063
|
-
var A, G, X, le,
|
|
1061
|
+
var A, G, X, le, g, D, ie, ee, L;
|
|
1064
1062
|
let x;
|
|
1065
1063
|
try {
|
|
1066
1064
|
x = t.resolvePO ? await t.resolvePO(ve) : ve;
|
|
1067
|
-
} catch (
|
|
1068
|
-
console.error("Failed to load full purchase order for action",
|
|
1065
|
+
} catch (b) {
|
|
1066
|
+
console.error("Failed to load full purchase order for action", b), O.open({
|
|
1069
1067
|
title: a("inventory.common.somethingWentWrong"),
|
|
1070
|
-
message: (
|
|
1068
|
+
message: (b == null ? void 0 : b.message) || a("inventory.common.tryAgain"),
|
|
1071
1069
|
type: "error"
|
|
1072
1070
|
});
|
|
1073
1071
|
return;
|
|
1074
1072
|
}
|
|
1075
1073
|
const w = wt(x);
|
|
1076
1074
|
if (!(n != null && n.onCustomAction && await n.onCustomAction(K, w))) {
|
|
1077
|
-
if (K ===
|
|
1078
|
-
let
|
|
1079
|
-
if (
|
|
1075
|
+
if (K === Ne.Print || K === Ne.PrintCustom) {
|
|
1076
|
+
let b = w;
|
|
1077
|
+
if (b.items == null && (n != null && n.fetchFullPo)) {
|
|
1080
1078
|
const o = await n.fetchFullPo(w);
|
|
1081
1079
|
if (o == null) return;
|
|
1082
|
-
|
|
1080
|
+
b = wt(o);
|
|
1083
1081
|
}
|
|
1084
1082
|
const j = (A = n == null ? void 0 : n.resolveLocation) == null ? void 0 : A.call(n, w), me = { ...(P == null ? void 0 : P.toInventoryLocation) ?? j ?? m.currentLocation };
|
|
1085
1083
|
if (me.type === "restaurant") {
|
|
1086
1084
|
const o = m.locationRestaurantFromCore(me.doc._id);
|
|
1087
1085
|
o !== null && (me.doc = o);
|
|
1088
1086
|
}
|
|
1089
|
-
((G = P == null ? void 0 : P.netSuite) != null && G.refNo || (X =
|
|
1087
|
+
((G = P == null ? void 0 : P.netSuite) != null && G.refNo || (X = b.netSuite) != null && X.refNo) && (b.ref = [((le = P == null ? void 0 : P.netSuite) == null ? void 0 : le.refNo) || ((g = b.netSuite) == null ? void 0 : g.refNo)].filter((o) => o).join(" "));
|
|
1090
1088
|
const ke = P ?? ((D = n == null ? void 0 : n.resolvePurchaseRequest) == null ? void 0 : D.call(n, w)), we = {
|
|
1091
|
-
po:
|
|
1089
|
+
po: b,
|
|
1092
1090
|
currentLocation: me,
|
|
1093
|
-
business:
|
|
1094
|
-
fulfilling:
|
|
1091
|
+
business: d.currentBusiness.value,
|
|
1092
|
+
fulfilling: c === "approval",
|
|
1095
1093
|
por: ke
|
|
1096
1094
|
};
|
|
1097
|
-
if (K ===
|
|
1095
|
+
if (K === Ne.PrintCustom) {
|
|
1098
1096
|
const o = ds(we);
|
|
1099
1097
|
o && (ae.value = o.html, Se.value = o.templateName, De.value = o.isDefault, Oe.value = !0);
|
|
1100
1098
|
} else
|
|
1101
|
-
|
|
1099
|
+
mr(we);
|
|
1102
1100
|
return;
|
|
1103
1101
|
}
|
|
1104
|
-
if (K ===
|
|
1102
|
+
if (K === Ne.Details) {
|
|
1105
1103
|
t.promptShowTransferDetails(w, P);
|
|
1106
1104
|
return;
|
|
1107
1105
|
}
|
|
1108
|
-
if (K ===
|
|
1106
|
+
if (K === Ne.Update) {
|
|
1109
1107
|
(ie = t.promptUpdateTransferDialog) == null || ie.call(t, w);
|
|
1110
1108
|
return;
|
|
1111
1109
|
}
|
|
1112
|
-
if (K ===
|
|
1110
|
+
if (K === Ne.Email) {
|
|
1113
1111
|
(ee = t.promptEmailDialog) == null || ee.call(t, w);
|
|
1114
1112
|
return;
|
|
1115
1113
|
}
|
|
@@ -1153,15 +1151,15 @@ function gi(d, t, r, n) {
|
|
|
1153
1151
|
header: () => a("inventory.transfer.table.noOfItems"),
|
|
1154
1152
|
cell: (P) => {
|
|
1155
1153
|
const x = P.row.original.version || "1", w = P.getValue();
|
|
1156
|
-
return
|
|
1154
|
+
return oe("div", { class: "flex items-center gap-2" }, [
|
|
1157
1155
|
w,
|
|
1158
|
-
x !== "1" ?
|
|
1156
|
+
x !== "1" ? oe(
|
|
1159
1157
|
"div",
|
|
1160
1158
|
{ class: "py-3" },
|
|
1161
|
-
|
|
1159
|
+
oe(
|
|
1162
1160
|
tt,
|
|
1163
1161
|
{},
|
|
1164
|
-
() =>
|
|
1162
|
+
() => oe(
|
|
1165
1163
|
"div",
|
|
1166
1164
|
{
|
|
1167
1165
|
class: ["fm-status-badge", "fm-status-badge-draft"].join(" ")
|
|
@@ -1183,10 +1181,10 @@ function gi(d, t, r, n) {
|
|
|
1183
1181
|
enableSorting: !1,
|
|
1184
1182
|
size: "auto"
|
|
1185
1183
|
},
|
|
1186
|
-
...(ve =
|
|
1184
|
+
...(ve = d.sessionUser.value) != null && ve.role.isAdmin ? [
|
|
1187
1185
|
{
|
|
1188
1186
|
id: "statusForAdmin",
|
|
1189
|
-
header: () =>
|
|
1187
|
+
header: () => oe(tt, {}, () => `${a("inventory.transfer.table.status")}`),
|
|
1190
1188
|
cell(P) {
|
|
1191
1189
|
return P.row.original.status;
|
|
1192
1190
|
},
|
|
@@ -1199,32 +1197,32 @@ function gi(d, t, r, n) {
|
|
|
1199
1197
|
header: () => a("inventory.transfer.table.status"),
|
|
1200
1198
|
cell(P) {
|
|
1201
1199
|
const x = P.getValue(), w = P.row.original, { partial: A, over: G } = w.items == null ? { partial: !!w.partialReceived, over: !!w.overReceived } : $t(vt(w)), X = Ct(x ?? "", A, G);
|
|
1202
|
-
let le = a(`inventory.transfer.status.${X}`),
|
|
1203
|
-
X ===
|
|
1200
|
+
let le = a(`inventory.transfer.status.${X}`), g = `${x ?? ""}`.toLocaleLowerCase("en-us");
|
|
1201
|
+
X === be.enum.CLOSE && (le = `${a(`inventory.transfer.status.${be.enum.COMPLETE}`)}`), X === "PARTIAL_RECEIVED" && g === be.enum.PROCESSING.toLocaleLowerCase("en-us") && (g = be.enum.RECEIVING.toLocaleLowerCase("en-us"));
|
|
1204
1202
|
let D = null;
|
|
1205
|
-
const ie =
|
|
1203
|
+
const ie = s.value.find((ee) => ee.ref === P.row.original._id);
|
|
1206
1204
|
if (ie != null && ie.milestones && ie.milestones.length > 0) {
|
|
1207
1205
|
const ee = ie.milestones[ie.milestones.length - 1];
|
|
1208
1206
|
if (ee.estimatedTime) {
|
|
1209
|
-
const L = new Date(ee.estimatedTime),
|
|
1210
|
-
D = `${L.toLocaleString("en-US", { month: "short" })} ${
|
|
1207
|
+
const L = new Date(ee.estimatedTime), b = L.getDate().toString().padStart(2, "0");
|
|
1208
|
+
D = `${L.toLocaleString("en-US", { month: "short" })} ${b}`;
|
|
1211
1209
|
}
|
|
1212
1210
|
}
|
|
1213
|
-
return
|
|
1211
|
+
return oe(
|
|
1214
1212
|
"div",
|
|
1215
1213
|
{
|
|
1216
1214
|
class: "flex"
|
|
1217
1215
|
},
|
|
1218
1216
|
[
|
|
1219
|
-
|
|
1217
|
+
oe(
|
|
1220
1218
|
"div",
|
|
1221
1219
|
{ class: "flex items-center" },
|
|
1222
|
-
|
|
1220
|
+
oe(
|
|
1223
1221
|
"div",
|
|
1224
1222
|
{
|
|
1225
1223
|
class: [
|
|
1226
1224
|
"fm-status-badge",
|
|
1227
|
-
`fm-status-badge-${
|
|
1225
|
+
`fm-status-badge-${g}`,
|
|
1228
1226
|
G && "fm-status-badge-error"
|
|
1229
1227
|
].filter(Boolean).join(" ")
|
|
1230
1228
|
},
|
|
@@ -1232,18 +1230,18 @@ function gi(d, t, r, n) {
|
|
|
1232
1230
|
)
|
|
1233
1231
|
),
|
|
1234
1232
|
...D ? [
|
|
1235
|
-
|
|
1233
|
+
oe(
|
|
1236
1234
|
"div",
|
|
1237
1235
|
{
|
|
1238
1236
|
class: "flex items-center gap-1 ml-2"
|
|
1239
1237
|
},
|
|
1240
1238
|
[
|
|
1241
|
-
|
|
1239
|
+
oe(pt.FmIcon, {
|
|
1242
1240
|
name: "local_shipping",
|
|
1243
1241
|
size: "md",
|
|
1244
1242
|
color: "neutral-gray-400"
|
|
1245
1243
|
}),
|
|
1246
|
-
|
|
1244
|
+
oe(
|
|
1247
1245
|
"span",
|
|
1248
1246
|
{ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
|
|
1249
1247
|
D
|
|
@@ -1265,7 +1263,7 @@ function gi(d, t, r, n) {
|
|
|
1265
1263
|
..._(x),
|
|
1266
1264
|
...((A = n == null ? void 0 : n.appendRowActions) == null ? void 0 : A.call(n, x)) ?? []
|
|
1267
1265
|
];
|
|
1268
|
-
return
|
|
1266
|
+
return Gt(w, (G) => te(G, x));
|
|
1269
1267
|
},
|
|
1270
1268
|
enableSorting: !1,
|
|
1271
1269
|
size: 40,
|
|
@@ -1323,20 +1321,20 @@ function gi(d, t, r, n) {
|
|
|
1323
1321
|
return (le = X.netSuite) == null ? void 0 : le.id;
|
|
1324
1322
|
});
|
|
1325
1323
|
return w != null && w.length ? w.map((X) => {
|
|
1326
|
-
var le,
|
|
1327
|
-
return `${((le = X.netSuite) == null ? void 0 : le.refNo) ?? "N/A"} (${((
|
|
1324
|
+
var le, g;
|
|
1325
|
+
return `${((le = X.netSuite) == null ? void 0 : le.refNo) ?? "N/A"} (${((g = X.netSuite) == null ? void 0 : g.id) ?? "-"})`;
|
|
1328
1326
|
}).join(", ") : (G = x.netSuite) != null && G.id ? `${x.netSuite.refNo} (${x.netSuite.id})` : "N/A";
|
|
1329
1327
|
},
|
|
1330
1328
|
header: () => "Netsuite ref no.",
|
|
1331
1329
|
cell(x) {
|
|
1332
1330
|
var G, X;
|
|
1333
1331
|
const w = x.row.original, A = (G = w.deliveryOrder) == null ? void 0 : G.filter((le) => {
|
|
1334
|
-
var
|
|
1335
|
-
return (
|
|
1332
|
+
var g;
|
|
1333
|
+
return (g = le.netSuite) == null ? void 0 : g.id;
|
|
1336
1334
|
});
|
|
1337
1335
|
return A != null && A.length ? A.map((le) => {
|
|
1338
|
-
var
|
|
1339
|
-
return `${((
|
|
1336
|
+
var g, D;
|
|
1337
|
+
return `${((g = le.netSuite) == null ? void 0 : g.refNo) ?? "N/A"} (${((D = le.netSuite) == null ? void 0 : D.id) ?? "-"})`;
|
|
1340
1338
|
}).join(", ") : (X = w.netSuite) != null && X.id ? `${w.netSuite.refNo} (${w.netSuite.id})` : "N/A";
|
|
1341
1339
|
},
|
|
1342
1340
|
enableSorting: !1,
|
|
@@ -1386,10 +1384,10 @@ function gi(d, t, r, n) {
|
|
|
1386
1384
|
enableSorting: !1,
|
|
1387
1385
|
size: "auto"
|
|
1388
1386
|
},
|
|
1389
|
-
...(ve =
|
|
1387
|
+
...(ve = d.sessionUser.value) != null && ve.role.isAdmin ? [
|
|
1390
1388
|
{
|
|
1391
1389
|
id: "statusForAdmin",
|
|
1392
|
-
header: () =>
|
|
1390
|
+
header: () => oe(tt, {}, () => `${a("inventory.transfer.table.status")}`),
|
|
1393
1391
|
cell(P) {
|
|
1394
1392
|
return P.row.original.status;
|
|
1395
1393
|
},
|
|
@@ -1403,18 +1401,18 @@ function gi(d, t, r, n) {
|
|
|
1403
1401
|
cell(P) {
|
|
1404
1402
|
const x = P.row.original, w = P.getValue();
|
|
1405
1403
|
if (!x.purchaseOrder)
|
|
1406
|
-
return
|
|
1404
|
+
return oe(pt.FmChip, {
|
|
1407
1405
|
label: "N/A",
|
|
1408
1406
|
compact: !0
|
|
1409
1407
|
});
|
|
1410
1408
|
const A = vt(x.purchaseOrder), { partial: G, over: X } = $t(A), le = Ct(w ?? "", G, X);
|
|
1411
|
-
let
|
|
1412
|
-
return le ===
|
|
1409
|
+
let g = a(`inventory.transfer.status.${le}`), D = `${w ?? ""}`.toLocaleLowerCase("en-us");
|
|
1410
|
+
return le === be.enum.CLOSE && (g = `${a(`inventory.transfer.status.${be.enum.COMPLETE}`)}`), le === "PARTIAL_RECEIVED" && D === be.enum.PROCESSING.toLocaleLowerCase("en-us") && (D = be.enum.RECEIVING.toLocaleLowerCase("en-us")), x.rejectedAt && (g = a("inventory.transfer.status.REJECT"), D = be.enum.REJECT.toLocaleLowerCase("en-us")), oe(
|
|
1413
1411
|
"div",
|
|
1414
1412
|
{
|
|
1415
1413
|
class: "flex"
|
|
1416
1414
|
},
|
|
1417
|
-
|
|
1415
|
+
oe(
|
|
1418
1416
|
"div",
|
|
1419
1417
|
{
|
|
1420
1418
|
class: [
|
|
@@ -1423,7 +1421,7 @@ function gi(d, t, r, n) {
|
|
|
1423
1421
|
X && "fm-status-badge-error"
|
|
1424
1422
|
].filter(Boolean).join(" ")
|
|
1425
1423
|
},
|
|
1426
|
-
`${
|
|
1424
|
+
`${g}`
|
|
1427
1425
|
)
|
|
1428
1426
|
);
|
|
1429
1427
|
},
|
|
@@ -1432,11 +1430,11 @@ function gi(d, t, r, n) {
|
|
|
1432
1430
|
{
|
|
1433
1431
|
id: "action",
|
|
1434
1432
|
cell(P) {
|
|
1435
|
-
const x = P.row.original, A = (x.purchaseOrder ? _(x.purchaseOrder) : []).map((G) => G.value ===
|
|
1433
|
+
const x = P.row.original, A = (x.purchaseOrder ? _(x.purchaseOrder) : []).map((G) => G.value === Ne.Print ? {
|
|
1436
1434
|
...G,
|
|
1437
1435
|
translationKey: "inventory.transfer.receiveRequest.details.printDeliveryOrder"
|
|
1438
1436
|
} : G);
|
|
1439
|
-
return
|
|
1437
|
+
return Gt(
|
|
1440
1438
|
A,
|
|
1441
1439
|
(G) => x.purchaseOrder ? te(G, x.purchaseOrder, x) : void 0
|
|
1442
1440
|
);
|
|
@@ -1493,24 +1491,24 @@ function gi(d, t, r, n) {
|
|
|
1493
1491
|
accessorFn: (x) => {
|
|
1494
1492
|
var A, G, X;
|
|
1495
1493
|
const w = (G = (A = x.purchaseOrder) == null ? void 0 : A.deliveryOrder) == null ? void 0 : G.filter((le) => {
|
|
1496
|
-
var
|
|
1497
|
-
return (
|
|
1494
|
+
var g;
|
|
1495
|
+
return (g = le.netSuite) == null ? void 0 : g.id;
|
|
1498
1496
|
});
|
|
1499
1497
|
return w != null && w.length ? w.map((le) => {
|
|
1500
|
-
var
|
|
1501
|
-
return `${((
|
|
1498
|
+
var g, D;
|
|
1499
|
+
return `${((g = le.netSuite) == null ? void 0 : g.refNo) ?? "N/A"} (${((D = le.netSuite) == null ? void 0 : D.id) ?? "-"})`;
|
|
1502
1500
|
}).join(", ") : (X = x.netSuite) != null && X.id ? `${x.netSuite.refNo} (${x.netSuite.id})` : "N/A";
|
|
1503
1501
|
},
|
|
1504
1502
|
header: () => "Netsuite ref no.",
|
|
1505
1503
|
cell(x) {
|
|
1506
1504
|
var G, X, le;
|
|
1507
|
-
const w = x.row.original, A = (X = (G = w.purchaseOrder) == null ? void 0 : G.deliveryOrder) == null ? void 0 : X.filter((
|
|
1505
|
+
const w = x.row.original, A = (X = (G = w.purchaseOrder) == null ? void 0 : G.deliveryOrder) == null ? void 0 : X.filter((g) => {
|
|
1508
1506
|
var D;
|
|
1509
|
-
return (D =
|
|
1507
|
+
return (D = g.netSuite) == null ? void 0 : D.id;
|
|
1510
1508
|
});
|
|
1511
|
-
return A != null && A.length ? A.map((
|
|
1509
|
+
return A != null && A.length ? A.map((g) => {
|
|
1512
1510
|
var D, ie;
|
|
1513
|
-
return `${((D =
|
|
1511
|
+
return `${((D = g.netSuite) == null ? void 0 : D.refNo) ?? "N/A"} (${((ie = g.netSuite) == null ? void 0 : ie.id) ?? "-"})`;
|
|
1514
1512
|
}).join(", ") : (le = w.netSuite) != null && le.id ? `${w.netSuite.refNo} (${w.netSuite.id})` : "N/A";
|
|
1515
1513
|
},
|
|
1516
1514
|
enableSorting: !1,
|
|
@@ -1525,7 +1523,7 @@ function gi(d, t, r, n) {
|
|
|
1525
1523
|
}
|
|
1526
1524
|
return K;
|
|
1527
1525
|
}
|
|
1528
|
-
const de = H(() =>
|
|
1526
|
+
const de = H(() => c === "receive/request" ? se() : Q()), Oe = re(!1), ae = re(""), Se = re(""), De = re(!1);
|
|
1529
1527
|
return {
|
|
1530
1528
|
columnDefs: de,
|
|
1531
1529
|
showCustomPrintDialog: Oe,
|
|
@@ -1534,20 +1532,20 @@ function gi(d, t, r, n) {
|
|
|
1534
1532
|
customPrintIsDefault: De
|
|
1535
1533
|
};
|
|
1536
1534
|
}
|
|
1537
|
-
const
|
|
1535
|
+
const pr = { class: "flex flex-col gap-4 border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, fr = { class: "flex items-center justify-between" }, vr = {
|
|
1538
1536
|
key: 0,
|
|
1539
1537
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary"
|
|
1540
|
-
},
|
|
1538
|
+
}, yr = { class: "flex justify-between items-start py-1 gap-4" }, hr = { class: "flex-1 min-w-0 flex flex-col gap-2" }, gr = { class: "flex flex-col gap-2 items-end w-52 shrink-0" }, br = {
|
|
1541
1539
|
key: 0,
|
|
1542
1540
|
class: "border-b border-fm-color-stroke-secondary"
|
|
1543
|
-
},
|
|
1541
|
+
}, It = /* @__PURE__ */ Ve({
|
|
1544
1542
|
__name: "PriceAdjustmentEditor",
|
|
1545
1543
|
props: {
|
|
1546
1544
|
controller: {},
|
|
1547
1545
|
state: {}
|
|
1548
1546
|
},
|
|
1549
|
-
setup(
|
|
1550
|
-
const t =
|
|
1547
|
+
setup(c) {
|
|
1548
|
+
const t = c, s = H(() => t.state.adjustments ?? []);
|
|
1551
1549
|
function n(a) {
|
|
1552
1550
|
return +$e(a.dinero);
|
|
1553
1551
|
}
|
|
@@ -1557,16 +1555,16 @@ const fr = { class: "flex flex-col gap-4 border border-fm-color-neutral-gray-200
|
|
|
1557
1555
|
function u(a, O) {
|
|
1558
1556
|
t.controller.updateAdjustment(a, O);
|
|
1559
1557
|
}
|
|
1560
|
-
function
|
|
1558
|
+
function d(a, O) {
|
|
1561
1559
|
t.controller.updateAdjustment(a, null, O);
|
|
1562
1560
|
}
|
|
1563
|
-
function
|
|
1561
|
+
function r(a) {
|
|
1564
1562
|
t.controller.removeAdjustment(a);
|
|
1565
1563
|
}
|
|
1566
1564
|
return (a, O) => {
|
|
1567
|
-
const f =
|
|
1568
|
-
return i(), v("div",
|
|
1569
|
-
e("div",
|
|
1565
|
+
const f = ne("FmButton"), N = ne("FmTextField"), R = ne("FmStepperField");
|
|
1566
|
+
return i(), v("div", pr, [
|
|
1567
|
+
e("div", fr, [
|
|
1570
1568
|
O[0] || (O[0] = e("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-secondary" }, "Price adjustments", -1)),
|
|
1571
1569
|
T(f, {
|
|
1572
1570
|
variant: "tertiary",
|
|
@@ -1576,13 +1574,13 @@ const fr = { class: "flex flex-col gap-4 border border-fm-color-neutral-gray-200
|
|
|
1576
1574
|
onClick: m
|
|
1577
1575
|
})
|
|
1578
1576
|
]),
|
|
1579
|
-
|
|
1580
|
-
(i(!0), v(Ce, null, Te(
|
|
1577
|
+
s.value.length === 0 ? (i(), v("div", vr, " No price adjustments ")) : V("", !0),
|
|
1578
|
+
(i(!0), v(Ce, null, Te(s.value, (F, _) => (i(), v("div", {
|
|
1581
1579
|
key: F.id
|
|
1582
1580
|
}, [
|
|
1583
|
-
e("div",
|
|
1584
|
-
e("div",
|
|
1585
|
-
T(
|
|
1581
|
+
e("div", yr, [
|
|
1582
|
+
e("div", hr, [
|
|
1583
|
+
T(N, {
|
|
1586
1584
|
"model-value": F.name,
|
|
1587
1585
|
"onUpdate:modelValue": (B) => u(F.id, B),
|
|
1588
1586
|
label: "Name",
|
|
@@ -1591,9 +1589,9 @@ const fr = { class: "flex flex-col gap-4 border border-fm-color-neutral-gray-200
|
|
|
1591
1589
|
}, null, 8, ["model-value", "onUpdate:modelValue"])
|
|
1592
1590
|
]),
|
|
1593
1591
|
e("div", gr, [
|
|
1594
|
-
T(
|
|
1592
|
+
T(R, {
|
|
1595
1593
|
"model-value": n(F),
|
|
1596
|
-
"onUpdate:modelValue": (B) =>
|
|
1594
|
+
"onUpdate:modelValue": (B) => d(F.id, B),
|
|
1597
1595
|
label: "Amount (+/-)",
|
|
1598
1596
|
step: 0.01,
|
|
1599
1597
|
placeholder: "0.00",
|
|
@@ -1606,79 +1604,79 @@ const fr = { class: "flex flex-col gap-4 border border-fm-color-neutral-gray-200
|
|
|
1606
1604
|
"prepend-icon": "delete",
|
|
1607
1605
|
size: "md",
|
|
1608
1606
|
class: "mt-6",
|
|
1609
|
-
onClick: (B) =>
|
|
1607
|
+
onClick: (B) => r(F.id)
|
|
1610
1608
|
}, null, 8, ["onClick"])
|
|
1611
1609
|
]),
|
|
1612
|
-
_ <
|
|
1610
|
+
_ < s.value.length - 1 ? (i(), v("div", br)) : V("", !0)
|
|
1613
1611
|
]))), 128))
|
|
1614
1612
|
]);
|
|
1615
1613
|
};
|
|
1616
1614
|
}
|
|
1617
1615
|
});
|
|
1618
|
-
function
|
|
1616
|
+
function Tt(c) {
|
|
1619
1617
|
const t = dt(
|
|
1620
|
-
|
|
1621
|
-
currency:
|
|
1622
|
-
adjustments:
|
|
1618
|
+
Yt({
|
|
1619
|
+
currency: c.currency,
|
|
1620
|
+
adjustments: c.adjustments ?? []
|
|
1623
1621
|
})
|
|
1624
|
-
),
|
|
1625
|
-
function n(
|
|
1626
|
-
const
|
|
1627
|
-
|
|
1622
|
+
), s = dt(t.value.state());
|
|
1623
|
+
function n(d) {
|
|
1624
|
+
const r = () => {
|
|
1625
|
+
s.value = d.state();
|
|
1628
1626
|
};
|
|
1629
|
-
return
|
|
1627
|
+
return d.addListener(r), () => d.removeListener(r);
|
|
1630
1628
|
}
|
|
1631
1629
|
let m = n(t.value);
|
|
1632
|
-
function u(
|
|
1633
|
-
m(), t.value =
|
|
1634
|
-
currency:
|
|
1635
|
-
adjustments:
|
|
1636
|
-
}), m = n(t.value),
|
|
1630
|
+
function u(d) {
|
|
1631
|
+
m(), t.value = Yt({
|
|
1632
|
+
currency: c.currency,
|
|
1633
|
+
adjustments: d ?? []
|
|
1634
|
+
}), m = n(t.value), s.value = t.value.state();
|
|
1637
1635
|
}
|
|
1638
|
-
return rs(() => m()), { controller: t, state:
|
|
1636
|
+
return rs(() => m()), { controller: t, state: s, reset: u };
|
|
1639
1637
|
}
|
|
1640
|
-
const
|
|
1638
|
+
const _r = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Sr = { class: "flex flex-col gap-8" }, kr = { class: "flex w-full justify-end gap-16" }, Or = /* @__PURE__ */ Ve({
|
|
1641
1639
|
__name: "FulfillmentForm",
|
|
1642
1640
|
props: {
|
|
1643
1641
|
purchaseOrder: {},
|
|
1644
1642
|
confirm: { type: Function }
|
|
1645
1643
|
},
|
|
1646
1644
|
emits: ["update:show"],
|
|
1647
|
-
setup(
|
|
1648
|
-
const
|
|
1645
|
+
setup(c, { emit: t }) {
|
|
1646
|
+
const s = c, n = As({
|
|
1649
1647
|
id: "",
|
|
1650
1648
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1651
1649
|
items: []
|
|
1652
|
-
}), m =
|
|
1650
|
+
}), m = re(), u = t, d = (a) => a != null && a !== "";
|
|
1653
1651
|
os(() => {
|
|
1654
|
-
|
|
1652
|
+
s.purchaseOrder && (n.items = s.purchaseOrder.items.map((a) => ({
|
|
1655
1653
|
id: a.id,
|
|
1656
1654
|
sku: a.sku,
|
|
1657
1655
|
measurement: a.measurement,
|
|
1658
1656
|
amount: a.quantity ?? { amount: 1, precision: 0 }
|
|
1659
1657
|
})));
|
|
1660
1658
|
});
|
|
1661
|
-
const
|
|
1659
|
+
const r = H(() => n.items.length <= 10);
|
|
1662
1660
|
return (a, O) => {
|
|
1663
|
-
const f =
|
|
1664
|
-
return i(), he(
|
|
1661
|
+
const f = ne("FmTable"), N = ne("FmButton"), R = ne("FmForm");
|
|
1662
|
+
return i(), he(R, {
|
|
1665
1663
|
ref_key: "formRef",
|
|
1666
1664
|
ref: m,
|
|
1667
1665
|
class: "bg-white flex flex-col gap-32 rounded-3xl p-24 w-[800px]",
|
|
1668
1666
|
onValidationFailed: console.log,
|
|
1669
|
-
onValidationSuccess: O[1] || (O[1] = () =>
|
|
1667
|
+
onValidationSuccess: O[1] || (O[1] = () => s.confirm(n))
|
|
1670
1668
|
}, {
|
|
1671
1669
|
default: ce(() => [
|
|
1672
1670
|
O[2] || (O[2] = e("div", { class: "fm-typo-en-title-sm-600" }, "Confirm the transfer amount", -1)),
|
|
1673
|
-
e("div",
|
|
1674
|
-
e("div",
|
|
1671
|
+
e("div", _r, [
|
|
1672
|
+
e("div", Sr, [
|
|
1675
1673
|
T(f, {
|
|
1676
1674
|
"column-defs": [
|
|
1677
1675
|
{
|
|
1678
1676
|
header: "Code",
|
|
1679
1677
|
cell: (F) => {
|
|
1680
|
-
const _ =
|
|
1681
|
-
return
|
|
1678
|
+
const _ = s.purchaseOrder.items.find((B) => d(F.row.original.id) ? B.id === F.row.original.id : B.sku._id === F.row.original.sku._id);
|
|
1679
|
+
return oe(
|
|
1682
1680
|
h(pt).FmTooltip,
|
|
1683
1681
|
{
|
|
1684
1682
|
content: _.code,
|
|
@@ -1686,7 +1684,7 @@ const Sr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1686
1684
|
variant: "plain",
|
|
1687
1685
|
zIndex: 50
|
|
1688
1686
|
},
|
|
1689
|
-
|
|
1687
|
+
oe(
|
|
1690
1688
|
"span",
|
|
1691
1689
|
{
|
|
1692
1690
|
class: "flex-auto line-clamp-2 text-ellipsis break-all"
|
|
@@ -1699,8 +1697,8 @@ const Sr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1699
1697
|
{
|
|
1700
1698
|
header: "Name",
|
|
1701
1699
|
cell: (F) => {
|
|
1702
|
-
const _ =
|
|
1703
|
-
return
|
|
1700
|
+
const _ = s.purchaseOrder.items.find((B) => d(F.row.original.id) ? B.id === F.row.original.id : B.sku._id === F.row.original.sku._id);
|
|
1701
|
+
return oe(
|
|
1704
1702
|
h(pt).FmTooltip,
|
|
1705
1703
|
{
|
|
1706
1704
|
content: _.name,
|
|
@@ -1708,7 +1706,7 @@ const Sr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1708
1706
|
variant: "plain",
|
|
1709
1707
|
zIndex: 50
|
|
1710
1708
|
},
|
|
1711
|
-
|
|
1709
|
+
oe(
|
|
1712
1710
|
"span",
|
|
1713
1711
|
{
|
|
1714
1712
|
class: "flex-auto line-clamp-2 text-ellipsis break-all"
|
|
@@ -1721,11 +1719,11 @@ const Sr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1721
1719
|
{
|
|
1722
1720
|
header: "Amount",
|
|
1723
1721
|
cell: (F) => {
|
|
1724
|
-
const _ = F.row.original, B =
|
|
1722
|
+
const _ = F.row.original, B = s.purchaseOrder.items.find((te) => d(_.id) ? te.id === _.id : te.sku._id === _.sku._id), E = _.amount ?? {
|
|
1725
1723
|
amount: 1,
|
|
1726
1724
|
precision: 0
|
|
1727
1725
|
};
|
|
1728
|
-
return
|
|
1726
|
+
return oe(Gs, {
|
|
1729
1727
|
style: {
|
|
1730
1728
|
flex: "1 1 0%"
|
|
1731
1729
|
},
|
|
@@ -1733,11 +1731,11 @@ const Sr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1733
1731
|
amount: E,
|
|
1734
1732
|
measurement: _.measurement ?? null
|
|
1735
1733
|
},
|
|
1736
|
-
key:
|
|
1734
|
+
key: d(_.id) ? _.id : _.sku._id,
|
|
1737
1735
|
unit: _.sku.unit,
|
|
1738
1736
|
"onUpdate:modelValue": (te) => {
|
|
1739
1737
|
if (!te) return;
|
|
1740
|
-
const se = n.items.find((Q) =>
|
|
1738
|
+
const se = n.items.find((Q) => d(_.id) ? Q.id === _.id : Q.sku._id === _.sku._id);
|
|
1741
1739
|
se && (se.amount = te.amount);
|
|
1742
1740
|
},
|
|
1743
1741
|
disableUnit: !0,
|
|
@@ -1753,19 +1751,19 @@ const Sr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1753
1751
|
}
|
|
1754
1752
|
],
|
|
1755
1753
|
"row-data": n.items,
|
|
1756
|
-
"hide-footer":
|
|
1754
|
+
"hide-footer": r.value
|
|
1757
1755
|
}, null, 8, ["column-defs", "row-data", "hide-footer"])
|
|
1758
1756
|
])
|
|
1759
1757
|
]),
|
|
1760
|
-
e("div",
|
|
1761
|
-
T(
|
|
1758
|
+
e("div", kr, [
|
|
1759
|
+
T(N, {
|
|
1762
1760
|
class: "px-16",
|
|
1763
1761
|
label: "Confirm",
|
|
1764
1762
|
size: "md",
|
|
1765
1763
|
variant: "primary",
|
|
1766
1764
|
type: "submit"
|
|
1767
1765
|
}),
|
|
1768
|
-
T(
|
|
1766
|
+
T(N, {
|
|
1769
1767
|
class: "px-16",
|
|
1770
1768
|
label: "Cancel",
|
|
1771
1769
|
size: "md",
|
|
@@ -1778,7 +1776,32 @@ const Sr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1778
1776
|
}, 8, ["onValidationFailed"]);
|
|
1779
1777
|
};
|
|
1780
1778
|
}
|
|
1781
|
-
})
|
|
1779
|
+
});
|
|
1780
|
+
var Dt = /* @__PURE__ */ ((c) => (c.loading = "loading", c.error = "error", c.success = "success", c))(Dt || {});
|
|
1781
|
+
function xr(c) {
|
|
1782
|
+
const t = re({
|
|
1783
|
+
state: "loading"
|
|
1784
|
+
/* loading */
|
|
1785
|
+
}), s = async (n) => {
|
|
1786
|
+
const m = n || c;
|
|
1787
|
+
if (!m) {
|
|
1788
|
+
t.value = { state: "error", error: new Error("No promise task provided") };
|
|
1789
|
+
return;
|
|
1790
|
+
}
|
|
1791
|
+
t.value = {
|
|
1792
|
+
state: "loading"
|
|
1793
|
+
/* loading */
|
|
1794
|
+
};
|
|
1795
|
+
try {
|
|
1796
|
+
const u = await m();
|
|
1797
|
+
t.value = { state: "success", data: u };
|
|
1798
|
+
} catch (u) {
|
|
1799
|
+
t.value = { state: "error", error: u };
|
|
1800
|
+
}
|
|
1801
|
+
};
|
|
1802
|
+
return c && s(), { result: t, execute: s };
|
|
1803
|
+
}
|
|
1804
|
+
const nt = {
|
|
1782
1805
|
submitRequest: {
|
|
1783
1806
|
translationKey: "inventory.transfer.receiveRequest.actions.submitRequest",
|
|
1784
1807
|
color: "primary",
|
|
@@ -1850,22 +1873,22 @@ const Sr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1850
1873
|
isTransferBetweenOutlets: { type: Boolean },
|
|
1851
1874
|
scope: {}
|
|
1852
1875
|
},
|
|
1853
|
-
setup(
|
|
1854
|
-
const t =
|
|
1876
|
+
setup(c) {
|
|
1877
|
+
const t = c, s = _t(), n = Ze(), m = bt(), u = re(!1);
|
|
1855
1878
|
H(() => {
|
|
1856
|
-
var f,
|
|
1857
|
-
let
|
|
1858
|
-
|
|
1879
|
+
var f, N, R, F;
|
|
1880
|
+
let r = !0;
|
|
1881
|
+
s.isEnabled || (r = !1);
|
|
1859
1882
|
const a = t.purchaseOrder, O = t.poRequest;
|
|
1860
|
-
return a && ((f = a == null ? void 0 : a.supplier) != null && f.internal ? (!O && a.status ==
|
|
1883
|
+
return a && ((f = a == null ? void 0 : a.supplier) != null && f.internal ? (!O && a.status == be.enum.DRAFT && (r = !1), O && !((N = O == null ? void 0 : O.netSuite) != null && N.id) && (r = !1), t.isTransferBetweenOutlets && (r = !1)) : ((a == null ? void 0 : a.status) !== be.enum.REQUESTING && a.supplier.internal && (r = !1), !O && !((R = a == null ? void 0 : a.netSuite) != null && R.id) && (r = !1), !O && ((F = a == null ? void 0 : a.netSuite) != null && F.id) && (a == null ? void 0 : a.status) == be.enum.REQUESTING && (r = !1))), r;
|
|
1861
1884
|
});
|
|
1862
|
-
async function
|
|
1885
|
+
async function d() {
|
|
1863
1886
|
u.value || m.open({
|
|
1864
1887
|
title: "Sync with NetSuite",
|
|
1865
|
-
contentComponent:
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1888
|
+
contentComponent: oe("div", [
|
|
1889
|
+
oe("p", "Are you sure you want to sync now?"),
|
|
1890
|
+
oe("br"),
|
|
1891
|
+
oe(
|
|
1869
1892
|
"p",
|
|
1870
1893
|
{ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
1871
1894
|
"Please wait a moment before syncing manually to avoid unnecessary actions."
|
|
@@ -1878,14 +1901,14 @@ const Sr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1878
1901
|
},
|
|
1879
1902
|
secondaryActions: { text: "Not now", close: !0 }
|
|
1880
1903
|
}).onPrimary(async () => {
|
|
1881
|
-
var
|
|
1904
|
+
var r, a, O, f, N, R, F;
|
|
1882
1905
|
try {
|
|
1883
1906
|
u.value = !0;
|
|
1884
|
-
const _ = ((
|
|
1885
|
-
await
|
|
1907
|
+
const _ = ((r = t.purchaseOrder) == null ? void 0 : r._id) || ((a = t.poRequest) == null ? void 0 : a.purchaseOrderId) || "", B = (O = t.poRequest) == null ? void 0 : O.to.dbName;
|
|
1908
|
+
await s.syncPurchaseOrder({
|
|
1886
1909
|
purchaseOrderId: _,
|
|
1887
1910
|
locationId: t.scope === "approval" ? B : void 0,
|
|
1888
|
-
netsuiteId: ((
|
|
1911
|
+
netsuiteId: ((N = (f = t.purchaseOrder) == null ? void 0 : f.netSuite) == null ? void 0 : N.id) || ((F = (R = t.poRequest) == null ? void 0 : R.netSuite) == null ? void 0 : F.id)
|
|
1889
1912
|
}), n.open({
|
|
1890
1913
|
title: "Sync with NetSuite",
|
|
1891
1914
|
message: "Requested to sync with NetSuite. Please wait a moment.",
|
|
@@ -1900,15 +1923,15 @@ const Sr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1900
1923
|
}
|
|
1901
1924
|
});
|
|
1902
1925
|
}
|
|
1903
|
-
return (
|
|
1904
|
-
const O =
|
|
1926
|
+
return (r, a) => {
|
|
1927
|
+
const O = ne("FmButton");
|
|
1905
1928
|
return i(), v("div", wr, [
|
|
1906
1929
|
T(O, {
|
|
1907
1930
|
"prepend-icon": "sync",
|
|
1908
1931
|
variant: "secondary",
|
|
1909
1932
|
label: "Sync",
|
|
1910
1933
|
loading: u.value,
|
|
1911
|
-
onClick:
|
|
1934
|
+
onClick: d,
|
|
1912
1935
|
"text-color": "primary",
|
|
1913
1936
|
"bg-color": "transparent",
|
|
1914
1937
|
"border-color": "primary"
|
|
@@ -1919,10 +1942,10 @@ const Sr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1919
1942
|
}), Cr = {
|
|
1920
1943
|
key: 0,
|
|
1921
1944
|
class: "flex flex-col gap-8"
|
|
1922
|
-
}, Ar = { class: "flex flex-col gap-4" }, Dr = { class: "fm-typo-en-body-lg-600" },
|
|
1945
|
+
}, Ar = { class: "flex flex-col gap-4" }, Dr = { class: "fm-typo-en-body-lg-600" }, Nr = {
|
|
1923
1946
|
key: 0,
|
|
1924
1947
|
class: "flex flex-col gap-4"
|
|
1925
|
-
},
|
|
1948
|
+
}, Rr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pr = { class: "fm-typo-en-body-lg-600" }, Fr = { key: 0 }, Ir = { key: 1 }, Tr = {
|
|
1926
1949
|
key: 1,
|
|
1927
1950
|
class: "flex flex-col gap-4"
|
|
1928
1951
|
}, Er = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, qr = { class: "fm-typo-en-body-lg-600" }, Vr = { key: 0 }, Lr = { key: 1 }, jr = {
|
|
@@ -1941,8 +1964,8 @@ const Sr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1941
1964
|
isTransferBetweenOutlets: { type: Boolean },
|
|
1942
1965
|
scope: {}
|
|
1943
1966
|
},
|
|
1944
|
-
setup(
|
|
1945
|
-
const t =
|
|
1967
|
+
setup(c) {
|
|
1968
|
+
const t = c, s = _t(), n = Xe(), m = re(t.poRequest);
|
|
1946
1969
|
os(async () => {
|
|
1947
1970
|
var a;
|
|
1948
1971
|
if (!t.poRequest && ((a = t.purchaseOrder) != null && a._id)) {
|
|
@@ -1952,30 +1975,30 @@ const Sr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1952
1975
|
});
|
|
1953
1976
|
const u = H(
|
|
1954
1977
|
() => {
|
|
1955
|
-
var a, O, f,
|
|
1956
|
-
return
|
|
1957
|
-
((f = (O = (a = t.purchaseOrder) == null ? void 0 : a.netSuite) == null ? void 0 : O.subsidiary) == null ? void 0 : f.id) || ((F = (
|
|
1978
|
+
var a, O, f, N, R, F;
|
|
1979
|
+
return s.getSubsidiaryFullName(
|
|
1980
|
+
((f = (O = (a = t.purchaseOrder) == null ? void 0 : a.netSuite) == null ? void 0 : O.subsidiary) == null ? void 0 : f.id) || ((F = (R = (N = t.poRequest) == null ? void 0 : N.netSuite) == null ? void 0 : R.subsidiary) == null ? void 0 : F.id)
|
|
1958
1981
|
).fullName;
|
|
1959
1982
|
}
|
|
1960
|
-
),
|
|
1961
|
-
var a, O, f,
|
|
1962
|
-
return (f = (O = (a = t.purchaseOrder) == null ? void 0 : a.netSuite) == null ? void 0 : O.additionalInfo) != null && f.transactionnumber ? (F = (
|
|
1963
|
-
}),
|
|
1964
|
-
var a, O, f,
|
|
1965
|
-
return (O = (a = t.purchaseOrder) == null ? void 0 : a.deliveryFullfillment) != null && O.length && ((
|
|
1983
|
+
), d = H(() => {
|
|
1984
|
+
var a, O, f, N, R, F, _, B, E, te, se, Q;
|
|
1985
|
+
return (f = (O = (a = t.purchaseOrder) == null ? void 0 : a.netSuite) == null ? void 0 : O.additionalInfo) != null && f.transactionnumber ? (F = (R = (N = t.purchaseOrder) == null ? void 0 : N.netSuite) == null ? void 0 : R.additionalInfo) == null ? void 0 : F.transactionnumber : (E = (B = (_ = m.value) == null ? void 0 : _.netSuite) == null ? void 0 : B.additionalInfo) != null && E.transactionnumber ? (Q = (se = (te = m.value) == null ? void 0 : te.netSuite) == null ? void 0 : se.additionalInfo) == null ? void 0 : Q.transactionnumber : null;
|
|
1986
|
+
}), r = H(() => {
|
|
1987
|
+
var a, O, f, N, R, F;
|
|
1988
|
+
return (O = (a = t.purchaseOrder) == null ? void 0 : a.deliveryFullfillment) != null && O.length && ((N = (f = t.purchaseOrder) == null ? void 0 : f.deliveryFullfillment) == null ? void 0 : N.length) > 0 ? (F = (R = t.purchaseOrder) == null ? void 0 : R.deliveryFullfillment) == null ? void 0 : F.map((_) => {
|
|
1966
1989
|
var B;
|
|
1967
1990
|
return (B = _.netSuite) == null ? void 0 : B.refNo;
|
|
1968
1991
|
}).join(", ") : "N/A";
|
|
1969
1992
|
});
|
|
1970
1993
|
return (a, O) => {
|
|
1971
|
-
var f,
|
|
1972
|
-
return h(
|
|
1994
|
+
var f, N, R, F, _, B, E, te, se, Q, de, Oe, ae, Se, De, K;
|
|
1995
|
+
return h(s).isEnabled ? (i(), v("div", Cr, [
|
|
1973
1996
|
e("div", Ar, [
|
|
1974
1997
|
O[0] || (O[0] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "NetSuite subsidiary", -1)),
|
|
1975
1998
|
e("div", Dr, k(u.value || "N/A"), 1)
|
|
1976
1999
|
]),
|
|
1977
|
-
!a.isTransferBetweenOutlets && a.scope === h(At).RECEIVE_REQUEST ? (i(), v("div",
|
|
1978
|
-
e("div",
|
|
2000
|
+
!a.isTransferBetweenOutlets && a.scope === h(At).RECEIVE_REQUEST ? (i(), v("div", Nr, [
|
|
2001
|
+
e("div", Rr, " NetSuite " + k((N = (f = a.purchaseOrder) == null ? void 0 : f.netSuite) != null && N.recordType ? h(as)((F = (R = a.purchaseOrder) == null ? void 0 : R.netSuite) == null ? void 0 : F.recordType) : a.transferType === h(at).enum.purchase ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
|
|
1979
2002
|
e("div", Pr, [
|
|
1980
2003
|
(B = (_ = a.purchaseOrder) == null ? void 0 : _.netSuite) != null && B.id ? (i(), v("span", Fr, k((te = (E = a.purchaseOrder) == null ? void 0 : E.netSuite) == null ? void 0 : te.refNo) + " (" + k((Q = (se = a.purchaseOrder) == null ? void 0 : se.netSuite) == null ? void 0 : Q.id) + ") ", 1)) : (i(), v("span", Ir, "N/A"))
|
|
1981
2004
|
])
|
|
@@ -1986,13 +2009,13 @@ const Sr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
1986
2009
|
(Oe = (de = m.value) == null ? void 0 : de.netSuite) != null && Oe.id ? (i(), v("span", Vr, k((Se = (ae = m.value) == null ? void 0 : ae.netSuite) == null ? void 0 : Se.refNo) + " (" + k((K = (De = m.value) == null ? void 0 : De.netSuite) == null ? void 0 : K.id) + ") ", 1)) : (i(), v("span", Lr, "N/A"))
|
|
1987
2010
|
])
|
|
1988
2011
|
])) : V("", !0),
|
|
1989
|
-
|
|
2012
|
+
d.value ? (i(), v("div", jr, [
|
|
1990
2013
|
O[1] || (O[1] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite Transaction Number ", -1)),
|
|
1991
|
-
e("div", Ur, k(
|
|
2014
|
+
e("div", Ur, k(d.value), 1)
|
|
1992
2015
|
])) : V("", !0),
|
|
1993
|
-
h(
|
|
2016
|
+
h(s).isEnabled && a.transferType === h(at).enum.transfer && !a.isTransferBetweenOutlets ? (i(), v("div", Mr, [
|
|
1994
2017
|
O[2] || (O[2] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite fulfillment IDs ", -1)),
|
|
1995
|
-
e("div", Br, k(
|
|
2018
|
+
e("div", Br, k(r.value), 1)
|
|
1996
2019
|
])) : V("", !0)
|
|
1997
2020
|
])) : V("", !0);
|
|
1998
2021
|
};
|
|
@@ -2003,22 +2026,22 @@ const Sr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2003
2026
|
netsuiteId: {},
|
|
2004
2027
|
purchaseOrderId: {}
|
|
2005
2028
|
},
|
|
2006
|
-
setup(
|
|
2007
|
-
const t =
|
|
2029
|
+
setup(c) {
|
|
2030
|
+
const t = Ze(), s = Ft();
|
|
2008
2031
|
async function n(m, u) {
|
|
2009
|
-
const
|
|
2010
|
-
if (m &&
|
|
2032
|
+
const d = [];
|
|
2033
|
+
if (m && d.push(`body.message:*${m}*`), u) {
|
|
2011
2034
|
const f = u.replace(/:/g, "\\:");
|
|
2012
|
-
|
|
2035
|
+
d.push(`${f}`);
|
|
2013
2036
|
}
|
|
2014
|
-
if (
|
|
2037
|
+
if (d.length === 0) {
|
|
2015
2038
|
t.open({
|
|
2016
2039
|
message: "Cannot open logs without valid filters.",
|
|
2017
2040
|
type: "error"
|
|
2018
2041
|
});
|
|
2019
2042
|
return;
|
|
2020
2043
|
}
|
|
2021
|
-
const a = `attributes.pod:netsuite* AND (${
|
|
2044
|
+
const a = `attributes.pod:netsuite* AND (${d.join(" OR ")})`, { url: O } = await s.getSyncLogs(a);
|
|
2022
2045
|
t.open(
|
|
2023
2046
|
{
|
|
2024
2047
|
message: "Opening NetSuite logs...",
|
|
@@ -2028,13 +2051,13 @@ const Sr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2028
2051
|
), await new Promise((f) => setTimeout(f, 800)), window.open(O, "_blank");
|
|
2029
2052
|
}
|
|
2030
2053
|
return (m, u) => {
|
|
2031
|
-
const
|
|
2054
|
+
const d = ne("FmButton");
|
|
2032
2055
|
return i(), v("div", Kr, [
|
|
2033
|
-
T(
|
|
2056
|
+
T(d, {
|
|
2034
2057
|
"prepend-icon": "history",
|
|
2035
2058
|
variant: "secondary",
|
|
2036
2059
|
label: "Logs",
|
|
2037
|
-
onClick: u[0] || (u[0] = (
|
|
2060
|
+
onClick: u[0] || (u[0] = (r) => n(m.netsuiteId, m.purchaseOrderId)),
|
|
2038
2061
|
"text-color": "primary",
|
|
2039
2062
|
"bg-color": "transparent",
|
|
2040
2063
|
"border-color": "primary"
|
|
@@ -2057,36 +2080,36 @@ const Sr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2057
2080
|
netsuiteId: {},
|
|
2058
2081
|
purchaseOrderId: {}
|
|
2059
2082
|
},
|
|
2060
|
-
setup(
|
|
2061
|
-
const t =
|
|
2062
|
-
async function
|
|
2083
|
+
setup(c) {
|
|
2084
|
+
const t = c, s = Ft(), n = re(!1), m = ze(), u = re(!0), d = re(!1), r = re(!1), a = re(!1), O = re(null), f = re([]);
|
|
2085
|
+
async function N() {
|
|
2063
2086
|
if (!O.value) {
|
|
2064
2087
|
n.value = !0;
|
|
2065
2088
|
try {
|
|
2066
2089
|
u.value = !0;
|
|
2067
|
-
const B = await
|
|
2090
|
+
const B = await s.getMoreInfo(
|
|
2068
2091
|
m.currentLocation.dbName,
|
|
2069
2092
|
t.purchaseOrderId
|
|
2070
2093
|
);
|
|
2071
|
-
O.value = B,
|
|
2094
|
+
O.value = B, d.value = !1;
|
|
2072
2095
|
} catch {
|
|
2073
|
-
|
|
2096
|
+
d.value = !0;
|
|
2074
2097
|
} finally {
|
|
2075
2098
|
u.value = !1;
|
|
2076
2099
|
}
|
|
2077
|
-
await
|
|
2100
|
+
await R();
|
|
2078
2101
|
}
|
|
2079
2102
|
}
|
|
2080
|
-
async function
|
|
2103
|
+
async function R() {
|
|
2081
2104
|
if (!(f.value.length > 0))
|
|
2082
2105
|
try {
|
|
2083
|
-
|
|
2084
|
-
const B = await
|
|
2106
|
+
r.value = !0;
|
|
2107
|
+
const B = await s.getChangeLogs(t.netsuiteId);
|
|
2085
2108
|
f.value = B, a.value = !1;
|
|
2086
2109
|
} catch {
|
|
2087
2110
|
a.value = !0;
|
|
2088
2111
|
} finally {
|
|
2089
|
-
|
|
2112
|
+
r.value = !1;
|
|
2090
2113
|
}
|
|
2091
2114
|
}
|
|
2092
2115
|
function F(B) {
|
|
@@ -2113,7 +2136,7 @@ const Sr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2113
2136
|
});
|
|
2114
2137
|
}
|
|
2115
2138
|
return (B, E) => {
|
|
2116
|
-
const te =
|
|
2139
|
+
const te = ne("FmButton"), se = ne("FmLabel"), Q = ne("FmCircularProgress"), de = ne("FmIcon"), Oe = ne("FmDialog");
|
|
2117
2140
|
return i(), v("div", Gr, [
|
|
2118
2141
|
T(Oe, {
|
|
2119
2142
|
modelValue: n.value,
|
|
@@ -2126,7 +2149,7 @@ const Sr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2126
2149
|
"prepend-icon": "info",
|
|
2127
2150
|
variant: "secondary",
|
|
2128
2151
|
label: "Latest Info",
|
|
2129
|
-
onClick: E[0] || (E[0] = (ae) =>
|
|
2152
|
+
onClick: E[0] || (E[0] = (ae) => N()),
|
|
2130
2153
|
"text-color": "primary",
|
|
2131
2154
|
"bg-color": "transparent",
|
|
2132
2155
|
"border-color": "primary"
|
|
@@ -2137,7 +2160,7 @@ const Sr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2137
2160
|
])),
|
|
2138
2161
|
default: ce(() => [
|
|
2139
2162
|
u.value ? (i(), v("div", Wr, "Loading...")) : (i(), v("div", Qr, [
|
|
2140
|
-
|
|
2163
|
+
d.value ? (i(), v("p", vo, "Something went wrong.")) : (i(), v(Ce, { key: 0 }, [
|
|
2141
2164
|
e("div", Yr, [
|
|
2142
2165
|
E[4] || (E[4] = e("h3", { class: "fm-typo-en-body-lg-600 mb-4" }, "NetSuite Order Details", -1)),
|
|
2143
2166
|
(i(!0), v(Ce, null, Te(O.value, (ae, Se) => (i(), v("div", {
|
|
@@ -2154,11 +2177,11 @@ const Sr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2154
2177
|
])
|
|
2155
2178
|
]))), 128))
|
|
2156
2179
|
]),
|
|
2157
|
-
|
|
2180
|
+
r.value ? (i(), v("div", eo, [
|
|
2158
2181
|
E[5] || (E[5] = e("span", null, "Change Log Loading...", -1)),
|
|
2159
2182
|
T(Q, { size: "md" })
|
|
2160
2183
|
])) : V("", !0),
|
|
2161
|
-
!
|
|
2184
|
+
!r.value && f.value.length > 0 ? (i(), v("div", to, [
|
|
2162
2185
|
e("h3", so, [
|
|
2163
2186
|
T(de, {
|
|
2164
2187
|
name: "error",
|
|
@@ -2228,7 +2251,7 @@ const Sr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2228
2251
|
}), ho = {
|
|
2229
2252
|
key: 0,
|
|
2230
2253
|
class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16 flex flex-col gap-8"
|
|
2231
|
-
},
|
|
2254
|
+
}, go = { class: "flex gap-8 items-center" }, bo = { class: "ml-auto" }, _o = { class: "flex gap-3" }, So = /* @__PURE__ */ Ve({
|
|
2232
2255
|
__name: "NetSuitePanel",
|
|
2233
2256
|
props: {
|
|
2234
2257
|
poRequest: {},
|
|
@@ -2237,23 +2260,23 @@ const Sr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2237
2260
|
transferToDbName: {},
|
|
2238
2261
|
scope: {}
|
|
2239
2262
|
},
|
|
2240
|
-
setup(
|
|
2241
|
-
const t =
|
|
2263
|
+
setup(c) {
|
|
2264
|
+
const t = c, s = Ys(), n = H(() => s.isNetSuiteEnabled);
|
|
2242
2265
|
return (m, u) => {
|
|
2243
|
-
var
|
|
2244
|
-
const
|
|
2266
|
+
var r, a;
|
|
2267
|
+
const d = ne("FmMenuDivider");
|
|
2245
2268
|
return n.value ? (i(), v("div", ho, [
|
|
2246
|
-
e("div",
|
|
2269
|
+
e("div", go, [
|
|
2247
2270
|
u[0] || (u[0] = e("span", { class: "flex-1 fm-typo-en-body-lg-600" }, "NetSuite Info", -1)),
|
|
2248
|
-
e("div",
|
|
2271
|
+
e("div", bo, [
|
|
2249
2272
|
e("div", _o, [
|
|
2250
|
-
(a = (
|
|
2273
|
+
(a = (r = t.purchaseOrder) == null ? void 0 : r.netSuite) != null && a.id ? (i(), he(tt, { key: 0 }, {
|
|
2251
2274
|
default: ce(() => {
|
|
2252
|
-
var O, f,
|
|
2275
|
+
var O, f, N;
|
|
2253
2276
|
return [
|
|
2254
2277
|
T(yo, {
|
|
2255
2278
|
"netsuite-id": (f = (O = m.purchaseOrder) == null ? void 0 : O.netSuite) == null ? void 0 : f.id,
|
|
2256
|
-
"purchase-order-id": (
|
|
2279
|
+
"purchase-order-id": (N = m.purchaseOrder) == null ? void 0 : N._id
|
|
2257
2280
|
}, null, 8, ["netsuite-id", "purchase-order-id"])
|
|
2258
2281
|
];
|
|
2259
2282
|
}),
|
|
@@ -2261,11 +2284,11 @@ const Sr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2261
2284
|
})) : V("", !0),
|
|
2262
2285
|
T(tt, null, {
|
|
2263
2286
|
default: ce(() => {
|
|
2264
|
-
var O, f,
|
|
2287
|
+
var O, f, N;
|
|
2265
2288
|
return [
|
|
2266
2289
|
T(Hr, {
|
|
2267
2290
|
"netsuite-id": (f = (O = m.purchaseOrder) == null ? void 0 : O.netSuite) == null ? void 0 : f.id,
|
|
2268
|
-
"purchase-order-id": (
|
|
2291
|
+
"purchase-order-id": (N = m.purchaseOrder) == null ? void 0 : N._id
|
|
2269
2292
|
}, null, 8, ["netsuite-id", "purchase-order-id"])
|
|
2270
2293
|
];
|
|
2271
2294
|
}),
|
|
@@ -2280,7 +2303,7 @@ const Sr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2280
2303
|
])
|
|
2281
2304
|
])
|
|
2282
2305
|
]),
|
|
2283
|
-
T(
|
|
2306
|
+
T(d),
|
|
2284
2307
|
T(zr, {
|
|
2285
2308
|
"po-request": m.poRequest,
|
|
2286
2309
|
"purchase-order": m.purchaseOrder,
|
|
@@ -2301,9 +2324,9 @@ const Sr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2301
2324
|
class: { default: void 0 },
|
|
2302
2325
|
contentClass: { default: void 0 }
|
|
2303
2326
|
},
|
|
2304
|
-
setup(
|
|
2305
|
-
const t =
|
|
2306
|
-
return (
|
|
2327
|
+
setup(c) {
|
|
2328
|
+
const t = c;
|
|
2329
|
+
return (s, n) => (i(), he(tt, {
|
|
2307
2330
|
selectable: t.selectable,
|
|
2308
2331
|
class: We(t.class)
|
|
2309
2332
|
}, {
|
|
@@ -2316,7 +2339,7 @@ const Sr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2316
2339
|
e("div", {
|
|
2317
2340
|
class: We(["mt-4 flex flex-col gap-2", t.contentClass])
|
|
2318
2341
|
}, [
|
|
2319
|
-
Ds(
|
|
2342
|
+
Ds(s.$slots, "default")
|
|
2320
2343
|
], 2)
|
|
2321
2344
|
], 8, ko)
|
|
2322
2345
|
]),
|
|
@@ -2324,30 +2347,30 @@ const Sr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
|
|
|
2324
2347
|
}, 8, ["selectable", "class"]));
|
|
2325
2348
|
}
|
|
2326
2349
|
});
|
|
2327
|
-
function _s(
|
|
2328
|
-
if (!(
|
|
2329
|
-
const t = new Set(
|
|
2330
|
-
for (const m of
|
|
2350
|
+
function _s(c) {
|
|
2351
|
+
if (!(c != null && c.itemsAtSubmission)) return [];
|
|
2352
|
+
const t = new Set(c.itemsAtSubmission.map((m) => m.sku._id)), s = /* @__PURE__ */ new Set(), n = [];
|
|
2353
|
+
for (const m of c.items) {
|
|
2331
2354
|
const u = m.sku._id;
|
|
2332
|
-
t.has(u) ||
|
|
2355
|
+
t.has(u) || s.has(u) || (s.add(u), n.push(m));
|
|
2333
2356
|
}
|
|
2334
2357
|
return n;
|
|
2335
2358
|
}
|
|
2336
|
-
function Ss(
|
|
2359
|
+
function Ss(c, t) {
|
|
2337
2360
|
var m;
|
|
2338
|
-
if (!
|
|
2339
|
-
const
|
|
2340
|
-
for (const u of
|
|
2341
|
-
for (const
|
|
2342
|
-
const
|
|
2343
|
-
|
|
2361
|
+
if (!c || t.length === 0) return {};
|
|
2362
|
+
const s = new Set(t.map((u) => u.sku._id)), n = {};
|
|
2363
|
+
for (const u of c.deliveryOrder ?? [])
|
|
2364
|
+
for (const d of u.received ?? []) {
|
|
2365
|
+
const r = d.sku._id;
|
|
2366
|
+
r && s.has(r) && (n[r] = (n[r] ?? 0) + (((m = d.amount) == null ? void 0 : m.amount) ?? 0));
|
|
2344
2367
|
}
|
|
2345
2368
|
return t.reduce(
|
|
2346
|
-
(u,
|
|
2347
|
-
var
|
|
2348
|
-
const
|
|
2349
|
-
return u[
|
|
2350
|
-
key:
|
|
2369
|
+
(u, d) => {
|
|
2370
|
+
var N, R;
|
|
2371
|
+
const r = d.sku._id ?? "", a = ((N = d.quantity) == null ? void 0 : N.amount) ?? 0, O = n[r] ?? 0, f = ((R = d.quantity) == null ? void 0 : R.precision) ?? 0;
|
|
2372
|
+
return u[r] = {
|
|
2373
|
+
key: r,
|
|
2351
2374
|
total: { amount: a, precision: f },
|
|
2352
2375
|
received: { amount: O, precision: f },
|
|
2353
2376
|
remaining: { amount: a - O, precision: f }
|
|
@@ -2356,7 +2379,7 @@ function Ss(d, t) {
|
|
|
2356
2379
|
{}
|
|
2357
2380
|
);
|
|
2358
2381
|
}
|
|
2359
|
-
const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4" }, $o = { class: "flex flex-col gap-4 fm-typo-en-body-lg-600" }, Co = { class: "flex flex-col gap-4" }, Ao = { class: "flex justify-between items-start py-1 gap-4" }, Do = { class: "flex flex-col flex-1 min-w-0" },
|
|
2382
|
+
const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4" }, $o = { class: "flex flex-col gap-4 fm-typo-en-body-lg-600" }, Co = { class: "flex flex-col gap-4" }, Ao = { class: "flex justify-between items-start py-1 gap-4" }, Do = { class: "flex flex-col flex-1 min-w-0" }, No = { class: "fm-typo-en-body-lg-600 truncate" }, Ro = { class: "fm-typo-en-body-md-400 truncate" }, Po = { class: "flex flex-col gap-2 items-end w-52 shrink-0" }, Fo = {
|
|
2360
2383
|
key: 0,
|
|
2361
2384
|
class: "flex items-center gap-2"
|
|
2362
2385
|
}, Io = {
|
|
@@ -2382,49 +2405,49 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
2382
2405
|
receivedInfoMap: {}
|
|
2383
2406
|
},
|
|
2384
2407
|
emits: ["submitted"],
|
|
2385
|
-
setup(
|
|
2408
|
+
setup(c, { emit: t }) {
|
|
2386
2409
|
var ee;
|
|
2387
|
-
const { t:
|
|
2388
|
-
controller:
|
|
2410
|
+
const { t: s } = or(), n = Je(), m = Ze(), u = re(!1), d = Nt(), r = c, a = (((ee = r.purchaseOrder) == null ? void 0 : ee.version) ?? Ue.enum[1]) === Ue.enum[2], O = t, f = is("deliveryOrder"), N = Xe(), {
|
|
2411
|
+
controller: R,
|
|
2389
2412
|
state: F,
|
|
2390
2413
|
reset: _
|
|
2391
|
-
} =
|
|
2414
|
+
} = Tt({
|
|
2392
2415
|
currency: Ae(),
|
|
2393
|
-
adjustments:
|
|
2416
|
+
adjustments: r.deliveryOrder.priceAdjustments
|
|
2394
2417
|
}), B = H(
|
|
2395
2418
|
() => {
|
|
2396
2419
|
var L;
|
|
2397
|
-
return ((L =
|
|
2398
|
-
(
|
|
2420
|
+
return ((L = r.purchaseOrder.deliveryFullfillment) == null ? void 0 : L.findIndex(
|
|
2421
|
+
(b) => r.deliveryOrder.fullfillmentId && b.id === r.deliveryOrder.fullfillmentId
|
|
2399
2422
|
)) ?? -1;
|
|
2400
2423
|
}
|
|
2401
|
-
), E = n.enablePurchaseOrderReceiveWithCustomCost, te = n.enablePortalDeliveryOrderWrite, se =
|
|
2402
|
-
() => (
|
|
2403
|
-
), de = H(() => _s(
|
|
2404
|
-
() => Ss(
|
|
2424
|
+
), E = n.enablePurchaseOrderReceiveWithCustomCost, te = n.enablePortalDeliveryOrderWrite, se = re({}), Q = H(
|
|
2425
|
+
() => (r.purchaseOrder.itemsAtSubmission ?? r.purchaseOrder.items).length
|
|
2426
|
+
), de = H(() => _s(r.purchaseOrder)), Oe = H(
|
|
2427
|
+
() => Ss(r.purchaseOrder, de.value)
|
|
2405
2428
|
), ae = H(
|
|
2406
|
-
() =>
|
|
2407
|
-
(L,
|
|
2429
|
+
() => r.purchaseOrder.items.map(
|
|
2430
|
+
(L, b) => H({
|
|
2408
2431
|
get: () => {
|
|
2409
2432
|
var J;
|
|
2410
|
-
const j = (J = f.received[
|
|
2433
|
+
const j = (J = f.received[b]) == null ? void 0 : J.amount;
|
|
2411
2434
|
return j ? +$e(j) : 0;
|
|
2412
2435
|
},
|
|
2413
2436
|
set: (j) => {
|
|
2414
|
-
f.received[
|
|
2437
|
+
f.received[b].amount = Qe(j, L.sku.unit.precision);
|
|
2415
2438
|
}
|
|
2416
2439
|
})
|
|
2417
2440
|
)
|
|
2418
2441
|
), Se = H(
|
|
2419
|
-
() =>
|
|
2420
|
-
(L,
|
|
2442
|
+
() => r.purchaseOrder.items.map(
|
|
2443
|
+
(L, b) => H({
|
|
2421
2444
|
get: () => {
|
|
2422
2445
|
var J;
|
|
2423
|
-
const j = (J = f.received[
|
|
2446
|
+
const j = (J = f.received[b]) == null ? void 0 : J.cost;
|
|
2424
2447
|
return j ? +$e(j) : 0;
|
|
2425
2448
|
},
|
|
2426
2449
|
set: (j) => {
|
|
2427
|
-
f.received[
|
|
2450
|
+
f.received[b].cost = {
|
|
2428
2451
|
currency: Ae(),
|
|
2429
2452
|
...Qe(j, 4)
|
|
2430
2453
|
};
|
|
@@ -2434,15 +2457,15 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
2434
2457
|
);
|
|
2435
2458
|
function De(L) {
|
|
2436
2459
|
var j;
|
|
2437
|
-
const
|
|
2438
|
-
if (se.value[L] =
|
|
2460
|
+
const b = !se.value[L];
|
|
2461
|
+
if (se.value[L] = b, b) {
|
|
2439
2462
|
const J = (j = f.received[L]) == null ? void 0 : j.cost;
|
|
2440
2463
|
f.received[L].cost = J ? { ...J, precision: 4 } : { currency: Ae(), amount: 0, precision: 4 };
|
|
2441
2464
|
} else
|
|
2442
2465
|
delete f.received[L].cost;
|
|
2443
2466
|
}
|
|
2444
|
-
const K =
|
|
2445
|
-
() =>
|
|
2467
|
+
const K = re([]), ve = H(
|
|
2468
|
+
() => d.skus.filter((L) => !L.isInactive).map((L) => ({ label: `${L.name} (${L.code})`, value: L._id }))
|
|
2446
2469
|
);
|
|
2447
2470
|
function P() {
|
|
2448
2471
|
K.value.push({ skuId: null, costEnabled: !1 }), f.received.push({
|
|
@@ -2454,29 +2477,29 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
2454
2477
|
function x(L) {
|
|
2455
2478
|
K.value.splice(L, 1), f.received.splice(Q.value + L, 1);
|
|
2456
2479
|
}
|
|
2457
|
-
function w(L,
|
|
2458
|
-
K.value[L].skuId =
|
|
2459
|
-
const j =
|
|
2480
|
+
function w(L, b) {
|
|
2481
|
+
K.value[L].skuId = b;
|
|
2482
|
+
const j = b ? d.skuById[b] : null;
|
|
2460
2483
|
f.received[Q.value + L].sku = j;
|
|
2461
2484
|
}
|
|
2462
|
-
function A(L,
|
|
2485
|
+
function A(L, b) {
|
|
2463
2486
|
var ke, we;
|
|
2464
|
-
const j = (ke =
|
|
2487
|
+
const j = (ke = r.receivedInfoMap) == null ? void 0 : ke[b.sku._id], J = j ? `${s("inventory.transfer.receiveRequest.details.received")} ${Pe.toFormatString({ value: j.received })} / ${ft(b.quantity, b.sku.unit, b.measurement)}` : void 0;
|
|
2465
2488
|
return (((we = ae.value[L]) == null ? void 0 : we.value) ?? 0) > 0 ? J : J ? `${J} · ${ct}` : ct;
|
|
2466
2489
|
}
|
|
2467
|
-
function G(L,
|
|
2490
|
+
function G(L, b) {
|
|
2468
2491
|
var ke;
|
|
2469
|
-
const J = (((ke = X.value[
|
|
2492
|
+
const J = (((ke = X.value[b]) == null ? void 0 : ke.value) ?? 0) <= 0;
|
|
2470
2493
|
let me;
|
|
2471
2494
|
if (L.skuId && Oe.value[L.skuId]) {
|
|
2472
2495
|
const we = Oe.value[L.skuId], o = Pe.toFormatString({ value: we.received });
|
|
2473
|
-
me = `${
|
|
2496
|
+
me = `${s("inventory.transfer.receiveRequest.details.received")} ${o}`;
|
|
2474
2497
|
}
|
|
2475
2498
|
return J ? me ? `${me} · ${ct}` : ct : me;
|
|
2476
2499
|
}
|
|
2477
2500
|
const X = H(
|
|
2478
|
-
() => K.value.map((L,
|
|
2479
|
-
const j = Q.value +
|
|
2501
|
+
() => K.value.map((L, b) => {
|
|
2502
|
+
const j = Q.value + b;
|
|
2480
2503
|
return H({
|
|
2481
2504
|
get: () => {
|
|
2482
2505
|
var me;
|
|
@@ -2485,14 +2508,14 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
2485
2508
|
},
|
|
2486
2509
|
set: (J) => {
|
|
2487
2510
|
var ke, we, o;
|
|
2488
|
-
const me = ((ke = L.historyItem) == null ? void 0 : ke.sku.unit.precision) ?? (L.skuId ? (o = (we =
|
|
2511
|
+
const me = ((ke = L.historyItem) == null ? void 0 : ke.sku.unit.precision) ?? (L.skuId ? (o = (we = d.skuById[L.skuId]) == null ? void 0 : we.unit) == null ? void 0 : o.precision : void 0) ?? 2;
|
|
2489
2512
|
f.received[j].amount = Qe(J, me);
|
|
2490
2513
|
}
|
|
2491
2514
|
});
|
|
2492
2515
|
})
|
|
2493
2516
|
), le = H(
|
|
2494
|
-
() => K.value.map((L,
|
|
2495
|
-
const j = Q.value +
|
|
2517
|
+
() => K.value.map((L, b) => {
|
|
2518
|
+
const j = Q.value + b;
|
|
2496
2519
|
return H({
|
|
2497
2520
|
get: () => {
|
|
2498
2521
|
var me;
|
|
@@ -2508,9 +2531,9 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
2508
2531
|
});
|
|
2509
2532
|
})
|
|
2510
2533
|
);
|
|
2511
|
-
function
|
|
2512
|
-
const
|
|
2513
|
-
|
|
2534
|
+
function g(L) {
|
|
2535
|
+
const b = K.value[L], j = Q.value + L;
|
|
2536
|
+
b.costEnabled = !b.costEnabled, b.costEnabled ? f.received[j].cost = { currency: Ae(), amount: 0, precision: 4 } : delete f.received[j].cost;
|
|
2514
2537
|
}
|
|
2515
2538
|
Ye(
|
|
2516
2539
|
() => u.value,
|
|
@@ -2520,13 +2543,13 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
2520
2543
|
K.value = [], se.value = {};
|
|
2521
2544
|
return;
|
|
2522
2545
|
}
|
|
2523
|
-
_(
|
|
2524
|
-
const
|
|
2525
|
-
for (const C of
|
|
2546
|
+
_(r.deliveryOrder.priceAdjustments);
|
|
2547
|
+
const b = r.purchaseOrder.itemsAtSubmission ?? r.purchaseOrder.items, j = new Set(b.map((C) => C.sku._id)), J = {}, me = [];
|
|
2548
|
+
for (const C of r.deliveryOrder.received ?? []) {
|
|
2526
2549
|
const q = (o = C.sku) == null ? void 0 : o._id;
|
|
2527
2550
|
q && (j.has(q) ? J[q] = C : me.push(C));
|
|
2528
2551
|
}
|
|
2529
|
-
f.received =
|
|
2552
|
+
f.received = b.map((C) => {
|
|
2530
2553
|
const q = J[C.sku._id];
|
|
2531
2554
|
return q ? { ...q } : {
|
|
2532
2555
|
// Propagate the stable id so V2 submissions match this existing PO line
|
|
@@ -2538,8 +2561,8 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
2538
2561
|
};
|
|
2539
2562
|
});
|
|
2540
2563
|
const ke = {};
|
|
2541
|
-
for (let C = 0; C <
|
|
2542
|
-
(l = J[
|
|
2564
|
+
for (let C = 0; C < b.length; C++)
|
|
2565
|
+
(l = J[b[C].sku._id]) != null && l.cost && (ke[C] = !0);
|
|
2543
2566
|
se.value = ke, K.value = [];
|
|
2544
2567
|
const we = de.value;
|
|
2545
2568
|
for (const C of me) {
|
|
@@ -2575,21 +2598,21 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
2575
2598
|
}
|
|
2576
2599
|
}
|
|
2577
2600
|
);
|
|
2578
|
-
const D =
|
|
2601
|
+
const D = re(!1);
|
|
2579
2602
|
function ie() {
|
|
2580
|
-
D.value = !0,
|
|
2603
|
+
D.value = !0, N.updateDeliveryOrder({
|
|
2581
2604
|
deliveryOrder: {
|
|
2582
|
-
...
|
|
2605
|
+
...r.deliveryOrder,
|
|
2583
2606
|
...f,
|
|
2584
|
-
priceAdjustments:
|
|
2607
|
+
priceAdjustments: R.value.state().adjustments
|
|
2585
2608
|
},
|
|
2586
|
-
purchaseOrderId:
|
|
2587
|
-
purchaseOrderRev:
|
|
2609
|
+
purchaseOrderId: r.purchaseOrder._id,
|
|
2610
|
+
purchaseOrderRev: r.purchaseOrder._rev
|
|
2588
2611
|
}).then(() => {
|
|
2589
2612
|
m.open(
|
|
2590
2613
|
{
|
|
2591
2614
|
title: "Success",
|
|
2592
|
-
message: `PO# ${
|
|
2615
|
+
message: `PO# ${r.purchaseOrder.seqNumber} Changes have been saved`,
|
|
2593
2616
|
type: "success"
|
|
2594
2617
|
},
|
|
2595
2618
|
1e4
|
|
@@ -2598,11 +2621,11 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
2598
2621
|
D.value = !1;
|
|
2599
2622
|
});
|
|
2600
2623
|
}
|
|
2601
|
-
return (L,
|
|
2602
|
-
const j =
|
|
2624
|
+
return (L, b) => {
|
|
2625
|
+
const j = ne("FmButton"), J = ne("FmStepperField"), me = ne("FmSwitch"), ke = ne("FmSelect"), we = ne("FmTextField"), o = ne("FmDialog");
|
|
2603
2626
|
return i(), he(o, {
|
|
2604
2627
|
modelValue: u.value,
|
|
2605
|
-
"onUpdate:modelValue":
|
|
2628
|
+
"onUpdate:modelValue": b[1] || (b[1] = (l) => u.value = l),
|
|
2606
2629
|
overlay: !0,
|
|
2607
2630
|
"min-width": 800
|
|
2608
2631
|
}, {
|
|
@@ -2616,7 +2639,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
2616
2639
|
})) : V("", !0)
|
|
2617
2640
|
]),
|
|
2618
2641
|
"dialog-header": ce(() => [
|
|
2619
|
-
e("div", null, "Received on " + k(h(et)(
|
|
2642
|
+
e("div", null, "Received on " + k(h(et)(r.deliveryOrder.createdAt)), 1)
|
|
2620
2643
|
]),
|
|
2621
2644
|
"dialog-footer": ce(() => [
|
|
2622
2645
|
T(j, {
|
|
@@ -2632,18 +2655,18 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
2632
2655
|
default: ce(() => [
|
|
2633
2656
|
e("div", xo, [
|
|
2634
2657
|
e("div", wo, [
|
|
2635
|
-
|
|
2636
|
-
e("div", $o, k(
|
|
2658
|
+
b[2] || (b[2] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Adjustment date", -1)),
|
|
2659
|
+
e("div", $o, k(r.deliveryOrder.adjustment ? h(et)(new Date(h(mt)(r.deliveryOrder.adjustment))) : "-"), 1)
|
|
2637
2660
|
]),
|
|
2638
2661
|
e("div", Co, [
|
|
2639
|
-
|
|
2640
|
-
(i(!0), v(Ce, null, Te(
|
|
2662
|
+
b[4] || (b[4] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Items going to receive ", -1)),
|
|
2663
|
+
(i(!0), v(Ce, null, Te(r.purchaseOrder.items, (l, $) => {
|
|
2641
2664
|
var C;
|
|
2642
2665
|
return i(), v("div", { key: $ }, [
|
|
2643
2666
|
e("div", Ao, [
|
|
2644
2667
|
e("div", Do, [
|
|
2645
|
-
e("span",
|
|
2646
|
-
e("span",
|
|
2668
|
+
e("span", No, k(l.sku.name), 1),
|
|
2669
|
+
e("span", Ro, k(l.sku.code), 1)
|
|
2647
2670
|
]),
|
|
2648
2671
|
e("div", Po, [
|
|
2649
2672
|
T(J, {
|
|
@@ -2659,7 +2682,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
2659
2682
|
"onUpdate:modelValue": (q) => De($),
|
|
2660
2683
|
size: "sm"
|
|
2661
2684
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
2662
|
-
|
|
2685
|
+
b[3] || (b[3] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
|
|
2663
2686
|
])) : V("", !0),
|
|
2664
2687
|
h(E) && se.value[$] ? (i(), he(J, {
|
|
2665
2688
|
key: 1,
|
|
@@ -2674,13 +2697,13 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
2674
2697
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) : V("", !0)
|
|
2675
2698
|
])
|
|
2676
2699
|
]),
|
|
2677
|
-
$ <
|
|
2700
|
+
$ < r.purchaseOrder.items.length - 1 ? (i(), v("div", Io)) : V("", !0)
|
|
2678
2701
|
]);
|
|
2679
2702
|
}), 128))
|
|
2680
2703
|
]),
|
|
2681
2704
|
e("div", To, [
|
|
2682
2705
|
e("div", Eo, [
|
|
2683
|
-
|
|
2706
|
+
b[5] || (b[5] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Extra items", -1)),
|
|
2684
2707
|
T(j, {
|
|
2685
2708
|
variant: "tertiary",
|
|
2686
2709
|
label: "Add item",
|
|
@@ -2711,17 +2734,17 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
2711
2734
|
label: "Receive Quantity",
|
|
2712
2735
|
modelValue: X.value[$].value,
|
|
2713
2736
|
"onUpdate:modelValue": (Y) => X.value[$].value = Y,
|
|
2714
|
-
"append-text": l.skuId ? ((q = (C = h(
|
|
2737
|
+
"append-text": l.skuId ? ((q = (C = h(d).skuById[l.skuId]) == null ? void 0 : C.unit) == null ? void 0 : q.abbrev) ?? "" : "",
|
|
2715
2738
|
"helper-text": G(l, $),
|
|
2716
2739
|
disabled: l.quantityLocked || !l.skuId
|
|
2717
2740
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text", "helper-text", "disabled"]),
|
|
2718
2741
|
h(E) ? (i(), v("div", Uo, [
|
|
2719
2742
|
T(me, {
|
|
2720
2743
|
"model-value": l.costEnabled,
|
|
2721
|
-
"onUpdate:modelValue": (Y) =>
|
|
2744
|
+
"onUpdate:modelValue": (Y) => g($),
|
|
2722
2745
|
size: "sm"
|
|
2723
2746
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
2724
|
-
|
|
2747
|
+
b[6] || (b[6] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
|
|
2725
2748
|
])) : V("", !0),
|
|
2726
2749
|
h(E) && l.costEnabled ? (i(), he(J, {
|
|
2727
2750
|
key: 1,
|
|
@@ -2749,27 +2772,27 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
2749
2772
|
}), 128))
|
|
2750
2773
|
]),
|
|
2751
2774
|
e("div", Bo, [
|
|
2752
|
-
|
|
2775
|
+
b[7] || (b[7] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Delivery order no.", -1)),
|
|
2753
2776
|
e("div", zo, [
|
|
2754
2777
|
T(we, {
|
|
2755
2778
|
modelValue: h(f).deliveryOrderNumber,
|
|
2756
|
-
"onUpdate:modelValue":
|
|
2779
|
+
"onUpdate:modelValue": b[0] || (b[0] = (l) => h(f).deliveryOrderNumber = l),
|
|
2757
2780
|
size: "md",
|
|
2758
|
-
placeholder:
|
|
2781
|
+
placeholder: r.deliveryOrder.deliveryOrderNumber
|
|
2759
2782
|
}, null, 8, ["modelValue", "placeholder"])
|
|
2760
2783
|
])
|
|
2761
2784
|
]),
|
|
2762
2785
|
e("div", Ko, [
|
|
2763
|
-
|
|
2764
|
-
e("div", Ho, k(
|
|
2786
|
+
b[8] || (b[8] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Remark", -1)),
|
|
2787
|
+
e("div", Ho, k(r.deliveryOrder.remark || "N/A"), 1)
|
|
2765
2788
|
]),
|
|
2766
|
-
h(n).enablePurchaseOrderPriceAdjustment ? (i(), he(
|
|
2789
|
+
h(n).enablePurchaseOrderPriceAdjustment ? (i(), he(It, {
|
|
2767
2790
|
key: 0,
|
|
2768
|
-
controller: h(
|
|
2791
|
+
controller: h(R),
|
|
2769
2792
|
state: h(F)
|
|
2770
2793
|
}, null, 8, ["controller", "state"])) : V("", !0),
|
|
2771
2794
|
B.value >= 0 ? (i(), v("div", Go, [
|
|
2772
|
-
|
|
2795
|
+
b[9] || (b[9] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Fulfilment's sequence", -1)),
|
|
2773
2796
|
e("div", Wo, k(B.value + 1), 1)
|
|
2774
2797
|
])) : V("", !0)
|
|
2775
2798
|
])
|
|
@@ -2796,7 +2819,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
2796
2819
|
}, hn = {
|
|
2797
2820
|
key: 0,
|
|
2798
2821
|
class: "border-b border-fm-color-stroke-secondary"
|
|
2799
|
-
},
|
|
2822
|
+
}, gn = { class: "flex flex-col gap-4" }, bn = { class: "flex items-center justify-between" }, _n = {
|
|
2800
2823
|
key: 0,
|
|
2801
2824
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary"
|
|
2802
2825
|
}, Sn = { class: "flex justify-between items-start py-1 gap-4" }, kn = { class: "flex-1 min-w-0 flex flex-col gap-2" }, On = { class: "flex flex-col gap-2 items-end w-52 shrink-0" }, xn = {
|
|
@@ -2808,7 +2831,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
2808
2831
|
}, $n = {
|
|
2809
2832
|
key: 0,
|
|
2810
2833
|
class: "border-b border-fm-color-stroke-secondary"
|
|
2811
|
-
}, Cn = { class: "flex flex-col gap-4" }, An = { class: "flex flex-col gap-4" }, Dn = { class: "flex flex-col gap-4" },
|
|
2834
|
+
}, Cn = { class: "flex flex-col gap-4" }, An = { class: "flex flex-col gap-4" }, Dn = { class: "flex flex-col gap-4" }, Nn = { class: "flex flex-col gap-4 fm-typo-en-body-lg-600" }, ss = "Will be ignored on save (zero or negative quantity)", Rn = /* @__PURE__ */ Ve({
|
|
2812
2835
|
__name: "CreateForm",
|
|
2813
2836
|
props: {
|
|
2814
2837
|
purchaseOrder: {},
|
|
@@ -2816,9 +2839,9 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
2816
2839
|
receivedMap: {}
|
|
2817
2840
|
},
|
|
2818
2841
|
emits: ["submitted"],
|
|
2819
|
-
setup(
|
|
2842
|
+
setup(c, { emit: t }) {
|
|
2820
2843
|
var ye, I, pe;
|
|
2821
|
-
const { t:
|
|
2844
|
+
const { t: s } = ht(), n = re(!1), m = gt(), u = c, d = t, r = is("", {
|
|
2822
2845
|
default: {
|
|
2823
2846
|
deliveryOrderNumber: "",
|
|
2824
2847
|
remark: "",
|
|
@@ -2841,15 +2864,15 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
2841
2864
|
},
|
|
2842
2865
|
createdAt: ""
|
|
2843
2866
|
}
|
|
2844
|
-
}), a = Xe(), O =
|
|
2845
|
-
controller:
|
|
2867
|
+
}), a = Xe(), O = bt(), f = Je(), N = Nt(), {
|
|
2868
|
+
controller: R,
|
|
2846
2869
|
state: F,
|
|
2847
2870
|
reset: _
|
|
2848
|
-
} =
|
|
2871
|
+
} = Tt({ currency: Ae() }), B = H(
|
|
2849
2872
|
() => u.purchaseOrder.deliveryFullfillment != null
|
|
2850
2873
|
), E = H(
|
|
2851
|
-
() => f.enablePortalDeliveryOrderWrite && (u.purchaseOrder.status ===
|
|
2852
|
-
), te = f.enablePurchaseOrderReceiveWithCustomCost, se = f.enableBackdateReceive, Q =
|
|
2874
|
+
() => f.enablePortalDeliveryOrderWrite && (u.purchaseOrder.status === be.Enum.RECEIVING || u.purchaseOrder.status === be.Enum.COMPLETE) && !B.value
|
|
2875
|
+
), te = f.enablePurchaseOrderReceiveWithCustomCost, se = f.enableBackdateReceive, Q = re({}), de = H(
|
|
2853
2876
|
() => u.purchaseOrder.itemsAtSubmission ?? u.purchaseOrder.items
|
|
2854
2877
|
), Oe = H(() => _s(u.purchaseOrder)), ae = H(
|
|
2855
2878
|
() => Ss(u.purchaseOrder, Oe.value)
|
|
@@ -2857,28 +2880,28 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
2857
2880
|
function Se(y) {
|
|
2858
2881
|
return y.sku._id ?? null;
|
|
2859
2882
|
}
|
|
2860
|
-
const De = (((pe = u.purchaseOrder) == null ? void 0 : pe.version) ?? Ue.enum[1]) === Ue.enum[2], K =
|
|
2883
|
+
const De = (((pe = u.purchaseOrder) == null ? void 0 : pe.version) ?? Ue.enum[1]) === Ue.enum[2], K = Ze(), ve = H({
|
|
2861
2884
|
get() {
|
|
2862
|
-
if (!
|
|
2863
|
-
const y = new Date(
|
|
2885
|
+
if (!r.createdAt) return "";
|
|
2886
|
+
const y = new Date(r.createdAt), p = y.getFullYear(), S = String(y.getMonth() + 1).padStart(2, "0"), U = String(y.getDate()).padStart(2, "0");
|
|
2864
2887
|
return `${p}-${S}-${U}`;
|
|
2865
2888
|
},
|
|
2866
2889
|
set(y) {
|
|
2867
2890
|
if (y) {
|
|
2868
|
-
const p =
|
|
2869
|
-
p.setFullYear(parseInt(S)), p.setMonth(parseInt(U) - 1), p.setDate(parseInt(M)),
|
|
2891
|
+
const p = r.createdAt ? new Date(r.createdAt) : /* @__PURE__ */ new Date(), [S, U, M] = y.split("-");
|
|
2892
|
+
p.setFullYear(parseInt(S)), p.setMonth(parseInt(U) - 1), p.setDate(parseInt(M)), r.createdAt = p.toISOString();
|
|
2870
2893
|
}
|
|
2871
2894
|
}
|
|
2872
2895
|
}), P = H({
|
|
2873
2896
|
get() {
|
|
2874
|
-
if (!
|
|
2875
|
-
const y = new Date(
|
|
2897
|
+
if (!r.createdAt) return "";
|
|
2898
|
+
const y = new Date(r.createdAt), p = String(y.getHours()).padStart(2, "0"), S = String(y.getMinutes()).padStart(2, "0");
|
|
2876
2899
|
return `${p}:${S}`;
|
|
2877
2900
|
},
|
|
2878
2901
|
set(y) {
|
|
2879
2902
|
if (y) {
|
|
2880
|
-
const p =
|
|
2881
|
-
p.setHours(parseInt(S)), p.setMinutes(parseInt(U)),
|
|
2903
|
+
const p = r.createdAt ? new Date(r.createdAt) : /* @__PURE__ */ new Date(), [S, U] = y.split(":");
|
|
2904
|
+
p.setHours(parseInt(S)), p.setMinutes(parseInt(U)), r.createdAt = p.toISOString();
|
|
2882
2905
|
}
|
|
2883
2906
|
}
|
|
2884
2907
|
}), x = H(() => {
|
|
@@ -2896,111 +2919,111 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
2896
2919
|
return `Delivery date & time cannot be earlier than order creation (${p} ${xe})`;
|
|
2897
2920
|
}
|
|
2898
2921
|
return null;
|
|
2899
|
-
}), G = H(() => A.value || ee.value.some((p) => !p.skuId) ? !1 :
|
|
2922
|
+
}), G = H(() => A.value || ee.value.some((p) => !p.skuId) ? !1 : r.received.some((p) => {
|
|
2900
2923
|
const S = p.amount;
|
|
2901
2924
|
return S ? +$e(S) > 0 : !1;
|
|
2902
2925
|
}));
|
|
2903
2926
|
function X(y) {
|
|
2904
2927
|
var U;
|
|
2905
2928
|
const p = (U = u.receivedInfoMap[y.sku._id]) == null ? void 0 : U.received, S = p != null ? Pe.toFormatString({ value: p }) : "0";
|
|
2906
|
-
return `${
|
|
2929
|
+
return `${s("inventory.transfer.receiveRequest.details.received")} ${S} / ${ft(y.quantity, y.sku.unit, y.measurement)}`;
|
|
2907
2930
|
}
|
|
2908
2931
|
function le() {
|
|
2909
|
-
|
|
2932
|
+
r.createdAt = "";
|
|
2910
2933
|
}
|
|
2911
|
-
const
|
|
2934
|
+
const g = H(() => de.value.map((y, p) => H({
|
|
2912
2935
|
get: () => {
|
|
2913
2936
|
var U;
|
|
2914
|
-
const S = (U =
|
|
2937
|
+
const S = (U = r.received[p]) == null ? void 0 : U.amount;
|
|
2915
2938
|
return S ? +$e(S) : 0;
|
|
2916
2939
|
},
|
|
2917
2940
|
set: (S) => {
|
|
2918
2941
|
var M;
|
|
2919
2942
|
const U = ((M = de.value[p]) == null ? void 0 : M.sku.unit.precision) ?? 2;
|
|
2920
|
-
|
|
2943
|
+
r.received[p].amount = Qe(S, U);
|
|
2921
2944
|
}
|
|
2922
2945
|
})));
|
|
2923
2946
|
function D(y) {
|
|
2924
2947
|
const p = !Q.value[y];
|
|
2925
2948
|
if (Q.value[y] = p, p) {
|
|
2926
2949
|
const S = de.value[y];
|
|
2927
|
-
S.totalCost ?
|
|
2950
|
+
S.totalCost ? r.received[y].cost = {
|
|
2928
2951
|
currency: S.totalCost.currency,
|
|
2929
2952
|
amount: S.totalCost.amount,
|
|
2930
2953
|
precision: 4
|
|
2931
2954
|
// Standardize to 4 decimals
|
|
2932
|
-
} :
|
|
2955
|
+
} : r.received[y].cost = {
|
|
2933
2956
|
currency: Ae(),
|
|
2934
2957
|
amount: 0,
|
|
2935
2958
|
precision: 4
|
|
2936
2959
|
};
|
|
2937
2960
|
} else
|
|
2938
|
-
delete
|
|
2961
|
+
delete r.received[y].cost;
|
|
2939
2962
|
}
|
|
2940
2963
|
const ie = H(() => de.value.map((y, p) => H({
|
|
2941
2964
|
get: () => {
|
|
2942
2965
|
var U;
|
|
2943
|
-
const S = (U =
|
|
2966
|
+
const S = (U = r.received[p]) == null ? void 0 : U.cost;
|
|
2944
2967
|
return S ? +$e(S) : 0;
|
|
2945
2968
|
},
|
|
2946
2969
|
set: (S) => {
|
|
2947
|
-
|
|
2970
|
+
r.received[p].cost = {
|
|
2948
2971
|
currency: Ae(),
|
|
2949
2972
|
...Qe(S, 4)
|
|
2950
2973
|
};
|
|
2951
2974
|
}
|
|
2952
|
-
}))), ee =
|
|
2953
|
-
() =>
|
|
2954
|
-
),
|
|
2975
|
+
}))), ee = re([]), L = H(
|
|
2976
|
+
() => N.skus.filter((y) => !y.isInactive).map((y) => ({ label: `${y.name} (${y.code})`, value: y._id }))
|
|
2977
|
+
), b = H(() => de.value.length);
|
|
2955
2978
|
function j() {
|
|
2956
|
-
ee.value.push({ skuId: null, stableKey: null, costEnabled: !1 }),
|
|
2979
|
+
ee.value.push({ skuId: null, stableKey: null, costEnabled: !1 }), r.received.push({
|
|
2957
2980
|
sku: null,
|
|
2958
2981
|
amount: Pe.fromNumber(0),
|
|
2959
2982
|
measurement: null
|
|
2960
2983
|
});
|
|
2961
2984
|
}
|
|
2962
2985
|
function J(y) {
|
|
2963
|
-
ee.value.splice(y, 1),
|
|
2986
|
+
ee.value.splice(y, 1), r.received.splice(b.value + y, 1);
|
|
2964
2987
|
}
|
|
2965
2988
|
function me(y, p) {
|
|
2966
2989
|
ee.value[y].skuId = p;
|
|
2967
|
-
const S = p ?
|
|
2968
|
-
|
|
2990
|
+
const S = p ? N.skuById[p] : null;
|
|
2991
|
+
r.received[b.value + y].sku = S;
|
|
2969
2992
|
}
|
|
2970
2993
|
function ke(y) {
|
|
2971
2994
|
const p = y.stableKey;
|
|
2972
2995
|
if (p && ae.value[p]) {
|
|
2973
2996
|
const S = ae.value[p], U = Pe.toFormatString({ value: S.received });
|
|
2974
|
-
return `${
|
|
2997
|
+
return `${s("inventory.transfer.receiveRequest.details.received")} ${U}`;
|
|
2975
2998
|
}
|
|
2976
2999
|
}
|
|
2977
3000
|
const we = H(
|
|
2978
3001
|
() => ee.value.map((y, p) => {
|
|
2979
|
-
const S =
|
|
3002
|
+
const S = b.value + p;
|
|
2980
3003
|
return H({
|
|
2981
3004
|
get: () => {
|
|
2982
3005
|
var M;
|
|
2983
|
-
const U = (M =
|
|
3006
|
+
const U = (M = r.received[S]) == null ? void 0 : M.amount;
|
|
2984
3007
|
return U ? +$e(U) : 0;
|
|
2985
3008
|
},
|
|
2986
3009
|
set: (U) => {
|
|
2987
3010
|
var xe, W, Z;
|
|
2988
|
-
const M = ee.value[p], _e = ((xe = M == null ? void 0 : M.historyItem) == null ? void 0 : xe.sku.unit.precision) ?? (M != null && M.skuId ? (Z = (W =
|
|
2989
|
-
|
|
3011
|
+
const M = ee.value[p], _e = ((xe = M == null ? void 0 : M.historyItem) == null ? void 0 : xe.sku.unit.precision) ?? (M != null && M.skuId ? (Z = (W = N.skuById[M.skuId]) == null ? void 0 : W.unit) == null ? void 0 : Z.precision : void 0) ?? 2;
|
|
3012
|
+
r.received[S].amount = Qe(U, _e);
|
|
2990
3013
|
}
|
|
2991
3014
|
});
|
|
2992
3015
|
})
|
|
2993
3016
|
), o = H(
|
|
2994
3017
|
() => ee.value.map((y, p) => {
|
|
2995
|
-
const S =
|
|
3018
|
+
const S = b.value + p;
|
|
2996
3019
|
return H({
|
|
2997
3020
|
get: () => {
|
|
2998
3021
|
var M;
|
|
2999
|
-
const U = (M =
|
|
3022
|
+
const U = (M = r.received[S]) == null ? void 0 : M.cost;
|
|
3000
3023
|
return U ? +$e(U) : 0;
|
|
3001
3024
|
},
|
|
3002
3025
|
set: (U) => {
|
|
3003
|
-
|
|
3026
|
+
r.received[S].cost = {
|
|
3004
3027
|
currency: Ae(),
|
|
3005
3028
|
...Qe(U, 4)
|
|
3006
3029
|
};
|
|
@@ -3009,8 +3032,8 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3009
3032
|
})
|
|
3010
3033
|
);
|
|
3011
3034
|
function l(y) {
|
|
3012
|
-
const p = ee.value[y], S =
|
|
3013
|
-
p.costEnabled = !p.costEnabled, p.costEnabled ?
|
|
3035
|
+
const p = ee.value[y], S = b.value + y;
|
|
3036
|
+
p.costEnabled = !p.costEnabled, p.costEnabled ? r.received[S].cost = { currency: Ae(), amount: 0, precision: 4 } : delete r.received[S].cost;
|
|
3014
3037
|
}
|
|
3015
3038
|
function $() {
|
|
3016
3039
|
Y() && O.open({
|
|
@@ -3027,12 +3050,12 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3027
3050
|
}
|
|
3028
3051
|
}).onPrimary(() => q());
|
|
3029
3052
|
}
|
|
3030
|
-
const C =
|
|
3053
|
+
const C = re(!1);
|
|
3031
3054
|
function q() {
|
|
3032
3055
|
Y() && (C.value = !0, a.createDeliveryOrder({
|
|
3033
3056
|
deliveryOrder: {
|
|
3034
|
-
...
|
|
3035
|
-
priceAdjustments:
|
|
3057
|
+
...r,
|
|
3058
|
+
priceAdjustments: R.value.state().adjustments
|
|
3036
3059
|
},
|
|
3037
3060
|
purchaseOrderId: u.purchaseOrder._id,
|
|
3038
3061
|
purchaseOrderRev: u.purchaseOrder._rev,
|
|
@@ -3045,7 +3068,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3045
3068
|
type: "success"
|
|
3046
3069
|
},
|
|
3047
3070
|
1e4
|
|
3048
|
-
), n.value = !1,
|
|
3071
|
+
), n.value = !1, d("submitted");
|
|
3049
3072
|
}).finally(() => {
|
|
3050
3073
|
C.value = !1;
|
|
3051
3074
|
}));
|
|
@@ -3067,7 +3090,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3067
3090
|
(y) => {
|
|
3068
3091
|
var U;
|
|
3069
3092
|
if (!y) {
|
|
3070
|
-
ee.value = [], _([]),
|
|
3093
|
+
ee.value = [], _([]), r.received = de.value.map((M) => ({
|
|
3071
3094
|
...De && M.id ? { id: M.id } : {},
|
|
3072
3095
|
sku: M.sku,
|
|
3073
3096
|
amount: Pe.fromNumber(0),
|
|
@@ -3077,8 +3100,8 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3077
3100
|
}
|
|
3078
3101
|
const p = de.value;
|
|
3079
3102
|
for (let M = 0; M < p.length; M++) {
|
|
3080
|
-
const _e = p[M], W = (((U = u.purchaseOrder) == null ? void 0 : U.version) ?? Ue.enum[1]) === Ue.enum[2] ? _e.id : _e.sku._id, Z = u.receivedMap[W],
|
|
3081
|
-
|
|
3103
|
+
const _e = p[M], W = (((U = u.purchaseOrder) == null ? void 0 : U.version) ?? Ue.enum[1]) === Ue.enum[2] ? _e.id : _e.sku._id, Z = u.receivedMap[W], ge = +$e(_e.quantity), Fe = Z ? +$e(Z.received) : 0;
|
|
3104
|
+
g.value[M].value = Math.max(0, ge - Fe);
|
|
3082
3105
|
}
|
|
3083
3106
|
const S = Oe.value;
|
|
3084
3107
|
if (S.length) {
|
|
@@ -3089,7 +3112,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3089
3112
|
stableKey: _e,
|
|
3090
3113
|
costEnabled: !1,
|
|
3091
3114
|
historyItem: M
|
|
3092
|
-
}),
|
|
3115
|
+
}), r.received.push({
|
|
3093
3116
|
// Propagate the stable id so V2 submissions align with the existing PO line.
|
|
3094
3117
|
...De && M.id ? { id: M.id } : {},
|
|
3095
3118
|
sku: M.sku,
|
|
@@ -3107,7 +3130,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3107
3130
|
}
|
|
3108
3131
|
}
|
|
3109
3132
|
), (y, p) => {
|
|
3110
|
-
const S =
|
|
3133
|
+
const S = ne("FmButton"), U = ne("FmDatePicker"), M = ne("FmTimePicker"), _e = ne("FmIcon"), xe = ne("FmStepperField"), W = ne("FmSwitch"), Z = ne("FmSelect"), ge = ne("FmTextField"), Fe = ne("FmDialog");
|
|
3111
3134
|
return i(), he(Fe, {
|
|
3112
3135
|
modelValue: n.value,
|
|
3113
3136
|
"onUpdate:modelValue": p[4] || (p[4] = (Ie) => n.value = Ie),
|
|
@@ -3186,7 +3209,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3186
3209
|
e("div", un, [
|
|
3187
3210
|
p[8] || (p[8] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Items going to receive ", -1)),
|
|
3188
3211
|
(i(!0), v(Ce, null, Te(de.value, (fe, ue) => {
|
|
3189
|
-
var
|
|
3212
|
+
var Re;
|
|
3190
3213
|
return i(), v("div", { key: ue }, [
|
|
3191
3214
|
e("div", cn, [
|
|
3192
3215
|
e("div", dn, [
|
|
@@ -3196,12 +3219,12 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3196
3219
|
e("div", fn, [
|
|
3197
3220
|
T(xe, {
|
|
3198
3221
|
label: "Receive Quantity",
|
|
3199
|
-
modelValue:
|
|
3200
|
-
"onUpdate:modelValue": (Ee) =>
|
|
3222
|
+
modelValue: g.value[ue].value,
|
|
3223
|
+
"onUpdate:modelValue": (Ee) => g.value[ue].value = Ee,
|
|
3201
3224
|
"helper-text": X(fe),
|
|
3202
|
-
"append-text": ((
|
|
3225
|
+
"append-text": ((Re = fe.measurement) == null ? void 0 : Re.abbrev) ?? fe.sku.unit.abbrev
|
|
3203
3226
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "helper-text", "append-text"]),
|
|
3204
|
-
|
|
3227
|
+
g.value[ue].value <= 0 ? (i(), v("div", vn, k(ss))) : V("", !0),
|
|
3205
3228
|
h(te) ? (i(), v("div", yn, [
|
|
3206
3229
|
T(W, {
|
|
3207
3230
|
"model-value": Q.value[ue],
|
|
@@ -3227,8 +3250,8 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3227
3250
|
]);
|
|
3228
3251
|
}), 128))
|
|
3229
3252
|
]),
|
|
3230
|
-
e("div",
|
|
3231
|
-
e("div",
|
|
3253
|
+
e("div", gn, [
|
|
3254
|
+
e("div", bn, [
|
|
3232
3255
|
p[9] || (p[9] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Extra items", -1)),
|
|
3233
3256
|
T(S, {
|
|
3234
3257
|
variant: "tertiary",
|
|
@@ -3240,7 +3263,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3240
3263
|
]),
|
|
3241
3264
|
ee.value.length === 0 ? (i(), v("div", _n, " No extra items added ")) : V("", !0),
|
|
3242
3265
|
(i(!0), v(Ce, null, Te(ee.value, (fe, ue) => {
|
|
3243
|
-
var
|
|
3266
|
+
var Re, Ee;
|
|
3244
3267
|
return i(), v("div", { key: ue }, [
|
|
3245
3268
|
e("div", Sn, [
|
|
3246
3269
|
e("div", kn, [
|
|
@@ -3260,7 +3283,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3260
3283
|
label: "Receive Quantity",
|
|
3261
3284
|
modelValue: we.value[ue].value,
|
|
3262
3285
|
"onUpdate:modelValue": (Le) => we.value[ue].value = Le,
|
|
3263
|
-
"append-text": fe.skuId ? ((Ee = (
|
|
3286
|
+
"append-text": fe.skuId ? ((Ee = (Re = h(N).skuById[fe.skuId]) == null ? void 0 : Re.unit) == null ? void 0 : Ee.abbrev) ?? "" : "",
|
|
3264
3287
|
"helper-text": ke(fe)
|
|
3265
3288
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "append-text", "helper-text"]),
|
|
3266
3289
|
we.value[ue].value <= 0 ? (i(), v("div", xn, k(ss))) : V("", !0),
|
|
@@ -3300,26 +3323,26 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3300
3323
|
e("div", Cn, [
|
|
3301
3324
|
p[11] || (p[11] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Delivery order no.", -1)),
|
|
3302
3325
|
e("div", An, [
|
|
3303
|
-
T(
|
|
3304
|
-
modelValue: h(
|
|
3305
|
-
"onUpdate:modelValue": p[2] || (p[2] = (fe) => h(
|
|
3326
|
+
T(ge, {
|
|
3327
|
+
modelValue: h(r).deliveryOrderNumber,
|
|
3328
|
+
"onUpdate:modelValue": p[2] || (p[2] = (fe) => h(r).deliveryOrderNumber = fe),
|
|
3306
3329
|
size: "md"
|
|
3307
3330
|
}, null, 8, ["modelValue"])
|
|
3308
3331
|
])
|
|
3309
3332
|
]),
|
|
3310
3333
|
e("div", Dn, [
|
|
3311
3334
|
p[12] || (p[12] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Remark", -1)),
|
|
3312
|
-
e("div",
|
|
3313
|
-
T(
|
|
3314
|
-
modelValue: h(
|
|
3315
|
-
"onUpdate:modelValue": p[3] || (p[3] = (fe) => h(
|
|
3335
|
+
e("div", Nn, [
|
|
3336
|
+
T(ge, {
|
|
3337
|
+
modelValue: h(r).remark,
|
|
3338
|
+
"onUpdate:modelValue": p[3] || (p[3] = (fe) => h(r).remark = fe),
|
|
3316
3339
|
size: "md"
|
|
3317
3340
|
}, null, 8, ["modelValue"])
|
|
3318
3341
|
])
|
|
3319
3342
|
]),
|
|
3320
|
-
h(f).enablePurchaseOrderPriceAdjustment ? (i(), he(
|
|
3343
|
+
h(f).enablePurchaseOrderPriceAdjustment ? (i(), he(It, {
|
|
3321
3344
|
key: 1,
|
|
3322
|
-
controller: h(
|
|
3345
|
+
controller: h(R),
|
|
3323
3346
|
state: h(F)
|
|
3324
3347
|
}, null, 8, ["controller", "state"])) : V("", !0)
|
|
3325
3348
|
])
|
|
@@ -3337,19 +3360,19 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3337
3360
|
props: {
|
|
3338
3361
|
adjustments: {}
|
|
3339
3362
|
},
|
|
3340
|
-
setup(
|
|
3341
|
-
const t =
|
|
3363
|
+
setup(c) {
|
|
3364
|
+
const t = c, s = H(() => t.adjustments ?? []);
|
|
3342
3365
|
function n(m) {
|
|
3343
|
-
const u = m.amount < 0 ? "-" : "+",
|
|
3344
|
-
return `${u}${m.currency} ${
|
|
3366
|
+
const u = m.amount < 0 ? "-" : "+", d = $e({ ...m, amount: Math.abs(m.amount) });
|
|
3367
|
+
return `${u}${m.currency} ${d}`;
|
|
3345
3368
|
}
|
|
3346
|
-
return (m, u) =>
|
|
3347
|
-
(i(!0), v(Ce, null, Te(
|
|
3348
|
-
key:
|
|
3369
|
+
return (m, u) => s.value.length ? (i(), v("div", Pn, [
|
|
3370
|
+
(i(!0), v(Ce, null, Te(s.value, (d) => (i(), v("div", {
|
|
3371
|
+
key: d.id,
|
|
3349
3372
|
class: "flex justify-between gap-4 fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
3350
3373
|
}, [
|
|
3351
|
-
e("span", Fn, k(
|
|
3352
|
-
e("span", In, k(n(
|
|
3374
|
+
e("span", Fn, k(d.name), 1),
|
|
3375
|
+
e("span", In, k(n(d.dinero)), 1)
|
|
3353
3376
|
]))), 128))
|
|
3354
3377
|
])) : V("", !0);
|
|
3355
3378
|
}
|
|
@@ -3359,39 +3382,39 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3359
3382
|
purchaseOrder: {}
|
|
3360
3383
|
},
|
|
3361
3384
|
emits: ["submitted"],
|
|
3362
|
-
setup(
|
|
3363
|
-
const
|
|
3385
|
+
setup(c, { emit: t }) {
|
|
3386
|
+
const s = c, n = t, m = Xe(), u = Ze(), d = re(!1), r = re(!1), { controller: a, state: O, reset: f } = Tt({
|
|
3364
3387
|
currency: Ae(),
|
|
3365
|
-
adjustments:
|
|
3388
|
+
adjustments: s.purchaseOrder.priceAdjustments
|
|
3366
3389
|
});
|
|
3367
3390
|
Ye(
|
|
3368
|
-
() =>
|
|
3369
|
-
(
|
|
3370
|
-
|
|
3391
|
+
() => d.value,
|
|
3392
|
+
(R) => {
|
|
3393
|
+
R && f(s.purchaseOrder.priceAdjustments);
|
|
3371
3394
|
}
|
|
3372
3395
|
);
|
|
3373
|
-
function
|
|
3374
|
-
|
|
3375
|
-
...
|
|
3396
|
+
function N() {
|
|
3397
|
+
r.value = !0, m.updatePurchaseOrder({
|
|
3398
|
+
...s.purchaseOrder,
|
|
3376
3399
|
priceAdjustments: a.value.state().adjustments
|
|
3377
3400
|
}).then(() => {
|
|
3378
3401
|
u.open(
|
|
3379
3402
|
{
|
|
3380
3403
|
title: "Success",
|
|
3381
|
-
message: `PO# ${
|
|
3404
|
+
message: `PO# ${s.purchaseOrder.seqNumber} price adjustments saved`,
|
|
3382
3405
|
type: "success"
|
|
3383
3406
|
},
|
|
3384
3407
|
1e4
|
|
3385
|
-
),
|
|
3408
|
+
), d.value = !1, n("submitted");
|
|
3386
3409
|
}).finally(() => {
|
|
3387
|
-
|
|
3410
|
+
r.value = !1;
|
|
3388
3411
|
});
|
|
3389
3412
|
}
|
|
3390
|
-
return (
|
|
3391
|
-
const _ =
|
|
3413
|
+
return (R, F) => {
|
|
3414
|
+
const _ = ne("FmButton"), B = ne("FmDialog");
|
|
3392
3415
|
return i(), he(B, {
|
|
3393
|
-
modelValue:
|
|
3394
|
-
"onUpdate:modelValue": F[0] || (F[0] = (E) =>
|
|
3416
|
+
modelValue: d.value,
|
|
3417
|
+
"onUpdate:modelValue": F[0] || (F[0] = (E) => d.value = E),
|
|
3395
3418
|
overlay: !0,
|
|
3396
3419
|
"min-width": 600
|
|
3397
3420
|
}, {
|
|
@@ -3404,7 +3427,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3404
3427
|
})
|
|
3405
3428
|
]),
|
|
3406
3429
|
"dialog-header": ce(() => [
|
|
3407
|
-
e("div", null, "Price adjustments — PO# " + k(
|
|
3430
|
+
e("div", null, "Price adjustments — PO# " + k(s.purchaseOrder.seqNumber), 1)
|
|
3408
3431
|
]),
|
|
3409
3432
|
"dialog-footer": ce(() => [
|
|
3410
3433
|
T(_, {
|
|
@@ -3412,14 +3435,14 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3412
3435
|
label: "Apply changes",
|
|
3413
3436
|
size: "md",
|
|
3414
3437
|
variant: "destructive",
|
|
3415
|
-
disabled:
|
|
3416
|
-
loading:
|
|
3417
|
-
onClick:
|
|
3438
|
+
disabled: r.value,
|
|
3439
|
+
loading: r.value,
|
|
3440
|
+
onClick: N
|
|
3418
3441
|
}, null, 8, ["disabled", "loading"])
|
|
3419
3442
|
]),
|
|
3420
3443
|
default: ce(() => [
|
|
3421
3444
|
e("div", En, [
|
|
3422
|
-
T(
|
|
3445
|
+
T(It, {
|
|
3423
3446
|
controller: h(a),
|
|
3424
3447
|
state: h(O)
|
|
3425
3448
|
}, null, 8, ["controller", "state"])
|
|
@@ -3443,14 +3466,14 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3443
3466
|
props: {
|
|
3444
3467
|
netsuiteId: {}
|
|
3445
3468
|
},
|
|
3446
|
-
setup(
|
|
3447
|
-
const t =
|
|
3448
|
-
async function
|
|
3449
|
-
if (!(
|
|
3469
|
+
setup(c) {
|
|
3470
|
+
const t = c, s = Ft(), n = re(!1), m = re(!1), u = re(!1), d = re([]);
|
|
3471
|
+
async function r() {
|
|
3472
|
+
if (!(d.value.length > 0))
|
|
3450
3473
|
try {
|
|
3451
3474
|
m.value = !0;
|
|
3452
|
-
const f = await
|
|
3453
|
-
|
|
3475
|
+
const f = await s.getChangeLogs(t.netsuiteId);
|
|
3476
|
+
d.value = f, u.value = !1;
|
|
3454
3477
|
} catch {
|
|
3455
3478
|
u.value = !0;
|
|
3456
3479
|
} finally {
|
|
@@ -3480,46 +3503,46 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3480
3503
|
minute: "2-digit"
|
|
3481
3504
|
});
|
|
3482
3505
|
}
|
|
3483
|
-
return (f,
|
|
3484
|
-
const
|
|
3506
|
+
return (f, N) => {
|
|
3507
|
+
const R = ne("FmButton"), F = ne("FmCircularProgress"), _ = ne("FmIcon"), B = ne("FmDialog");
|
|
3485
3508
|
return i(), v("div", Vn, [
|
|
3486
3509
|
T(B, {
|
|
3487
3510
|
modelValue: n.value,
|
|
3488
|
-
"onUpdate:modelValue":
|
|
3511
|
+
"onUpdate:modelValue": N[2] || (N[2] = (E) => n.value = E),
|
|
3489
3512
|
overlay: !0,
|
|
3490
3513
|
"max-width": 800
|
|
3491
3514
|
}, {
|
|
3492
3515
|
"dialog-button": ce(() => [
|
|
3493
|
-
T(
|
|
3516
|
+
T(R, {
|
|
3494
3517
|
"prepend-icon": "info",
|
|
3495
3518
|
variant: "secondary",
|
|
3496
3519
|
label: "NetSuite",
|
|
3497
|
-
onClick:
|
|
3520
|
+
onClick: N[0] || (N[0] = (E) => r()),
|
|
3498
3521
|
"text-color": "primary",
|
|
3499
3522
|
"bg-color": "transparent",
|
|
3500
3523
|
"border-color": "primary"
|
|
3501
3524
|
})
|
|
3502
3525
|
]),
|
|
3503
|
-
"dialog-header": ce(() =>
|
|
3526
|
+
"dialog-header": ce(() => N[3] || (N[3] = [
|
|
3504
3527
|
e("div", null, "NetSuite info", -1)
|
|
3505
3528
|
])),
|
|
3506
3529
|
default: ce(() => [
|
|
3507
3530
|
m.value ? (i(), v("div", Ln, [
|
|
3508
|
-
|
|
3531
|
+
N[4] || (N[4] = e("span", null, "Change Log Loading...", -1)),
|
|
3509
3532
|
T(F, { size: "md" })
|
|
3510
3533
|
])) : V("", !0),
|
|
3511
|
-
!m.value &&
|
|
3534
|
+
!m.value && d.value.length > 0 ? (i(), v("div", jn, [
|
|
3512
3535
|
e("h3", Un, [
|
|
3513
3536
|
T(_, {
|
|
3514
3537
|
name: "error",
|
|
3515
3538
|
color: "#ff9500",
|
|
3516
3539
|
size: "sm"
|
|
3517
3540
|
}),
|
|
3518
|
-
|
|
3541
|
+
N[5] || (N[5] = Ge(" Change Logs "))
|
|
3519
3542
|
]),
|
|
3520
3543
|
e("div", Mn, [
|
|
3521
3544
|
e("table", Bn, [
|
|
3522
|
-
|
|
3545
|
+
N[6] || (N[6] = e("thead", { class: "bg-fm-color-neutral-gray-50" }, [
|
|
3523
3546
|
e("tr", { class: "border-b border-fm-color-neutral-gray-200" }, [
|
|
3524
3547
|
e("th", {
|
|
3525
3548
|
class: "text-left p-3 fm-typo-en-body-md-600",
|
|
@@ -3536,7 +3559,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3536
3559
|
])
|
|
3537
3560
|
], -1)),
|
|
3538
3561
|
e("tbody", null, [
|
|
3539
|
-
(i(!0), v(Ce, null, Te(
|
|
3562
|
+
(i(!0), v(Ce, null, Te(d.value, (E, te) => (i(), v("tr", {
|
|
3540
3563
|
key: te,
|
|
3541
3564
|
class: "border-b border-fm-color-neutral-gray-200 last:border-b-0"
|
|
3542
3565
|
}, [
|
|
@@ -3555,17 +3578,17 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3555
3578
|
])
|
|
3556
3579
|
])
|
|
3557
3580
|
])
|
|
3558
|
-
])) : (i(), v("div", Zn,
|
|
3581
|
+
])) : (i(), v("div", Zn, N[7] || (N[7] = [
|
|
3559
3582
|
e("p", null, "No change logs available.", -1)
|
|
3560
3583
|
])))
|
|
3561
3584
|
]),
|
|
3562
3585
|
"dialog-footer": ce(() => [
|
|
3563
|
-
T(
|
|
3586
|
+
T(R, {
|
|
3564
3587
|
class: "ml-auto sm:w-full xs:w-full",
|
|
3565
3588
|
label: "Close",
|
|
3566
3589
|
size: "md",
|
|
3567
3590
|
variant: "primary",
|
|
3568
|
-
onClick:
|
|
3591
|
+
onClick: N[1] || (N[1] = (E) => n.value = !1)
|
|
3569
3592
|
})
|
|
3570
3593
|
]),
|
|
3571
3594
|
_: 1
|
|
@@ -3588,13 +3611,13 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3588
3611
|
}, va = { class: "text-xs font-mono text-right break-all" }, ya = {
|
|
3589
3612
|
key: 3,
|
|
3590
3613
|
class: "flex items-start justify-between gap-6"
|
|
3591
|
-
}, ha = { class: "text-xs font-mono text-right break-all" },
|
|
3614
|
+
}, ha = { class: "text-xs font-mono text-right break-all" }, ga = { class: "flex flex-col gap-4" }, ba = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _a = { class: "flex gap-1" }, Sa = { class: "fm-typo-en-body-lg-600" }, ka = {
|
|
3592
3615
|
key: 0,
|
|
3593
3616
|
class: "flex flex-col gap-4"
|
|
3594
3617
|
}, Oa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, xa = { class: "fm-typo-en-body-lg-600" }, wa = { class: "flex flex-col gap-4" }, $a = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ca = { class: "fm-typo-en-body-lg-600" }, Aa = {
|
|
3595
3618
|
key: 1,
|
|
3596
3619
|
class: "flex flex-col gap-4"
|
|
3597
|
-
}, Da = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
3620
|
+
}, Da = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Na = { class: "fm-typo-en-body-lg-600" }, Ra = {
|
|
3598
3621
|
key: 2,
|
|
3599
3622
|
class: "flex flex-col gap-4"
|
|
3600
3623
|
}, Pa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Fa = { class: "fm-typo-en-body-lg-600" }, Ia = {
|
|
@@ -3627,7 +3650,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3627
3650
|
}, fl = { class: "flex gap-12 content-stretch" }, vl = {
|
|
3628
3651
|
class: "flex flex-col w-40",
|
|
3629
3652
|
name: "circles"
|
|
3630
|
-
}, yl = { class: "flex-1 flex flex-col items-center" }, hl = { class: "h-40 w-40 bg-fm-color-primary rounded-full flex items-center justify-center" },
|
|
3653
|
+
}, yl = { class: "flex-1 flex flex-col items-center" }, hl = { class: "h-40 w-40 bg-fm-color-primary rounded-full flex items-center justify-center" }, gl = { class: "flex-1 flex flex-col items-center" }, bl = { class: "flex w-full items-center gap-4" }, _l = {
|
|
3631
3654
|
class: "py-12 flex flex-col gap-4",
|
|
3632
3655
|
name: "received-at header"
|
|
3633
3656
|
}, Sl = { class: "fm-typo-en-body-lg-400" }, kl = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ol = { class: "ml-auto flex gap-1" }, xl = { class: "flex gap-12 content-stretch" }, wl = {
|
|
@@ -3636,7 +3659,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3636
3659
|
}, $l = { class: "flex-1 flex flex-col items-center" }, Cl = {
|
|
3637
3660
|
class: "py-12 flex flex-col gap-4 flex-1",
|
|
3638
3661
|
name: "delivery details"
|
|
3639
|
-
}, Al = { class: "flex flex-col gap-8" }, Dl = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" },
|
|
3662
|
+
}, Al = { class: "flex flex-col gap-8" }, Dl = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Nl = { class: "flex flex-col gap-4" }, Rl = {
|
|
3640
3663
|
key: 2,
|
|
3641
3664
|
class: "flex-1 xs:w-screen xs:max-w-full"
|
|
3642
3665
|
}, Pl = {
|
|
@@ -3648,7 +3671,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3648
3671
|
}, El = { class: "flex flex-col gap-4" }, ql = { class: "flex justify-between gap-8" }, Vl = { class: "fm-typo-en-body-lg-600" }, Ll = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary whitespace-nowrap" }, jl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ul = {
|
|
3649
3672
|
key: 0,
|
|
3650
3673
|
class: "fm-typo-en-body-md-400"
|
|
3651
|
-
}, Ml = { class: "flex gap-8 xs:flex-col" },
|
|
3674
|
+
}, Ml = { class: "flex gap-8 xs:flex-col" }, gi = /* @__PURE__ */ Ve({
|
|
3652
3675
|
__name: "TransferDetails",
|
|
3653
3676
|
props: {
|
|
3654
3677
|
poRequest: {},
|
|
@@ -3663,20 +3686,20 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3663
3686
|
shipments: {}
|
|
3664
3687
|
},
|
|
3665
3688
|
emits: ["update:show", "submitted"],
|
|
3666
|
-
setup(
|
|
3667
|
-
const
|
|
3668
|
-
function
|
|
3689
|
+
setup(c, { emit: t }) {
|
|
3690
|
+
const s = c, n = t, m = bt(), u = Ze(), d = Je(), r = ze(), a = gt(), { hasOrderDraftPermission: O } = bs(), f = hs();
|
|
3691
|
+
function N(o) {
|
|
3669
3692
|
const l = o.isCustomCost, $ = o.totalCost;
|
|
3670
3693
|
return l != null ? l === !0 : $ != null;
|
|
3671
3694
|
}
|
|
3672
3695
|
Ye(
|
|
3673
|
-
() =>
|
|
3696
|
+
() => s.purchaseOrder,
|
|
3674
3697
|
(o) => {
|
|
3675
3698
|
f.init(o);
|
|
3676
3699
|
},
|
|
3677
3700
|
{ immediate: !0 }
|
|
3678
3701
|
);
|
|
3679
|
-
const
|
|
3702
|
+
const R = H(
|
|
3680
3703
|
() => {
|
|
3681
3704
|
var o, l;
|
|
3682
3705
|
return {
|
|
@@ -3684,16 +3707,16 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3684
3707
|
name: ((l = a.sessionUser.value) == null ? void 0 : l.displayName) ?? ""
|
|
3685
3708
|
};
|
|
3686
3709
|
}
|
|
3687
|
-
), F =
|
|
3710
|
+
), F = gs(), { t: _ } = ht(), B = H(
|
|
3688
3711
|
() => {
|
|
3689
3712
|
var o, l, $, C;
|
|
3690
|
-
return ((l = (o =
|
|
3713
|
+
return ((l = (o = s.purchaseOrder) == null ? void 0 : o.supplier) == null ? void 0 : l.internal) === "restaurant" || ((C = ($ = s.purchaseOrder) == null ? void 0 : $.supplier) == null ? void 0 : C.internal) === "warehouse" ? at.enum.transfer : at.enum.purchase;
|
|
3691
3714
|
}
|
|
3692
3715
|
), E = H(() => {
|
|
3693
3716
|
var $;
|
|
3694
|
-
const o = ($ =
|
|
3717
|
+
const o = ($ = s.shipments) == null ? void 0 : $.find((C) => {
|
|
3695
3718
|
var q;
|
|
3696
|
-
return C.ref === ((q =
|
|
3719
|
+
return C.ref === ((q = s.purchaseOrder) == null ? void 0 : q._id);
|
|
3697
3720
|
});
|
|
3698
3721
|
let l = null;
|
|
3699
3722
|
if (o != null && o.milestones && o.milestones.length > 0) {
|
|
@@ -3704,43 +3727,43 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3704
3727
|
}
|
|
3705
3728
|
}
|
|
3706
3729
|
return l;
|
|
3707
|
-
}), te =
|
|
3730
|
+
}), te = re(!1), se = re(""), Q = re(!0), de = Xe(), Oe = xr(de.getWorkflowConfig), ae = fs(), Se = [
|
|
3708
3731
|
z.enum.receiveStock,
|
|
3709
3732
|
z.enum.processRequest,
|
|
3710
3733
|
z.enum.closeRequest
|
|
3711
3734
|
], De = H(() => {
|
|
3712
3735
|
var pe, y, p, S, U, M, _e, xe, W;
|
|
3713
|
-
if (!
|
|
3736
|
+
if (!s.purchaseOrder)
|
|
3714
3737
|
return [];
|
|
3715
3738
|
const o = Oe.result.value;
|
|
3716
|
-
if (o.state ===
|
|
3739
|
+
if (o.state === Dt.loading)
|
|
3717
3740
|
return [];
|
|
3718
3741
|
let l;
|
|
3719
|
-
const $ = ns.safeParse(
|
|
3742
|
+
const $ = ns.safeParse(s.purchaseOrder);
|
|
3720
3743
|
if ($.success)
|
|
3721
3744
|
l = $.data;
|
|
3722
3745
|
else {
|
|
3723
|
-
const Z = /* @__PURE__ */ new Set(["1", "2"]),
|
|
3746
|
+
const Z = /* @__PURE__ */ new Set(["1", "2"]), ge = { line1: "", state: "", city: "", postcode: "", country: "" };
|
|
3724
3747
|
l = {
|
|
3725
|
-
_id: ((pe =
|
|
3726
|
-
status: ((y =
|
|
3727
|
-
version: Z.has((p =
|
|
3728
|
-
seqNumber: typeof ((U =
|
|
3748
|
+
_id: ((pe = s.purchaseOrder) == null ? void 0 : pe._id) ?? "",
|
|
3749
|
+
status: ((y = s.purchaseOrder) == null ? void 0 : y.status) ?? be.enum.DRAFT,
|
|
3750
|
+
version: Z.has((p = s.purchaseOrder) == null ? void 0 : p.version) ? (S = s.purchaseOrder) == null ? void 0 : S.version : null,
|
|
3751
|
+
seqNumber: typeof ((U = s.purchaseOrder) == null ? void 0 : U.seqNumber) == "number" ? s.purchaseOrder.seqNumber : 0,
|
|
3729
3752
|
supplier: {
|
|
3730
|
-
_id: ((_e = (M =
|
|
3731
|
-
name: ((W = (xe =
|
|
3732
|
-
address:
|
|
3753
|
+
_id: ((_e = (M = s.purchaseOrder) == null ? void 0 : M.supplier) == null ? void 0 : _e._id) ?? "",
|
|
3754
|
+
name: ((W = (xe = s.purchaseOrder) == null ? void 0 : xe.supplier) == null ? void 0 : W.name) ?? "",
|
|
3755
|
+
address: ge
|
|
3733
3756
|
},
|
|
3734
3757
|
items: [],
|
|
3735
3758
|
deliveryOrder: []
|
|
3736
3759
|
};
|
|
3737
3760
|
}
|
|
3738
3761
|
const C = {
|
|
3739
|
-
user:
|
|
3740
|
-
executedAt:
|
|
3762
|
+
user: R.value,
|
|
3763
|
+
executedAt: r.locations.computeFirst(
|
|
3741
3764
|
(Z) => {
|
|
3742
|
-
var
|
|
3743
|
-
return Z.dbName === ((
|
|
3765
|
+
var ge;
|
|
3766
|
+
return Z.dbName === ((ge = r._currentLocation) == null ? void 0 : ge.dbName) ? Z : null;
|
|
3744
3767
|
}
|
|
3745
3768
|
),
|
|
3746
3769
|
// Strip purchaseOrder and netSuite from the POR before passing to the Dart
|
|
@@ -3751,16 +3774,16 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3751
3774
|
// The workflow engine only needs from/to/processedAt/rejectedAt — passing
|
|
3752
3775
|
// null for an unvalidatable POR yields the same available actions.
|
|
3753
3776
|
purchaseOrderRequest: (() => {
|
|
3754
|
-
if (
|
|
3755
|
-
const Z = Es.safeParse(
|
|
3777
|
+
if (s.poRequest == null) return s.poRequest;
|
|
3778
|
+
const Z = Es.safeParse(s.poRequest);
|
|
3756
3779
|
return Z.success ? { ...Z.data, purchaseOrder: null, netSuite: null } : null;
|
|
3757
3780
|
})(),
|
|
3758
3781
|
purchaseOrder: l
|
|
3759
|
-
}, q =
|
|
3782
|
+
}, q = d.useOperatePurchaseOrderV2, Y = d.poWorkflowAllowToMarkCompleted, ye = [...Se];
|
|
3760
3783
|
q && !Y && ye.push(z.enum.completeReceive);
|
|
3761
3784
|
let I = [];
|
|
3762
3785
|
try {
|
|
3763
|
-
o.state ===
|
|
3786
|
+
o.state === Dt.error ? (console.error("Error fetching workflow config:", o.error), I = St.getAvailableActions({
|
|
3764
3787
|
...C,
|
|
3765
3788
|
orderConfig: St.getDefaultConfig()
|
|
3766
3789
|
}).actions.filter((Z) => !ye.includes(Z))) : I = St.getAvailableActions({
|
|
@@ -3770,10 +3793,10 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3770
3793
|
} catch (Z) {
|
|
3771
3794
|
console.error("Error getting available actions:", Z);
|
|
3772
3795
|
}
|
|
3773
|
-
return
|
|
3796
|
+
return s.scope === "approval" && (I = I.filter((Z) => Z !== z.enum.completeReceive)), O.value || (I = I.filter(
|
|
3774
3797
|
(Z) => Z !== z.enum.approveDraft && Z !== z.enum.rejectDraft
|
|
3775
3798
|
)), I;
|
|
3776
|
-
}), K = Bs(
|
|
3799
|
+
}), K = Bs(s, "show"), ve = H(() => [
|
|
3777
3800
|
{
|
|
3778
3801
|
label: _("inventory.transfer.receiveRequest.details.overview"),
|
|
3779
3802
|
value: "overview"
|
|
@@ -3786,9 +3809,9 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3786
3809
|
label: _("inventory.transfer.receiveRequest.details.actionLogs"),
|
|
3787
3810
|
value: "actionLogs"
|
|
3788
3811
|
}
|
|
3789
|
-
]), P =
|
|
3812
|
+
]), P = re(ve.value[0]);
|
|
3790
3813
|
Ye(
|
|
3791
|
-
() =>
|
|
3814
|
+
() => s.show,
|
|
3792
3815
|
(o) => {
|
|
3793
3816
|
o && (P.value = ve.value[0]);
|
|
3794
3817
|
}
|
|
@@ -3833,7 +3856,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3833
3856
|
deliveryOrderNumber: "",
|
|
3834
3857
|
deliveryRemark: null,
|
|
3835
3858
|
items: x(l.fulfillment.items),
|
|
3836
|
-
createdBy:
|
|
3859
|
+
createdBy: R.value
|
|
3837
3860
|
}
|
|
3838
3861
|
})) : $ === z.enum.processRequest ? l.fulfillment && y.push({
|
|
3839
3862
|
action: "processRequest",
|
|
@@ -3842,7 +3865,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3842
3865
|
deliveryOrderNumber: "",
|
|
3843
3866
|
deliveryRemark: null,
|
|
3844
3867
|
items: x(l.fulfillment.items),
|
|
3845
|
-
createdBy:
|
|
3868
|
+
createdBy: R.value
|
|
3846
3869
|
}
|
|
3847
3870
|
}) : $ === z.enum.rejectRequest ? y.push({
|
|
3848
3871
|
action: "rejectRequest",
|
|
@@ -3864,13 +3887,13 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3864
3887
|
options: l
|
|
3865
3888
|
},
|
|
3866
3889
|
operateV2: {
|
|
3867
|
-
_id: ((p =
|
|
3868
|
-
_rev: ((S =
|
|
3890
|
+
_id: ((p = s.purchaseOrder) == null ? void 0 : p._id) ?? "",
|
|
3891
|
+
_rev: ((S = s.purchaseOrder) == null ? void 0 : S._rev) ?? "",
|
|
3869
3892
|
action: $ === z.enum.submitRequest ? z.enum.confirmDraft : $,
|
|
3870
3893
|
payloads: y
|
|
3871
3894
|
// add payload if action is receiveStock or processRequest
|
|
3872
3895
|
},
|
|
3873
|
-
transferTo: (M = (U =
|
|
3896
|
+
transferTo: (M = (U = s.poRequest) == null ? void 0 : U.to) == null ? void 0 : M.dbName
|
|
3874
3897
|
}).delayed(1e3), Y("submitted");
|
|
3875
3898
|
} catch (_e) {
|
|
3876
3899
|
ye(_e);
|
|
@@ -3897,23 +3920,23 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3897
3920
|
return;
|
|
3898
3921
|
}
|
|
3899
3922
|
const { successMessage: $, ...C } = l;
|
|
3900
|
-
if (
|
|
3923
|
+
if (s.purchaseOrder) {
|
|
3901
3924
|
se.value = `${o}`, te.value = !0, Q.value = !1;
|
|
3902
3925
|
const pe = {};
|
|
3903
3926
|
let y = 0;
|
|
3904
3927
|
if ((o === z.enum.confirmDraft || // auto receive for warehouse to warehouse
|
|
3905
|
-
o === z.enum.completeReceive) &&
|
|
3928
|
+
o === z.enum.completeReceive) && d.autoReceiveWarehouse)
|
|
3906
3929
|
pe.autoReceive = !0;
|
|
3907
|
-
else if ((o === z.enum.approveRequest || o === z.enum.processRequest) &&
|
|
3908
|
-
const p = (Y = (q =
|
|
3930
|
+
else if ((o === z.enum.approveRequest || o === z.enum.processRequest) && d.acceptRequireFulfillment) {
|
|
3931
|
+
const p = (Y = (q = s.poRequest) == null ? void 0 : q.from) == null ? void 0 : Y.dbName, S = (I = (ye = s.poRequest) == null ? void 0 : ye.to) == null ? void 0 : I.dbName;
|
|
3909
3932
|
if (p && S && (p.startsWith("warehouse_") || S.startsWith("warehouse_"))) {
|
|
3910
3933
|
const U = await new Promise((M, _e) => {
|
|
3911
3934
|
m.open({
|
|
3912
3935
|
closeButton: !1,
|
|
3913
3936
|
title: "Confirm transfer amount",
|
|
3914
|
-
dialogComponent:
|
|
3937
|
+
dialogComponent: Or,
|
|
3915
3938
|
dialogComponentProps: {
|
|
3916
|
-
purchaseOrder:
|
|
3939
|
+
purchaseOrder: s.purchaseOrder,
|
|
3917
3940
|
confirm: M,
|
|
3918
3941
|
"onUpdate:show": (xe) => {
|
|
3919
3942
|
xe || (se.value = "", te.value = !1, Q.value = !0, y++, m.close()), _e("cancelled");
|
|
@@ -3926,7 +3949,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3926
3949
|
}
|
|
3927
3950
|
try {
|
|
3928
3951
|
await w(
|
|
3929
|
-
|
|
3952
|
+
s.purchaseOrder,
|
|
3930
3953
|
pe,
|
|
3931
3954
|
o,
|
|
3932
3955
|
l,
|
|
@@ -3941,7 +3964,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3941
3964
|
title: "Something went wrong",
|
|
3942
3965
|
message: p instanceof Error ? p.message : "Please try again.",
|
|
3943
3966
|
type: "error"
|
|
3944
|
-
}), console.error("Error when submitting PO operation", o,
|
|
3967
|
+
}), console.error("Error when submitting PO operation", o, s.purchaseOrder, p);
|
|
3945
3968
|
} finally {
|
|
3946
3969
|
se.value = "", te.value = !1, Q.value = !0;
|
|
3947
3970
|
}
|
|
@@ -3949,19 +3972,19 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3949
3972
|
}
|
|
3950
3973
|
const G = H(() => {
|
|
3951
3974
|
var o, l;
|
|
3952
|
-
return ((o =
|
|
3953
|
-
}), X = H(() =>
|
|
3954
|
-
const o =
|
|
3975
|
+
return ((o = s.purchaseOrder) == null ? void 0 : o.status) === be.enum.RECEIVING || ((l = s.purchaseOrder) == null ? void 0 : l.status) === be.enum.COMPLETE;
|
|
3976
|
+
}), X = H(() => s.purchaseOrder ? vt(s.purchaseOrder) : {}), le = H(() => {
|
|
3977
|
+
const o = s.purchaseOrder;
|
|
3955
3978
|
if (!o) return { status: "", statusClass: "" };
|
|
3956
3979
|
const { partial: l, over: $ } = $t(X.value), C = Ct(o.status, l, $);
|
|
3957
3980
|
let q = _(`inventory.transfer.status.${C}`), Y = `${o.status}`.toLocaleLowerCase("en-us");
|
|
3958
|
-
return C ===
|
|
3981
|
+
return C === be.enum.CLOSE && (q = `${_(`inventory.transfer.status.${be.enum.COMPLETE}`)}`), C === "PARTIAL_RECEIVED" && Y === be.enum.PROCESSING.toLocaleLowerCase("en-us") && (Y = be.enum.RECEIVING.toLocaleLowerCase("en-us")), {
|
|
3959
3982
|
status: q,
|
|
3960
3983
|
statusClass: `fm-status-badge fm-status-badge-${Y}`
|
|
3961
3984
|
};
|
|
3962
|
-
}),
|
|
3985
|
+
}), g = H(() => {
|
|
3963
3986
|
var Y, ye;
|
|
3964
|
-
const o = ((Y =
|
|
3987
|
+
const o = ((Y = s.purchaseOrder) == null ? void 0 : Y.deliveryOrder) ?? [], l = ((ye = s.purchaseOrder) == null ? void 0 : ye.deliveryFullfillment) ?? [], $ = [
|
|
3965
3988
|
...o.map((I) => ({
|
|
3966
3989
|
createdAt: I.createdAt,
|
|
3967
3990
|
type: "grn",
|
|
@@ -3975,7 +3998,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3975
3998
|
];
|
|
3976
3999
|
$.reverse().sort((I, pe) => I.createdAt.localeCompare(pe.createdAt));
|
|
3977
4000
|
function C(I) {
|
|
3978
|
-
var p, S, U, M, _e, xe, W, Z,
|
|
4001
|
+
var p, S, U, M, _e, xe, W, Z, ge, Fe, Ie, fe;
|
|
3979
4002
|
const pe = l.findIndex((ue) => ue.id === I.fullfillmentId), y = [
|
|
3980
4003
|
(S = (p = l[pe]) == null ? void 0 : p.netSuite) != null && S.id ? {
|
|
3981
4004
|
label: "Fulfillment's ref no. (Netsuite)",
|
|
@@ -3985,7 +4008,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
3985
4008
|
} : null,
|
|
3986
4009
|
(W = I == null ? void 0 : I.netSuite) != null && W.id ? {
|
|
3987
4010
|
label: "Netsuite ref no.",
|
|
3988
|
-
values: [`${((Z = I == null ? void 0 : I.netSuite) == null ? void 0 : Z.refNo) ?? "N/A"} (${((
|
|
4011
|
+
values: [`${((Z = I == null ? void 0 : I.netSuite) == null ? void 0 : Z.refNo) ?? "N/A"} (${((ge = I == null ? void 0 : I.netSuite) == null ? void 0 : ge.id) ?? "-"})`]
|
|
3989
4012
|
} : null,
|
|
3990
4013
|
(Fe = I == null ? void 0 : I.netSuite) != null && Fe.recordType ? {
|
|
3991
4014
|
label: "Netsuite Type",
|
|
@@ -4010,28 +4033,28 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4010
4033
|
{
|
|
4011
4034
|
label: "Received items",
|
|
4012
4035
|
values: I.received.map((ue) => {
|
|
4013
|
-
var
|
|
4014
|
-
return
|
|
4015
|
-
|
|
4036
|
+
var Re;
|
|
4037
|
+
return oe("div", [
|
|
4038
|
+
oe(
|
|
4016
4039
|
"div",
|
|
4017
4040
|
{
|
|
4018
4041
|
class: "flex gap-4"
|
|
4019
4042
|
},
|
|
4020
4043
|
[
|
|
4021
|
-
|
|
4044
|
+
oe(
|
|
4022
4045
|
"div",
|
|
4023
4046
|
{
|
|
4024
4047
|
class: "flex flex-col"
|
|
4025
4048
|
},
|
|
4026
4049
|
[
|
|
4027
|
-
|
|
4050
|
+
oe(
|
|
4028
4051
|
"span",
|
|
4029
4052
|
{
|
|
4030
4053
|
class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
|
|
4031
4054
|
},
|
|
4032
4055
|
`${ue.sku.name}`
|
|
4033
4056
|
),
|
|
4034
|
-
|
|
4057
|
+
oe(
|
|
4035
4058
|
"span",
|
|
4036
4059
|
{
|
|
4037
4060
|
class: "fm-typo-en-body-md-400"
|
|
@@ -4040,35 +4063,35 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4040
4063
|
)
|
|
4041
4064
|
]
|
|
4042
4065
|
),
|
|
4043
|
-
|
|
4066
|
+
oe(
|
|
4044
4067
|
"div",
|
|
4045
4068
|
{
|
|
4046
4069
|
class: "ml-auto flex flex-col"
|
|
4047
4070
|
},
|
|
4048
4071
|
[
|
|
4049
|
-
|
|
4072
|
+
oe(
|
|
4050
4073
|
"div",
|
|
4051
4074
|
{
|
|
4052
4075
|
class: "ml-auto flex gap-1"
|
|
4053
4076
|
},
|
|
4054
4077
|
[
|
|
4055
|
-
|
|
4078
|
+
oe(
|
|
4056
4079
|
"span",
|
|
4057
4080
|
{
|
|
4058
4081
|
class: "fm-typo-en-body-lg-600 self-end"
|
|
4059
4082
|
},
|
|
4060
4083
|
$e(ue.amount, !1)
|
|
4061
4084
|
),
|
|
4062
|
-
|
|
4085
|
+
oe(
|
|
4063
4086
|
"span",
|
|
4064
4087
|
{
|
|
4065
4088
|
class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
4066
4089
|
},
|
|
4067
|
-
((
|
|
4090
|
+
((Re = ue.measurement) == null ? void 0 : Re.abbrev) ?? ue.sku.unit.abbrev
|
|
4068
4091
|
)
|
|
4069
4092
|
]
|
|
4070
4093
|
),
|
|
4071
|
-
|
|
4094
|
+
oe(
|
|
4072
4095
|
"div",
|
|
4073
4096
|
{
|
|
4074
4097
|
class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
@@ -4113,27 +4136,27 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4113
4136
|
label: "Receiveable items",
|
|
4114
4137
|
values: I.items.map((U) => {
|
|
4115
4138
|
var M;
|
|
4116
|
-
return
|
|
4117
|
-
|
|
4139
|
+
return oe("div", [
|
|
4140
|
+
oe(
|
|
4118
4141
|
"div",
|
|
4119
4142
|
{
|
|
4120
4143
|
class: "flex gap-4"
|
|
4121
4144
|
},
|
|
4122
4145
|
[
|
|
4123
|
-
|
|
4146
|
+
oe(
|
|
4124
4147
|
"div",
|
|
4125
4148
|
{
|
|
4126
4149
|
class: "flex flex-col"
|
|
4127
4150
|
},
|
|
4128
4151
|
[
|
|
4129
|
-
|
|
4152
|
+
oe(
|
|
4130
4153
|
"span",
|
|
4131
4154
|
{
|
|
4132
4155
|
class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
|
|
4133
4156
|
},
|
|
4134
4157
|
`${U.sku.name}`
|
|
4135
4158
|
),
|
|
4136
|
-
|
|
4159
|
+
oe(
|
|
4137
4160
|
"span",
|
|
4138
4161
|
{
|
|
4139
4162
|
class: "fm-typo-en-body-md-400"
|
|
@@ -4142,26 +4165,26 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4142
4165
|
)
|
|
4143
4166
|
]
|
|
4144
4167
|
),
|
|
4145
|
-
|
|
4168
|
+
oe(
|
|
4146
4169
|
"div",
|
|
4147
4170
|
{
|
|
4148
4171
|
class: "ml-auto flex flex-col"
|
|
4149
4172
|
},
|
|
4150
4173
|
[
|
|
4151
|
-
|
|
4174
|
+
oe(
|
|
4152
4175
|
"div",
|
|
4153
4176
|
{
|
|
4154
4177
|
class: "ml-auto flex gap-1"
|
|
4155
4178
|
},
|
|
4156
4179
|
[
|
|
4157
|
-
|
|
4180
|
+
oe(
|
|
4158
4181
|
"span",
|
|
4159
4182
|
{
|
|
4160
4183
|
class: "fm-typo-en-body-lg-600 self-end"
|
|
4161
4184
|
},
|
|
4162
4185
|
$e(U.amount, !1)
|
|
4163
4186
|
),
|
|
4164
|
-
|
|
4187
|
+
oe(
|
|
4165
4188
|
"span",
|
|
4166
4189
|
{
|
|
4167
4190
|
class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
@@ -4170,7 +4193,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4170
4193
|
)
|
|
4171
4194
|
]
|
|
4172
4195
|
),
|
|
4173
|
-
|
|
4196
|
+
oe(
|
|
4174
4197
|
"div",
|
|
4175
4198
|
{
|
|
4176
4199
|
class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
@@ -4195,7 +4218,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4195
4218
|
(I) => I.type === "grn" ? C(I.doc) : q(I.doc)
|
|
4196
4219
|
);
|
|
4197
4220
|
}), D = H(() => {
|
|
4198
|
-
const o =
|
|
4221
|
+
const o = s.purchaseOrder;
|
|
4199
4222
|
if (!o) return [];
|
|
4200
4223
|
if (!o.itemsAtSubmission) return o.items ?? [];
|
|
4201
4224
|
const l = new Set(o.itemsAtSubmission.map((C) => C.sku._id)), $ = [];
|
|
@@ -4203,14 +4226,14 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4203
4226
|
l.has(C.sku._id) || (l.add(C.sku._id), $.push(C));
|
|
4204
4227
|
return [...o.itemsAtSubmission, ...$];
|
|
4205
4228
|
}), ie = H(() => {
|
|
4206
|
-
const o =
|
|
4207
|
-
if (!o || o.version !== Ue.enum[2]) return
|
|
4229
|
+
const o = s.purchaseOrder;
|
|
4230
|
+
if (!o || o.version !== Ue.enum[2]) return s.receivedMap;
|
|
4208
4231
|
const l = {}, $ = {};
|
|
4209
4232
|
for (const q of o.items ?? [])
|
|
4210
4233
|
l[q.sku._id] || (l[q.sku._id] = []), $[q.sku._id] = q.sku.unit.precision, q.id && l[q.sku._id].push(q.id);
|
|
4211
4234
|
const C = {};
|
|
4212
4235
|
for (const [q, Y] of Object.entries(l)) {
|
|
4213
|
-
const ye = Y.map((p) =>
|
|
4236
|
+
const ye = Y.map((p) => s.receivedMap[p]).filter(Boolean);
|
|
4214
4237
|
if (ye.length === 0) continue;
|
|
4215
4238
|
const I = { amount: 0, precision: $[q] ?? 0 }, pe = ye.reduce((p, S) => Pe.add([p, S.total]), I), y = ye.reduce((p, S) => Pe.add([p, S.received]), I);
|
|
4216
4239
|
C[q] = {
|
|
@@ -4223,34 +4246,34 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4223
4246
|
return C;
|
|
4224
4247
|
});
|
|
4225
4248
|
function ee(o) {
|
|
4226
|
-
const l = ie.value[o.sku._id], $ =
|
|
4249
|
+
const l = ie.value[o.sku._id], $ = b(o);
|
|
4227
4250
|
return l ? `<span class="${$} fm-typo-en-body-lg-600">${Pe.toFormatString({ value: l.received })}</span>/${ft(o.quantity, o.sku.unit, o.measurement)}` : `<span class="fm-typo-en-body-lg-600">-</span>/${ft(o.quantity, o.sku.unit, o.measurement)}`;
|
|
4228
4251
|
}
|
|
4229
4252
|
function L(o) {
|
|
4230
|
-
const l =
|
|
4253
|
+
const l = s.purchaseOrder;
|
|
4231
4254
|
return l != null && l.itemsAtSubmission ? !l.itemsAtSubmission.some(($) => $.sku._id === o.sku._id) : !1;
|
|
4232
4255
|
}
|
|
4233
|
-
function
|
|
4256
|
+
function b(o) {
|
|
4234
4257
|
const l = ie.value[o.sku._id];
|
|
4235
4258
|
if (!l)
|
|
4236
4259
|
return "text-fm-color-typo-tertiary";
|
|
4237
|
-
const { isPartialReceive: $, isNoReceive: C, isOverReceive: q, isFullReceive: Y } =
|
|
4260
|
+
const { isPartialReceive: $, isNoReceive: C, isOverReceive: q, isFullReceive: Y } = dr(l);
|
|
4238
4261
|
return C ? "text-fm-color-typo-tertiary" : $ ? "text-fm-color-system-warning-300" : q ? "text-fm-color-system-error-300" : Y ? "text-fm-color-system-success-300" : "";
|
|
4239
4262
|
}
|
|
4240
4263
|
const j = H(() => {
|
|
4241
4264
|
var o, l, $;
|
|
4242
|
-
return (o =
|
|
4265
|
+
return (o = s.purchaseOrder) != null && o.itemsAtSubmission ? ((l = s.purchaseOrder) == null ? void 0 : l.version) === Ue.enum[2] ? s.purchaseOrder.items.reduce((C, q) => {
|
|
4243
4266
|
var ye, I;
|
|
4244
|
-
const Y = (I = (ye =
|
|
4267
|
+
const Y = (I = (ye = s.purchaseOrder) == null ? void 0 : ye.itemsAtSubmission) == null ? void 0 : I.find(
|
|
4245
4268
|
(pe) => pe.id === q.id
|
|
4246
4269
|
);
|
|
4247
4270
|
return Y && Y.quantity !== q.quantity && C.set(q.sku.code, {
|
|
4248
4271
|
originalAmount: Number(Pe.toFormatString({ value: Y.quantity })),
|
|
4249
4272
|
newAmount: Number(Pe.toFormatString({ value: q.quantity }))
|
|
4250
4273
|
}), C;
|
|
4251
|
-
}, /* @__PURE__ */ new Map()) : ($ =
|
|
4274
|
+
}, /* @__PURE__ */ new Map()) : ($ = s.purchaseOrder) == null ? void 0 : $.items.reduce((C, q) => {
|
|
4252
4275
|
var pe, y;
|
|
4253
|
-
const Y = (y = (pe =
|
|
4276
|
+
const Y = (y = (pe = s.purchaseOrder) == null ? void 0 : pe.itemsAtSubmission) == null ? void 0 : y.find(
|
|
4254
4277
|
(p) => p.sku._id === q.sku._id
|
|
4255
4278
|
), ye = Y ? Number(Pe.toFormatString({ value: Y.quantity })) : 0, I = Number(Pe.toFormatString({ value: q.quantity }));
|
|
4256
4279
|
return Y && ye !== I && C.set(q.sku.code, {
|
|
@@ -4261,13 +4284,13 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4261
4284
|
}), J = (o) => {
|
|
4262
4285
|
var $, C;
|
|
4263
4286
|
const l = j.value;
|
|
4264
|
-
return (($ =
|
|
4287
|
+
return (($ = s.purchaseOrder) == null ? void 0 : $.version) === Ue.enum[2] ? l.has(o.id) : l.has((C = o.sku) == null ? void 0 : C.code);
|
|
4265
4288
|
}, me = (o) => {
|
|
4266
4289
|
var $, C;
|
|
4267
4290
|
const l = j.value;
|
|
4268
|
-
return (($ =
|
|
4291
|
+
return (($ = s.purchaseOrder) == null ? void 0 : $.version) === Ue.enum[2] ? l.get(o.id) : l.get((C = o.sku) == null ? void 0 : C.code);
|
|
4269
4292
|
}, ke = H(() => {
|
|
4270
|
-
const o =
|
|
4293
|
+
const o = s.purchaseOrder;
|
|
4271
4294
|
if (!o) return "";
|
|
4272
4295
|
const l = o.actionChangelogs ?? [], $ = l.length ? l[l.length - 1] : null;
|
|
4273
4296
|
if ($ && $.action === "rejectDraft") {
|
|
@@ -4276,14 +4299,14 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4276
4299
|
}
|
|
4277
4300
|
return "";
|
|
4278
4301
|
}), we = H(() => {
|
|
4279
|
-
const o =
|
|
4302
|
+
const o = s.purchaseOrder;
|
|
4280
4303
|
return o ? [...o.actionChangelogs ?? []].reverse() : [];
|
|
4281
4304
|
});
|
|
4282
4305
|
return (o, l) => {
|
|
4283
|
-
const $ =
|
|
4306
|
+
const $ = ne("FmButton"), C = ne("FmButtonGroup"), q = ne("FmChip"), Y = ne("FmIcon"), ye = ne("FmMenuDivider"), I = ne("FmCard"), pe = ne("FmTooltip"), y = ne("FmSpacer"), p = ne("FmSideSheet");
|
|
4284
4307
|
return i(), he(p, {
|
|
4285
4308
|
modelValue: h(K),
|
|
4286
|
-
"onUpdate:modelValue": l[9] || (l[9] = (S) =>
|
|
4309
|
+
"onUpdate:modelValue": l[9] || (l[9] = (S) => Ns(K) ? K.value = S : null),
|
|
4287
4310
|
"dismiss-away": Q.value,
|
|
4288
4311
|
"max-width": 600,
|
|
4289
4312
|
"close-button": !1
|
|
@@ -4306,7 +4329,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4306
4329
|
modelValue: P.value,
|
|
4307
4330
|
"onUpdate:modelValue": l[1] || (l[1] = (M) => P.value = M)
|
|
4308
4331
|
}, null, 8, ["items", "modelValue"]),
|
|
4309
|
-
o.purchaseOrder && P.value.value === "deliveryHistory" ? (i(), he(
|
|
4332
|
+
o.purchaseOrder && P.value.value === "deliveryHistory" ? (i(), he(Rn, {
|
|
4310
4333
|
key: 0,
|
|
4311
4334
|
"purchase-order": o.purchaseOrder,
|
|
4312
4335
|
"received-info-map": X.value,
|
|
@@ -4329,7 +4352,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4329
4352
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
4330
4353
|
}, {
|
|
4331
4354
|
default: ce(() => {
|
|
4332
|
-
var W, Z,
|
|
4355
|
+
var W, Z, ge, Fe, Ie, fe, ue, Re, Ee, Le;
|
|
4333
4356
|
return [
|
|
4334
4357
|
e("div", oa, [
|
|
4335
4358
|
e("div", na, k(h(_)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
|
|
@@ -4352,19 +4375,19 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4352
4375
|
e("div", ua, [
|
|
4353
4376
|
T(ts, { title: "Debug Info" }, {
|
|
4354
4377
|
default: ce(() => {
|
|
4355
|
-
var it,
|
|
4378
|
+
var it, Et, qt, Vt, Lt, jt, Ut, Mt, Bt, zt, Kt, Ht;
|
|
4356
4379
|
return [
|
|
4357
4380
|
(it = o.purchaseOrder) != null && it._id ? (i(), v("div", ca, [
|
|
4358
4381
|
l[10] || (l[10] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Purchase Order ID ", -1)),
|
|
4359
|
-
e("span", da, k((
|
|
4382
|
+
e("span", da, k((Et = o.purchaseOrder) == null ? void 0 : Et._id), 1)
|
|
4360
4383
|
])) : V("", !0),
|
|
4361
|
-
(
|
|
4384
|
+
(qt = o.purchaseOrder) != null && qt.status ? (i(), v("div", ma, [
|
|
4362
4385
|
l[11] || (l[11] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Purchase Order Status ", -1)),
|
|
4363
|
-
e("span", pa, k((
|
|
4386
|
+
e("span", pa, k((Vt = o.purchaseOrder) == null ? void 0 : Vt.status), 1)
|
|
4364
4387
|
])) : V("", !0),
|
|
4365
|
-
(
|
|
4388
|
+
(jt = (Lt = o.purchaseOrder) == null ? void 0 : Lt.supplier) != null && jt._id ? (i(), v("div", fa, [
|
|
4366
4389
|
l[12] || (l[12] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Source Location ID ", -1)),
|
|
4367
|
-
e("span", va, k(((
|
|
4390
|
+
e("span", va, k(((Mt = (Ut = o.purchaseOrder) == null ? void 0 : Ut.supplier) == null ? void 0 : Mt.internal) != null ? `${(zt = (Bt = o.purchaseOrder) == null ? void 0 : Bt.supplier) == null ? void 0 : zt.internal}_` : "") + k((Ht = (Kt = o.purchaseOrder) == null ? void 0 : Kt.supplier) == null ? void 0 : Ht._id), 1)
|
|
4368
4391
|
])) : V("", !0),
|
|
4369
4392
|
o.transferToDbName ? (i(), v("div", ya, [
|
|
4370
4393
|
l[13] || (l[13] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Destination Location ID ", -1)),
|
|
@@ -4374,15 +4397,15 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4374
4397
|
}),
|
|
4375
4398
|
_: 1
|
|
4376
4399
|
}),
|
|
4377
|
-
e("div",
|
|
4378
|
-
e("div",
|
|
4400
|
+
e("div", ga, [
|
|
4401
|
+
e("div", ba, [
|
|
4379
4402
|
e("div", _a, k(h(_)("inventory.transfer.receiveRequest.details.createdAt")), 1)
|
|
4380
4403
|
]),
|
|
4381
4404
|
e("div", Sa, k(h(lt)(((W = o.purchaseOrder) == null ? void 0 : W._id) ?? "")), 1)
|
|
4382
4405
|
]),
|
|
4383
4406
|
(Z = o.purchaseOrder) != null && Z.effectiveAt ? (i(), v("div", ka, [
|
|
4384
4407
|
e("div", Oa, k(h(_)("inventory.transfer.receiveRequest.details.date")), 1),
|
|
4385
|
-
e("div", xa, k(h(
|
|
4408
|
+
e("div", xa, k(h(Pt)(new Date((ge = o.purchaseOrder) == null ? void 0 : ge.effectiveAt))), 1)
|
|
4386
4409
|
])) : V("", !0),
|
|
4387
4410
|
e("div", wa, [
|
|
4388
4411
|
e("div", $a, k(h(_)("inventory.transfer.receiveRequest.details.type.title")), 1),
|
|
@@ -4392,13 +4415,13 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4392
4415
|
]),
|
|
4393
4416
|
(Ie = (Fe = o.purchaseOrder) == null ? void 0 : Fe.supplier) != null && Ie.name ? (i(), v("div", Aa, [
|
|
4394
4417
|
e("div", Da, k(h(_)("inventory.transfer.receiveRequest.details.from")), 1),
|
|
4395
|
-
e("div",
|
|
4418
|
+
e("div", Na, k((ue = (fe = o.purchaseOrder) == null ? void 0 : fe.supplier) == null ? void 0 : ue.name), 1)
|
|
4396
4419
|
])) : V("", !0),
|
|
4397
|
-
o.transferTo ? (i(), v("div",
|
|
4420
|
+
o.transferTo ? (i(), v("div", Ra, [
|
|
4398
4421
|
e("div", Pa, k(h(_)("inventory.transfer.receiveRequest.details.to")), 1),
|
|
4399
4422
|
e("div", Fa, k(o.transferTo), 1)
|
|
4400
4423
|
])) : V("", !0),
|
|
4401
|
-
(
|
|
4424
|
+
(Re = o.purchaseOrder) != null && Re.ref ? (i(), v("div", Ia, [
|
|
4402
4425
|
e("div", Ta, k(h(_)("inventory.transfer.receiveRequest.details.reference")), 1),
|
|
4403
4426
|
e("div", Ea, k(o.purchaseOrder.ref), 1)
|
|
4404
4427
|
])) : V("", !0),
|
|
@@ -4406,7 +4429,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4406
4429
|
e("div", Va, k(h(_)("inventory.transfer.receiveRequest.details.remark")), 1),
|
|
4407
4430
|
e("div", La, k(o.purchaseOrder.remark), 1)
|
|
4408
4431
|
])) : V("", !0),
|
|
4409
|
-
((Le = o.purchaseOrder) == null ? void 0 : Le.status) === h(
|
|
4432
|
+
((Le = o.purchaseOrder) == null ? void 0 : Le.status) === h(be).enum.DRAFT && ke.value ? (i(), v("div", ja, [
|
|
4410
4433
|
e("div", Ua, k(h(_)("inventory.transfer.receiveRequest.details.rejectionReason")), 1),
|
|
4411
4434
|
e("div", Ma, k(ke.value !== "" ? ke.value : "-"), 1)
|
|
4412
4435
|
])) : V("", !0)
|
|
@@ -4438,7 +4461,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4438
4461
|
var W, Z;
|
|
4439
4462
|
return [
|
|
4440
4463
|
e("div", Ga, [
|
|
4441
|
-
(i(!0), v(Ce, null, Te((Z = (W = o.purchaseOrder) == null ? void 0 : W.netSuite) == null ? void 0 : Z.missingItems, (
|
|
4464
|
+
(i(!0), v(Ce, null, Te((Z = (W = o.purchaseOrder) == null ? void 0 : W.netSuite) == null ? void 0 : Z.missingItems, (ge, Fe) => (i(), v("div", {
|
|
4442
4465
|
class: "flex justify-center align-middle",
|
|
4443
4466
|
key: Fe
|
|
4444
4467
|
}, [
|
|
@@ -4446,7 +4469,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4446
4469
|
name: "arrow_right",
|
|
4447
4470
|
size: "sm"
|
|
4448
4471
|
}),
|
|
4449
|
-
Ge(" " + k(`(${
|
|
4472
|
+
Ge(" " + k(`(${ge.netSuiteId}) ${ge.name}: ${ge.reason}`), 1)
|
|
4450
4473
|
]))), 128))
|
|
4451
4474
|
])
|
|
4452
4475
|
];
|
|
@@ -4464,7 +4487,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4464
4487
|
]),
|
|
4465
4488
|
T(ye),
|
|
4466
4489
|
(i(!0), v(Ce, null, Te(D.value, (W, Z) => {
|
|
4467
|
-
var
|
|
4490
|
+
var ge, Fe;
|
|
4468
4491
|
return i(), v("div", {
|
|
4469
4492
|
key: Z,
|
|
4470
4493
|
class: "flex flex-col"
|
|
@@ -4524,11 +4547,11 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4524
4547
|
]),
|
|
4525
4548
|
e("div", Xa, [
|
|
4526
4549
|
e("div", el, k(W.code), 1),
|
|
4527
|
-
h(
|
|
4550
|
+
h(d).enableTotalCost && ((ge = W.totalCost) != null && ge.amount || typeof W.sku == "object" && W.sku != null) ? (i(), v("div", tl, [
|
|
4528
4551
|
e("span", sl, k(h(ut)(
|
|
4529
4552
|
(Fe = W.totalCost) != null && Fe.amount ? W.totalCost : h(f).controller.value.getItemCost(W, h(Ae)()).cost
|
|
4530
4553
|
)), 1),
|
|
4531
|
-
|
|
4554
|
+
N(W) ? V("", !0) : (i(), v("span", rl, [
|
|
4532
4555
|
l[16] || (l[16] = e("span", { class: "w-1.5 h-1.5 rounded-full bg-gray-400" }, null, -1)),
|
|
4533
4556
|
Ge(" " + k(h(_)("inventory.transfer.form.items.autoCalculated")), 1)
|
|
4534
4557
|
]))
|
|
@@ -4548,7 +4571,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4548
4571
|
}).replace(/[^0-9.,]/g, "")), 1)
|
|
4549
4572
|
])
|
|
4550
4573
|
], 64)) : V("", !0),
|
|
4551
|
-
h(
|
|
4574
|
+
h(d).enablePurchaseOrderPriceAdjustment ? (i(), v(Ce, { key: 1 }, [
|
|
4552
4575
|
T(Tn, {
|
|
4553
4576
|
adjustments: (xe = o.purchaseOrder) == null ? void 0 : xe.priceAdjustments
|
|
4554
4577
|
}, null, 8, ["adjustments"]),
|
|
@@ -4564,9 +4587,9 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4564
4587
|
])
|
|
4565
4588
|
])
|
|
4566
4589
|
], 64)) : P.value.value === "deliveryHistory" ? (i(), v("div", il, [
|
|
4567
|
-
|
|
4568
|
-
(i(!0), v(Ce, null, Te(
|
|
4569
|
-
var
|
|
4590
|
+
g.value.length ? (i(), v("div", pl, [
|
|
4591
|
+
(i(!0), v(Ce, null, Te(g.value, (W, Z) => {
|
|
4592
|
+
var ge, Fe, Ie, fe, ue;
|
|
4570
4593
|
return i(), v(Ce, { key: Z }, [
|
|
4571
4594
|
e("div", fl, [
|
|
4572
4595
|
e("div", vl, [
|
|
@@ -4589,19 +4612,19 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4589
4612
|
color: "#ffffff"
|
|
4590
4613
|
})) : V("", !0)
|
|
4591
4614
|
]),
|
|
4592
|
-
e("div",
|
|
4615
|
+
e("div", gl, [
|
|
4593
4616
|
e("div", {
|
|
4594
4617
|
class: We([
|
|
4595
4618
|
{
|
|
4596
|
-
"bg-fm-color-primary": Z <
|
|
4597
|
-
"bg-white": Z >=
|
|
4619
|
+
"bg-fm-color-primary": Z < g.value.length - 1,
|
|
4620
|
+
"bg-white": Z >= g.value.length - 1
|
|
4598
4621
|
},
|
|
4599
4622
|
"w-[2px] h-full"
|
|
4600
4623
|
])
|
|
4601
4624
|
}, null, 2)
|
|
4602
4625
|
])
|
|
4603
4626
|
]),
|
|
4604
|
-
e("div",
|
|
4627
|
+
e("div", bl, [
|
|
4605
4628
|
e("div", _l, [
|
|
4606
4629
|
e("div", Sl, k(W.header), 1),
|
|
4607
4630
|
e("div", kl, k(W.date), 1)
|
|
@@ -4616,16 +4639,16 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4616
4639
|
n("update:show", !1), n("submitted");
|
|
4617
4640
|
})
|
|
4618
4641
|
}, null, 8, ["deliveryOrder", "purchaseOrder", "received-info-map"])) : V("", !0),
|
|
4619
|
-
(Fe = (
|
|
4642
|
+
(Fe = (ge = W.deliveryOrder) == null ? void 0 : ge.netSuite) != null && Fe.id ? (i(), he(ts, {
|
|
4620
4643
|
key: 1,
|
|
4621
4644
|
title: "Admin",
|
|
4622
4645
|
class: "min-w-[140px]"
|
|
4623
4646
|
}, {
|
|
4624
4647
|
default: ce(() => {
|
|
4625
|
-
var
|
|
4648
|
+
var Re, Ee;
|
|
4626
4649
|
return [
|
|
4627
4650
|
T(Xn, {
|
|
4628
|
-
"netsuite-id": (Ee = (
|
|
4651
|
+
"netsuite-id": (Ee = (Re = W.deliveryOrder) == null ? void 0 : Re.netSuite) == null ? void 0 : Ee.id
|
|
4629
4652
|
}, null, 8, ["netsuite-id"])
|
|
4630
4653
|
];
|
|
4631
4654
|
}),
|
|
@@ -4645,8 +4668,8 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4645
4668
|
e("div", {
|
|
4646
4669
|
class: We([
|
|
4647
4670
|
{
|
|
4648
|
-
"bg-fm-color-primary": Z <
|
|
4649
|
-
"bg-white": Z >=
|
|
4671
|
+
"bg-fm-color-primary": Z < g.value.length - 1,
|
|
4672
|
+
"bg-white": Z >= g.value.length - 1
|
|
4650
4673
|
},
|
|
4651
4674
|
"w-[2px] h-full"
|
|
4652
4675
|
])
|
|
@@ -4660,19 +4683,19 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4660
4683
|
}, {
|
|
4661
4684
|
default: ce(() => [
|
|
4662
4685
|
e("div", Al, [
|
|
4663
|
-
(i(!0), v(Ce, null, Te(W.info, (
|
|
4686
|
+
(i(!0), v(Ce, null, Te(W.info, (Re, Ee) => (i(), v("div", {
|
|
4664
4687
|
key: Ee,
|
|
4665
4688
|
class: "flex flex-col gap-4"
|
|
4666
4689
|
}, [
|
|
4667
|
-
e("div", Dl, k(
|
|
4668
|
-
e("div",
|
|
4669
|
-
(i(!0), v(Ce, null, Te(
|
|
4690
|
+
e("div", Dl, k(Re == null ? void 0 : Re.label), 1),
|
|
4691
|
+
e("div", Nl, [
|
|
4692
|
+
(i(!0), v(Ce, null, Te(Re == null ? void 0 : Re.values, (Le, it) => (i(), v("div", {
|
|
4670
4693
|
key: it,
|
|
4671
4694
|
class: "fm-typo-en-body-lg-600"
|
|
4672
4695
|
}, [
|
|
4673
4696
|
typeof Le == "string" ? (i(), v(Ce, { key: 0 }, [
|
|
4674
4697
|
Ge(k(Le), 1)
|
|
4675
|
-
], 64)) : (i(), he(
|
|
4698
|
+
], 64)) : (i(), he(Rs(Le), { key: 1 }))
|
|
4676
4699
|
]))), 128))
|
|
4677
4700
|
])
|
|
4678
4701
|
]))), 128))
|
|
@@ -4688,7 +4711,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4688
4711
|
T(y),
|
|
4689
4712
|
e("div", null, [
|
|
4690
4713
|
e("img", {
|
|
4691
|
-
src: h(
|
|
4714
|
+
src: h(Jt),
|
|
4692
4715
|
alt: "List is empty"
|
|
4693
4716
|
}, null, 8, cl)
|
|
4694
4717
|
]),
|
|
@@ -4697,7 +4720,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4697
4720
|
T(y),
|
|
4698
4721
|
T(y)
|
|
4699
4722
|
]))
|
|
4700
|
-
])) : P.value.value === "actionLogs" ? (i(), v("div",
|
|
4723
|
+
])) : P.value.value === "actionLogs" ? (i(), v("div", Rl, [
|
|
4701
4724
|
we.value.length ? (i(), v("div", Tl, [
|
|
4702
4725
|
(i(!0), v(Ce, null, Te(we.value, (W, Z) => (i(), he(I, {
|
|
4703
4726
|
key: Z,
|
|
@@ -4705,14 +4728,14 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4705
4728
|
class: "py-12 px-16"
|
|
4706
4729
|
}, {
|
|
4707
4730
|
default: ce(() => {
|
|
4708
|
-
var
|
|
4731
|
+
var ge;
|
|
4709
4732
|
return [
|
|
4710
4733
|
e("div", El, [
|
|
4711
4734
|
e("div", ql, [
|
|
4712
4735
|
e("div", Vl, k(h(nt)[W.action] ? h(_)(h(nt)[W.action].translationKey) : W.action), 1),
|
|
4713
4736
|
e("div", Ll, k(h(et)(W.changedAt)), 1)
|
|
4714
4737
|
]),
|
|
4715
|
-
e("div", jl, k((
|
|
4738
|
+
e("div", jl, k((ge = W.changedBy) == null ? void 0 : ge.name), 1),
|
|
4716
4739
|
W.remarks ? (i(), v("div", Ul, k(W.remarks), 1)) : V("", !0)
|
|
4717
4740
|
])
|
|
4718
4741
|
];
|
|
@@ -4723,7 +4746,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4723
4746
|
T(y),
|
|
4724
4747
|
e("div", null, [
|
|
4725
4748
|
e("img", {
|
|
4726
|
-
src: h(
|
|
4749
|
+
src: h(Jt),
|
|
4727
4750
|
alt: "List is empty"
|
|
4728
4751
|
}, null, 8, Fl)
|
|
4729
4752
|
]),
|
|
@@ -4761,7 +4784,7 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4761
4784
|
loading: se.value === "approveRequest",
|
|
4762
4785
|
disabled: se.value !== "approveRequest" && te.value
|
|
4763
4786
|
}, null, 8, ["label", "loading", "disabled"])) : V("", !0),
|
|
4764
|
-
h(F).ableToCreateFulfillment(o.purchaseOrder, o.poRequest) &&
|
|
4787
|
+
h(F).ableToCreateFulfillment(o.purchaseOrder, o.poRequest) && s.scope === "approval" ? (i(), he($, {
|
|
4765
4788
|
key: 2,
|
|
4766
4789
|
label: h(_)("inventory.transfer.receiveRequest.actions.processRequest"),
|
|
4767
4790
|
onClick: l[7] || (l[7] = (S) => A("processRequest")),
|
|
@@ -4782,16 +4805,16 @@ const xo = { class: "flex flex-col gap-3" }, wo = { class: "flex flex-col gap-4"
|
|
|
4782
4805
|
});
|
|
4783
4806
|
export {
|
|
4784
4807
|
At as P,
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4808
|
+
gi as _,
|
|
4809
|
+
hi as a,
|
|
4810
|
+
lr as b,
|
|
4788
4811
|
ps as c,
|
|
4789
4812
|
ms as d,
|
|
4790
4813
|
hs as e,
|
|
4791
4814
|
vt as f,
|
|
4792
4815
|
us as g,
|
|
4793
4816
|
fs as h,
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4817
|
+
Tt as i,
|
|
4818
|
+
It as j,
|
|
4819
|
+
yi as u
|
|
4797
4820
|
};
|