@feedmepos/mf-inventory-portal 1.2.31-dev.2 → 1.2.32
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-BMf3N76A.js → App-CYA9SdBE.js} +3 -3
- package/dist/{ApprovalView-ue3fJ7v_.js → ApprovalView-BE6fbVVu.js} +5 -5
- package/dist/{BindingsDialog-ByMj3RjY.js → BindingsDialog-CIxhHnp_.js} +2 -2
- package/dist/{BindingsPicker-DgSjaVrq.js → BindingsPicker-DBQaijkW.js} +2 -2
- package/dist/{BindingsTable-BUu0r9Zo.js → BindingsTable-ESwPz0i6.js} +3 -3
- package/dist/{ClosingDraftView-R2NPPsXD.js → ClosingDraftView-IVlNBCTz.js} +89 -85
- package/dist/{ClosingHistoryView-1W_y3JEM.js → ClosingHistoryView-br-Snk31.js} +3 -3
- package/dist/{ClosingTemplateView-BC9w8vZ0.js → ClosingTemplateView-K4YRKCem.js} +14 -14
- package/dist/{DeliveryOrderPrintPreview-zJhQH8By.js → DeliveryOrderPrintPreview-j8G30DPb.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CJ_bPMX_.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-7_SwtBvD.js} +5 -5
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Cphr1J6U.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CNIXAsVD.js} +2 -2
- package/dist/{FmMultiselectDialog-DSGQitHT.js → FmMultiselectDialog-CA7fTPHX.js} +1 -1
- package/dist/{FmMultiselectDialog-DEt2I4_c.js → FmMultiselectDialog-DAAO-zDO.js} +2 -2
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-spkm7SZK.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DpyAu1Sa.js} +3 -3
- package/dist/{ImportView-ank5c4AV.js → ImportView-ChaQacFp.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DhE2M3CD.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-zsCjINbS.js} +1 -1
- package/dist/{IngredientGroupView-DVT0Yyae.js → IngredientGroupView-TlaErIKU.js} +5 -5
- package/dist/{IngredientsView-BcmPBoOb.js → IngredientsView-BbqoUavX.js} +14 -14
- package/dist/{IntegrationView-0JY21Fjn.js → IntegrationView-C9UbRnvN.js} +11 -11
- package/dist/{InventoryBindingForm-FhDgibuy.js → InventoryBindingForm-I6ekqXEO.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DL2pd-U1.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-Z9A3dfL1.js} +4 -4
- package/dist/{InventoryBindingSummary-Rj4rLIp-.js → InventoryBindingSummary-DiB9T-H3.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CtqVtwbE.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-C9klFvAA.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BJZmEJ_9.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CYOBDy43.js} +2 -2
- package/dist/{PublishView-NyqU4ogZ.js → PublishView-DktlPUsr.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-Cua1-cfS.js → PurchaseOrderPrintPreview-C36PAZ8S.js} +1 -1
- package/dist/{ReceiveRequestView-BQtpsAOR.js → ReceiveRequestView-DfnU80K-.js} +19 -19
- package/dist/{RecipeView-Dcv3Pnvu.js → RecipeView-CbjMupHA.js} +8 -8
- package/dist/{StockView-D2jlQ_IE.js → StockView-CsP3aOk1.js} +15 -15
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang--F8e7pUI.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-C_DOOzNP.js} +1 -1
- package/dist/{SupplierView-CGAtUowc.js → SupplierView-DCcjhtKG.js} +11 -11
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-Cd9R8l0c.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-DbrZEQlu.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Dy5JfpNp.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BPbG9gLo.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BqxG1uZu.js → TransferDetails.vue_vue_type_script_setup_true_lang-BxZKAYzR.js} +14 -14
- package/dist/{TransferTemplateView-DMuw4LtY.js → TransferTemplateView-BqVXXaUw.js} +15 -15
- package/dist/{UnitView-CwlT0HpP.js → UnitView-CnR0B9QA.js} +6 -6
- package/dist/{WarehouseView-mT3A-9uq.js → WarehouseView-DYZlY-vs.js} +5 -5
- package/dist/{WastageTemplateView-C3_KtgFQ.js → WastageTemplateView-DjpDoyk8.js} +14 -14
- package/dist/{app-C2nudFnk.js → app-Dn2TmFC1.js} +1347 -1325
- package/dist/app.js +1 -1
- package/dist/{closing-template-fRmBNy4y.js → closing-template-MZE5jGm7.js} +1 -1
- package/dist/{date2-ngfXp6E2.js → date2-BO4Qnc6Z.js} +1 -1
- package/dist/{dayjs.min-BvcCfiWk.js → dayjs.min-Cv3MYkF5.js} +1 -1
- package/dist/{decimal-h7clfS02.js → decimal-0ElvTF5X.js} +2 -2
- package/dist/{defineDeepModel-C_n3Ytw6.js → defineDeepModel-yo52Udnj.js} +1 -1
- package/dist/{duplicate-template-CHiQ3uHE.js → duplicate-template--pOE4L_k.js} +1 -1
- package/dist/{feature-CrcV14lV.js → feature-CnEBS-5A.js} +2 -2
- package/dist/{format-time-from-id-ljQJ36VV.js → format-time-from-id-CIOcpLW8.js} +1 -1
- package/dist/{format-unit-display-r1oynPKD.js → format-unit-display-lRIlfSwg.js} +10 -10
- package/dist/{import-export.helper-C5TdWJLB.js → import-export.helper-BcVVS0pv.js} +5 -5
- package/dist/{index-gutj1NVB.js → index-B94-KOsL.js} +1 -1
- package/dist/{index-C0Q6KaoS.js → index-BTGtU8AJ.js} +3 -3
- package/dist/{index-DluVXb7-.js → index-C81u_gK5.js} +1 -1
- package/dist/{lodash-CJ0fXmvq.js → lodash-BQvsWdt3.js} +1 -1
- package/dist/{netsuite-Dp3KQlN9.js → netsuite-BA3499Kb.js} +374 -360
- package/dist/{purchase-order-template-CTICqz-0.js → purchase-order-template-Hi8QkwAl.js} +1 -1
- package/dist/{rules-CWhZXxdv.js → rules-h4fXYIs1.js} +3 -3
- package/dist/{stock-DHpvp37w.js → stock-BMLn_D1-.js} +1 -1
- package/dist/{stock-BpY8FTMC.js → stock-BvYSvIZm.js} +3 -3
- package/dist/{supplier-CfiMZbRg.js → supplier-oDUHcoN8.js} +2 -2
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-DrYxhoTU.js → use-ingredient-select-dialog-CVqGxfeJ.js} +2 -2
- package/dist/{use-inventory-binding-dialog-BAYX4xEg.js → use-inventory-binding-dialog-d9MT9hcY.js} +2 -2
- package/dist/{use-template-enabled-locations-2-DbNAe5rC.js → use-template-enabled-locations-2-43l3gMUA.js} +2 -2
- package/dist/{vue-i18n-BNE50uOV.js → vue-i18n-DmR2XhU0.js} +541 -541
- package/dist/{xlsx-BSJt4rqr.js → xlsx-CenPzqZX.js} +398 -398
- package/dist/{xlsx.util-DEF923iN.js → xlsx.util-C2Rlp2KT.js} +1 -1
- package/package.json +2 -2
|
@@ -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-Dn2TmFC1.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-BQvsWdt3.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-CnEBS-5A.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 = [];
|
|
@@ -2800,7 +2812,7 @@ function ye(s, a, u, c, r = !1) {
|
|
|
2800
2812
|
else {
|
|
2801
2813
|
const o = Object.keys(qe.shape);
|
|
2802
2814
|
for (const m of o) {
|
|
2803
|
-
if (m === "id" || m === "
|
|
2815
|
+
if (m === "id" || m === "name" || m === "externalId" && c === ee.Enum[1])
|
|
2804
2816
|
continue;
|
|
2805
2817
|
if (m === "sku") {
|
|
2806
2818
|
n[m]._id !== i[m]._id && t.push({
|
|
@@ -2825,11 +2837,13 @@ 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])) {
|
|
2832
2844
|
let d = f, I = l;
|
|
2845
|
+
if (m === "code" && f)
|
|
2846
|
+
continue;
|
|
2833
2847
|
typeof n[m] == "object" && (d = JSON.stringify(f), I = JSON.stringify(l)), t.push({
|
|
2834
2848
|
type: h.ITEM_UPDATED,
|
|
2835
2849
|
message: ne(Te, [
|
|
@@ -2854,7 +2868,7 @@ function ye(s, a, u, c, r = !1) {
|
|
|
2854
2868
|
}
|
|
2855
2869
|
return t;
|
|
2856
2870
|
}
|
|
2857
|
-
|
|
2871
|
+
E(ye, "detectPurchaseOrderItemConflicts");
|
|
2858
2872
|
function tt(s, a, u, c, r) {
|
|
2859
2873
|
const t = [], n = {};
|
|
2860
2874
|
if (r === ee.Enum[2] && c.length != 0 && c.every((i) => !i.externalId))
|
|
@@ -2932,7 +2946,7 @@ function tt(s, a, u, c, r) {
|
|
|
2932
2946
|
continue;
|
|
2933
2947
|
}
|
|
2934
2948
|
const f = i[l] ?? null, d = o[l] ?? null;
|
|
2935
|
-
if (!(l === "amount" && f && d &&
|
|
2949
|
+
if (!(l === "amount" && f && d && A.equals({
|
|
2936
2950
|
a: f,
|
|
2937
2951
|
b: d
|
|
2938
2952
|
})) && !L.isEqual(i[l], o[l])) {
|
|
@@ -2962,7 +2976,7 @@ function tt(s, a, u, c, r) {
|
|
|
2962
2976
|
}
|
|
2963
2977
|
return t;
|
|
2964
2978
|
}
|
|
2965
|
-
|
|
2979
|
+
E(tt, "detectPurchaseOrderReceivedConflicts");
|
|
2966
2980
|
function Ve(s, a, u = "1") {
|
|
2967
2981
|
if (a.length === 0)
|
|
2968
2982
|
return s;
|
|
@@ -2987,7 +3001,7 @@ function Ve(s, a, u = "1") {
|
|
|
2987
3001
|
id: r.id || crypto.randomUUID()
|
|
2988
3002
|
}));
|
|
2989
3003
|
}
|
|
2990
|
-
|
|
3004
|
+
E(Ve, "resolvePurchaseOrderItemConflicts");
|
|
2991
3005
|
function nt(s, a, u = "1") {
|
|
2992
3006
|
if (a.length === 0)
|
|
2993
3007
|
return s;
|
|
@@ -3009,12 +3023,12 @@ function nt(s, a, u = "1") {
|
|
|
3009
3023
|
}
|
|
3010
3024
|
return c;
|
|
3011
3025
|
}
|
|
3012
|
-
|
|
3026
|
+
E(nt, "resolvePurchaseOrderReceivedConflicts");
|
|
3013
3027
|
var de;
|
|
3014
3028
|
(function(s) {
|
|
3015
3029
|
s.ITEM_FULFILLMENT_CREATED = "ITEM_FULFILLMENT_CREATED", s.ITEM_FULFILLMENT_UPDATED = "ITEM_FULFILLMENT_UPDATED", s.ITEM_FULFILLMENT_DELETED = "ITEM_FULFILLMENT_DELETED";
|
|
3016
3030
|
})(de || (de = {}));
|
|
3017
|
-
var
|
|
3031
|
+
var kn = 'Record [$] item on line [$], field "$" changed from "$" to "$"';
|
|
3018
3032
|
function Rn(s, a, u) {
|
|
3019
3033
|
var t, n, i;
|
|
3020
3034
|
const c = Object.keys(Gt.shape), r = [];
|
|
@@ -3042,7 +3056,7 @@ function Rn(s, a, u) {
|
|
|
3042
3056
|
let I = d, p = f;
|
|
3043
3057
|
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
3058
|
type: de.ITEM_FULFILLMENT_UPDATED,
|
|
3045
|
-
message: ne(
|
|
3059
|
+
message: ne(kn, [
|
|
3046
3060
|
"Item Fulfillment Field",
|
|
3047
3061
|
`${(n = o.netSuite) == null ? void 0 : n.id}`,
|
|
3048
3062
|
l,
|
|
@@ -3061,7 +3075,7 @@ function Rn(s, a, u) {
|
|
|
3061
3075
|
}
|
|
3062
3076
|
return r;
|
|
3063
3077
|
}
|
|
3064
|
-
|
|
3078
|
+
E(Rn, "detectItemFulfillmentConflicts");
|
|
3065
3079
|
function On(s, a) {
|
|
3066
3080
|
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
3081
|
if (u.length === 0)
|
|
@@ -3099,21 +3113,21 @@ function On(s, a) {
|
|
|
3099
3113
|
}));
|
|
3100
3114
|
return r;
|
|
3101
3115
|
}
|
|
3102
|
-
|
|
3116
|
+
E(On, "resolveDeliveryFulfillmentConflicts");
|
|
3103
3117
|
var ce;
|
|
3104
3118
|
(function(s) {
|
|
3105
3119
|
s.ITEM_RECEIPT_CREATED = "ITEM_RECEIPT_CREATED", s.ITEM_RECEIPT_UPDATED = "ITEM_RECEIPT_UPDATED", s.ITEM_RECEIPT_DELETED = "ITEM_RECEIPT_DELETED";
|
|
3106
3120
|
})(ce || (ce = {}));
|
|
3107
|
-
var W = /* @__PURE__ */
|
|
3121
|
+
var W = /* @__PURE__ */ E((s) => s === "" ? null : s, "normalizeNullOrEmpty"), Ln = 'Record [$] item on line [$], field "$" changed from "$" to "$"';
|
|
3108
3122
|
function Ot(s, a, u) {
|
|
3109
3123
|
var i, o, m, l, f, d, I;
|
|
3110
3124
|
const c = Object.keys(Jt.shape), r = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set();
|
|
3111
3125
|
for (const p of s) {
|
|
3112
|
-
const
|
|
3113
|
-
if (
|
|
3114
|
-
if (r.has(
|
|
3115
|
-
throw new Error(`Duplicate NetSuite ID found: ${
|
|
3116
|
-
r.add(
|
|
3126
|
+
const g = W((i = p.netSuite) == null ? void 0 : i.id), y = W(p.id);
|
|
3127
|
+
if (g) {
|
|
3128
|
+
if (r.has(g))
|
|
3129
|
+
throw new Error(`Duplicate NetSuite ID found: ${g}`);
|
|
3130
|
+
r.add(g);
|
|
3117
3131
|
}
|
|
3118
3132
|
if (y) {
|
|
3119
3133
|
if (t.has(y))
|
|
@@ -3123,13 +3137,13 @@ function Ot(s, a, u) {
|
|
|
3123
3137
|
}
|
|
3124
3138
|
const n = [];
|
|
3125
3139
|
for (const p of a) {
|
|
3126
|
-
const
|
|
3140
|
+
const g = W(p.id), y = W((o = p.netSuite) == null ? void 0 : o.id);
|
|
3127
3141
|
if (!y)
|
|
3128
3142
|
continue;
|
|
3129
3143
|
const _ = s.find((S) => {
|
|
3130
|
-
var
|
|
3131
|
-
const v = W(S.id),
|
|
3132
|
-
return
|
|
3144
|
+
var D;
|
|
3145
|
+
const v = W(S.id), C = W((D = S.netSuite) == null ? void 0 : D.id);
|
|
3146
|
+
return C && y && C === y || v && v === g;
|
|
3133
3147
|
});
|
|
3134
3148
|
if (!_)
|
|
3135
3149
|
n.push({
|
|
@@ -3139,7 +3153,7 @@ function Ot(s, a, u) {
|
|
|
3139
3153
|
});
|
|
3140
3154
|
else {
|
|
3141
3155
|
const S = W(_.id), v = W((l = _.netSuite) == null ? void 0 : l.id);
|
|
3142
|
-
if (v && y && v !== y ||
|
|
3156
|
+
if (v && y && v !== y || g && S && S !== g)
|
|
3143
3157
|
throw new Error(`Inconsistent data for Item Receipt ${(f = p.netSuite) == null ? void 0 : f.id} (or ${p.id})`);
|
|
3144
3158
|
for (const b of c) {
|
|
3145
3159
|
if (b === "adjustment" || b === "id")
|
|
@@ -3148,24 +3162,24 @@ function Ot(s, a, u) {
|
|
|
3148
3162
|
n.push(...tt(_.id, "deliveryOrder", p.received, _.received, u));
|
|
3149
3163
|
continue;
|
|
3150
3164
|
}
|
|
3151
|
-
const
|
|
3152
|
-
if (!L.isEqual(
|
|
3165
|
+
const D = W(p[b] ?? null), F = W(_[b] ?? null);
|
|
3166
|
+
if (!L.isEqual(D, F)) {
|
|
3153
3167
|
if ((b === "createdAt" || b === "createdBy" || b === "remark" || b === "effectiveAt") && F)
|
|
3154
3168
|
continue;
|
|
3155
|
-
let
|
|
3156
|
-
typeof p[b] == "object" && (
|
|
3169
|
+
let w = F, U = D;
|
|
3170
|
+
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
3171
|
type: ce.ITEM_RECEIPT_UPDATED,
|
|
3158
3172
|
message: ne(Ln, [
|
|
3159
3173
|
"Item Receipt Field",
|
|
3160
3174
|
`${(d = p.netSuite) == null ? void 0 : d.id}`,
|
|
3161
3175
|
b,
|
|
3162
|
-
`${
|
|
3176
|
+
`${w}`,
|
|
3163
3177
|
`${U}`
|
|
3164
3178
|
]),
|
|
3165
3179
|
data: {
|
|
3166
3180
|
recordId: `${(I = p.netSuite) == null ? void 0 : I.id}`,
|
|
3167
3181
|
field: b,
|
|
3168
|
-
incomingValue:
|
|
3182
|
+
incomingValue: D,
|
|
3169
3183
|
existingValue: F
|
|
3170
3184
|
}
|
|
3171
3185
|
});
|
|
@@ -3175,7 +3189,7 @@ function Ot(s, a, u) {
|
|
|
3175
3189
|
}
|
|
3176
3190
|
return n;
|
|
3177
3191
|
}
|
|
3178
|
-
|
|
3192
|
+
E(Ot, "detectItemReceiptConflicts");
|
|
3179
3193
|
function Lt(s, a) {
|
|
3180
3194
|
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
3195
|
if (u.length === 0)
|
|
@@ -3220,7 +3234,7 @@ function Lt(s, a) {
|
|
|
3220
3234
|
}));
|
|
3221
3235
|
return r;
|
|
3222
3236
|
}
|
|
3223
|
-
|
|
3237
|
+
E(Lt, "resolveDeliveryOrdersConflicts");
|
|
3224
3238
|
function Pn(s, a, u, c) {
|
|
3225
3239
|
var n, i;
|
|
3226
3240
|
const r = Lt(a, c), t = [];
|
|
@@ -3239,7 +3253,7 @@ function Pn(s, a, u, c) {
|
|
|
3239
3253
|
}
|
|
3240
3254
|
return t;
|
|
3241
3255
|
}
|
|
3242
|
-
|
|
3256
|
+
E(Pn, "resolveAndMergeDeliveryOrders");
|
|
3243
3257
|
var G;
|
|
3244
3258
|
(function(s) {
|
|
3245
3259
|
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 +3262,7 @@ function K(s, a, u, c, r) {
|
|
|
3248
3262
|
let t = c, n = r;
|
|
3249
3263
|
return typeof c == "object" && (t = JSON.stringify(c), n = JSON.stringify(r)), `${s} ${a} field ${u} changed from "${t}" to "${n}"`;
|
|
3250
3264
|
}
|
|
3251
|
-
|
|
3265
|
+
E(K, "generateLogMessage");
|
|
3252
3266
|
function xn(s, a, u, c = !1) {
|
|
3253
3267
|
var t, n;
|
|
3254
3268
|
const r = [];
|
|
@@ -3320,10 +3334,10 @@ function xn(s, a, u, c = !1) {
|
|
|
3320
3334
|
const f = !!u.processedAt, d = !!u.rejectedAt;
|
|
3321
3335
|
if (s.purchaseOrder.status === j.Enum.REQUESTING && (f || d))
|
|
3322
3336
|
continue;
|
|
3323
|
-
const p = s.purchaseOrderRequest[o] ? new Date(s.purchaseOrderRequest[o]).toISOString() : null,
|
|
3337
|
+
const p = s.purchaseOrderRequest[o] ? new Date(s.purchaseOrderRequest[o]).toISOString() : null, g = u[o] ? new Date(u[o]).toISOString() : null;
|
|
3324
3338
|
r.push({
|
|
3325
3339
|
type: G.PURCHASE_ORDER_REQUEST_UPDATED,
|
|
3326
|
-
message: K("Transfer Order", (n = s.purchaseOrder.netSuite) == null ? void 0 : n.id, o,
|
|
3340
|
+
message: K("Transfer Order", (n = s.purchaseOrder.netSuite) == null ? void 0 : n.id, o, g, p),
|
|
3327
3341
|
data: {
|
|
3328
3342
|
field: o,
|
|
3329
3343
|
incomingValue: s.purchaseOrderRequest[o],
|
|
@@ -3335,7 +3349,7 @@ function xn(s, a, u, c = !1) {
|
|
|
3335
3349
|
}
|
|
3336
3350
|
return r;
|
|
3337
3351
|
}
|
|
3338
|
-
|
|
3352
|
+
E(xn, "detectTransferOrderConflicts");
|
|
3339
3353
|
function $n(s, a, u, c, r) {
|
|
3340
3354
|
if (s.length === 0)
|
|
3341
3355
|
throw new Error("No order lines found");
|
|
@@ -3417,7 +3431,7 @@ function $n(s, a, u, c, r) {
|
|
|
3417
3431
|
purchaseOrderRequest: n
|
|
3418
3432
|
};
|
|
3419
3433
|
}
|
|
3420
|
-
|
|
3434
|
+
E($n, "resolveTransferOrderConflicts");
|
|
3421
3435
|
e.object({
|
|
3422
3436
|
lineItem: qe.nullish(),
|
|
3423
3437
|
existinglineItem: qe.nullish(),
|
|
@@ -3432,16 +3446,16 @@ e.object({
|
|
|
3432
3446
|
incomingValue: e.any(),
|
|
3433
3447
|
existingValue: e.any()
|
|
3434
3448
|
});
|
|
3435
|
-
var
|
|
3449
|
+
var Ee;
|
|
3436
3450
|
(function(s) {
|
|
3437
3451
|
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
|
-
})(
|
|
3452
|
+
})(Ee || (Ee = {}));
|
|
3439
3453
|
function jn(s, a) {
|
|
3440
3454
|
var r;
|
|
3441
3455
|
const u = [];
|
|
3442
3456
|
if (!a)
|
|
3443
3457
|
return u.push({
|
|
3444
|
-
type:
|
|
3458
|
+
type: Ee.PURCHASE_ORDER_CREATED,
|
|
3445
3459
|
message: "Purchase order not found",
|
|
3446
3460
|
data: s
|
|
3447
3461
|
}), u.push(...ye(s.items, [], "", "2")), u;
|
|
@@ -3470,7 +3484,7 @@ function jn(s, a) {
|
|
|
3470
3484
|
continue;
|
|
3471
3485
|
const m = i && typeof i == "string" ? new Date(i).toISOString() : null, l = o && typeof o == "string" ? new Date(o).toISOString() : null;
|
|
3472
3486
|
u.push({
|
|
3473
|
-
type:
|
|
3487
|
+
type: Ee.PURCHASE_ORDER_UPDATED,
|
|
3474
3488
|
message: K("Purchase Order", (r = s.netSuite) == null ? void 0 : r.id, t, l, m),
|
|
3475
3489
|
data: {
|
|
3476
3490
|
field: t,
|
|
@@ -3482,7 +3496,7 @@ function jn(s, a) {
|
|
|
3482
3496
|
}
|
|
3483
3497
|
return u.push(...Ot((a == null ? void 0 : a.deliveryOrder) ?? [], s.deliveryOrder ?? [], a ? (a == null ? void 0 : a.version) || "1" : s.version)), u;
|
|
3484
3498
|
}
|
|
3485
|
-
|
|
3499
|
+
E(jn, "detectPurchaseOrderConflicts");
|
|
3486
3500
|
function Vn(s, a, u, c) {
|
|
3487
3501
|
let r = c ? L.cloneDeep(c) : null;
|
|
3488
3502
|
const t = Ve((r == null ? void 0 : r.items) || [], a);
|
|
@@ -3490,7 +3504,7 @@ function Vn(s, a, u, c) {
|
|
|
3490
3504
|
throw new Error("No order lines found");
|
|
3491
3505
|
if (r) {
|
|
3492
3506
|
for (const n of a)
|
|
3493
|
-
if (n.type ===
|
|
3507
|
+
if (n.type === Ee.PURCHASE_ORDER_UPDATED) {
|
|
3494
3508
|
const i = n.data.field, o = n.data.incomingValue, m = r[i];
|
|
3495
3509
|
o !== m && (r = {
|
|
3496
3510
|
...r,
|
|
@@ -3510,7 +3524,7 @@ function Vn(s, a, u, c) {
|
|
|
3510
3524
|
}
|
|
3511
3525
|
for (const n of a)
|
|
3512
3526
|
switch (n.type) {
|
|
3513
|
-
case
|
|
3527
|
+
case Ee.PURCHASE_ORDER_CREATED:
|
|
3514
3528
|
const i = new Date(ie(u._id)), o = new Date(u.effectiveAt);
|
|
3515
3529
|
r = {
|
|
3516
3530
|
...u,
|
|
@@ -3521,7 +3535,7 @@ function Vn(s, a, u, c) {
|
|
|
3521
3535
|
items: t
|
|
3522
3536
|
};
|
|
3523
3537
|
break;
|
|
3524
|
-
case
|
|
3538
|
+
case Ee.PURCHASE_ORDER_UPDATED:
|
|
3525
3539
|
if (r) {
|
|
3526
3540
|
const m = n.data.field, l = n.data.incomingValue;
|
|
3527
3541
|
r[m], r = {
|
|
@@ -3537,7 +3551,7 @@ function Vn(s, a, u, c) {
|
|
|
3537
3551
|
netSuite: u.netSuite
|
|
3538
3552
|
}, r;
|
|
3539
3553
|
}
|
|
3540
|
-
|
|
3554
|
+
E(Vn, "resolvePurchaseOrderConflicts");
|
|
3541
3555
|
var Ne;
|
|
3542
3556
|
(function(s) {
|
|
3543
3557
|
s.UNIT_CREATED = "UNIT_CREATED", s.UNIT_UPDATED = "UNIT_UPDATED", s.UNIT_DELETED = "UNIT_DELETED";
|
|
@@ -3591,7 +3605,7 @@ function Pt(s, a) {
|
|
|
3591
3605
|
});
|
|
3592
3606
|
return c;
|
|
3593
3607
|
}
|
|
3594
|
-
|
|
3608
|
+
E(Pt, "detectUnitOfMeasureConflicts");
|
|
3595
3609
|
function qn(s, a) {
|
|
3596
3610
|
const u = [];
|
|
3597
3611
|
if (!a)
|
|
@@ -3626,7 +3640,7 @@ function qn(s, a) {
|
|
|
3626
3640
|
}
|
|
3627
3641
|
return u;
|
|
3628
3642
|
}
|
|
3629
|
-
|
|
3643
|
+
E(qn, "detectUnitTypeConflicts");
|
|
3630
3644
|
function xt(s, a) {
|
|
3631
3645
|
if (a.length === 0)
|
|
3632
3646
|
return s;
|
|
@@ -3645,7 +3659,7 @@ function xt(s, a) {
|
|
|
3645
3659
|
}
|
|
3646
3660
|
return u;
|
|
3647
3661
|
}
|
|
3648
|
-
|
|
3662
|
+
E(xt, "resolveUnitOfMeasurementConflicts");
|
|
3649
3663
|
function Hn(s, a, u) {
|
|
3650
3664
|
let c = u;
|
|
3651
3665
|
const r = xt((u == null ? void 0 : u.measurements) || a.measurements, s);
|
|
@@ -3674,16 +3688,16 @@ function Hn(s, a, u) {
|
|
|
3674
3688
|
measurements: r
|
|
3675
3689
|
};
|
|
3676
3690
|
}
|
|
3677
|
-
|
|
3678
|
-
var
|
|
3691
|
+
E(Hn, "resolveUnitTypeConflicts");
|
|
3692
|
+
var ge;
|
|
3679
3693
|
(function(s) {
|
|
3680
3694
|
s.PURCHASE_ORDER_CREATED = "PURCHASE_ORDER_CREATED", s.PURCHASE_ORDER_UPDATED = "PURCHASE_ORDER_UPDATED";
|
|
3681
|
-
})(
|
|
3695
|
+
})(ge || (ge = {}));
|
|
3682
3696
|
function Kn(s, a) {
|
|
3683
3697
|
var c;
|
|
3684
3698
|
const u = [];
|
|
3685
3699
|
if (a || u.push({
|
|
3686
|
-
type:
|
|
3700
|
+
type: ge.PURCHASE_ORDER_CREATED,
|
|
3687
3701
|
message: "Purchase order not found",
|
|
3688
3702
|
data: s
|
|
3689
3703
|
}), !a)
|
|
@@ -3727,7 +3741,7 @@ function Kn(s, a) {
|
|
|
3727
3741
|
o = i && typeof i == "string" ? new Date(i).toISOString() : null, m = n && typeof n == "string" ? new Date(n).toISOString() : null;
|
|
3728
3742
|
}
|
|
3729
3743
|
u.push({
|
|
3730
|
-
type:
|
|
3744
|
+
type: ge.PURCHASE_ORDER_UPDATED,
|
|
3731
3745
|
message: K("Inventory Transfer", (c = s.netSuite) == null ? void 0 : c.id, t, o, m),
|
|
3732
3746
|
data: {
|
|
3733
3747
|
field: t,
|
|
@@ -3740,7 +3754,7 @@ function Kn(s, a) {
|
|
|
3740
3754
|
}
|
|
3741
3755
|
return u;
|
|
3742
3756
|
}
|
|
3743
|
-
|
|
3757
|
+
E(Kn, "detectInventoryTransferConflicts");
|
|
3744
3758
|
function Yn(s, a, u, c) {
|
|
3745
3759
|
if (s.length === 0)
|
|
3746
3760
|
throw new Error("No order lines found");
|
|
@@ -3750,7 +3764,7 @@ function Yn(s, a, u, c) {
|
|
|
3750
3764
|
return c;
|
|
3751
3765
|
if (r) {
|
|
3752
3766
|
for (const n of a)
|
|
3753
|
-
if (n.type ===
|
|
3767
|
+
if (n.type === ge.PURCHASE_ORDER_UPDATED) {
|
|
3754
3768
|
const i = n.data.field, o = n.data.incomingValue;
|
|
3755
3769
|
r = {
|
|
3756
3770
|
...r,
|
|
@@ -3764,7 +3778,7 @@ function Yn(s, a, u, c) {
|
|
|
3764
3778
|
}
|
|
3765
3779
|
for (const n of a)
|
|
3766
3780
|
switch (n.type) {
|
|
3767
|
-
case
|
|
3781
|
+
case ge.PURCHASE_ORDER_CREATED:
|
|
3768
3782
|
const i = new Date(ie(u._id)), o = new Date(u.effectiveAt);
|
|
3769
3783
|
r = {
|
|
3770
3784
|
...u,
|
|
@@ -3775,7 +3789,7 @@ function Yn(s, a, u, c) {
|
|
|
3775
3789
|
items: t
|
|
3776
3790
|
};
|
|
3777
3791
|
break;
|
|
3778
|
-
case
|
|
3792
|
+
case ge.PURCHASE_ORDER_UPDATED:
|
|
3779
3793
|
if (r) {
|
|
3780
3794
|
const m = n.data.field, l = n.data.incomingValue, f = r[m];
|
|
3781
3795
|
if (m === "version" && l !== f)
|
|
@@ -3792,7 +3806,7 @@ function Yn(s, a, u, c) {
|
|
|
3792
3806
|
netSuite: u.netSuite
|
|
3793
3807
|
}, r;
|
|
3794
3808
|
}
|
|
3795
|
-
|
|
3809
|
+
E(Yn, "resolveInventoryTransferConflicts");
|
|
3796
3810
|
var q;
|
|
3797
3811
|
(function(s) {
|
|
3798
3812
|
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 +3854,7 @@ function Qn(s) {
|
|
|
3840
3854
|
}
|
|
3841
3855
|
return a;
|
|
3842
3856
|
}
|
|
3843
|
-
|
|
3857
|
+
E(Qn, "detectInventoryChildItemConflicts");
|
|
3844
3858
|
function Wn(s) {
|
|
3845
3859
|
const a = [], { incoming: u, current: c } = s;
|
|
3846
3860
|
if (u.itemType !== V.Enum.InvtPart)
|
|
@@ -3879,7 +3893,7 @@ function Wn(s) {
|
|
|
3879
3893
|
}
|
|
3880
3894
|
return a;
|
|
3881
3895
|
}
|
|
3882
|
-
|
|
3896
|
+
E(Wn, "detectInventoryParentItemConflicts");
|
|
3883
3897
|
function Zn(s, a, u) {
|
|
3884
3898
|
if (a.itemType !== V.Enum.InvtPart)
|
|
3885
3899
|
throw new Error("[resolveInventoryParentItemConflicts] only supports InvtPart parent items");
|
|
@@ -3905,7 +3919,7 @@ function Zn(s, a, u) {
|
|
|
3905
3919
|
}
|
|
3906
3920
|
return r;
|
|
3907
3921
|
}
|
|
3908
|
-
|
|
3922
|
+
E(Zn, "resolveInventoryParentItemConflicts");
|
|
3909
3923
|
function Xn(s, a, u) {
|
|
3910
3924
|
if (a.itemType !== V.Enum.InvtPart)
|
|
3911
3925
|
throw new Error("[resolveInventoryChildItemConflicts] only supports InvtPart child items");
|
|
@@ -3922,7 +3936,7 @@ function Xn(s, a, u) {
|
|
|
3922
3936
|
}
|
|
3923
3937
|
return r;
|
|
3924
3938
|
}
|
|
3925
|
-
|
|
3939
|
+
E(Xn, "resolveInventoryChildItemConflicts");
|
|
3926
3940
|
var H;
|
|
3927
3941
|
(function(s) {
|
|
3928
3942
|
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 +3984,7 @@ function ii(s) {
|
|
|
3970
3984
|
}
|
|
3971
3985
|
return a;
|
|
3972
3986
|
}
|
|
3973
|
-
|
|
3987
|
+
E(ii, "detectAssemblyChildItemConflicts");
|
|
3974
3988
|
function si(s) {
|
|
3975
3989
|
const a = [], { incoming: u, current: c } = s;
|
|
3976
3990
|
if (u.itemType !== V.Enum.Assembly)
|
|
@@ -4009,7 +4023,7 @@ function si(s) {
|
|
|
4009
4023
|
}
|
|
4010
4024
|
return a;
|
|
4011
4025
|
}
|
|
4012
|
-
|
|
4026
|
+
E(si, "detectAssemblyParentItemConflicts");
|
|
4013
4027
|
function ri(s, a, u) {
|
|
4014
4028
|
if (a.itemType !== V.Enum.Assembly)
|
|
4015
4029
|
throw new Error("[resolveAssemblyParentItemConflicts] only supports Assembly parent items");
|
|
@@ -4035,7 +4049,7 @@ function ri(s, a, u) {
|
|
|
4035
4049
|
}
|
|
4036
4050
|
return r;
|
|
4037
4051
|
}
|
|
4038
|
-
|
|
4052
|
+
E(ri, "resolveAssemblyParentItemConflicts");
|
|
4039
4053
|
function oi(s, a, u) {
|
|
4040
4054
|
if (a.itemType !== V.Enum.Assembly)
|
|
4041
4055
|
throw new Error("[resolveAssemblyChildItemConflicts] only supports Assembly child items");
|
|
@@ -4052,7 +4066,7 @@ function oi(s, a, u) {
|
|
|
4052
4066
|
}
|
|
4053
4067
|
return r;
|
|
4054
4068
|
}
|
|
4055
|
-
|
|
4069
|
+
E(oi, "resolveAssemblyChildItemConflicts");
|
|
4056
4070
|
function ai(s, a, u, c, r) {
|
|
4057
4071
|
const t = {}, n = {};
|
|
4058
4072
|
for (const o of a) {
|
|
@@ -4069,7 +4083,7 @@ function ai(s, a, u, c, r) {
|
|
|
4069
4083
|
orderItemMappingByReceipt: n
|
|
4070
4084
|
};
|
|
4071
4085
|
}
|
|
4072
|
-
|
|
4086
|
+
E(ai, "prepareTransferOrderTransformContext");
|
|
4073
4087
|
function ui(s, a, u, c) {
|
|
4074
4088
|
const r = {};
|
|
4075
4089
|
for (const n of a) {
|
|
@@ -4081,13 +4095,13 @@ function ui(s, a, u, c) {
|
|
|
4081
4095
|
orderItemMappingByReceipt: r
|
|
4082
4096
|
};
|
|
4083
4097
|
}
|
|
4084
|
-
|
|
4098
|
+
E(ui, "preparePurchaseOrderTransformContext");
|
|
4085
4099
|
function di(s, a, u) {
|
|
4086
4100
|
return {
|
|
4087
4101
|
orderItemMapping: pe(u.sku ?? [], u.unit ?? [], a, s.inventory.items)
|
|
4088
4102
|
};
|
|
4089
4103
|
}
|
|
4090
|
-
|
|
4104
|
+
E(di, "prepareInventoryTransferTransformContext");
|
|
4091
4105
|
function ci(s, a) {
|
|
4092
4106
|
const u = s;
|
|
4093
4107
|
u.version = ee.Enum[1];
|
|
@@ -4129,7 +4143,7 @@ function ci(s, a) {
|
|
|
4129
4143
|
} : void 0
|
|
4130
4144
|
};
|
|
4131
4145
|
}
|
|
4132
|
-
|
|
4146
|
+
E(ci, "transformPurchaseOrderToV1");
|
|
4133
4147
|
function li(s, a) {
|
|
4134
4148
|
const u = new Date(ie(s._id));
|
|
4135
4149
|
if (J(u, a)) return !0;
|
|
@@ -4144,7 +4158,7 @@ function li(s, a) {
|
|
|
4144
4158
|
}
|
|
4145
4159
|
return !1;
|
|
4146
4160
|
}
|
|
4147
|
-
|
|
4161
|
+
E(li, "shouldSyncOrderByTimestamp");
|
|
4148
4162
|
function mi(s) {
|
|
4149
4163
|
var a, u;
|
|
4150
4164
|
return {
|
|
@@ -4162,7 +4176,7 @@ function mi(s) {
|
|
|
4162
4176
|
cogsAccount: s.cogsAccount
|
|
4163
4177
|
};
|
|
4164
4178
|
}
|
|
4165
|
-
|
|
4179
|
+
E(mi, "transformParentToFdoNetSuiteItem");
|
|
4166
4180
|
function fi(s) {
|
|
4167
4181
|
var a, u;
|
|
4168
4182
|
return {
|
|
@@ -4180,7 +4194,7 @@ function fi(s) {
|
|
|
4180
4194
|
cogsAccount: s.cogsAccount
|
|
4181
4195
|
};
|
|
4182
4196
|
}
|
|
4183
|
-
|
|
4197
|
+
E(fi, "transformChildToFdoNetSuiteItem");
|
|
4184
4198
|
const Se = Qt((s, a) => {
|
|
4185
4199
|
const u = Me(), c = Xt();
|
|
4186
4200
|
return a.onError(async (r) => {
|
|
@@ -4282,7 +4296,7 @@ const Se = Qt((s, a) => {
|
|
|
4282
4296
|
},
|
|
4283
4297
|
urls: s
|
|
4284
4298
|
};
|
|
4285
|
-
}), Ii = { class: "flex flex-col" }, pi = { class: "text-sm" },
|
|
4299
|
+
}), 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
4300
|
key: 0,
|
|
4287
4301
|
class: "text-xs"
|
|
4288
4302
|
}, hi = {
|
|
@@ -4297,7 +4311,7 @@ const Se = Qt((s, a) => {
|
|
|
4297
4311
|
}, Fi = {
|
|
4298
4312
|
class: "flex flex-col w-full gap-2",
|
|
4299
4313
|
style: { "margin-left": "15px" }
|
|
4300
|
-
},
|
|
4314
|
+
}, wi = { class: "flex flex-col gap-3" }, ki = /* @__PURE__ */ en({
|
|
4301
4315
|
__name: "NetSuiteCustomCodeSelection",
|
|
4302
4316
|
props: {
|
|
4303
4317
|
readonly: { type: Boolean },
|
|
@@ -4319,7 +4333,7 @@ const Se = Qt((s, a) => {
|
|
|
4319
4333
|
return `Overwrite with "${f ?? "N/A"}"`;
|
|
4320
4334
|
}
|
|
4321
4335
|
return (f, d) => {
|
|
4322
|
-
const I =
|
|
4336
|
+
const I = ke("FmButton"), p = ke("FmLabel"), g = ke("FmSelect"), y = ke("FmDialog");
|
|
4323
4337
|
return z(), tn(y, {
|
|
4324
4338
|
modelValue: r.value,
|
|
4325
4339
|
"onUpdate:modelValue": d[4] || (d[4] = (_) => r.value = _),
|
|
@@ -4346,7 +4360,7 @@ const Se = Qt((s, a) => {
|
|
|
4346
4360
|
M("div", Fi, [
|
|
4347
4361
|
f.readonly ? Ae("", !0) : (z(), ae(Re, { key: 0 }, [
|
|
4348
4362
|
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",
|
|
4363
|
+
M("div", wi, [
|
|
4350
4364
|
oe(I, {
|
|
4351
4365
|
class: "sm:w-full xs:w-full",
|
|
4352
4366
|
label: l(n.value.code),
|
|
@@ -4387,14 +4401,14 @@ const Se = Qt((s, a) => {
|
|
|
4387
4401
|
])),
|
|
4388
4402
|
_: 1
|
|
4389
4403
|
}),
|
|
4390
|
-
M("span",
|
|
4404
|
+
M("span", Ei, x(f.sku.name), 1),
|
|
4391
4405
|
oe(p, null, {
|
|
4392
4406
|
default: re(() => d[8] || (d[8] = [
|
|
4393
4407
|
Q("Unit")
|
|
4394
4408
|
])),
|
|
4395
4409
|
_: 1
|
|
4396
4410
|
}),
|
|
4397
|
-
M("span",
|
|
4411
|
+
M("span", gi, x(f.sku.unit.name), 1)
|
|
4398
4412
|
]),
|
|
4399
4413
|
f.readonly ? (z(), ae(Re, { key: 0 }, [
|
|
4400
4414
|
d[14] || (d[14] = M("hr", { class: "my-2" }, null, -1)),
|
|
@@ -4440,7 +4454,7 @@ const Se = Qt((s, a) => {
|
|
|
4440
4454
|
])),
|
|
4441
4455
|
_: 1
|
|
4442
4456
|
}),
|
|
4443
|
-
oe(
|
|
4457
|
+
oe(g, {
|
|
4444
4458
|
modelValue: n.value,
|
|
4445
4459
|
"onUpdate:modelValue": d[1] || (d[1] = (_) => n.value = _),
|
|
4446
4460
|
items: t.value,
|
|
@@ -4574,7 +4588,7 @@ function Oi() {
|
|
|
4574
4588
|
id: "netsuite-verify",
|
|
4575
4589
|
cell: (o) => {
|
|
4576
4590
|
const m = s.skuById[o.row.original.sku._id];
|
|
4577
|
-
return sn(
|
|
4591
|
+
return sn(ki, {
|
|
4578
4592
|
sku: m,
|
|
4579
4593
|
settingOptions: T.value.skuOptions,
|
|
4580
4594
|
"onUpdate:modelValue": (l, f, d) => {
|
|
@@ -4739,11 +4753,11 @@ function Oi() {
|
|
|
4739
4753
|
);
|
|
4740
4754
|
if (m.includeChildren) {
|
|
4741
4755
|
const I = T.value.setting.childItems.filter((p) => {
|
|
4742
|
-
let
|
|
4756
|
+
let g = p.subsidiaryIds;
|
|
4743
4757
|
if (p.includeChildren == !0)
|
|
4744
4758
|
for (const y of p.subsidiaryIds)
|
|
4745
|
-
|
|
4746
|
-
return
|
|
4759
|
+
g = g.concat(f[y]);
|
|
4760
|
+
return g = [...new Set(g)], p.parentNetSuiteId === m.netSuiteId && console.log(p), p.parentNetSuiteId === m.netSuiteId && g.some((y) => l.includes(y));
|
|
4747
4761
|
}).flatMap((p) => p.unitTypeId);
|
|
4748
4762
|
return T.value.setting.units.filter((p) => I.includes(p.netSuiteId)).flatMap((p) => p.measurements).map((p) => p.id);
|
|
4749
4763
|
}
|
|
@@ -4756,14 +4770,14 @@ function Oi() {
|
|
|
4756
4770
|
if (this.state.setting = o, (m = T.value.setting.subsidiaries) != null && m.length) {
|
|
4757
4771
|
const { flat: f, tree: d } = Z(T.value.setting.subsidiaries);
|
|
4758
4772
|
for (const p of o.vendors) {
|
|
4759
|
-
const
|
|
4760
|
-
this.state.vendorSubsidiary[p.id] = (
|
|
4773
|
+
const g = f.find((y) => y.id === p.subsidiaryId);
|
|
4774
|
+
this.state.vendorSubsidiary[p.id] = (g == null ? void 0 : g.fullName) || "";
|
|
4761
4775
|
}
|
|
4762
4776
|
for (const p of o.items) {
|
|
4763
|
-
const
|
|
4777
|
+
const g = [];
|
|
4764
4778
|
for (const _ of p.subsidiaryIds) {
|
|
4765
4779
|
const S = f.find((v) => v.id === _);
|
|
4766
|
-
S &&
|
|
4780
|
+
S && g.push(S.fullName || "");
|
|
4767
4781
|
}
|
|
4768
4782
|
const y = $t(
|
|
4769
4783
|
d,
|
|
@@ -4772,7 +4786,7 @@ function Oi() {
|
|
|
4772
4786
|
);
|
|
4773
4787
|
this.state.skuSubsidiaries[p.id] = {
|
|
4774
4788
|
includeChildren: p.includeChildren,
|
|
4775
|
-
flattenedSubsidiaryNames:
|
|
4789
|
+
flattenedSubsidiaryNames: g,
|
|
4776
4790
|
subsidiaryTree: y
|
|
4777
4791
|
};
|
|
4778
4792
|
}
|
|
@@ -4839,22 +4853,22 @@ function Oi() {
|
|
|
4839
4853
|
const l = `business_${((p = Me().currentBusiness.value) == null ? void 0 : p._id) ?? ""}`, f = $e[l].code, d = c.value.get(i._id);
|
|
4840
4854
|
let I = null;
|
|
4841
4855
|
if (d && d.length > 0) {
|
|
4842
|
-
const
|
|
4843
|
-
|
|
4856
|
+
const g = d[0];
|
|
4857
|
+
g[f] && (I = g[f]);
|
|
4844
4858
|
const y = T.value.setting.units.find((S) => {
|
|
4845
4859
|
var v;
|
|
4846
4860
|
return S.id === ((v = i.unit) == null ? void 0 : v._id);
|
|
4847
|
-
}), _ =
|
|
4861
|
+
}), _ = g.netSuiteId;
|
|
4848
4862
|
if (o) {
|
|
4849
4863
|
const S = y == null ? void 0 : y.measurements.find((v) => v.id === o);
|
|
4850
4864
|
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((
|
|
4865
|
+
const v = ["ZPH"], N = T.value.setting.childItems.filter(
|
|
4866
|
+
(b) => b.parentNetSuiteId === _ && b.unitTypeId === (y == null ? void 0 : y.netSuiteId) && b.unitOfMeasureId === S.netSuiteId && b.externalId && !v.some((D) => {
|
|
4853
4867
|
var F;
|
|
4854
|
-
return (F = b.externalId) == null ? void 0 : F.startsWith(
|
|
4868
|
+
return (F = b.externalId) == null ? void 0 : F.startsWith(D);
|
|
4855
4869
|
})
|
|
4856
4870
|
)[0];
|
|
4857
|
-
|
|
4871
|
+
N && N[f] && (I = N[f]);
|
|
4858
4872
|
}
|
|
4859
4873
|
}
|
|
4860
4874
|
}
|
|
@@ -4919,36 +4933,36 @@ function Li(s) {
|
|
|
4919
4933
|
}
|
|
4920
4934
|
}, d = o.childItems.reduce(
|
|
4921
4935
|
(I, p) => {
|
|
4922
|
-
const
|
|
4936
|
+
const g = a("code", void 0, p), y = a("name", void 0, p), _ = o.unit.measurements.find(
|
|
4923
4937
|
(b) => b.netSuiteId === p.unitOfMeasureId
|
|
4924
4938
|
);
|
|
4925
|
-
let S = i.unit.measurements.find((b) => b.id === (_ == null ? void 0 : _.id)), v,
|
|
4939
|
+
let S = i.unit.measurements.find((b) => b.id === (_ == null ? void 0 : _.id)), v, C = S == null ? void 0 : S.abbrev;
|
|
4926
4940
|
if (!_) {
|
|
4927
4941
|
const b = o.units[p.unitTypeId];
|
|
4928
4942
|
if (b) {
|
|
4929
|
-
const
|
|
4943
|
+
const D = t[b.id], F = b == null ? void 0 : b.measurements.find(
|
|
4930
4944
|
(U) => U.netSuiteId === p.unitOfMeasureId
|
|
4931
|
-
),
|
|
4945
|
+
), w = D == null ? void 0 : D.measurements.find(
|
|
4932
4946
|
(U) => U.id === (F == null ? void 0 : F.id)
|
|
4933
4947
|
);
|
|
4934
|
-
if (
|
|
4948
|
+
if (w) {
|
|
4935
4949
|
const U = i.unit.measurements.find(
|
|
4936
|
-
(B) => B.name ===
|
|
4950
|
+
(B) => B.name === w.name
|
|
4937
4951
|
);
|
|
4938
|
-
U ? (
|
|
4952
|
+
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
4953
|
}
|
|
4940
4954
|
}
|
|
4941
4955
|
}
|
|
4942
|
-
const
|
|
4956
|
+
const N = p.name || "N/A (childName not found)";
|
|
4943
4957
|
return I.push({
|
|
4944
|
-
label: `${
|
|
4958
|
+
label: `${N} (${g})`,
|
|
4945
4959
|
value: {
|
|
4946
|
-
code:
|
|
4960
|
+
code: g,
|
|
4947
4961
|
name: y,
|
|
4948
|
-
childName:
|
|
4962
|
+
childName: N,
|
|
4949
4963
|
externalId: p.externalId || "N/A (externalId not found)",
|
|
4950
4964
|
fmMeasurementId: S == null ? void 0 : S.id,
|
|
4951
|
-
fmMeasurementAbbrev:
|
|
4965
|
+
fmMeasurementAbbrev: C,
|
|
4952
4966
|
remark: v
|
|
4953
4967
|
}
|
|
4954
4968
|
}), I;
|
|
@@ -4973,7 +4987,7 @@ const Pi = {
|
|
|
4973
4987
|
};
|
|
4974
4988
|
export {
|
|
4975
4989
|
Ke as S,
|
|
4976
|
-
|
|
4990
|
+
ki as _,
|
|
4977
4991
|
Se as a,
|
|
4978
4992
|
Oi as u
|
|
4979
4993
|
};
|