@feedmepos/mf-inventory-portal 1.2.31-dev.1 → 1.2.31-dev.3
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-DfKh34ES.js → App-B-WNsmAG.js} +3 -3
- package/dist/{ApprovalView-DyoKsEqh.js → ApprovalView-DQi0XFmN.js} +6 -6
- package/dist/{BindingsDialog-7rGLzkyA.js → BindingsDialog-Cx4fEpHS.js} +2 -2
- package/dist/{BindingsPicker-Cj1DvhQN.js → BindingsPicker-DGfp2MzU.js} +2 -2
- package/dist/{BindingsTable-CAreptqr.js → BindingsTable-DL7BI4SC.js} +4 -4
- package/dist/{ClosingDraftView-DoDGz9Y8.js → ClosingDraftView-j3924s99.js} +60 -61
- package/dist/{ClosingHistoryView-BJSE7ZSv.js → ClosingHistoryView-Dto_61bZ.js} +3 -3
- package/dist/{ClosingTemplateView-Dr2eJk4h.js → ClosingTemplateView-BXzUL5Jc.js} +63 -64
- package/dist/{DeliveryOrderPrintPreview-BzYLm6J6.js → DeliveryOrderPrintPreview-FrW3oyrD.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-16r_hkBE.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BMRQb-me.js} +5 -5
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Csesow4V.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-frjrO0sv.js} +3 -3
- package/dist/{FmMultiselectDialog-BGhSjgbj.js → FmMultiselectDialog-66369F8L.js} +63 -62
- package/dist/{FmMultiselectDialog-DUrpqAkF.js → FmMultiselectDialog-Dx0o4EXh.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CSv7osJW.js → FmUnitInput.vue_vue_type_script_setup_true_lang-hGy_zxob.js} +3 -3
- package/dist/{ImportView-BAkyTU_3.js → ImportView-8bdFM2le.js} +7 -7
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-z0IAsrH_.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-6YWvuajr.js} +1 -1
- package/dist/{IngredientGroupView-D7gurA7T.js → IngredientGroupView-DNJ9i8FJ.js} +6 -6
- package/dist/{IngredientsView-hwfpMtTX.js → IngredientsView-BQV62iRc.js} +15 -15
- package/dist/{IntegrationView-DwqzQ6E3.js → IntegrationView-DdjyJMIa.js} +11 -11
- package/dist/{InventoryBindingForm-CwjM6Rqk.js → InventoryBindingForm-CJacciDp.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-BPr8PDwu.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DcHAS2mI.js} +4 -4
- package/dist/{InventoryBindingSummary-B7UFFMkm.js → InventoryBindingSummary-DivPGJmB.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Djo2b2Ix.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DGnzF9Y-.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BSgGGiN6.js → PremiumBadge.vue_vue_type_script_setup_true_lang-kBjgDNjc.js} +2 -2
- package/dist/{PublishView-CA9gFV_r.js → PublishView-BsrYIDHu.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-BeHd82Y0.js → PurchaseOrderPrintPreview-BWvJYn3H.js} +1 -1
- package/dist/{ReceiveRequestView-DEthRdM1.js → ReceiveRequestView-DmG9dEJS.js} +20 -20
- package/dist/{RecipeView-D45gkYHY.js → RecipeView-Dt_kJwvE.js} +8 -8
- package/dist/{StockView-COx7A4Ac.js → StockView-BgFKkgZT.js} +16 -16
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DX35xDkm.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DzCb7l2o.js} +1 -1
- package/dist/{SupplierView-DHM3dJMZ.js → SupplierView-DhBm-m5W.js} +11 -11
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-Bg2K2ULw.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-BqUcJtoV.js} +2 -2
- package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CW5xPij2.js +153 -0
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CVm2bXic.js → TransferDetails.vue_vue_type_script_setup_true_lang-CxybW4_c.js} +14 -14
- package/dist/{TransferTemplateView-BtYozLuk.js → TransferTemplateView-C_ZrimOH.js} +15 -15
- package/dist/{UnitView-B4mqodQa.js → UnitView-wKMnAjUO.js} +6 -6
- package/dist/{WarehouseView-CjDM8L_V.js → WarehouseView-BG7tXYmF.js} +5 -5
- package/dist/{WastageTemplateView-Be4Y_zV8.js → WastageTemplateView-g4fCdiB1.js} +54 -55
- package/dist/{app-DYsP0gKj.js → app-D4IM0wHL.js} +1347 -1325
- package/dist/{app-rgirz_52.js → app-uBuHtW8m.js} +2546 -2443
- package/dist/app.js +1 -1
- package/dist/{closing-template-BVy1ga2g.js → closing-template-Bv6Myxdn.js} +1 -1
- package/dist/components/FmMultiselectDialogProps.d.ts +7 -0
- package/dist/components/TemplatePublishDialog.d.ts +1 -1
- package/dist/{date2-BO7HiZTk.js → date2-Dd9ptrqd.js} +1 -1
- package/dist/{dayjs.min-HNt4C1ja.js → dayjs.min-CWI11hCD.js} +1 -1
- package/dist/{decimal-BJ8rKm1R.js → decimal-C3Z-ftMJ.js} +2 -2
- package/dist/{defineDeepModel-CidpVmK7.js → defineDeepModel-BfiLqnop.js} +1 -1
- package/dist/{duplicate-template-C25Z0lvq.js → duplicate-template-B2EuoFxA.js} +1 -1
- package/dist/{feature-DCia3aqG.js → feature-ZHDFuTZ_.js} +2 -2
- package/dist/{format-time-from-id-BPws326b.js → format-time-from-id-CSpCF7Ee.js} +1 -1
- package/dist/{format-unit-display-C2P3mS8l.js → format-unit-display-BcWGiCVI.js} +10 -10
- package/dist/{import-export.helper-Dt6ZMAPT.js → import-export.helper-C7ae5erR.js} +5 -5
- package/dist/{index-BjUDHtA2.js → index-BeB8ecvv.js} +1 -1
- package/dist/{index-6zxXdF-V.js → index-Dre7jvrB.js} +1 -1
- package/dist/{index-tZj47B-j.js → index-s4uXiu5o.js} +3 -3
- package/dist/{lodash-DLMgBu6M.js → lodash-DrzA6QGq.js} +1 -1
- package/dist/{netsuite-BSMLXIQa.js → netsuite-DFbsrLfl.js} +371 -359
- package/dist/{purchase-order-template-D5NGCbI2.js → purchase-order-template-J0Uqb3IF.js} +1 -1
- package/dist/{rules-BiaGzhvQ.js → rules-RP2F9r_X.js} +3 -3
- package/dist/{stock-DOCQ91Jh.js → stock-Ctj1mNkn.js} +1 -1
- package/dist/{stock-Ty-89Ap8.js → stock-DOmkE0Nf.js} +3 -3
- package/dist/style.css +1 -1
- package/dist/{supplier-Dxb5ULjF.js → supplier-DQToh3we.js} +2 -2
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-BI0yIG6A.js → use-ingredient-select-dialog-kOstDeTC.js} +2 -2
- package/dist/{use-inventory-binding-dialog-CbZC-VuL.js → use-inventory-binding-dialog-DrrHdZ4N.js} +2 -2
- package/dist/use-template-enabled-locations-2-B2Hu1KET.js +120 -0
- package/dist/{vue-i18n-Cqx7gNJF.js → vue-i18n-C-GaaY2p.js} +321 -321
- package/dist/{xlsx-ex8Bmftq.js → xlsx-Bg6KF2T6.js} +398 -398
- package/dist/{xlsx.util-C8YXEqEl.js → xlsx.util-CegYq3Hg.js} +1 -1
- package/package.json +3 -3
- package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CyMEGFh5.js +0 -123
- package/dist/use-template-enabled-locations-2-Dhttpl0B.js +0 -111
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { m as e, U as jt, V as Vt, W as Bt, X as qt, Y as je, Z as Ht, _ as Be, L as qe, $ as bt, a0 as St, a1 as R, a2 as O, s as
|
|
1
|
+
import { m as e, U as jt, V as Vt, W as Bt, X as qt, Y as je, Z as Ht, _ as Be, L as qe, $ as bt, a0 as St, a1 as R, a2 as O, s as A, e as ve, a3 as Oe, Q as ee, z as ie, a4 as Kt, J as j, a5 as vt, a6 as V, a7 as Yt, a8 as Gt, a9 as Jt, aa as Qe, ab as zt, o as Qt, j as Wt, t as dt, a as Zt, u as Ce } from "./app-D4IM0wHL.js";
|
|
2
2
|
import { useCoreStore as Me } from "@feedmepos/mf-common";
|
|
3
3
|
import { useSnackbar as Xt } from "@feedmepos/ui-library";
|
|
4
|
-
import { _ as L } from "./lodash-
|
|
5
|
-
import { defineComponent as en, ref as He, computed as le, resolveComponent as
|
|
6
|
-
import { u as rn } from "./feature-
|
|
7
|
-
var on = Object.defineProperty,
|
|
4
|
+
import { _ as L } from "./lodash-DrzA6QGq.js";
|
|
5
|
+
import { defineComponent as en, ref as He, computed as le, resolveComponent as ke, openBlock as z, createBlock as tn, withCtx as re, createVNode as oe, createElementVNode as M, createElementBlock as ae, Fragment as Re, createCommentVNode as Ae, createTextVNode as Q, toDisplayString as x, renderList as nn, unref as ct, h as sn } from "vue";
|
|
6
|
+
import { u as rn } from "./feature-ZHDFuTZ_.js";
|
|
7
|
+
var on = Object.defineProperty, E = (s, a) => on(s, "name", { value: a, configurable: !0 }), he = "MYR";
|
|
8
8
|
e.enum([
|
|
9
9
|
"custbody_fm_do_id",
|
|
10
10
|
"custbody_fm_po_request_id",
|
|
@@ -401,7 +401,7 @@ var pn = e.object({
|
|
|
401
401
|
custcol_pkt_code: e.string().nullish(),
|
|
402
402
|
custcol_pkt_name: e.string().nullish(),
|
|
403
403
|
externalId: e.string().nullish()
|
|
404
|
-
}),
|
|
404
|
+
}), En = e.object({
|
|
405
405
|
item: e.object({
|
|
406
406
|
id: e.string()
|
|
407
407
|
}),
|
|
@@ -447,16 +447,16 @@ e.object({
|
|
|
447
447
|
}).optional(),
|
|
448
448
|
trandate: e.string().nullish(),
|
|
449
449
|
item: e.object({
|
|
450
|
-
items: e.array(
|
|
450
|
+
items: e.array(En)
|
|
451
451
|
}).optional(),
|
|
452
452
|
custbody_fm_po_request_id: e.string(),
|
|
453
453
|
custbody_fm_po_num: e.number()
|
|
454
454
|
});
|
|
455
|
-
var
|
|
455
|
+
var k;
|
|
456
456
|
(function(s) {
|
|
457
457
|
s.A = "Pending Approval", s.B = "Pending Fulfillment", s.C = "Rejected", s.D = "Partially Fulfilled", s.E = "Pending Receipt/Partially Fulfilled", s.F = "Pending Receipt", s.G = "Received", s.H = "Closed";
|
|
458
|
-
})(
|
|
459
|
-
var ue = e.nativeEnum(
|
|
458
|
+
})(k || (k = {}));
|
|
459
|
+
var ue = e.nativeEnum(k), gn = e.object({
|
|
460
460
|
abbreviation: e.string(),
|
|
461
461
|
baseUnit: e.boolean(),
|
|
462
462
|
conversionRate: e.number(),
|
|
@@ -472,7 +472,7 @@ e.object({
|
|
|
472
472
|
lastModifiedDate: e.string(),
|
|
473
473
|
name: e.string(),
|
|
474
474
|
uom: e.object({
|
|
475
|
-
items: e.array(
|
|
475
|
+
items: e.array(gn),
|
|
476
476
|
totalResults: e.number()
|
|
477
477
|
})
|
|
478
478
|
});
|
|
@@ -865,52 +865,58 @@ e.object({
|
|
|
865
865
|
function Ze(s) {
|
|
866
866
|
return Oe.FCurrency.safeParse(s.trim().toUpperCase()).success;
|
|
867
867
|
}
|
|
868
|
-
|
|
868
|
+
E(Ze, "isCurrencySupported");
|
|
869
869
|
var lt;
|
|
870
870
|
(function(s) {
|
|
871
871
|
(function(a) {
|
|
872
872
|
function u(r, t) {
|
|
873
|
-
var v,
|
|
873
|
+
var v, C;
|
|
874
874
|
const { nsAssemblyItem: n, fmUnit: i, nsUnitTypeConfig: o } = r;
|
|
875
875
|
if (!n.unitsType)
|
|
876
876
|
throw new Error(`Missing unit type in NetSuite assembly item ${n.id}`);
|
|
877
877
|
if (o.netSuiteId !== n.unitsType.id)
|
|
878
878
|
throw new Error(`Unit type mismatch for NetSuite assembly item ${n.id}: expected unit type ID ${n.unitsType.id}, got ${o.netSuiteId}`);
|
|
879
|
-
const m = n.subsidiary.items.map((
|
|
879
|
+
const m = n.subsidiary.items.map((N) => N.id), l = R({
|
|
880
880
|
prefix: O.Enum.sku
|
|
881
|
-
}), f = (v = t == null ? void 0 : t.netsuiteCustomAttributes) == null ? void 0 : v.reduce((
|
|
882
|
-
const
|
|
881
|
+
}), f = (v = t == null ? void 0 : t.netsuiteCustomAttributes) == null ? void 0 : v.reduce((N, b) => {
|
|
882
|
+
const D = b.compute(r);
|
|
883
883
|
return {
|
|
884
|
-
...
|
|
885
|
-
[b.fieldId]:
|
|
884
|
+
...N,
|
|
885
|
+
[b.fieldId]: D
|
|
886
886
|
};
|
|
887
887
|
}, {}), d = n.purchaseUnit === n.baseUnit;
|
|
888
888
|
let I = null;
|
|
889
889
|
if (!d) {
|
|
890
|
-
const
|
|
891
|
-
if (!
|
|
890
|
+
const N = o.measurements.find((D) => D.netSuiteId === n.purchaseUnit);
|
|
891
|
+
if (!N)
|
|
892
892
|
throw new Error(`Measurement with NetSuite ID ${n.purchaseUnit} not found in unit ${i._id} (NetSuite unit type ${n.unitsType.id}). Please sync unit types before syncing assembly items.`);
|
|
893
|
-
|
|
893
|
+
const b = i.measurements.find((D) => D.id === N.id);
|
|
894
|
+
if (!b)
|
|
895
|
+
throw new Error(`Measurement with ID ${N.id} not found in unit ${i._id}. This indicates a data inconsistency. Please investigate.`);
|
|
896
|
+
I = b;
|
|
894
897
|
}
|
|
895
|
-
const p = (
|
|
896
|
-
const
|
|
898
|
+
const p = (C = t == null ? void 0 : t.overrideAttributes) == null ? void 0 : C.reduce((N, b) => {
|
|
899
|
+
const D = b.compute(r);
|
|
897
900
|
return {
|
|
898
|
-
...
|
|
899
|
-
[b.fieldId]:
|
|
901
|
+
...N,
|
|
902
|
+
[b.fieldId]: D
|
|
900
903
|
};
|
|
901
|
-
}, {}),
|
|
904
|
+
}, {}), g = n.currency.refName.trim().toUpperCase(), y = n.cost ?? n.lastPurchasePrice, _ = {
|
|
902
905
|
_id: l,
|
|
903
906
|
name: n.itemId,
|
|
904
907
|
code: n.id,
|
|
905
908
|
unit: i,
|
|
906
|
-
trackingMeasurement: I,
|
|
909
|
+
trackingMeasurement: (I == null ? void 0 : I.id) ?? null,
|
|
907
910
|
convert: null,
|
|
908
911
|
valuation: Dt(n),
|
|
909
912
|
isInactive: n.isInactive,
|
|
910
913
|
defaultCost: y ? {
|
|
914
|
+
...I && {
|
|
915
|
+
measurement: I
|
|
916
|
+
},
|
|
911
917
|
costPerUnit: {
|
|
912
|
-
currency: Ze(
|
|
913
|
-
...
|
|
918
|
+
currency: Ze(g) ? g : he,
|
|
919
|
+
...A.fromNumber(y)
|
|
914
920
|
}
|
|
915
921
|
} : null,
|
|
916
922
|
...p
|
|
@@ -935,7 +941,7 @@ var lt;
|
|
|
935
941
|
}
|
|
936
942
|
};
|
|
937
943
|
}
|
|
938
|
-
|
|
944
|
+
E(u, "transformAsParent"), a.transformAsParent = u;
|
|
939
945
|
function c(r, t) {
|
|
940
946
|
var f;
|
|
941
947
|
const { nsAssemblyItem: n, nsUnitTypeConfig: i } = r;
|
|
@@ -957,7 +963,7 @@ var lt;
|
|
|
957
963
|
name: n.itemId,
|
|
958
964
|
netSuiteId: String(n.internalId),
|
|
959
965
|
unitTypeId: n.unitsType.id,
|
|
960
|
-
unitOfMeasureId: n.
|
|
966
|
+
unitOfMeasureId: n.stockUnit,
|
|
961
967
|
cogsAccount: n.cogsAccount ? {
|
|
962
968
|
id: n.cogsAccount.id,
|
|
963
969
|
refName: n.cogsAccount.refName
|
|
@@ -970,7 +976,7 @@ var lt;
|
|
|
970
976
|
}
|
|
971
977
|
};
|
|
972
978
|
}
|
|
973
|
-
|
|
979
|
+
E(c, "transformAsChild"), a.transformAsChild = c;
|
|
974
980
|
})(s.FromNetsuite || (s.FromNetsuite = {}));
|
|
975
981
|
})(lt || (lt = {}));
|
|
976
982
|
function Dt(s) {
|
|
@@ -983,52 +989,58 @@ function Dt(s) {
|
|
|
983
989
|
return ve.Enum.WAVG;
|
|
984
990
|
}
|
|
985
991
|
}
|
|
986
|
-
|
|
992
|
+
E(Dt, "_getValuation");
|
|
987
993
|
var mt;
|
|
988
994
|
(function(s) {
|
|
989
995
|
(function(a) {
|
|
990
996
|
function u(r, t) {
|
|
991
|
-
var v,
|
|
997
|
+
var v, C;
|
|
992
998
|
const { nsInventoryItem: n, fmUnit: i, nsUnitTypeConfig: o } = r;
|
|
993
999
|
if (!n.unitsType)
|
|
994
1000
|
throw new Error(`Missing unit type in NetSuite inventory item ${n.id}`);
|
|
995
1001
|
if (o.netSuiteId !== n.unitsType.id)
|
|
996
1002
|
throw new Error(`Unit type mismatch for NetSuite inventory item ${n.id}: expected unit type ID ${n.unitsType.id}, got ${o.netSuiteId}`);
|
|
997
|
-
const m = n.subsidiary.items.map((
|
|
1003
|
+
const m = n.subsidiary.items.map((N) => N.id), l = R({
|
|
998
1004
|
prefix: O.Enum.sku
|
|
999
|
-
}), f = (v = t == null ? void 0 : t.netsuiteCustomAttributes) == null ? void 0 : v.reduce((
|
|
1000
|
-
const
|
|
1005
|
+
}), f = (v = t == null ? void 0 : t.netsuiteCustomAttributes) == null ? void 0 : v.reduce((N, b) => {
|
|
1006
|
+
const D = b.compute(r);
|
|
1001
1007
|
return {
|
|
1002
|
-
...
|
|
1003
|
-
[b.fieldId]:
|
|
1008
|
+
...N,
|
|
1009
|
+
[b.fieldId]: D
|
|
1004
1010
|
};
|
|
1005
1011
|
}, {}), d = n.purchaseUnit === n.baseUnit;
|
|
1006
1012
|
let I = null;
|
|
1007
1013
|
if (!d) {
|
|
1008
|
-
const
|
|
1009
|
-
if (!
|
|
1014
|
+
const N = o.measurements.find((D) => D.netSuiteId === n.purchaseUnit);
|
|
1015
|
+
if (!N)
|
|
1010
1016
|
throw new Error(`Measurement with NetSuite ID ${n.purchaseUnit} not found in unit ${i._id} (NetSuite unit type ${n.unitsType.id}). Please sync unit types before syncing inventory items.`);
|
|
1011
|
-
|
|
1017
|
+
const b = i.measurements.find((D) => D.id === N.id);
|
|
1018
|
+
if (!b)
|
|
1019
|
+
throw new Error(`Measurement with ID ${N.id} not found in unit ${i._id}. This indicates a data inconsistency. Please investigate.`);
|
|
1020
|
+
I = b;
|
|
1012
1021
|
}
|
|
1013
|
-
const p = (
|
|
1014
|
-
const
|
|
1022
|
+
const p = (C = t == null ? void 0 : t.overrideAttributes) == null ? void 0 : C.reduce((N, b) => {
|
|
1023
|
+
const D = b.compute(r);
|
|
1015
1024
|
return {
|
|
1016
|
-
...
|
|
1017
|
-
[b.fieldId]:
|
|
1025
|
+
...N,
|
|
1026
|
+
[b.fieldId]: D
|
|
1018
1027
|
};
|
|
1019
|
-
}, {}),
|
|
1028
|
+
}, {}), g = n.currency.refName.trim().toUpperCase(), y = n.cost, _ = {
|
|
1020
1029
|
_id: l,
|
|
1021
1030
|
name: n.itemId,
|
|
1022
1031
|
code: n.id,
|
|
1023
1032
|
unit: i,
|
|
1024
|
-
trackingMeasurement: I,
|
|
1033
|
+
trackingMeasurement: (I == null ? void 0 : I.id) ?? null,
|
|
1025
1034
|
convert: null,
|
|
1026
1035
|
valuation: Nt(n),
|
|
1027
1036
|
isInactive: n.isInactive,
|
|
1028
1037
|
defaultCost: y ? {
|
|
1038
|
+
...I && {
|
|
1039
|
+
measurement: I
|
|
1040
|
+
},
|
|
1029
1041
|
costPerUnit: {
|
|
1030
|
-
currency: Ze(
|
|
1031
|
-
...
|
|
1042
|
+
currency: Ze(g) ? g : he,
|
|
1043
|
+
...A.fromNumber(y)
|
|
1032
1044
|
}
|
|
1033
1045
|
} : null,
|
|
1034
1046
|
...p
|
|
@@ -1053,7 +1065,7 @@ var mt;
|
|
|
1053
1065
|
}
|
|
1054
1066
|
};
|
|
1055
1067
|
}
|
|
1056
|
-
|
|
1068
|
+
E(u, "transformAsParent"), a.transformAsParent = u;
|
|
1057
1069
|
function c(r, t) {
|
|
1058
1070
|
var f;
|
|
1059
1071
|
const { nsInventoryItem: n, nsUnitTypeConfig: i } = r;
|
|
@@ -1075,7 +1087,7 @@ var mt;
|
|
|
1075
1087
|
name: n.itemId,
|
|
1076
1088
|
netSuiteId: String(n.internalId),
|
|
1077
1089
|
unitTypeId: n.unitsType.id,
|
|
1078
|
-
unitOfMeasureId: n.
|
|
1090
|
+
unitOfMeasureId: n.stockUnit,
|
|
1079
1091
|
cogsAccount: n.cogsAccount ? {
|
|
1080
1092
|
id: n.cogsAccount.id,
|
|
1081
1093
|
refName: n.cogsAccount.refName
|
|
@@ -1088,7 +1100,7 @@ var mt;
|
|
|
1088
1100
|
}
|
|
1089
1101
|
};
|
|
1090
1102
|
}
|
|
1091
|
-
|
|
1103
|
+
E(c, "transformAsChild"), a.transformAsChild = c;
|
|
1092
1104
|
})(s.FromNetsuite || (s.FromNetsuite = {}));
|
|
1093
1105
|
})(mt || (mt = {}));
|
|
1094
1106
|
function Nt(s) {
|
|
@@ -1101,7 +1113,7 @@ function Nt(s) {
|
|
|
1101
1113
|
return ve.Enum.WAVG;
|
|
1102
1114
|
}
|
|
1103
1115
|
}
|
|
1104
|
-
|
|
1116
|
+
E(Nt, "_getValuation");
|
|
1105
1117
|
function Xe(s, a, u) {
|
|
1106
1118
|
let c = 0, r = he;
|
|
1107
1119
|
const t = s == null ? void 0 : s.find((n) => n.itemid === u && n.hascostline === "T" && n.transactionline === a);
|
|
@@ -1117,7 +1129,7 @@ function Xe(s, a, u) {
|
|
|
1117
1129
|
currency: r
|
|
1118
1130
|
};
|
|
1119
1131
|
}
|
|
1120
|
-
|
|
1132
|
+
E(Xe, "getGLImpactCostMapping");
|
|
1121
1133
|
var te;
|
|
1122
1134
|
(function(s) {
|
|
1123
1135
|
(function(a) {
|
|
@@ -1126,34 +1138,34 @@ var te;
|
|
|
1126
1138
|
const { poItem: n, nsItemSetting: i, nsUnitTypes: o, overrideCost: m = !0, customAttributes: l } = t;
|
|
1127
1139
|
let f;
|
|
1128
1140
|
if (m && n.totalCost) {
|
|
1129
|
-
const
|
|
1141
|
+
const g = A.divide([
|
|
1130
1142
|
n.totalCost,
|
|
1131
1143
|
n.quantity
|
|
1132
1144
|
]);
|
|
1133
1145
|
f = {
|
|
1134
|
-
amount: Number(
|
|
1146
|
+
amount: Number(A.toFormatString({
|
|
1135
1147
|
value: n.totalCost
|
|
1136
1148
|
})),
|
|
1137
|
-
rate: Number(
|
|
1138
|
-
value:
|
|
1149
|
+
rate: Number(A.toFormatString({
|
|
1150
|
+
value: g
|
|
1139
1151
|
}))
|
|
1140
1152
|
};
|
|
1141
1153
|
}
|
|
1142
1154
|
let d;
|
|
1143
1155
|
if (n.measurement) {
|
|
1144
|
-
const
|
|
1156
|
+
const g = n.measurement.id;
|
|
1145
1157
|
for (const y of o)
|
|
1146
1158
|
for (const _ of (y == null ? void 0 : y.measurements) || [])
|
|
1147
|
-
if (_.id ===
|
|
1159
|
+
if (_.id === g) {
|
|
1148
1160
|
d = _.netSuiteId;
|
|
1149
1161
|
break;
|
|
1150
1162
|
}
|
|
1151
1163
|
} else
|
|
1152
|
-
d = (p = o.find((
|
|
1153
|
-
const I = l == null ? void 0 : l.reduce((
|
|
1164
|
+
d = (p = o.find((g) => g.id == n.sku.unit._id)) == null ? void 0 : p.baseUnitUnitOfMeasureId;
|
|
1165
|
+
const I = l == null ? void 0 : l.reduce((g, y) => {
|
|
1154
1166
|
const _ = y.compute(t, y.extraParams);
|
|
1155
1167
|
return {
|
|
1156
|
-
...
|
|
1168
|
+
...g,
|
|
1157
1169
|
[y.fieldId]: _
|
|
1158
1170
|
};
|
|
1159
1171
|
}, {});
|
|
@@ -1164,13 +1176,13 @@ var te;
|
|
|
1164
1176
|
},
|
|
1165
1177
|
line: n.externalId ? Number(n.externalId) : void 0,
|
|
1166
1178
|
units: d,
|
|
1167
|
-
quantity: Number(
|
|
1179
|
+
quantity: Number(A.toFormatString({
|
|
1168
1180
|
value: n.quantity
|
|
1169
1181
|
})),
|
|
1170
1182
|
...I
|
|
1171
1183
|
};
|
|
1172
1184
|
}
|
|
1173
|
-
|
|
1185
|
+
E(u, "toCreateDto"), a.toCreateDto = u;
|
|
1174
1186
|
function c(t) {
|
|
1175
1187
|
var d;
|
|
1176
1188
|
const {
|
|
@@ -1184,18 +1196,18 @@ var te;
|
|
|
1184
1196
|
if (n.measurement) {
|
|
1185
1197
|
const I = n.measurement.id;
|
|
1186
1198
|
for (const p of o)
|
|
1187
|
-
for (const
|
|
1188
|
-
if (
|
|
1189
|
-
l =
|
|
1199
|
+
for (const g of (p == null ? void 0 : p.measurements) || [])
|
|
1200
|
+
if (g.id === I) {
|
|
1201
|
+
l = g.netSuiteId;
|
|
1190
1202
|
break;
|
|
1191
1203
|
}
|
|
1192
1204
|
} else
|
|
1193
1205
|
l = (d = o.find((I) => I.id == n.sku.unit._id)) == null ? void 0 : d.baseUnitUnitOfMeasureId;
|
|
1194
1206
|
const f = m == null ? void 0 : m.reduce((I, p) => {
|
|
1195
|
-
const
|
|
1207
|
+
const g = p.compute(t, p.extraParams);
|
|
1196
1208
|
return {
|
|
1197
1209
|
...I,
|
|
1198
|
-
[p.fieldId]:
|
|
1210
|
+
[p.fieldId]: g
|
|
1199
1211
|
};
|
|
1200
1212
|
}, {});
|
|
1201
1213
|
return {
|
|
@@ -1206,13 +1218,13 @@ var te;
|
|
|
1206
1218
|
unit: {
|
|
1207
1219
|
id: l
|
|
1208
1220
|
},
|
|
1209
|
-
quantity: Number(
|
|
1221
|
+
quantity: Number(A.toFormatString({
|
|
1210
1222
|
value: n.quantity
|
|
1211
1223
|
})),
|
|
1212
1224
|
...f
|
|
1213
1225
|
};
|
|
1214
1226
|
}
|
|
1215
|
-
|
|
1227
|
+
E(c, "toTransferOrderItemUpdateDto"), a.toTransferOrderItemUpdateDto = c;
|
|
1216
1228
|
function r(t) {
|
|
1217
1229
|
const {
|
|
1218
1230
|
poItem: n,
|
|
@@ -1235,17 +1247,17 @@ var te;
|
|
|
1235
1247
|
}
|
|
1236
1248
|
};
|
|
1237
1249
|
}
|
|
1238
|
-
|
|
1250
|
+
E(r, "toPurchaseOrderItemUpdateDto"), a.toPurchaseOrderItemUpdateDto = r;
|
|
1239
1251
|
})(s.ToNetSuite || (s.ToNetSuite = {})), function(a) {
|
|
1240
1252
|
function u(r) {
|
|
1241
|
-
var
|
|
1242
|
-
const { nsOrderItem: t, sku: n, measurement: i, context: o, currency: m } = r, l = (_ = (y = (
|
|
1243
|
-
const
|
|
1253
|
+
var g, y, _;
|
|
1254
|
+
const { nsOrderItem: t, sku: n, measurement: i, context: o, currency: m } = r, l = (_ = (y = (g = o == null ? void 0 : o.options) == null ? void 0 : g.purchaseOrderItem) == null ? void 0 : y.customAttributes) == null ? void 0 : _.reduce((S, v) => {
|
|
1255
|
+
const C = v.compute(r, v.extraParams);
|
|
1244
1256
|
return {
|
|
1245
1257
|
...S,
|
|
1246
|
-
[v.fieldId]:
|
|
1258
|
+
[v.fieldId]: C
|
|
1247
1259
|
};
|
|
1248
|
-
}, {}), f =
|
|
1260
|
+
}, {}), f = A.fromNumber(t.quantity), d = t.amount ? A.fromNumber(t.amount) : A.fromNumber(0), I = Oe.FCurrency.safeParse(m), p = I.success ? I.data : he;
|
|
1249
1261
|
return {
|
|
1250
1262
|
id: "",
|
|
1251
1263
|
externalId: String(t.line),
|
|
@@ -1265,16 +1277,16 @@ var te;
|
|
|
1265
1277
|
...l
|
|
1266
1278
|
};
|
|
1267
1279
|
}
|
|
1268
|
-
|
|
1280
|
+
E(u, "toPurchaseOrderItem"), a.toPurchaseOrderItem = u;
|
|
1269
1281
|
function c(r) {
|
|
1270
1282
|
var _, S, v;
|
|
1271
|
-
const { nsOrderItem: t, sku: n, measurement: i, context: o, glImpactCost: m } = r, { cost: l, currency: f } = Xe(m, String(t.line), t.item.id), d = (v = (S = (_ = o == null ? void 0 : o.options) == null ? void 0 : _.purchaseOrderReceived) == null ? void 0 : S.customAttributes) == null ? void 0 : v.reduce((
|
|
1272
|
-
const b =
|
|
1283
|
+
const { nsOrderItem: t, sku: n, measurement: i, context: o, glImpactCost: m } = r, { cost: l, currency: f } = Xe(m, String(t.line), t.item.id), d = (v = (S = (_ = o == null ? void 0 : o.options) == null ? void 0 : _.purchaseOrderReceived) == null ? void 0 : S.customAttributes) == null ? void 0 : v.reduce((C, N) => {
|
|
1284
|
+
const b = N.compute(r);
|
|
1273
1285
|
return {
|
|
1274
|
-
...
|
|
1275
|
-
[
|
|
1286
|
+
...C,
|
|
1287
|
+
[N.fieldId]: b
|
|
1276
1288
|
};
|
|
1277
|
-
}, {}), I =
|
|
1289
|
+
}, {}), I = A.fromNumber(t.quantity), p = A.fromNumber(l), g = Oe.FCurrency.safeParse(f), y = g.success ? g.data : he;
|
|
1278
1290
|
return {
|
|
1279
1291
|
id: "",
|
|
1280
1292
|
externalId: String(t.orderLine),
|
|
@@ -1292,7 +1304,7 @@ var te;
|
|
|
1292
1304
|
...d
|
|
1293
1305
|
};
|
|
1294
1306
|
}
|
|
1295
|
-
|
|
1307
|
+
E(c, "toPurchaseOrderReceived"), a.toPurchaseOrderReceived = c;
|
|
1296
1308
|
}(s.FromNetSuite || (s.FromNetSuite = {}));
|
|
1297
1309
|
})(te || (te = {}));
|
|
1298
1310
|
var ft;
|
|
@@ -1308,7 +1320,7 @@ var ft;
|
|
|
1308
1320
|
currency: c.currency.refName
|
|
1309
1321
|
};
|
|
1310
1322
|
}
|
|
1311
|
-
|
|
1323
|
+
E(u, "transform"), a.transform = u;
|
|
1312
1324
|
})(s.FromNetsuite || (s.FromNetsuite = {}));
|
|
1313
1325
|
})(ft || (ft = {}));
|
|
1314
1326
|
var Ye;
|
|
@@ -1330,7 +1342,7 @@ var Ye;
|
|
|
1330
1342
|
id: f.item.id
|
|
1331
1343
|
},
|
|
1332
1344
|
itemReceive: !0,
|
|
1333
|
-
quantity: Number(
|
|
1345
|
+
quantity: Number(A.toFormatString({
|
|
1334
1346
|
value: d.amount
|
|
1335
1347
|
})),
|
|
1336
1348
|
orderLine: l + 1
|
|
@@ -1348,7 +1360,7 @@ var Ye;
|
|
|
1348
1360
|
}
|
|
1349
1361
|
};
|
|
1350
1362
|
}
|
|
1351
|
-
|
|
1363
|
+
E(u, "transformFromTransferOrder"), a.transformFromTransferOrder = u;
|
|
1352
1364
|
})(s.ToNetSuite || (s.ToNetSuite = {})), function(a) {
|
|
1353
1365
|
function u(c, r, t) {
|
|
1354
1366
|
const n = t.item.items.map((o) => {
|
|
@@ -1372,18 +1384,18 @@ var Ye;
|
|
|
1372
1384
|
}
|
|
1373
1385
|
};
|
|
1374
1386
|
}
|
|
1375
|
-
|
|
1387
|
+
E(u, "transform"), a.transform = u;
|
|
1376
1388
|
}(s.FromNetSuite || (s.FromNetSuite = {}));
|
|
1377
1389
|
})(Ye || (Ye = {}));
|
|
1378
1390
|
function Le(s) {
|
|
1379
1391
|
const a = s.getFullYear(), u = String(s.getMonth() + 1).padStart(2, "0"), c = String(s.getDate()).padStart(2, "0");
|
|
1380
1392
|
return `${a}-${u}-${c}`;
|
|
1381
1393
|
}
|
|
1382
|
-
|
|
1394
|
+
E(Le, "formatDateYYYYMMDD");
|
|
1383
1395
|
function J(s, a) {
|
|
1384
1396
|
return s.getDate() === a.getDate() && s.getMonth() === a.getMonth() && s.getFullYear() === a.getFullYear();
|
|
1385
1397
|
}
|
|
1386
|
-
|
|
1398
|
+
E(J, "isSameDay");
|
|
1387
1399
|
var Pe;
|
|
1388
1400
|
(function(s) {
|
|
1389
1401
|
(function(a) {
|
|
@@ -1400,7 +1412,7 @@ var Pe;
|
|
|
1400
1412
|
return {
|
|
1401
1413
|
orderLine: d,
|
|
1402
1414
|
itemId: i[f.sku._id],
|
|
1403
|
-
quantity: Number(
|
|
1415
|
+
quantity: Number(A.toFormatString({
|
|
1404
1416
|
value: f.amount
|
|
1405
1417
|
}))
|
|
1406
1418
|
};
|
|
@@ -1417,7 +1429,7 @@ var Pe;
|
|
|
1417
1429
|
}
|
|
1418
1430
|
};
|
|
1419
1431
|
}
|
|
1420
|
-
|
|
1432
|
+
E(u, "toCreateDto"), a.toCreateDto = u;
|
|
1421
1433
|
})(s.ToNetSuiteTransferOrder || (s.ToNetSuiteTransferOrder = {})), function(a) {
|
|
1422
1434
|
function u(c, r, t, n) {
|
|
1423
1435
|
const i = Le(new Date(t.effectiveAt ?? t.createdAt)), o = c.reduce((l, f) => (f.id && (l[f.id] = f), l), {}), m = t.received.map((l) => {
|
|
@@ -1432,7 +1444,7 @@ var Pe;
|
|
|
1432
1444
|
return {
|
|
1433
1445
|
orderLine: f,
|
|
1434
1446
|
itemId: n[l.sku._id],
|
|
1435
|
-
quantity: Number(
|
|
1447
|
+
quantity: Number(A.toFormatString({
|
|
1436
1448
|
value: l.amount
|
|
1437
1449
|
}))
|
|
1438
1450
|
};
|
|
@@ -1448,7 +1460,7 @@ var Pe;
|
|
|
1448
1460
|
}
|
|
1449
1461
|
};
|
|
1450
1462
|
}
|
|
1451
|
-
|
|
1463
|
+
E(u, "toCreateDto"), a.toCreateDto = u;
|
|
1452
1464
|
}(s.ToNetSuitePurchaseOrder || (s.ToNetSuitePurchaseOrder = {})), function(a) {
|
|
1453
1465
|
function u(c, r, t) {
|
|
1454
1466
|
var o;
|
|
@@ -1479,11 +1491,11 @@ var Pe;
|
|
|
1479
1491
|
fullfillmentId: (o = t.itemFulfillment) == null ? void 0 : o.id
|
|
1480
1492
|
};
|
|
1481
1493
|
}
|
|
1482
|
-
|
|
1494
|
+
E(u, "transform"), a.transform = u;
|
|
1483
1495
|
}(s.FromNetSuite || (s.FromNetSuite = {}));
|
|
1484
1496
|
})(Pe || (Pe = {}));
|
|
1485
1497
|
function Ct(s) {
|
|
1486
|
-
switch (
|
|
1498
|
+
switch (k[s.id]) {
|
|
1487
1499
|
case ue.enum.A:
|
|
1488
1500
|
return j.Enum.REQUESTING;
|
|
1489
1501
|
case ue.enum.B:
|
|
@@ -1501,7 +1513,7 @@ function Ct(s) {
|
|
|
1501
1513
|
}
|
|
1502
1514
|
throw new Error(`Invalid NetSuite Transfer Order status with ${s.id}`);
|
|
1503
1515
|
}
|
|
1504
|
-
|
|
1516
|
+
E(Ct, "validateTransferOrderStatusByKey");
|
|
1505
1517
|
function At(s) {
|
|
1506
1518
|
switch (De[s.id]) {
|
|
1507
1519
|
case X.enum.A:
|
|
@@ -1520,31 +1532,31 @@ function At(s) {
|
|
|
1520
1532
|
}
|
|
1521
1533
|
throw new Error(`Invalid NetSuite Purchase Order status with ${s.id}`);
|
|
1522
1534
|
}
|
|
1523
|
-
|
|
1535
|
+
E(At, "validatePurchaseOrderStatusByKey");
|
|
1524
1536
|
function xe(s) {
|
|
1525
|
-
const a = Object.keys(
|
|
1537
|
+
const a = Object.keys(k).find((u) => k[u] === s);
|
|
1526
1538
|
if (!a)
|
|
1527
1539
|
throw new Error(`Invalid transfer order status value: ${s}`);
|
|
1528
1540
|
return a;
|
|
1529
1541
|
}
|
|
1530
|
-
|
|
1542
|
+
E(xe, "getTransferOrderStatusEnumKeyByValue");
|
|
1531
1543
|
function Ge(s) {
|
|
1532
1544
|
const a = Object.keys(De).find((u) => De[u] === s);
|
|
1533
1545
|
if (!a)
|
|
1534
1546
|
throw new Error(`Invalid purchase order status value: ${s}`);
|
|
1535
1547
|
return a;
|
|
1536
1548
|
}
|
|
1537
|
-
|
|
1549
|
+
E(Ge, "getPurchaseOrderStatusEnumKeyByValue");
|
|
1538
1550
|
function Mt(s, a, u) {
|
|
1539
1551
|
const c = u.filter((d) => d.field === "TRANDOC.KSTATUS"), r = [
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1552
|
+
k.B,
|
|
1553
|
+
k.D,
|
|
1554
|
+
k.E,
|
|
1555
|
+
k.F,
|
|
1556
|
+
k.G
|
|
1545
1557
|
], t = [
|
|
1546
|
-
|
|
1547
|
-
], n = Object.keys(
|
|
1558
|
+
k.C
|
|
1559
|
+
], n = Object.keys(k).filter((d) => r.includes(k[d])), i = Object.keys(k).filter((d) => t.includes(k[d])), o = c.find((d) => d.status === "Rejected"), m = c.find((d) => d.status === "Pending Fulfillment");
|
|
1548
1560
|
let l = null, f = null;
|
|
1549
1561
|
if (m ? l = new Date(m.datetime) : n.includes(a) && (l = new Date(s)), o ? f = new Date(o.datetime) : i.includes(a) && (f = new Date(s)), l && f)
|
|
1550
1562
|
throw new Error("Both processedAt and rejectedAt are set.");
|
|
@@ -1553,7 +1565,7 @@ function Mt(s, a, u) {
|
|
|
1553
1565
|
rejectedAt: f ? f.toISOString() : null
|
|
1554
1566
|
};
|
|
1555
1567
|
}
|
|
1556
|
-
|
|
1568
|
+
E(Mt, "getPurchaseOrderRequestStatusTimestamp");
|
|
1557
1569
|
function Ut(s) {
|
|
1558
1570
|
const a = s.shipDate;
|
|
1559
1571
|
if (!a)
|
|
@@ -1566,7 +1578,7 @@ function Ut(s) {
|
|
|
1566
1578
|
estimatedTime: new Date(a).toISOString()
|
|
1567
1579
|
};
|
|
1568
1580
|
}
|
|
1569
|
-
|
|
1581
|
+
E(Ut, "transformTransferOrderPreparingShipmentMilestoneFromNetSuite");
|
|
1570
1582
|
var It;
|
|
1571
1583
|
(function(s) {
|
|
1572
1584
|
(function(a) {
|
|
@@ -1576,10 +1588,10 @@ var It;
|
|
|
1576
1588
|
throw new Error("Purchase order request does not have a purchase order");
|
|
1577
1589
|
if (n.netSuite.subsidiary === void 0)
|
|
1578
1590
|
throw new Error("Purchase order request does not have a NetSuite subsidiary");
|
|
1579
|
-
const d = f.items.map((
|
|
1580
|
-
const y = t.items.find((_) => _.id ===
|
|
1591
|
+
const d = f.items.map((g) => {
|
|
1592
|
+
const y = t.items.find((_) => _.id === g.sku._id);
|
|
1581
1593
|
return te.ToNetSuite.toCreateDto({
|
|
1582
|
-
poItem:
|
|
1594
|
+
poItem: g,
|
|
1583
1595
|
nsUnitTypes: t.units,
|
|
1584
1596
|
nsItemSetting: y,
|
|
1585
1597
|
overrideCost: o,
|
|
@@ -1610,10 +1622,10 @@ var It;
|
|
|
1610
1622
|
custbody_fm_po_request_id: n._id
|
|
1611
1623
|
};
|
|
1612
1624
|
}
|
|
1613
|
-
|
|
1625
|
+
E(u, "toCreateDto"), a.toCreateDto = u;
|
|
1614
1626
|
function c({ setting: t, purchaseOrder: n, overrideItemCost: i, customItemAttributes: o, includeItems: m = !1, orderStatus: l, customFields: f }) {
|
|
1615
1627
|
const d = n.items.map((I) => {
|
|
1616
|
-
const p = t.items.find((
|
|
1628
|
+
const p = t.items.find((g) => g.id === I.sku._id);
|
|
1617
1629
|
return te.ToNetSuite.toTransferOrderItemUpdateDto({
|
|
1618
1630
|
poItem: I,
|
|
1619
1631
|
nsUnitTypes: t.units,
|
|
@@ -1634,7 +1646,7 @@ var It;
|
|
|
1634
1646
|
custbody_fm_po_request_id: n.request.id
|
|
1635
1647
|
};
|
|
1636
1648
|
}
|
|
1637
|
-
|
|
1649
|
+
E(c, "toUpdateDto"), a.toUpdateDto = c;
|
|
1638
1650
|
function r(t) {
|
|
1639
1651
|
return {
|
|
1640
1652
|
item: {
|
|
@@ -1645,11 +1657,11 @@ var It;
|
|
|
1645
1657
|
}
|
|
1646
1658
|
};
|
|
1647
1659
|
}
|
|
1648
|
-
|
|
1660
|
+
E(r, "toCloseDto"), a.toCloseDto = r;
|
|
1649
1661
|
})(s.ToNetSuite || (s.ToNetSuite = {})), function(a) {
|
|
1650
1662
|
function u(r) {
|
|
1651
|
-
var $, be,
|
|
1652
|
-
const { fromLocation: t, toLocation: n, nsTransferOrder: i, orderItemMapping: o, nsItemFulfillments: m, orderItemMappingByFulfillment: l, nsItemReceipts: f, orderItemMappingByReceipt: d, context: I, nsSystemNotes: p } = r,
|
|
1663
|
+
var $, be, we, it, st, rt, ot, at, ut;
|
|
1664
|
+
const { fromLocation: t, toLocation: n, nsTransferOrder: i, orderItemMapping: o, nsItemFulfillments: m, orderItemMappingByFulfillment: l, nsItemReceipts: f, orderItemMappingByReceipt: d, context: I, nsSystemNotes: p } = r, g = {
|
|
1653
1665
|
_id: t.doc._id,
|
|
1654
1666
|
internal: t.type,
|
|
1655
1667
|
contactName: t.doc.profile.name,
|
|
@@ -1660,7 +1672,7 @@ var It;
|
|
|
1660
1672
|
address: {
|
|
1661
1673
|
line1: (($ = t.doc.profile.address) == null ? void 0 : $.line1) || "",
|
|
1662
1674
|
line2: (be = t.doc.profile.address) == null ? void 0 : be.line2,
|
|
1663
|
-
state: ((
|
|
1675
|
+
state: ((we = t.doc.profile.address) == null ? void 0 : we.state) || "",
|
|
1664
1676
|
city: ((it = t.doc.profile.address) == null ? void 0 : it.city) || "",
|
|
1665
1677
|
country: ((st = t.doc.profile.address) == null ? void 0 : st.country) || "",
|
|
1666
1678
|
postcode: ((rt = t.doc.profile.address) == null ? void 0 : rt.postcode) || ""
|
|
@@ -1687,7 +1699,7 @@ var It;
|
|
|
1687
1699
|
}), v = f.map((P) => {
|
|
1688
1700
|
const Y = d[P.id];
|
|
1689
1701
|
return Pe.FromNetSuite.transform(I, Y, P);
|
|
1690
|
-
}),
|
|
1702
|
+
}), C = i.item.items.map((P) => {
|
|
1691
1703
|
const Y = o[P.line].sku, fe = o[P.line].measurement;
|
|
1692
1704
|
return te.FromNetSuite.toPurchaseOrderItem({
|
|
1693
1705
|
currency: i.currency.refName,
|
|
@@ -1697,17 +1709,17 @@ var It;
|
|
|
1697
1709
|
measurement: fe,
|
|
1698
1710
|
context: I
|
|
1699
1711
|
});
|
|
1700
|
-
}),
|
|
1712
|
+
}), N = new Date(i.createdDate), [b, D, F] = i.tranDate.split("-"), w = new Date(Number(b), Number(D) - 1, Number(F)), U = Ut(i), B = {
|
|
1701
1713
|
_id: R({
|
|
1702
1714
|
prefix: O.Enum.purchaseOrder,
|
|
1703
|
-
dateTime:
|
|
1715
|
+
dateTime: N.toISOString()
|
|
1704
1716
|
}),
|
|
1705
1717
|
version: "2",
|
|
1706
1718
|
status: Ct(i.orderStatus),
|
|
1707
|
-
supplier:
|
|
1719
|
+
supplier: g,
|
|
1708
1720
|
seqNumber: parseInt(i.custbody_fm_po_num ?? "0"),
|
|
1709
|
-
items:
|
|
1710
|
-
effectiveAt:
|
|
1721
|
+
items: C,
|
|
1722
|
+
effectiveAt: w.toISOString(),
|
|
1711
1723
|
deliveryFullfillment: S,
|
|
1712
1724
|
deliveryOrder: v,
|
|
1713
1725
|
// NetSuite
|
|
@@ -1743,10 +1755,10 @@ var It;
|
|
|
1743
1755
|
deliveryMilestone: U
|
|
1744
1756
|
};
|
|
1745
1757
|
}
|
|
1746
|
-
|
|
1758
|
+
E(u, "transform"), a.transform = u;
|
|
1747
1759
|
function c() {
|
|
1748
1760
|
}
|
|
1749
|
-
|
|
1761
|
+
E(c, "convertToV1"), a.convertToV1 = c;
|
|
1750
1762
|
}(s.FromNetSuite || (s.FromNetSuite = {}));
|
|
1751
1763
|
})(It || (It = {}));
|
|
1752
1764
|
function Ft(s, a) {
|
|
@@ -1765,8 +1777,8 @@ function Ft(s, a) {
|
|
|
1765
1777
|
netSuiteToId: c
|
|
1766
1778
|
};
|
|
1767
1779
|
}
|
|
1768
|
-
|
|
1769
|
-
function
|
|
1780
|
+
E(Ft, "locationMapper");
|
|
1781
|
+
function wt(s) {
|
|
1770
1782
|
let a = null, u = !1, c = !1;
|
|
1771
1783
|
for (const n of s.item.items) {
|
|
1772
1784
|
const i = n.expectedReceiptDate;
|
|
@@ -1793,15 +1805,15 @@ function kt(s) {
|
|
|
1793
1805
|
estimatedTime: new Date(a).toISOString()
|
|
1794
1806
|
};
|
|
1795
1807
|
}
|
|
1796
|
-
|
|
1808
|
+
E(wt, "transformPreparingShipmentMilestoneFromNetSuite");
|
|
1797
1809
|
var pt;
|
|
1798
1810
|
(function(s) {
|
|
1799
1811
|
(function(a) {
|
|
1800
1812
|
function u({ locationDb: t, setting: n, purchaseOrder: i, status: o = X.enum.A, overrideItemCost: m = !0, customItemAttributes: l, customFields: f }) {
|
|
1801
|
-
const { netSuiteFromId: d, netSuiteToId: I } = Je(n.locations, n.vendors, t, i.supplier._id), p = i.items.map((
|
|
1802
|
-
const y = n.items.find((_) => _.id ===
|
|
1813
|
+
const { netSuiteFromId: d, netSuiteToId: I } = Je(n.locations, n.vendors, t, i.supplier._id), p = i.items.map((g) => {
|
|
1814
|
+
const y = n.items.find((_) => _.id === g.sku._id);
|
|
1803
1815
|
return te.ToNetSuite.toCreateDto({
|
|
1804
|
-
poItem:
|
|
1816
|
+
poItem: g,
|
|
1805
1817
|
nsUnitTypes: n.units,
|
|
1806
1818
|
nsItemSetting: y,
|
|
1807
1819
|
overrideCost: m,
|
|
@@ -1809,7 +1821,7 @@ var pt;
|
|
|
1809
1821
|
{
|
|
1810
1822
|
fieldId: "location",
|
|
1811
1823
|
extraParams: I,
|
|
1812
|
-
compute: /* @__PURE__ */
|
|
1824
|
+
compute: /* @__PURE__ */ E((_, S) => ({
|
|
1813
1825
|
id: S
|
|
1814
1826
|
}), "compute")
|
|
1815
1827
|
},
|
|
@@ -1841,17 +1853,17 @@ var pt;
|
|
|
1841
1853
|
custbody_fm_po_id: i._id
|
|
1842
1854
|
};
|
|
1843
1855
|
}
|
|
1844
|
-
|
|
1856
|
+
E(u, "toCreateDto"), a.toCreateDto = u;
|
|
1845
1857
|
function c({ locationDb: t, setting: n, purchaseOrder: i, overrideItemCost: o, customItemAttributes: m, includeItems: l = !1, customFields: f }) {
|
|
1846
1858
|
const { netSuiteToId: d } = Je(n.locations, n.vendors, t, i.supplier._id);
|
|
1847
1859
|
i != null && i.effectiveAt || ie(i._id);
|
|
1848
1860
|
const I = i.items.map((p) => {
|
|
1849
|
-
const
|
|
1861
|
+
const g = n.items.find((y) => y.id === p.sku._id);
|
|
1850
1862
|
return te.ToNetSuite.toPurchaseOrderItemUpdateDto({
|
|
1851
1863
|
nsLocationId: d,
|
|
1852
1864
|
poItem: p,
|
|
1853
1865
|
nsUnitTypes: n.units,
|
|
1854
|
-
nsItemSetting:
|
|
1866
|
+
nsItemSetting: g,
|
|
1855
1867
|
overrideCost: o,
|
|
1856
1868
|
customAttributes: m
|
|
1857
1869
|
});
|
|
@@ -1866,7 +1878,7 @@ var pt;
|
|
|
1866
1878
|
custbody_fm_po_id: i._id
|
|
1867
1879
|
};
|
|
1868
1880
|
}
|
|
1869
|
-
|
|
1881
|
+
E(c, "toUpdateDto"), a.toUpdateDto = c;
|
|
1870
1882
|
function r() {
|
|
1871
1883
|
return {
|
|
1872
1884
|
orderStatus: {
|
|
@@ -1874,10 +1886,10 @@ var pt;
|
|
|
1874
1886
|
}
|
|
1875
1887
|
};
|
|
1876
1888
|
}
|
|
1877
|
-
|
|
1889
|
+
E(r, "toCloseDto"), a.toCloseDto = r;
|
|
1878
1890
|
})(s.ToNetSuite || (s.ToNetSuite = {})), function(a) {
|
|
1879
1891
|
function u(c) {
|
|
1880
|
-
var b,
|
|
1892
|
+
var b, D, F, w, U, B, Ue, Fe, _e;
|
|
1881
1893
|
const { vendor: r, nsPurchaseOrder: t, orderItemMapping: n, nsItemReceipts: i, orderItemMappingByReceipt: o, context: m } = c, l = {
|
|
1882
1894
|
_id: r._id,
|
|
1883
1895
|
contactName: r.contactName,
|
|
@@ -1887,9 +1899,9 @@ var pt;
|
|
|
1887
1899
|
registrationNumber: r.registrationNumber,
|
|
1888
1900
|
address: {
|
|
1889
1901
|
line1: ((b = r.address) == null ? void 0 : b.line1) || "",
|
|
1890
|
-
line2: (
|
|
1902
|
+
line2: (D = r.address) == null ? void 0 : D.line2,
|
|
1891
1903
|
state: ((F = r.address) == null ? void 0 : F.state) || "",
|
|
1892
|
-
city: ((
|
|
1904
|
+
city: ((w = r.address) == null ? void 0 : w.city) || "",
|
|
1893
1905
|
country: ((U = r.address) == null ? void 0 : U.country) || "",
|
|
1894
1906
|
postcode: ((B = r.address) == null ? void 0 : B.postcode) || ""
|
|
1895
1907
|
}
|
|
@@ -1915,21 +1927,21 @@ var pt;
|
|
|
1915
1927
|
}), p = t.item.items.reduce((se, $) => {
|
|
1916
1928
|
if ($.itemType.id === "Service")
|
|
1917
1929
|
return console.log(`Skipping service type item with line ${$.line} in purchase order ${t.tranId}`), se;
|
|
1918
|
-
const be = n[$.line].sku,
|
|
1930
|
+
const be = n[$.line].sku, we = n[$.line].measurement;
|
|
1919
1931
|
return se.push(te.FromNetSuite.toPurchaseOrderItem({
|
|
1920
1932
|
currency: t.currency.refName,
|
|
1921
1933
|
nsOrderItem: $,
|
|
1922
1934
|
sku: be,
|
|
1923
1935
|
glImpactCost: [],
|
|
1924
|
-
measurement:
|
|
1936
|
+
measurement: we,
|
|
1925
1937
|
context: m
|
|
1926
1938
|
})), se;
|
|
1927
|
-
}, []),
|
|
1939
|
+
}, []), g = new Date(t.createdDate), [y, _, S] = t.tranDate.split("-"), v = new Date(Number(y), Number(_) - 1, Number(S)), C = wt(t);
|
|
1928
1940
|
return {
|
|
1929
1941
|
purchaseOrder: {
|
|
1930
1942
|
_id: R({
|
|
1931
1943
|
prefix: O.Enum.purchaseOrder,
|
|
1932
|
-
dateTime:
|
|
1944
|
+
dateTime: g.toISOString()
|
|
1933
1945
|
}),
|
|
1934
1946
|
version: "2",
|
|
1935
1947
|
status: At(t.orderStatus),
|
|
@@ -1941,10 +1953,10 @@ var pt;
|
|
|
1941
1953
|
// NetSuite
|
|
1942
1954
|
netSuite: d
|
|
1943
1955
|
},
|
|
1944
|
-
deliveryMilestone:
|
|
1956
|
+
deliveryMilestone: C
|
|
1945
1957
|
};
|
|
1946
1958
|
}
|
|
1947
|
-
|
|
1959
|
+
E(u, "transform"), a.transform = u;
|
|
1948
1960
|
}(s.FromNetSuite || (s.FromNetSuite = {}));
|
|
1949
1961
|
})(pt || (pt = {}));
|
|
1950
1962
|
function Je(s, a, u, c) {
|
|
@@ -1960,7 +1972,7 @@ function Je(s, a, u, c) {
|
|
|
1960
1972
|
netSuiteToId: t
|
|
1961
1973
|
};
|
|
1962
1974
|
}
|
|
1963
|
-
|
|
1975
|
+
E(Je, "locationMapper");
|
|
1964
1976
|
var ze;
|
|
1965
1977
|
(function(s) {
|
|
1966
1978
|
(function(a) {
|
|
@@ -1984,10 +1996,10 @@ var ze;
|
|
|
1984
1996
|
}
|
|
1985
1997
|
};
|
|
1986
1998
|
}
|
|
1987
|
-
|
|
1999
|
+
E(u, "transform"), a.transform = u;
|
|
1988
2000
|
})(s.FromNetsuite || (s.FromNetsuite = {}));
|
|
1989
2001
|
})(ze || (ze = {}));
|
|
1990
|
-
var
|
|
2002
|
+
var Et;
|
|
1991
2003
|
(function(s) {
|
|
1992
2004
|
(function(a) {
|
|
1993
2005
|
function u(c, r) {
|
|
@@ -2025,9 +2037,9 @@ var gt;
|
|
|
2025
2037
|
measurements: l
|
|
2026
2038
|
};
|
|
2027
2039
|
}
|
|
2028
|
-
|
|
2040
|
+
E(u, "transform"), a.transform = u;
|
|
2029
2041
|
})(s.FromNetsuite || (s.FromNetsuite = {}));
|
|
2030
|
-
})(
|
|
2042
|
+
})(Et || (Et = {}));
|
|
2031
2043
|
function Tn(s, a) {
|
|
2032
2044
|
let u;
|
|
2033
2045
|
const c = [];
|
|
@@ -2044,8 +2056,8 @@ function Tn(s, a) {
|
|
|
2044
2056
|
measurements: c
|
|
2045
2057
|
}, u;
|
|
2046
2058
|
}
|
|
2047
|
-
|
|
2048
|
-
var
|
|
2059
|
+
E(Tn, "convertToUnitWithNsConfig");
|
|
2060
|
+
var gt;
|
|
2049
2061
|
(function(s) {
|
|
2050
2062
|
(function(a) {
|
|
2051
2063
|
function u(c) {
|
|
@@ -2058,7 +2070,7 @@ var Et;
|
|
|
2058
2070
|
contactName: (r == null ? void 0 : r.addressBookAddress.attention) || (r == null ? void 0 : r.addressBookAddress.addressee),
|
|
2059
2071
|
phoneNumber: c.phone,
|
|
2060
2072
|
registrationNumber: "",
|
|
2061
|
-
address:
|
|
2073
|
+
address: kt(r)
|
|
2062
2074
|
}, i = {
|
|
2063
2075
|
id: t,
|
|
2064
2076
|
netSuiteId: c.id,
|
|
@@ -2070,10 +2082,10 @@ var Et;
|
|
|
2070
2082
|
nsConfig: i
|
|
2071
2083
|
};
|
|
2072
2084
|
}
|
|
2073
|
-
|
|
2085
|
+
E(u, "transform"), a.transform = u;
|
|
2074
2086
|
})(s.FromNetsuite || (s.FromNetsuite = {}));
|
|
2075
|
-
})(
|
|
2076
|
-
function
|
|
2087
|
+
})(gt || (gt = {}));
|
|
2088
|
+
function kt(s) {
|
|
2077
2089
|
let a = {
|
|
2078
2090
|
line1: "",
|
|
2079
2091
|
state: "",
|
|
@@ -2091,7 +2103,7 @@ function wt(s) {
|
|
|
2091
2103
|
country: s.addressBookAddress.country.refName
|
|
2092
2104
|
}), a;
|
|
2093
2105
|
}
|
|
2094
|
-
|
|
2106
|
+
E(kt, "_transfromToSupplierAddress");
|
|
2095
2107
|
function et(s, a) {
|
|
2096
2108
|
const u = {}, c = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
|
|
2097
2109
|
for (const n of a) {
|
|
@@ -2118,7 +2130,7 @@ function et(s, a) {
|
|
|
2118
2130
|
}
|
|
2119
2131
|
return t;
|
|
2120
2132
|
}
|
|
2121
|
-
|
|
2133
|
+
E(et, "mapOrderLineId");
|
|
2122
2134
|
function hn(s, a, u, c, r) {
|
|
2123
2135
|
var l, f;
|
|
2124
2136
|
const t = u.some((d) => d.id), n = et(a, u), i = [], o = c, m = [
|
|
@@ -2133,14 +2145,14 @@ function hn(s, a, u, c, r) {
|
|
|
2133
2145
|
}
|
|
2134
2146
|
for (let d = 0; d < o.length; d++) {
|
|
2135
2147
|
const I = o[d], p = [];
|
|
2136
|
-
for (const
|
|
2137
|
-
const y =
|
|
2148
|
+
for (const g of I.received) {
|
|
2149
|
+
const y = g.externalId;
|
|
2138
2150
|
if (!y) {
|
|
2139
|
-
p.push(
|
|
2151
|
+
p.push(g);
|
|
2140
2152
|
continue;
|
|
2141
2153
|
}
|
|
2142
|
-
const _ = (l = a.find((
|
|
2143
|
-
...
|
|
2154
|
+
const _ = (l = a.find((C) => C.lineid === y)) == null ? void 0 : l.transferorderitemlineid, S = t && _ ? n[_] : void 0, v = {
|
|
2155
|
+
...g,
|
|
2144
2156
|
id: S
|
|
2145
2157
|
};
|
|
2146
2158
|
if (s === ee.Enum[2] && (!S || S === ""))
|
|
@@ -2155,14 +2167,14 @@ function hn(s, a, u, c, r) {
|
|
|
2155
2167
|
if (m)
|
|
2156
2168
|
for (let d = 0; d < m.length; d++) {
|
|
2157
2169
|
const I = m[d], p = [];
|
|
2158
|
-
for (const
|
|
2159
|
-
const y =
|
|
2170
|
+
for (const g of I.items) {
|
|
2171
|
+
const y = g.externalId;
|
|
2160
2172
|
if (!y) {
|
|
2161
|
-
p.push(
|
|
2173
|
+
p.push(g);
|
|
2162
2174
|
continue;
|
|
2163
2175
|
}
|
|
2164
|
-
const _ = (f = a.find((
|
|
2165
|
-
...
|
|
2176
|
+
const _ = (f = a.find((C) => C.lineid === y)) == null ? void 0 : f.transferorderitemlineid, S = t && _ ? n[_] : g.id, v = {
|
|
2177
|
+
...g,
|
|
2166
2178
|
id: S
|
|
2167
2179
|
};
|
|
2168
2180
|
if (s === ee.Enum[2] && (!S || S === ""))
|
|
@@ -2180,7 +2192,7 @@ function hn(s, a, u, c, r) {
|
|
|
2180
2192
|
alignedDeliveryFulfillments: m
|
|
2181
2193
|
};
|
|
2182
2194
|
}
|
|
2183
|
-
|
|
2195
|
+
E(hn, "alignItemLineIdsAcrossDocuments");
|
|
2184
2196
|
function Dn(s, a, u) {
|
|
2185
2197
|
const c = a.some((i) => i.id), r = et(s, a), t = [], n = u;
|
|
2186
2198
|
for (const i of a) {
|
|
@@ -2209,7 +2221,7 @@ function Dn(s, a, u) {
|
|
|
2209
2221
|
alignedDeliveryOrders: n
|
|
2210
2222
|
};
|
|
2211
2223
|
}
|
|
2212
|
-
|
|
2224
|
+
E(Dn, "alignInventoryTransferItemLineIds");
|
|
2213
2225
|
var Ie;
|
|
2214
2226
|
(function(s) {
|
|
2215
2227
|
(function(a) {
|
|
@@ -2230,16 +2242,16 @@ var Ie;
|
|
|
2230
2242
|
item: {
|
|
2231
2243
|
id: n.netSuiteId
|
|
2232
2244
|
},
|
|
2233
|
-
adjustQtyBy: Number(
|
|
2245
|
+
adjustQtyBy: Number(A.toFormatString({
|
|
2234
2246
|
value: r.quantity
|
|
2235
2247
|
})),
|
|
2236
2248
|
units: i
|
|
2237
2249
|
};
|
|
2238
2250
|
}
|
|
2239
|
-
|
|
2251
|
+
E(u, "toCreateDto"), a.toCreateDto = u;
|
|
2240
2252
|
})(s.ToNetSuite || (s.ToNetSuite = {})), function(a) {
|
|
2241
2253
|
function u(r, t, n, i) {
|
|
2242
|
-
const { cost: o, currency: m } = Xe(t, String(r.line), r.item.id), l =
|
|
2254
|
+
const { cost: o, currency: m } = Xe(t, String(r.line), r.item.id), l = A.fromNumber(r.adjustQtyBy), f = A.fromNumber(o), d = Oe.FCurrency.safeParse(m), I = d.success ? d.data : he;
|
|
2243
2255
|
return {
|
|
2244
2256
|
id: "",
|
|
2245
2257
|
externalId: String(r.line),
|
|
@@ -2256,9 +2268,9 @@ var Ie;
|
|
|
2256
2268
|
measurement: i ?? null
|
|
2257
2269
|
};
|
|
2258
2270
|
}
|
|
2259
|
-
|
|
2271
|
+
E(u, "toPurchaseOrderReceived"), a.toPurchaseOrderReceived = u;
|
|
2260
2272
|
function c(r, t, n) {
|
|
2261
|
-
const i =
|
|
2273
|
+
const i = A.fromNumber(r.adjustQtyBy), o = A.fromNumber(0);
|
|
2262
2274
|
return {
|
|
2263
2275
|
id: "",
|
|
2264
2276
|
externalId: String(r.line),
|
|
@@ -2277,7 +2289,7 @@ var Ie;
|
|
|
2277
2289
|
measurement: n ?? null
|
|
2278
2290
|
};
|
|
2279
2291
|
}
|
|
2280
|
-
|
|
2292
|
+
E(c, "toPurchaseOrderItem"), a.toPurchaseOrderItem = c;
|
|
2281
2293
|
}(s.FromNetSuite || (s.FromNetSuite = {}));
|
|
2282
2294
|
})(Ie || (Ie = {}));
|
|
2283
2295
|
var yt;
|
|
@@ -2285,7 +2297,7 @@ var yt;
|
|
|
2285
2297
|
(function(a) {
|
|
2286
2298
|
function u(r) {
|
|
2287
2299
|
const { setting: t, sourceLocationId: n, destinationLocationId: i, subsidiaryId: o, effectiveAt: m, orderItems: l, newAdjustmentId: f } = r, d = l.map((I) => {
|
|
2288
|
-
const p = t.items.find((
|
|
2300
|
+
const p = t.items.find((g) => g.id === I.sku._id);
|
|
2289
2301
|
return Ie.ToNetSuite.toCreateDto({
|
|
2290
2302
|
orderItem: I,
|
|
2291
2303
|
nsUnitTypes: t.units,
|
|
@@ -2309,7 +2321,7 @@ var yt;
|
|
|
2309
2321
|
custbody_fm_adjustment_id: f
|
|
2310
2322
|
};
|
|
2311
2323
|
}
|
|
2312
|
-
|
|
2324
|
+
E(u, "toCreateDto"), a.toCreateDto = u;
|
|
2313
2325
|
function c(r, t) {
|
|
2314
2326
|
return {
|
|
2315
2327
|
custbody_fm_po_id: r._id,
|
|
@@ -2317,7 +2329,7 @@ var yt;
|
|
|
2317
2329
|
custbody_fm_po_request_id: t == null ? void 0 : t._id
|
|
2318
2330
|
};
|
|
2319
2331
|
}
|
|
2320
|
-
|
|
2332
|
+
E(c, "toUpdateDto"), a.toUpdateDto = c;
|
|
2321
2333
|
})(s.ToNetSuite || (s.ToNetSuite = {})), function(a) {
|
|
2322
2334
|
function u(r) {
|
|
2323
2335
|
const { nsInventoryTransfer: t, transferItemMapping: n } = r, i = new Date(t.createdDate), [o, m, l] = t.tranDate.split("-"), f = new Date(Number(o), Number(m) - 1, Number(l)), d = {
|
|
@@ -2335,10 +2347,10 @@ var yt;
|
|
|
2335
2347
|
id: t.id,
|
|
2336
2348
|
refNo: t.tranId,
|
|
2337
2349
|
recordType: Be.Enum.inventoryTransfer
|
|
2338
|
-
},
|
|
2350
|
+
}, g = {
|
|
2339
2351
|
received: t.inventory.items.map((S) => {
|
|
2340
|
-
const v = n[S.line].sku,
|
|
2341
|
-
return Ie.FromNetSuite.toPurchaseOrderReceived(S, t.glImpacts ?? [], v,
|
|
2352
|
+
const v = n[S.line].sku, C = n[S.line].measurement;
|
|
2353
|
+
return Ie.FromNetSuite.toPurchaseOrderReceived(S, t.glImpacts ?? [], v, C);
|
|
2342
2354
|
}),
|
|
2343
2355
|
createdBy: {
|
|
2344
2356
|
name: "",
|
|
@@ -2349,8 +2361,8 @@ var yt;
|
|
|
2349
2361
|
netSuite: I,
|
|
2350
2362
|
effectiveAt: f.toISOString()
|
|
2351
2363
|
}, y = t.inventory.items.map((S) => {
|
|
2352
|
-
const v = n[S.line].sku,
|
|
2353
|
-
return Ie.FromNetSuite.toPurchaseOrderItem(S, v,
|
|
2364
|
+
const v = n[S.line].sku, C = n[S.line].measurement;
|
|
2365
|
+
return Ie.FromNetSuite.toPurchaseOrderItem(S, v, C);
|
|
2354
2366
|
});
|
|
2355
2367
|
return {
|
|
2356
2368
|
_id: R({
|
|
@@ -2364,7 +2376,7 @@ var yt;
|
|
|
2364
2376
|
seqNumber: t.custbody_fm_po_num ?? 0,
|
|
2365
2377
|
items: y,
|
|
2366
2378
|
deliveryOrder: [
|
|
2367
|
-
|
|
2379
|
+
g
|
|
2368
2380
|
],
|
|
2369
2381
|
request: t.custbody_fm_po_request_id ? {
|
|
2370
2382
|
id: t.custbody_fm_po_request_id,
|
|
@@ -2373,9 +2385,9 @@ var yt;
|
|
|
2373
2385
|
netSuite: I
|
|
2374
2386
|
};
|
|
2375
2387
|
}
|
|
2376
|
-
|
|
2388
|
+
E(u, "transformTransferIn"), a.transformTransferIn = u;
|
|
2377
2389
|
function c(r) {
|
|
2378
|
-
var v,
|
|
2390
|
+
var v, C, N, b, D, F;
|
|
2379
2391
|
const { sourceLocation: t, nsInventoryTransfer: n, transferItemMapping: i } = r, o = new Date(n.createdDate), [m, l, f] = n.tranDate.split("-"), d = new Date(Number(m), Number(l) - 1, Number(f)), I = {
|
|
2380
2392
|
_id: t.doc._id,
|
|
2381
2393
|
internal: t.type,
|
|
@@ -2386,10 +2398,10 @@ var yt;
|
|
|
2386
2398
|
registrationNumber: t.doc.profile.regNo,
|
|
2387
2399
|
address: {
|
|
2388
2400
|
line1: ((v = t.doc.profile.address) == null ? void 0 : v.line1) || "",
|
|
2389
|
-
line2: (
|
|
2390
|
-
state: ((
|
|
2401
|
+
line2: (C = t.doc.profile.address) == null ? void 0 : C.line2,
|
|
2402
|
+
state: ((N = t.doc.profile.address) == null ? void 0 : N.state) || "",
|
|
2391
2403
|
city: ((b = t.doc.profile.address) == null ? void 0 : b.city) || "",
|
|
2392
|
-
country: ((
|
|
2404
|
+
country: ((D = t.doc.profile.address) == null ? void 0 : D.country) || "",
|
|
2393
2405
|
postcode: ((F = t.doc.profile.address) == null ? void 0 : F.postcode) || ""
|
|
2394
2406
|
}
|
|
2395
2407
|
}, p = {
|
|
@@ -2401,9 +2413,9 @@ var yt;
|
|
|
2401
2413
|
name: n.subsidiary.refName
|
|
2402
2414
|
}
|
|
2403
2415
|
}, y = {
|
|
2404
|
-
received: n.inventory.items.map((
|
|
2405
|
-
const U = i[
|
|
2406
|
-
return Ie.FromNetSuite.toPurchaseOrderReceived(
|
|
2416
|
+
received: n.inventory.items.map((w) => {
|
|
2417
|
+
const U = i[w.line].sku, B = i[w.line].measurement;
|
|
2418
|
+
return Ie.FromNetSuite.toPurchaseOrderReceived(w, n.glImpacts ?? [], U, B);
|
|
2407
2419
|
}),
|
|
2408
2420
|
createdBy: {
|
|
2409
2421
|
name: "",
|
|
@@ -2413,9 +2425,9 @@ var yt;
|
|
|
2413
2425
|
deliveryOrderNumber: "",
|
|
2414
2426
|
netSuite: p,
|
|
2415
2427
|
effectiveAt: d.toISOString()
|
|
2416
|
-
}, _ = n.inventory.items.map((
|
|
2417
|
-
const U = i[
|
|
2418
|
-
return Ie.FromNetSuite.toPurchaseOrderItem(
|
|
2428
|
+
}, _ = n.inventory.items.map((w) => {
|
|
2429
|
+
const U = i[w.line].sku, B = i[w.line].measurement;
|
|
2430
|
+
return Ie.FromNetSuite.toPurchaseOrderItem(w, U, B);
|
|
2419
2431
|
});
|
|
2420
2432
|
return {
|
|
2421
2433
|
_id: R({
|
|
@@ -2438,7 +2450,7 @@ var yt;
|
|
|
2438
2450
|
netSuite: p
|
|
2439
2451
|
};
|
|
2440
2452
|
}
|
|
2441
|
-
|
|
2453
|
+
E(c, "transformTransferOut"), a.transformTransferOut = c;
|
|
2442
2454
|
}(s.FromNetSuite || (s.FromNetSuite = {}));
|
|
2443
2455
|
})(yt || (yt = {}));
|
|
2444
2456
|
function pe(s, a, u, c) {
|
|
@@ -2447,7 +2459,7 @@ function pe(s, a, u, c) {
|
|
|
2447
2459
|
"itemType" in t && t.itemType.id === "Service" || (r[t.line] = Rt(s, a, u, t.item.id, t.units));
|
|
2448
2460
|
}), r;
|
|
2449
2461
|
}
|
|
2450
|
-
|
|
2462
|
+
E(pe, "validateOrderItems");
|
|
2451
2463
|
function Rt(s, a, u, c, r) {
|
|
2452
2464
|
const t = u.items.find((f) => f.netSuiteId === c);
|
|
2453
2465
|
if (!t)
|
|
@@ -2474,11 +2486,11 @@ function Rt(s, a, u, c, r) {
|
|
|
2474
2486
|
measurement: l
|
|
2475
2487
|
};
|
|
2476
2488
|
}
|
|
2477
|
-
|
|
2489
|
+
E(Rt, "validateNetSuiteOrderItem");
|
|
2478
2490
|
function Nn(s, a) {
|
|
2479
2491
|
const u = s.items.reduce((c, r) => {
|
|
2480
2492
|
const { id: t, quantity: n } = r;
|
|
2481
|
-
return c[t] || (c[t] =
|
|
2493
|
+
return c[t] || (c[t] = A.fromNumber(0)), c[t] = A.add([
|
|
2482
2494
|
c[t],
|
|
2483
2495
|
n
|
|
2484
2496
|
]), c;
|
|
@@ -2486,21 +2498,21 @@ function Nn(s, a) {
|
|
|
2486
2498
|
for (const c of a) {
|
|
2487
2499
|
const r = c.received;
|
|
2488
2500
|
for (const t of r)
|
|
2489
|
-
u[t.id] =
|
|
2501
|
+
u[t.id] = A.subtract([
|
|
2490
2502
|
u[t.id],
|
|
2491
2503
|
t.amount
|
|
2492
2504
|
]);
|
|
2493
2505
|
}
|
|
2494
|
-
return Object.entries(u).reduce((c, [r, t]) => (
|
|
2506
|
+
return Object.entries(u).reduce((c, [r, t]) => (A.smallerThan({
|
|
2495
2507
|
a: t,
|
|
2496
|
-
b:
|
|
2508
|
+
b: A.fromNumber(0)
|
|
2497
2509
|
}) && (c[r] = t), c), {});
|
|
2498
2510
|
}
|
|
2499
|
-
|
|
2511
|
+
E(Nn, "validatePurchaseOrderOverReceive");
|
|
2500
2512
|
function Cn(s, a) {
|
|
2501
2513
|
const u = s.items.reduce((c, r) => {
|
|
2502
2514
|
const { id: t, amount: n } = r;
|
|
2503
|
-
return c[t] || (c[t] =
|
|
2515
|
+
return c[t] || (c[t] = A.fromNumber(0)), c[t] = A.add([
|
|
2504
2516
|
c[t],
|
|
2505
2517
|
n
|
|
2506
2518
|
]), c;
|
|
@@ -2508,17 +2520,17 @@ function Cn(s, a) {
|
|
|
2508
2520
|
for (const c of a) {
|
|
2509
2521
|
const r = c.received;
|
|
2510
2522
|
for (const t of r)
|
|
2511
|
-
u[t.id] =
|
|
2523
|
+
u[t.id] = A.subtract([
|
|
2512
2524
|
u[t.id],
|
|
2513
2525
|
t.amount
|
|
2514
2526
|
]);
|
|
2515
2527
|
}
|
|
2516
|
-
return Object.entries(u).reduce((c, [r, t]) => (
|
|
2528
|
+
return Object.entries(u).reduce((c, [r, t]) => (A.smallerThan({
|
|
2517
2529
|
a: t,
|
|
2518
|
-
b:
|
|
2530
|
+
b: A.fromNumber(0)
|
|
2519
2531
|
}) && (c[r] = t), c), {});
|
|
2520
2532
|
}
|
|
2521
|
-
|
|
2533
|
+
E(Cn, "validateItemFulfillmentOverReceive");
|
|
2522
2534
|
var _t;
|
|
2523
2535
|
(function(s) {
|
|
2524
2536
|
(function(a) {
|
|
@@ -2529,19 +2541,19 @@ var _t;
|
|
|
2529
2541
|
if ((i = (n = r.netSuite) == null ? void 0 : n.subsidiary) != null && i.id)
|
|
2530
2542
|
throw new Error("NetSuite subsidiary ID is required");
|
|
2531
2543
|
}
|
|
2532
|
-
|
|
2544
|
+
E(u, "validateCreate"), a.validateCreate = u;
|
|
2533
2545
|
function c(r) {
|
|
2534
2546
|
const { orderStatus: t, processedAt: n, rejectedAt: i } = r;
|
|
2535
2547
|
if (!t || !t.id)
|
|
2536
2548
|
throw new Error("Missing transfer order status");
|
|
2537
2549
|
if (n && i)
|
|
2538
2550
|
throw new Error("Transfer Order cannot be both approved and rejected at the same time");
|
|
2539
|
-
const o = xe(
|
|
2551
|
+
const o = xe(k.A);
|
|
2540
2552
|
return t.id === o && n ? {
|
|
2541
|
-
id: xe(
|
|
2553
|
+
id: xe(k.B)
|
|
2542
2554
|
} : t;
|
|
2543
2555
|
}
|
|
2544
|
-
|
|
2556
|
+
E(c, "validateApprovalStatus"), a.validateApprovalStatus = c;
|
|
2545
2557
|
})(s.ToNetSuite || (s.ToNetSuite = {})), function(a) {
|
|
2546
2558
|
function u(c, r, t, n) {
|
|
2547
2559
|
const i = c.every((l) => l.isClosed);
|
|
@@ -2568,7 +2580,7 @@ var _t;
|
|
|
2568
2580
|
adjustmentGoingToDeleteMap: m
|
|
2569
2581
|
};
|
|
2570
2582
|
}
|
|
2571
|
-
|
|
2583
|
+
E(u, "isVoided"), a.isVoided = u;
|
|
2572
2584
|
}(s.FromNetSuite || (s.FromNetSuite = {}));
|
|
2573
2585
|
})(_t || (_t = {}));
|
|
2574
2586
|
function An(s, a) {
|
|
@@ -2585,7 +2597,7 @@ function An(s, a) {
|
|
|
2585
2597
|
}
|
|
2586
2598
|
return c;
|
|
2587
2599
|
}
|
|
2588
|
-
|
|
2600
|
+
E(An, "getAvailableItemToBeFulfilled");
|
|
2589
2601
|
function Mn(s) {
|
|
2590
2602
|
var l, f;
|
|
2591
2603
|
const { inventorySkus: a, legacyParentItemConfigs: u, parentReplicas: c } = s, r = u.reduce((d, I) => (d[I.id] = I, d), {}), t = c.reduce((d, I) => (d[I.netSuiteId] = I, d), {}), n = /* @__PURE__ */ new Set(), i = [];
|
|
@@ -2595,17 +2607,17 @@ function Mn(s) {
|
|
|
2595
2607
|
const p = r[d._id];
|
|
2596
2608
|
if (!p)
|
|
2597
2609
|
throw new Error(`Missing NetSuite assembly item config for SKU with ID ${d._id}`);
|
|
2598
|
-
const
|
|
2599
|
-
if (!
|
|
2610
|
+
const g = t[p.netSuiteId];
|
|
2611
|
+
if (!g)
|
|
2600
2612
|
throw new Error(`Missing replica for NetSuite ID ${p.netSuiteId} for SKU with ID ${d._id}`);
|
|
2601
|
-
if (!
|
|
2613
|
+
if (!g.skuCache)
|
|
2602
2614
|
throw new Error(`Replica for NetSuite ID ${p.netSuiteId} is missing skuCache. Expected parent item replica.`);
|
|
2603
|
-
if (
|
|
2604
|
-
throw new Error(`Replica for NetSuite ID ${p.netSuiteId} has itemType '${
|
|
2605
|
-
if (
|
|
2606
|
-
throw new Error(`SKU ID mismatch: expected replica skuCache._id to be '${d._id}', but got '${
|
|
2615
|
+
if (g.itemType !== V.Enum.Assembly)
|
|
2616
|
+
throw new Error(`Replica for NetSuite ID ${p.netSuiteId} has itemType '${g.itemType}'. Expected 'Assembly'.`);
|
|
2617
|
+
if (g.skuCache._id !== d._id)
|
|
2618
|
+
throw new Error(`SKU ID mismatch: expected replica skuCache._id to be '${d._id}', but got '${g.skuCache._id}'`);
|
|
2607
2619
|
I = {
|
|
2608
|
-
...
|
|
2620
|
+
...g.skuCache,
|
|
2609
2621
|
customAttributes: d.customAttributes
|
|
2610
2622
|
};
|
|
2611
2623
|
} catch (p) {
|
|
@@ -2630,8 +2642,8 @@ function Mn(s) {
|
|
|
2630
2642
|
cogsAccount: d.cogsAccount,
|
|
2631
2643
|
itemType: d.itemType,
|
|
2632
2644
|
externalId: d.externalId,
|
|
2633
|
-
pktCode: (l = d.customFields) == null ? void 0 : l.pktCode,
|
|
2634
|
-
pktName: (f = d.customFields) == null ? void 0 : f.pktName
|
|
2645
|
+
pktCode: ((l = d.customFields) == null ? void 0 : l.pktCode) ?? null,
|
|
2646
|
+
pktName: ((f = d.customFields) == null ? void 0 : f.pktName) ?? null
|
|
2635
2647
|
}));
|
|
2636
2648
|
for (const d of u)
|
|
2637
2649
|
d.itemType !== V.Enum.Assembly && !m.has(d.id) && o.push(d);
|
|
@@ -2640,7 +2652,7 @@ function Mn(s) {
|
|
|
2640
2652
|
updatedParentItemConfigs: o
|
|
2641
2653
|
};
|
|
2642
2654
|
}
|
|
2643
|
-
|
|
2655
|
+
E(Mn, "syncAssemblyParentItemsWithLegacyConfig");
|
|
2644
2656
|
function Un(s) {
|
|
2645
2657
|
var t, n;
|
|
2646
2658
|
const { legacyChildItemConfigs: a, childReplicas: u } = s, c = [], r = /* @__PURE__ */ new Set();
|
|
@@ -2656,14 +2668,14 @@ function Un(s) {
|
|
|
2656
2668
|
cogsAccount: i.cogsAccount,
|
|
2657
2669
|
itemType: i.itemType,
|
|
2658
2670
|
externalId: i.externalId,
|
|
2659
|
-
pktCode: (t = i.customFields) == null ? void 0 : t.pktCode,
|
|
2660
|
-
pktName: (n = i.customFields) == null ? void 0 : n.pktName
|
|
2671
|
+
pktCode: ((t = i.customFields) == null ? void 0 : t.pktCode) ?? null,
|
|
2672
|
+
pktName: ((n = i.customFields) == null ? void 0 : n.pktName) ?? null
|
|
2661
2673
|
});
|
|
2662
2674
|
for (const i of a)
|
|
2663
2675
|
i.itemType !== V.Enum.Assembly && !r.has(i.netSuiteId) && c.push(i);
|
|
2664
2676
|
return c;
|
|
2665
2677
|
}
|
|
2666
|
-
|
|
2678
|
+
E(Un, "syncAssemblyChildItemsWithLegacyConfig");
|
|
2667
2679
|
function Fn(s) {
|
|
2668
2680
|
var l, f;
|
|
2669
2681
|
const { inventorySkus: a, legacyParentItemConfigs: u, parentReplicas: c } = s, r = u.reduce((d, I) => (d[I.id] = I, d), {}), t = c.reduce((d, I) => (d[I.netSuiteId] = I, d), {}), n = /* @__PURE__ */ new Set(), i = [];
|
|
@@ -2673,17 +2685,17 @@ function Fn(s) {
|
|
|
2673
2685
|
const p = r[d._id];
|
|
2674
2686
|
if (!p)
|
|
2675
2687
|
throw new Error(`Missing NetSuite inventory item config for SKU with ID ${d._id}`);
|
|
2676
|
-
const
|
|
2677
|
-
if (!
|
|
2688
|
+
const g = t[p.netSuiteId];
|
|
2689
|
+
if (!g)
|
|
2678
2690
|
throw new Error(`Missing replica for NetSuite ID ${p.netSuiteId} for SKU with ID ${d._id}`);
|
|
2679
|
-
if (!
|
|
2691
|
+
if (!g.skuCache)
|
|
2680
2692
|
throw new Error(`Replica for NetSuite ID ${p.netSuiteId} is missing skuCache. Expected parent item replica.`);
|
|
2681
|
-
if (
|
|
2682
|
-
throw new Error(`Replica for NetSuite ID ${p.netSuiteId} has itemType '${
|
|
2683
|
-
if (
|
|
2684
|
-
throw new Error(`SKU ID mismatch: expected replica skuCache._id to be '${d._id}', but got '${
|
|
2693
|
+
if (g.itemType !== V.Enum.InvtPart)
|
|
2694
|
+
throw new Error(`Replica for NetSuite ID ${p.netSuiteId} has itemType '${g.itemType}'. Expected 'InvtPart'.`);
|
|
2695
|
+
if (g.skuCache._id !== d._id)
|
|
2696
|
+
throw new Error(`SKU ID mismatch: expected replica skuCache._id to be '${d._id}', but got '${g.skuCache._id}'`);
|
|
2685
2697
|
I = {
|
|
2686
|
-
...
|
|
2698
|
+
...g.skuCache,
|
|
2687
2699
|
customAttributes: d.customAttributes
|
|
2688
2700
|
};
|
|
2689
2701
|
} catch (p) {
|
|
@@ -2708,8 +2720,8 @@ function Fn(s) {
|
|
|
2708
2720
|
cogsAccount: d.cogsAccount,
|
|
2709
2721
|
itemType: d.itemType,
|
|
2710
2722
|
externalId: d.externalId,
|
|
2711
|
-
pktCode: (l = d.customFields) == null ? void 0 : l.pktCode,
|
|
2712
|
-
pktName: (f = d.customFields) == null ? void 0 : f.pktName
|
|
2723
|
+
pktCode: ((l = d.customFields) == null ? void 0 : l.pktCode) ?? null,
|
|
2724
|
+
pktName: ((f = d.customFields) == null ? void 0 : f.pktName) ?? null
|
|
2713
2725
|
}));
|
|
2714
2726
|
for (const d of u)
|
|
2715
2727
|
d.itemType !== V.Enum.InvtPart && !m.has(d.id) && o.push(d);
|
|
@@ -2718,8 +2730,8 @@ function Fn(s) {
|
|
|
2718
2730
|
updatedParentItemConfigs: o
|
|
2719
2731
|
};
|
|
2720
2732
|
}
|
|
2721
|
-
|
|
2722
|
-
function
|
|
2733
|
+
E(Fn, "syncInventoryParentItemsWithLegacyConfig");
|
|
2734
|
+
function wn(s) {
|
|
2723
2735
|
var t, n;
|
|
2724
2736
|
const { legacyChildItemConfigs: a, childReplicas: u } = s, c = [], r = /* @__PURE__ */ new Set();
|
|
2725
2737
|
for (const i of u)
|
|
@@ -2734,14 +2746,14 @@ function kn(s) {
|
|
|
2734
2746
|
cogsAccount: i.cogsAccount,
|
|
2735
2747
|
itemType: i.itemType,
|
|
2736
2748
|
externalId: i.externalId,
|
|
2737
|
-
pktCode: (t = i.customFields) == null ? void 0 : t.pktCode,
|
|
2738
|
-
pktName: (n = i.customFields) == null ? void 0 : n.pktName
|
|
2749
|
+
pktCode: ((t = i.customFields) == null ? void 0 : t.pktCode) ?? null,
|
|
2750
|
+
pktName: ((n = i.customFields) == null ? void 0 : n.pktName) ?? null
|
|
2739
2751
|
});
|
|
2740
2752
|
for (const i of a)
|
|
2741
2753
|
i.itemType !== V.Enum.InvtPart && !r.has(i.netSuiteId) && c.push(i);
|
|
2742
2754
|
return c;
|
|
2743
2755
|
}
|
|
2744
|
-
|
|
2756
|
+
E(wn, "syncInventoryChildItemsWithLegacyConfig");
|
|
2745
2757
|
var h;
|
|
2746
2758
|
(function(s) {
|
|
2747
2759
|
s.ITEM_CREATED = "ITEM_CREATED", s.ITEM_UPDATED = "ITEM_UPDATED", s.ITEM_DELETED = "ITEM_DELETED", s.ITEM_DUPLICATE = "ITEM_DUPLICATE", s.ITEM_RECEIPT_ITEM_CREATED = "ITEM_RECEIPT_ITEM_CREATED", s.ITEM_RECEIPT_ITEM_UPDATED = "ITEM_RECEIPT_ITEM_UPDATED", s.ITEM_RECEIPT_ITEM_DELETED = "ITEM_RECEIPT_ITEM_DELETED", s.ITEM_FULFILLMENT_ITEM_CREATED = "ITEM_FULFILLMENT_ITEM_CREATED", s.ITEM_FULFILLMENT_ITEM_UPDATED = "ITEM_FULFILLMENT_ITEM_UPDATED", s.ITEM_FULFILLMENT_ITEM_DELETED = "ITEM_FULFILLMENT_ITEM_DELETED";
|
|
@@ -2749,7 +2761,7 @@ var h;
|
|
|
2749
2761
|
function ne(s, a) {
|
|
2750
2762
|
return a.reduce((u, c) => u.replace("$", c), s);
|
|
2751
2763
|
}
|
|
2752
|
-
|
|
2764
|
+
E(ne, "replacePlaceholders");
|
|
2753
2765
|
var Te = 'Record [$] item on line [$], field "$" changed from "$" to "$"';
|
|
2754
2766
|
function ye(s, a, u, c, r = !1) {
|
|
2755
2767
|
const t = [];
|
|
@@ -2825,7 +2837,7 @@ function ye(s, a, u, c, r = !1) {
|
|
|
2825
2837
|
continue;
|
|
2826
2838
|
}
|
|
2827
2839
|
const l = n[m] ?? null, f = i[m] ?? null;
|
|
2828
|
-
if (!(m === "quantity" && l && f &&
|
|
2840
|
+
if (!(m === "quantity" && l && f && A.equals({
|
|
2829
2841
|
a: l,
|
|
2830
2842
|
b: f
|
|
2831
2843
|
})) && !L.isEqual(n[m], i[m])) {
|
|
@@ -2854,7 +2866,7 @@ function ye(s, a, u, c, r = !1) {
|
|
|
2854
2866
|
}
|
|
2855
2867
|
return t;
|
|
2856
2868
|
}
|
|
2857
|
-
|
|
2869
|
+
E(ye, "detectPurchaseOrderItemConflicts");
|
|
2858
2870
|
function tt(s, a, u, c, r) {
|
|
2859
2871
|
const t = [], n = {};
|
|
2860
2872
|
if (r === ee.Enum[2] && c.length != 0 && c.every((i) => !i.externalId))
|
|
@@ -2932,7 +2944,7 @@ function tt(s, a, u, c, r) {
|
|
|
2932
2944
|
continue;
|
|
2933
2945
|
}
|
|
2934
2946
|
const f = i[l] ?? null, d = o[l] ?? null;
|
|
2935
|
-
if (!(l === "amount" && f && d &&
|
|
2947
|
+
if (!(l === "amount" && f && d && A.equals({
|
|
2936
2948
|
a: f,
|
|
2937
2949
|
b: d
|
|
2938
2950
|
})) && !L.isEqual(i[l], o[l])) {
|
|
@@ -2962,7 +2974,7 @@ function tt(s, a, u, c, r) {
|
|
|
2962
2974
|
}
|
|
2963
2975
|
return t;
|
|
2964
2976
|
}
|
|
2965
|
-
|
|
2977
|
+
E(tt, "detectPurchaseOrderReceivedConflicts");
|
|
2966
2978
|
function Ve(s, a, u = "1") {
|
|
2967
2979
|
if (a.length === 0)
|
|
2968
2980
|
return s;
|
|
@@ -2987,7 +2999,7 @@ function Ve(s, a, u = "1") {
|
|
|
2987
2999
|
id: r.id || crypto.randomUUID()
|
|
2988
3000
|
}));
|
|
2989
3001
|
}
|
|
2990
|
-
|
|
3002
|
+
E(Ve, "resolvePurchaseOrderItemConflicts");
|
|
2991
3003
|
function nt(s, a, u = "1") {
|
|
2992
3004
|
if (a.length === 0)
|
|
2993
3005
|
return s;
|
|
@@ -3009,12 +3021,12 @@ function nt(s, a, u = "1") {
|
|
|
3009
3021
|
}
|
|
3010
3022
|
return c;
|
|
3011
3023
|
}
|
|
3012
|
-
|
|
3024
|
+
E(nt, "resolvePurchaseOrderReceivedConflicts");
|
|
3013
3025
|
var de;
|
|
3014
3026
|
(function(s) {
|
|
3015
3027
|
s.ITEM_FULFILLMENT_CREATED = "ITEM_FULFILLMENT_CREATED", s.ITEM_FULFILLMENT_UPDATED = "ITEM_FULFILLMENT_UPDATED", s.ITEM_FULFILLMENT_DELETED = "ITEM_FULFILLMENT_DELETED";
|
|
3016
3028
|
})(de || (de = {}));
|
|
3017
|
-
var
|
|
3029
|
+
var kn = 'Record [$] item on line [$], field "$" changed from "$" to "$"';
|
|
3018
3030
|
function Rn(s, a, u) {
|
|
3019
3031
|
var t, n, i;
|
|
3020
3032
|
const c = Object.keys(Gt.shape), r = [];
|
|
@@ -3042,7 +3054,7 @@ function Rn(s, a, u) {
|
|
|
3042
3054
|
let I = d, p = f;
|
|
3043
3055
|
typeof o[l] == "object" && (I = JSON.stringify(d), p = JSON.stringify(f)), l === "createdAt" && (I = new Date(o[l]).toISOString(), p = new Date(m[l]).toISOString()), r.push({
|
|
3044
3056
|
type: de.ITEM_FULFILLMENT_UPDATED,
|
|
3045
|
-
message: ne(
|
|
3057
|
+
message: ne(kn, [
|
|
3046
3058
|
"Item Fulfillment Field",
|
|
3047
3059
|
`${(n = o.netSuite) == null ? void 0 : n.id}`,
|
|
3048
3060
|
l,
|
|
@@ -3061,7 +3073,7 @@ function Rn(s, a, u) {
|
|
|
3061
3073
|
}
|
|
3062
3074
|
return r;
|
|
3063
3075
|
}
|
|
3064
|
-
|
|
3076
|
+
E(Rn, "detectItemFulfillmentConflicts");
|
|
3065
3077
|
function On(s, a) {
|
|
3066
3078
|
const u = a.filter((t) => t.type === de.ITEM_FULFILLMENT_CREATED || t.type === de.ITEM_FULFILLMENT_UPDATED || t.type === de.ITEM_FULFILLMENT_DELETED || t.type === h.ITEM_FULFILLMENT_ITEM_CREATED || t.type === h.ITEM_FULFILLMENT_ITEM_UPDATED || t.type === h.ITEM_FULFILLMENT_ITEM_DELETED), c = [];
|
|
3067
3079
|
if (u.length === 0)
|
|
@@ -3099,21 +3111,21 @@ function On(s, a) {
|
|
|
3099
3111
|
}));
|
|
3100
3112
|
return r;
|
|
3101
3113
|
}
|
|
3102
|
-
|
|
3114
|
+
E(On, "resolveDeliveryFulfillmentConflicts");
|
|
3103
3115
|
var ce;
|
|
3104
3116
|
(function(s) {
|
|
3105
3117
|
s.ITEM_RECEIPT_CREATED = "ITEM_RECEIPT_CREATED", s.ITEM_RECEIPT_UPDATED = "ITEM_RECEIPT_UPDATED", s.ITEM_RECEIPT_DELETED = "ITEM_RECEIPT_DELETED";
|
|
3106
3118
|
})(ce || (ce = {}));
|
|
3107
|
-
var W = /* @__PURE__ */
|
|
3119
|
+
var W = /* @__PURE__ */ E((s) => s === "" ? null : s, "normalizeNullOrEmpty"), Ln = 'Record [$] item on line [$], field "$" changed from "$" to "$"';
|
|
3108
3120
|
function Ot(s, a, u) {
|
|
3109
3121
|
var i, o, m, l, f, d, I;
|
|
3110
3122
|
const c = Object.keys(Jt.shape), r = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set();
|
|
3111
3123
|
for (const p of s) {
|
|
3112
|
-
const
|
|
3113
|
-
if (
|
|
3114
|
-
if (r.has(
|
|
3115
|
-
throw new Error(`Duplicate NetSuite ID found: ${
|
|
3116
|
-
r.add(
|
|
3124
|
+
const g = W((i = p.netSuite) == null ? void 0 : i.id), y = W(p.id);
|
|
3125
|
+
if (g) {
|
|
3126
|
+
if (r.has(g))
|
|
3127
|
+
throw new Error(`Duplicate NetSuite ID found: ${g}`);
|
|
3128
|
+
r.add(g);
|
|
3117
3129
|
}
|
|
3118
3130
|
if (y) {
|
|
3119
3131
|
if (t.has(y))
|
|
@@ -3123,13 +3135,13 @@ function Ot(s, a, u) {
|
|
|
3123
3135
|
}
|
|
3124
3136
|
const n = [];
|
|
3125
3137
|
for (const p of a) {
|
|
3126
|
-
const
|
|
3138
|
+
const g = W(p.id), y = W((o = p.netSuite) == null ? void 0 : o.id);
|
|
3127
3139
|
if (!y)
|
|
3128
3140
|
continue;
|
|
3129
3141
|
const _ = s.find((S) => {
|
|
3130
|
-
var
|
|
3131
|
-
const v = W(S.id),
|
|
3132
|
-
return
|
|
3142
|
+
var D;
|
|
3143
|
+
const v = W(S.id), C = W((D = S.netSuite) == null ? void 0 : D.id);
|
|
3144
|
+
return C && y && C === y || v && v === g;
|
|
3133
3145
|
});
|
|
3134
3146
|
if (!_)
|
|
3135
3147
|
n.push({
|
|
@@ -3139,7 +3151,7 @@ function Ot(s, a, u) {
|
|
|
3139
3151
|
});
|
|
3140
3152
|
else {
|
|
3141
3153
|
const S = W(_.id), v = W((l = _.netSuite) == null ? void 0 : l.id);
|
|
3142
|
-
if (v && y && v !== y ||
|
|
3154
|
+
if (v && y && v !== y || g && S && S !== g)
|
|
3143
3155
|
throw new Error(`Inconsistent data for Item Receipt ${(f = p.netSuite) == null ? void 0 : f.id} (or ${p.id})`);
|
|
3144
3156
|
for (const b of c) {
|
|
3145
3157
|
if (b === "adjustment" || b === "id")
|
|
@@ -3148,24 +3160,24 @@ function Ot(s, a, u) {
|
|
|
3148
3160
|
n.push(...tt(_.id, "deliveryOrder", p.received, _.received, u));
|
|
3149
3161
|
continue;
|
|
3150
3162
|
}
|
|
3151
|
-
const
|
|
3152
|
-
if (!L.isEqual(
|
|
3163
|
+
const D = W(p[b] ?? null), F = W(_[b] ?? null);
|
|
3164
|
+
if (!L.isEqual(D, F)) {
|
|
3153
3165
|
if ((b === "createdAt" || b === "createdBy" || b === "remark" || b === "effectiveAt") && F)
|
|
3154
3166
|
continue;
|
|
3155
|
-
let
|
|
3156
|
-
typeof p[b] == "object" && (
|
|
3167
|
+
let w = F, U = D;
|
|
3168
|
+
typeof p[b] == "object" && (w = JSON.stringify(F), U = JSON.stringify(D)), b === "createdAt" && (w = new Date(p[b]).toISOString(), U = new Date(_[b]).toISOString()), n.push({
|
|
3157
3169
|
type: ce.ITEM_RECEIPT_UPDATED,
|
|
3158
3170
|
message: ne(Ln, [
|
|
3159
3171
|
"Item Receipt Field",
|
|
3160
3172
|
`${(d = p.netSuite) == null ? void 0 : d.id}`,
|
|
3161
3173
|
b,
|
|
3162
|
-
`${
|
|
3174
|
+
`${w}`,
|
|
3163
3175
|
`${U}`
|
|
3164
3176
|
]),
|
|
3165
3177
|
data: {
|
|
3166
3178
|
recordId: `${(I = p.netSuite) == null ? void 0 : I.id}`,
|
|
3167
3179
|
field: b,
|
|
3168
|
-
incomingValue:
|
|
3180
|
+
incomingValue: D,
|
|
3169
3181
|
existingValue: F
|
|
3170
3182
|
}
|
|
3171
3183
|
});
|
|
@@ -3175,7 +3187,7 @@ function Ot(s, a, u) {
|
|
|
3175
3187
|
}
|
|
3176
3188
|
return n;
|
|
3177
3189
|
}
|
|
3178
|
-
|
|
3190
|
+
E(Ot, "detectItemReceiptConflicts");
|
|
3179
3191
|
function Lt(s, a) {
|
|
3180
3192
|
const u = a.filter((t) => t.type === ce.ITEM_RECEIPT_CREATED || t.type === ce.ITEM_RECEIPT_UPDATED || t.type === ce.ITEM_RECEIPT_DELETED || t.type === h.ITEM_RECEIPT_ITEM_CREATED || t.type === h.ITEM_RECEIPT_ITEM_UPDATED || t.type === h.ITEM_RECEIPT_ITEM_DELETED), c = [];
|
|
3181
3193
|
if (u.length === 0)
|
|
@@ -3220,7 +3232,7 @@ function Lt(s, a) {
|
|
|
3220
3232
|
}));
|
|
3221
3233
|
return r;
|
|
3222
3234
|
}
|
|
3223
|
-
|
|
3235
|
+
E(Lt, "resolveDeliveryOrdersConflicts");
|
|
3224
3236
|
function Pn(s, a, u, c) {
|
|
3225
3237
|
var n, i;
|
|
3226
3238
|
const r = Lt(a, c), t = [];
|
|
@@ -3239,7 +3251,7 @@ function Pn(s, a, u, c) {
|
|
|
3239
3251
|
}
|
|
3240
3252
|
return t;
|
|
3241
3253
|
}
|
|
3242
|
-
|
|
3254
|
+
E(Pn, "resolveAndMergeDeliveryOrders");
|
|
3243
3255
|
var G;
|
|
3244
3256
|
(function(s) {
|
|
3245
3257
|
s.PURCHASE_ORDER_CREATED = "PURCHASE_ORDER_CREATED", s.PURCHASE_ORDER_UPDATED = "PURCHASE_ORDER_UPDATED", s.PURCHASE_ORDER_REQUEST_CREATED = "PURCHASE_ORDER_REQUEST_CREATED", s.PURCHASE_ORDER_REQUEST_UPDATED = "PURCHASE_ORDER_REQUEST_UPDATED", s.ITEM_FULFILLMENT_CREATED = "ITEM_FULFILLMENT_CREATED", s.ITEM_FULFILLMENT_UPDATED = "ITEM_FULFILLMENT_UPDATED", s.ITEM_FULFILLMENT_DELETED = "ITEM_FULFILLMENT_DELETED", s.ITEM_FULFILLMENT_ITEM_CREATED = "ITEM_FULFILLMENT_ITEM_CREATED", s.ITEM_FULFILLMENT_ITEM_UPDATED = "ITEM_FULFILLMENT_ITEM_UPDATED", s.ITEM_FULFILLMENT_ITEM_DELETED = "ITEM_FULFILLMENT_ITEM_DELETED";
|
|
@@ -3248,7 +3260,7 @@ function K(s, a, u, c, r) {
|
|
|
3248
3260
|
let t = c, n = r;
|
|
3249
3261
|
return typeof c == "object" && (t = JSON.stringify(c), n = JSON.stringify(r)), `${s} ${a} field ${u} changed from "${t}" to "${n}"`;
|
|
3250
3262
|
}
|
|
3251
|
-
|
|
3263
|
+
E(K, "generateLogMessage");
|
|
3252
3264
|
function xn(s, a, u, c = !1) {
|
|
3253
3265
|
var t, n;
|
|
3254
3266
|
const r = [];
|
|
@@ -3320,10 +3332,10 @@ function xn(s, a, u, c = !1) {
|
|
|
3320
3332
|
const f = !!u.processedAt, d = !!u.rejectedAt;
|
|
3321
3333
|
if (s.purchaseOrder.status === j.Enum.REQUESTING && (f || d))
|
|
3322
3334
|
continue;
|
|
3323
|
-
const p = s.purchaseOrderRequest[o] ? new Date(s.purchaseOrderRequest[o]).toISOString() : null,
|
|
3335
|
+
const p = s.purchaseOrderRequest[o] ? new Date(s.purchaseOrderRequest[o]).toISOString() : null, g = u[o] ? new Date(u[o]).toISOString() : null;
|
|
3324
3336
|
r.push({
|
|
3325
3337
|
type: G.PURCHASE_ORDER_REQUEST_UPDATED,
|
|
3326
|
-
message: K("Transfer Order", (n = s.purchaseOrder.netSuite) == null ? void 0 : n.id, o,
|
|
3338
|
+
message: K("Transfer Order", (n = s.purchaseOrder.netSuite) == null ? void 0 : n.id, o, g, p),
|
|
3327
3339
|
data: {
|
|
3328
3340
|
field: o,
|
|
3329
3341
|
incomingValue: s.purchaseOrderRequest[o],
|
|
@@ -3335,7 +3347,7 @@ function xn(s, a, u, c = !1) {
|
|
|
3335
3347
|
}
|
|
3336
3348
|
return r;
|
|
3337
3349
|
}
|
|
3338
|
-
|
|
3350
|
+
E(xn, "detectTransferOrderConflicts");
|
|
3339
3351
|
function $n(s, a, u, c, r) {
|
|
3340
3352
|
if (s.length === 0)
|
|
3341
3353
|
throw new Error("No order lines found");
|
|
@@ -3417,7 +3429,7 @@ function $n(s, a, u, c, r) {
|
|
|
3417
3429
|
purchaseOrderRequest: n
|
|
3418
3430
|
};
|
|
3419
3431
|
}
|
|
3420
|
-
|
|
3432
|
+
E($n, "resolveTransferOrderConflicts");
|
|
3421
3433
|
e.object({
|
|
3422
3434
|
lineItem: qe.nullish(),
|
|
3423
3435
|
existinglineItem: qe.nullish(),
|
|
@@ -3432,16 +3444,16 @@ e.object({
|
|
|
3432
3444
|
incomingValue: e.any(),
|
|
3433
3445
|
existingValue: e.any()
|
|
3434
3446
|
});
|
|
3435
|
-
var
|
|
3447
|
+
var Ee;
|
|
3436
3448
|
(function(s) {
|
|
3437
3449
|
s.PURCHASE_ORDER_CREATED = "PURCHASE_ORDER_CREATED", s.PURCHASE_ORDER_UPDATED = "PURCHASE_ORDER_UPDATED", s.ITEM_RECEIPT_CREATED = "ITEM_RECEIPT_CREATED", s.ITEM_RECEIPT_UPDATED = "ITEM_RECEIPT_UPDATED", s.ITEM_RECEIPT_DELETED = "ITEM_RECEIPT_DELETED", s.ITEM_RECEIPT_ITEM_CREATED = "ITEM_RECEIPT_ITEM_CREATED", s.ITEM_RECEIPT_ITEM_UPDATED = "ITEM_RECEIPT_ITEM_UPDATED", s.ITEM_RECEIPT_ITEM_DELETED = "ITEM_RECEIPT_ITEM_DELETED";
|
|
3438
|
-
})(
|
|
3450
|
+
})(Ee || (Ee = {}));
|
|
3439
3451
|
function jn(s, a) {
|
|
3440
3452
|
var r;
|
|
3441
3453
|
const u = [];
|
|
3442
3454
|
if (!a)
|
|
3443
3455
|
return u.push({
|
|
3444
|
-
type:
|
|
3456
|
+
type: Ee.PURCHASE_ORDER_CREATED,
|
|
3445
3457
|
message: "Purchase order not found",
|
|
3446
3458
|
data: s
|
|
3447
3459
|
}), u.push(...ye(s.items, [], "", "2")), u;
|
|
@@ -3470,7 +3482,7 @@ function jn(s, a) {
|
|
|
3470
3482
|
continue;
|
|
3471
3483
|
const m = i && typeof i == "string" ? new Date(i).toISOString() : null, l = o && typeof o == "string" ? new Date(o).toISOString() : null;
|
|
3472
3484
|
u.push({
|
|
3473
|
-
type:
|
|
3485
|
+
type: Ee.PURCHASE_ORDER_UPDATED,
|
|
3474
3486
|
message: K("Purchase Order", (r = s.netSuite) == null ? void 0 : r.id, t, l, m),
|
|
3475
3487
|
data: {
|
|
3476
3488
|
field: t,
|
|
@@ -3482,7 +3494,7 @@ function jn(s, a) {
|
|
|
3482
3494
|
}
|
|
3483
3495
|
return u.push(...Ot((a == null ? void 0 : a.deliveryOrder) ?? [], s.deliveryOrder ?? [], a ? (a == null ? void 0 : a.version) || "1" : s.version)), u;
|
|
3484
3496
|
}
|
|
3485
|
-
|
|
3497
|
+
E(jn, "detectPurchaseOrderConflicts");
|
|
3486
3498
|
function Vn(s, a, u, c) {
|
|
3487
3499
|
let r = c ? L.cloneDeep(c) : null;
|
|
3488
3500
|
const t = Ve((r == null ? void 0 : r.items) || [], a);
|
|
@@ -3490,7 +3502,7 @@ function Vn(s, a, u, c) {
|
|
|
3490
3502
|
throw new Error("No order lines found");
|
|
3491
3503
|
if (r) {
|
|
3492
3504
|
for (const n of a)
|
|
3493
|
-
if (n.type ===
|
|
3505
|
+
if (n.type === Ee.PURCHASE_ORDER_UPDATED) {
|
|
3494
3506
|
const i = n.data.field, o = n.data.incomingValue, m = r[i];
|
|
3495
3507
|
o !== m && (r = {
|
|
3496
3508
|
...r,
|
|
@@ -3510,7 +3522,7 @@ function Vn(s, a, u, c) {
|
|
|
3510
3522
|
}
|
|
3511
3523
|
for (const n of a)
|
|
3512
3524
|
switch (n.type) {
|
|
3513
|
-
case
|
|
3525
|
+
case Ee.PURCHASE_ORDER_CREATED:
|
|
3514
3526
|
const i = new Date(ie(u._id)), o = new Date(u.effectiveAt);
|
|
3515
3527
|
r = {
|
|
3516
3528
|
...u,
|
|
@@ -3521,7 +3533,7 @@ function Vn(s, a, u, c) {
|
|
|
3521
3533
|
items: t
|
|
3522
3534
|
};
|
|
3523
3535
|
break;
|
|
3524
|
-
case
|
|
3536
|
+
case Ee.PURCHASE_ORDER_UPDATED:
|
|
3525
3537
|
if (r) {
|
|
3526
3538
|
const m = n.data.field, l = n.data.incomingValue;
|
|
3527
3539
|
r[m], r = {
|
|
@@ -3537,7 +3549,7 @@ function Vn(s, a, u, c) {
|
|
|
3537
3549
|
netSuite: u.netSuite
|
|
3538
3550
|
}, r;
|
|
3539
3551
|
}
|
|
3540
|
-
|
|
3552
|
+
E(Vn, "resolvePurchaseOrderConflicts");
|
|
3541
3553
|
var Ne;
|
|
3542
3554
|
(function(s) {
|
|
3543
3555
|
s.UNIT_CREATED = "UNIT_CREATED", s.UNIT_UPDATED = "UNIT_UPDATED", s.UNIT_DELETED = "UNIT_DELETED";
|
|
@@ -3591,7 +3603,7 @@ function Pt(s, a) {
|
|
|
3591
3603
|
});
|
|
3592
3604
|
return c;
|
|
3593
3605
|
}
|
|
3594
|
-
|
|
3606
|
+
E(Pt, "detectUnitOfMeasureConflicts");
|
|
3595
3607
|
function qn(s, a) {
|
|
3596
3608
|
const u = [];
|
|
3597
3609
|
if (!a)
|
|
@@ -3626,7 +3638,7 @@ function qn(s, a) {
|
|
|
3626
3638
|
}
|
|
3627
3639
|
return u;
|
|
3628
3640
|
}
|
|
3629
|
-
|
|
3641
|
+
E(qn, "detectUnitTypeConflicts");
|
|
3630
3642
|
function xt(s, a) {
|
|
3631
3643
|
if (a.length === 0)
|
|
3632
3644
|
return s;
|
|
@@ -3645,7 +3657,7 @@ function xt(s, a) {
|
|
|
3645
3657
|
}
|
|
3646
3658
|
return u;
|
|
3647
3659
|
}
|
|
3648
|
-
|
|
3660
|
+
E(xt, "resolveUnitOfMeasurementConflicts");
|
|
3649
3661
|
function Hn(s, a, u) {
|
|
3650
3662
|
let c = u;
|
|
3651
3663
|
const r = xt((u == null ? void 0 : u.measurements) || a.measurements, s);
|
|
@@ -3674,16 +3686,16 @@ function Hn(s, a, u) {
|
|
|
3674
3686
|
measurements: r
|
|
3675
3687
|
};
|
|
3676
3688
|
}
|
|
3677
|
-
|
|
3678
|
-
var
|
|
3689
|
+
E(Hn, "resolveUnitTypeConflicts");
|
|
3690
|
+
var ge;
|
|
3679
3691
|
(function(s) {
|
|
3680
3692
|
s.PURCHASE_ORDER_CREATED = "PURCHASE_ORDER_CREATED", s.PURCHASE_ORDER_UPDATED = "PURCHASE_ORDER_UPDATED";
|
|
3681
|
-
})(
|
|
3693
|
+
})(ge || (ge = {}));
|
|
3682
3694
|
function Kn(s, a) {
|
|
3683
3695
|
var c;
|
|
3684
3696
|
const u = [];
|
|
3685
3697
|
if (a || u.push({
|
|
3686
|
-
type:
|
|
3698
|
+
type: ge.PURCHASE_ORDER_CREATED,
|
|
3687
3699
|
message: "Purchase order not found",
|
|
3688
3700
|
data: s
|
|
3689
3701
|
}), !a)
|
|
@@ -3727,7 +3739,7 @@ function Kn(s, a) {
|
|
|
3727
3739
|
o = i && typeof i == "string" ? new Date(i).toISOString() : null, m = n && typeof n == "string" ? new Date(n).toISOString() : null;
|
|
3728
3740
|
}
|
|
3729
3741
|
u.push({
|
|
3730
|
-
type:
|
|
3742
|
+
type: ge.PURCHASE_ORDER_UPDATED,
|
|
3731
3743
|
message: K("Inventory Transfer", (c = s.netSuite) == null ? void 0 : c.id, t, o, m),
|
|
3732
3744
|
data: {
|
|
3733
3745
|
field: t,
|
|
@@ -3740,7 +3752,7 @@ function Kn(s, a) {
|
|
|
3740
3752
|
}
|
|
3741
3753
|
return u;
|
|
3742
3754
|
}
|
|
3743
|
-
|
|
3755
|
+
E(Kn, "detectInventoryTransferConflicts");
|
|
3744
3756
|
function Yn(s, a, u, c) {
|
|
3745
3757
|
if (s.length === 0)
|
|
3746
3758
|
throw new Error("No order lines found");
|
|
@@ -3750,7 +3762,7 @@ function Yn(s, a, u, c) {
|
|
|
3750
3762
|
return c;
|
|
3751
3763
|
if (r) {
|
|
3752
3764
|
for (const n of a)
|
|
3753
|
-
if (n.type ===
|
|
3765
|
+
if (n.type === ge.PURCHASE_ORDER_UPDATED) {
|
|
3754
3766
|
const i = n.data.field, o = n.data.incomingValue;
|
|
3755
3767
|
r = {
|
|
3756
3768
|
...r,
|
|
@@ -3764,7 +3776,7 @@ function Yn(s, a, u, c) {
|
|
|
3764
3776
|
}
|
|
3765
3777
|
for (const n of a)
|
|
3766
3778
|
switch (n.type) {
|
|
3767
|
-
case
|
|
3779
|
+
case ge.PURCHASE_ORDER_CREATED:
|
|
3768
3780
|
const i = new Date(ie(u._id)), o = new Date(u.effectiveAt);
|
|
3769
3781
|
r = {
|
|
3770
3782
|
...u,
|
|
@@ -3775,7 +3787,7 @@ function Yn(s, a, u, c) {
|
|
|
3775
3787
|
items: t
|
|
3776
3788
|
};
|
|
3777
3789
|
break;
|
|
3778
|
-
case
|
|
3790
|
+
case ge.PURCHASE_ORDER_UPDATED:
|
|
3779
3791
|
if (r) {
|
|
3780
3792
|
const m = n.data.field, l = n.data.incomingValue, f = r[m];
|
|
3781
3793
|
if (m === "version" && l !== f)
|
|
@@ -3792,7 +3804,7 @@ function Yn(s, a, u, c) {
|
|
|
3792
3804
|
netSuite: u.netSuite
|
|
3793
3805
|
}, r;
|
|
3794
3806
|
}
|
|
3795
|
-
|
|
3807
|
+
E(Yn, "resolveInventoryTransferConflicts");
|
|
3796
3808
|
var q;
|
|
3797
3809
|
(function(s) {
|
|
3798
3810
|
s.INVENTORY_ITEM_CREATED = "INVENTORY_ITEM_CREATED", s.INVENTORY_ITEM_UPDATED = "INVENTORY_ITEM_UPDATED", s.INVENTORY_ITEM_DELETED = "INVENTORY_ITEM_DELETED", s.INVENTORY_ITEM_SKU_UPDATED = "INVENTORY_ITEM_SKU_UPDATED";
|
|
@@ -3840,7 +3852,7 @@ function Qn(s) {
|
|
|
3840
3852
|
}
|
|
3841
3853
|
return a;
|
|
3842
3854
|
}
|
|
3843
|
-
|
|
3855
|
+
E(Qn, "detectInventoryChildItemConflicts");
|
|
3844
3856
|
function Wn(s) {
|
|
3845
3857
|
const a = [], { incoming: u, current: c } = s;
|
|
3846
3858
|
if (u.itemType !== V.Enum.InvtPart)
|
|
@@ -3879,7 +3891,7 @@ function Wn(s) {
|
|
|
3879
3891
|
}
|
|
3880
3892
|
return a;
|
|
3881
3893
|
}
|
|
3882
|
-
|
|
3894
|
+
E(Wn, "detectInventoryParentItemConflicts");
|
|
3883
3895
|
function Zn(s, a, u) {
|
|
3884
3896
|
if (a.itemType !== V.Enum.InvtPart)
|
|
3885
3897
|
throw new Error("[resolveInventoryParentItemConflicts] only supports InvtPart parent items");
|
|
@@ -3905,7 +3917,7 @@ function Zn(s, a, u) {
|
|
|
3905
3917
|
}
|
|
3906
3918
|
return r;
|
|
3907
3919
|
}
|
|
3908
|
-
|
|
3920
|
+
E(Zn, "resolveInventoryParentItemConflicts");
|
|
3909
3921
|
function Xn(s, a, u) {
|
|
3910
3922
|
if (a.itemType !== V.Enum.InvtPart)
|
|
3911
3923
|
throw new Error("[resolveInventoryChildItemConflicts] only supports InvtPart child items");
|
|
@@ -3922,7 +3934,7 @@ function Xn(s, a, u) {
|
|
|
3922
3934
|
}
|
|
3923
3935
|
return r;
|
|
3924
3936
|
}
|
|
3925
|
-
|
|
3937
|
+
E(Xn, "resolveInventoryChildItemConflicts");
|
|
3926
3938
|
var H;
|
|
3927
3939
|
(function(s) {
|
|
3928
3940
|
s.ASSEMBLY_ITEM_CREATED = "ASSEMBLY_ITEM_CREATED", s.ASSEMBLY_ITEM_UPDATED = "ASSEMBLY_ITEM_UPDATED", s.ASSEMBLY_ITEM_DELETED = "ASSEMBLY_ITEM_DELETED", s.ASSEMBLY_ITEM_SKU_UPDATED = "ASSEMBLY_ITEM_SKU_UPDATED";
|
|
@@ -3970,7 +3982,7 @@ function ii(s) {
|
|
|
3970
3982
|
}
|
|
3971
3983
|
return a;
|
|
3972
3984
|
}
|
|
3973
|
-
|
|
3985
|
+
E(ii, "detectAssemblyChildItemConflicts");
|
|
3974
3986
|
function si(s) {
|
|
3975
3987
|
const a = [], { incoming: u, current: c } = s;
|
|
3976
3988
|
if (u.itemType !== V.Enum.Assembly)
|
|
@@ -4009,7 +4021,7 @@ function si(s) {
|
|
|
4009
4021
|
}
|
|
4010
4022
|
return a;
|
|
4011
4023
|
}
|
|
4012
|
-
|
|
4024
|
+
E(si, "detectAssemblyParentItemConflicts");
|
|
4013
4025
|
function ri(s, a, u) {
|
|
4014
4026
|
if (a.itemType !== V.Enum.Assembly)
|
|
4015
4027
|
throw new Error("[resolveAssemblyParentItemConflicts] only supports Assembly parent items");
|
|
@@ -4035,7 +4047,7 @@ function ri(s, a, u) {
|
|
|
4035
4047
|
}
|
|
4036
4048
|
return r;
|
|
4037
4049
|
}
|
|
4038
|
-
|
|
4050
|
+
E(ri, "resolveAssemblyParentItemConflicts");
|
|
4039
4051
|
function oi(s, a, u) {
|
|
4040
4052
|
if (a.itemType !== V.Enum.Assembly)
|
|
4041
4053
|
throw new Error("[resolveAssemblyChildItemConflicts] only supports Assembly child items");
|
|
@@ -4052,7 +4064,7 @@ function oi(s, a, u) {
|
|
|
4052
4064
|
}
|
|
4053
4065
|
return r;
|
|
4054
4066
|
}
|
|
4055
|
-
|
|
4067
|
+
E(oi, "resolveAssemblyChildItemConflicts");
|
|
4056
4068
|
function ai(s, a, u, c, r) {
|
|
4057
4069
|
const t = {}, n = {};
|
|
4058
4070
|
for (const o of a) {
|
|
@@ -4069,7 +4081,7 @@ function ai(s, a, u, c, r) {
|
|
|
4069
4081
|
orderItemMappingByReceipt: n
|
|
4070
4082
|
};
|
|
4071
4083
|
}
|
|
4072
|
-
|
|
4084
|
+
E(ai, "prepareTransferOrderTransformContext");
|
|
4073
4085
|
function ui(s, a, u, c) {
|
|
4074
4086
|
const r = {};
|
|
4075
4087
|
for (const n of a) {
|
|
@@ -4081,13 +4093,13 @@ function ui(s, a, u, c) {
|
|
|
4081
4093
|
orderItemMappingByReceipt: r
|
|
4082
4094
|
};
|
|
4083
4095
|
}
|
|
4084
|
-
|
|
4096
|
+
E(ui, "preparePurchaseOrderTransformContext");
|
|
4085
4097
|
function di(s, a, u) {
|
|
4086
4098
|
return {
|
|
4087
4099
|
orderItemMapping: pe(u.sku ?? [], u.unit ?? [], a, s.inventory.items)
|
|
4088
4100
|
};
|
|
4089
4101
|
}
|
|
4090
|
-
|
|
4102
|
+
E(di, "prepareInventoryTransferTransformContext");
|
|
4091
4103
|
function ci(s, a) {
|
|
4092
4104
|
const u = s;
|
|
4093
4105
|
u.version = ee.Enum[1];
|
|
@@ -4129,7 +4141,7 @@ function ci(s, a) {
|
|
|
4129
4141
|
} : void 0
|
|
4130
4142
|
};
|
|
4131
4143
|
}
|
|
4132
|
-
|
|
4144
|
+
E(ci, "transformPurchaseOrderToV1");
|
|
4133
4145
|
function li(s, a) {
|
|
4134
4146
|
const u = new Date(ie(s._id));
|
|
4135
4147
|
if (J(u, a)) return !0;
|
|
@@ -4144,7 +4156,7 @@ function li(s, a) {
|
|
|
4144
4156
|
}
|
|
4145
4157
|
return !1;
|
|
4146
4158
|
}
|
|
4147
|
-
|
|
4159
|
+
E(li, "shouldSyncOrderByTimestamp");
|
|
4148
4160
|
function mi(s) {
|
|
4149
4161
|
var a, u;
|
|
4150
4162
|
return {
|
|
@@ -4162,7 +4174,7 @@ function mi(s) {
|
|
|
4162
4174
|
cogsAccount: s.cogsAccount
|
|
4163
4175
|
};
|
|
4164
4176
|
}
|
|
4165
|
-
|
|
4177
|
+
E(mi, "transformParentToFdoNetSuiteItem");
|
|
4166
4178
|
function fi(s) {
|
|
4167
4179
|
var a, u;
|
|
4168
4180
|
return {
|
|
@@ -4180,7 +4192,7 @@ function fi(s) {
|
|
|
4180
4192
|
cogsAccount: s.cogsAccount
|
|
4181
4193
|
};
|
|
4182
4194
|
}
|
|
4183
|
-
|
|
4195
|
+
E(fi, "transformChildToFdoNetSuiteItem");
|
|
4184
4196
|
const Se = Qt((s, a) => {
|
|
4185
4197
|
const u = Me(), c = Xt();
|
|
4186
4198
|
return a.onError(async (r) => {
|
|
@@ -4282,7 +4294,7 @@ const Se = Qt((s, a) => {
|
|
|
4282
4294
|
},
|
|
4283
4295
|
urls: s
|
|
4284
4296
|
};
|
|
4285
|
-
}), Ii = { class: "flex flex-col" }, pi = { class: "text-sm" },
|
|
4297
|
+
}), Ii = { class: "flex flex-col" }, pi = { class: "text-sm" }, Ei = { class: "text-sm" }, gi = { class: "text-sm" }, yi = { class: "flex flex-col gap-2 mt-2" }, _i = { class: "text-xs" }, bi = { class: "text-xs" }, Si = { class: "text-xs" }, vi = { class: "text-xs" }, Ti = {
|
|
4286
4298
|
key: 0,
|
|
4287
4299
|
class: "text-xs"
|
|
4288
4300
|
}, hi = {
|
|
@@ -4297,7 +4309,7 @@ const Se = Qt((s, a) => {
|
|
|
4297
4309
|
}, Fi = {
|
|
4298
4310
|
class: "flex flex-col w-full gap-2",
|
|
4299
4311
|
style: { "margin-left": "15px" }
|
|
4300
|
-
},
|
|
4312
|
+
}, wi = { class: "flex flex-col gap-3" }, ki = /* @__PURE__ */ en({
|
|
4301
4313
|
__name: "NetSuiteCustomCodeSelection",
|
|
4302
4314
|
props: {
|
|
4303
4315
|
readonly: { type: Boolean },
|
|
@@ -4319,7 +4331,7 @@ const Se = Qt((s, a) => {
|
|
|
4319
4331
|
return `Overwrite with "${f ?? "N/A"}"`;
|
|
4320
4332
|
}
|
|
4321
4333
|
return (f, d) => {
|
|
4322
|
-
const I =
|
|
4334
|
+
const I = ke("FmButton"), p = ke("FmLabel"), g = ke("FmSelect"), y = ke("FmDialog");
|
|
4323
4335
|
return z(), tn(y, {
|
|
4324
4336
|
modelValue: r.value,
|
|
4325
4337
|
"onUpdate:modelValue": d[4] || (d[4] = (_) => r.value = _),
|
|
@@ -4346,7 +4358,7 @@ const Se = Qt((s, a) => {
|
|
|
4346
4358
|
M("div", Fi, [
|
|
4347
4359
|
f.readonly ? Ae("", !0) : (z(), ae(Re, { key: 0 }, [
|
|
4348
4360
|
d[17] || (d[17] = M("span", { class: "text-sm mb-2 font-bold" }, " This will overwrite the code and uom only.", -1)),
|
|
4349
|
-
M("div",
|
|
4361
|
+
M("div", wi, [
|
|
4350
4362
|
oe(I, {
|
|
4351
4363
|
class: "sm:w-full xs:w-full",
|
|
4352
4364
|
label: l(n.value.code),
|
|
@@ -4387,14 +4399,14 @@ const Se = Qt((s, a) => {
|
|
|
4387
4399
|
])),
|
|
4388
4400
|
_: 1
|
|
4389
4401
|
}),
|
|
4390
|
-
M("span",
|
|
4402
|
+
M("span", Ei, x(f.sku.name), 1),
|
|
4391
4403
|
oe(p, null, {
|
|
4392
4404
|
default: re(() => d[8] || (d[8] = [
|
|
4393
4405
|
Q("Unit")
|
|
4394
4406
|
])),
|
|
4395
4407
|
_: 1
|
|
4396
4408
|
}),
|
|
4397
|
-
M("span",
|
|
4409
|
+
M("span", gi, x(f.sku.unit.name), 1)
|
|
4398
4410
|
]),
|
|
4399
4411
|
f.readonly ? (z(), ae(Re, { key: 0 }, [
|
|
4400
4412
|
d[14] || (d[14] = M("hr", { class: "my-2" }, null, -1)),
|
|
@@ -4440,7 +4452,7 @@ const Se = Qt((s, a) => {
|
|
|
4440
4452
|
])),
|
|
4441
4453
|
_: 1
|
|
4442
4454
|
}),
|
|
4443
|
-
oe(
|
|
4455
|
+
oe(g, {
|
|
4444
4456
|
modelValue: n.value,
|
|
4445
4457
|
"onUpdate:modelValue": d[1] || (d[1] = (_) => n.value = _),
|
|
4446
4458
|
items: t.value,
|
|
@@ -4574,7 +4586,7 @@ function Oi() {
|
|
|
4574
4586
|
id: "netsuite-verify",
|
|
4575
4587
|
cell: (o) => {
|
|
4576
4588
|
const m = s.skuById[o.row.original.sku._id];
|
|
4577
|
-
return sn(
|
|
4589
|
+
return sn(ki, {
|
|
4578
4590
|
sku: m,
|
|
4579
4591
|
settingOptions: T.value.skuOptions,
|
|
4580
4592
|
"onUpdate:modelValue": (l, f, d) => {
|
|
@@ -4739,11 +4751,11 @@ function Oi() {
|
|
|
4739
4751
|
);
|
|
4740
4752
|
if (m.includeChildren) {
|
|
4741
4753
|
const I = T.value.setting.childItems.filter((p) => {
|
|
4742
|
-
let
|
|
4754
|
+
let g = p.subsidiaryIds;
|
|
4743
4755
|
if (p.includeChildren == !0)
|
|
4744
4756
|
for (const y of p.subsidiaryIds)
|
|
4745
|
-
|
|
4746
|
-
return
|
|
4757
|
+
g = g.concat(f[y]);
|
|
4758
|
+
return g = [...new Set(g)], p.parentNetSuiteId === m.netSuiteId && console.log(p), p.parentNetSuiteId === m.netSuiteId && g.some((y) => l.includes(y));
|
|
4747
4759
|
}).flatMap((p) => p.unitTypeId);
|
|
4748
4760
|
return T.value.setting.units.filter((p) => I.includes(p.netSuiteId)).flatMap((p) => p.measurements).map((p) => p.id);
|
|
4749
4761
|
}
|
|
@@ -4756,14 +4768,14 @@ function Oi() {
|
|
|
4756
4768
|
if (this.state.setting = o, (m = T.value.setting.subsidiaries) != null && m.length) {
|
|
4757
4769
|
const { flat: f, tree: d } = Z(T.value.setting.subsidiaries);
|
|
4758
4770
|
for (const p of o.vendors) {
|
|
4759
|
-
const
|
|
4760
|
-
this.state.vendorSubsidiary[p.id] = (
|
|
4771
|
+
const g = f.find((y) => y.id === p.subsidiaryId);
|
|
4772
|
+
this.state.vendorSubsidiary[p.id] = (g == null ? void 0 : g.fullName) || "";
|
|
4761
4773
|
}
|
|
4762
4774
|
for (const p of o.items) {
|
|
4763
|
-
const
|
|
4775
|
+
const g = [];
|
|
4764
4776
|
for (const _ of p.subsidiaryIds) {
|
|
4765
4777
|
const S = f.find((v) => v.id === _);
|
|
4766
|
-
S &&
|
|
4778
|
+
S && g.push(S.fullName || "");
|
|
4767
4779
|
}
|
|
4768
4780
|
const y = $t(
|
|
4769
4781
|
d,
|
|
@@ -4772,7 +4784,7 @@ function Oi() {
|
|
|
4772
4784
|
);
|
|
4773
4785
|
this.state.skuSubsidiaries[p.id] = {
|
|
4774
4786
|
includeChildren: p.includeChildren,
|
|
4775
|
-
flattenedSubsidiaryNames:
|
|
4787
|
+
flattenedSubsidiaryNames: g,
|
|
4776
4788
|
subsidiaryTree: y
|
|
4777
4789
|
};
|
|
4778
4790
|
}
|
|
@@ -4839,22 +4851,22 @@ function Oi() {
|
|
|
4839
4851
|
const l = `business_${((p = Me().currentBusiness.value) == null ? void 0 : p._id) ?? ""}`, f = $e[l].code, d = c.value.get(i._id);
|
|
4840
4852
|
let I = null;
|
|
4841
4853
|
if (d && d.length > 0) {
|
|
4842
|
-
const
|
|
4843
|
-
|
|
4854
|
+
const g = d[0];
|
|
4855
|
+
g[f] && (I = g[f]);
|
|
4844
4856
|
const y = T.value.setting.units.find((S) => {
|
|
4845
4857
|
var v;
|
|
4846
4858
|
return S.id === ((v = i.unit) == null ? void 0 : v._id);
|
|
4847
|
-
}), _ =
|
|
4859
|
+
}), _ = g.netSuiteId;
|
|
4848
4860
|
if (o) {
|
|
4849
4861
|
const S = y == null ? void 0 : y.measurements.find((v) => v.id === o);
|
|
4850
4862
|
if (S) {
|
|
4851
|
-
const v = ["ZPH"],
|
|
4852
|
-
(b) => b.parentNetSuiteId === _ && b.unitTypeId === (y == null ? void 0 : y.netSuiteId) && b.unitOfMeasureId === S.netSuiteId && b.externalId && !v.some((
|
|
4863
|
+
const v = ["ZPH"], N = T.value.setting.childItems.filter(
|
|
4864
|
+
(b) => b.parentNetSuiteId === _ && b.unitTypeId === (y == null ? void 0 : y.netSuiteId) && b.unitOfMeasureId === S.netSuiteId && b.externalId && !v.some((D) => {
|
|
4853
4865
|
var F;
|
|
4854
|
-
return (F = b.externalId) == null ? void 0 : F.startsWith(
|
|
4866
|
+
return (F = b.externalId) == null ? void 0 : F.startsWith(D);
|
|
4855
4867
|
})
|
|
4856
4868
|
)[0];
|
|
4857
|
-
|
|
4869
|
+
N && N[f] && (I = N[f]);
|
|
4858
4870
|
}
|
|
4859
4871
|
}
|
|
4860
4872
|
}
|
|
@@ -4919,36 +4931,36 @@ function Li(s) {
|
|
|
4919
4931
|
}
|
|
4920
4932
|
}, d = o.childItems.reduce(
|
|
4921
4933
|
(I, p) => {
|
|
4922
|
-
const
|
|
4934
|
+
const g = a("code", void 0, p), y = a("name", void 0, p), _ = o.unit.measurements.find(
|
|
4923
4935
|
(b) => b.netSuiteId === p.unitOfMeasureId
|
|
4924
4936
|
);
|
|
4925
|
-
let S = i.unit.measurements.find((b) => b.id === (_ == null ? void 0 : _.id)), v,
|
|
4937
|
+
let S = i.unit.measurements.find((b) => b.id === (_ == null ? void 0 : _.id)), v, C = S == null ? void 0 : S.abbrev;
|
|
4926
4938
|
if (!_) {
|
|
4927
4939
|
const b = o.units[p.unitTypeId];
|
|
4928
4940
|
if (b) {
|
|
4929
|
-
const
|
|
4941
|
+
const D = t[b.id], F = b == null ? void 0 : b.measurements.find(
|
|
4930
4942
|
(U) => U.netSuiteId === p.unitOfMeasureId
|
|
4931
|
-
),
|
|
4943
|
+
), w = D == null ? void 0 : D.measurements.find(
|
|
4932
4944
|
(U) => U.id === (F == null ? void 0 : F.id)
|
|
4933
4945
|
);
|
|
4934
|
-
if (
|
|
4946
|
+
if (w) {
|
|
4935
4947
|
const U = i.unit.measurements.find(
|
|
4936
|
-
(B) => B.name ===
|
|
4948
|
+
(B) => B.name === w.name
|
|
4937
4949
|
);
|
|
4938
|
-
U ? (
|
|
4950
|
+
U ? (C = `${U == null ? void 0 : U.abbrev} ⚠️`, S = U) : C = `Fallback to "${i.unit.abbrev}" (⚠️ Not match with any measurement name)`, v = `UOM "${w.abbrev}" is from "${D.name}"`;
|
|
4939
4951
|
}
|
|
4940
4952
|
}
|
|
4941
4953
|
}
|
|
4942
|
-
const
|
|
4954
|
+
const N = p.name || "N/A (childName not found)";
|
|
4943
4955
|
return I.push({
|
|
4944
|
-
label: `${
|
|
4956
|
+
label: `${N} (${g})`,
|
|
4945
4957
|
value: {
|
|
4946
|
-
code:
|
|
4958
|
+
code: g,
|
|
4947
4959
|
name: y,
|
|
4948
|
-
childName:
|
|
4960
|
+
childName: N,
|
|
4949
4961
|
externalId: p.externalId || "N/A (externalId not found)",
|
|
4950
4962
|
fmMeasurementId: S == null ? void 0 : S.id,
|
|
4951
|
-
fmMeasurementAbbrev:
|
|
4963
|
+
fmMeasurementAbbrev: C,
|
|
4952
4964
|
remark: v
|
|
4953
4965
|
}
|
|
4954
4966
|
}), I;
|
|
@@ -4973,7 +4985,7 @@ const Pi = {
|
|
|
4973
4985
|
};
|
|
4974
4986
|
export {
|
|
4975
4987
|
Ke as S,
|
|
4976
|
-
|
|
4988
|
+
ki as _,
|
|
4977
4989
|
Se as a,
|
|
4978
4990
|
Oi as u
|
|
4979
4991
|
};
|