@feedmepos/mf-inventory-portal 1.2.38 → 1.2.40-dev.1
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-CONrAP7y.js → App-0DyZL1Fq.js} +3 -3
- package/dist/{ApprovalView-Cn9_7xk9.js → ApprovalView-BmBq5TGO.js} +5 -5
- package/dist/{BindingsDialog-L7mP6sx9.js → BindingsDialog-DtBdmYMs.js} +11 -11
- package/dist/{BindingsPicker-DZqBMDUg.js → BindingsPicker-BAGxi1ZC.js} +9 -9
- package/dist/{BindingsTable-DHkFDwiH.js → BindingsTable-DKlb_qiS.js} +24 -24
- package/dist/{ClosingDraftView-BtSmlj0J.js → ClosingDraftView-CEmvLMPP.js} +8 -8
- package/dist/{ClosingHistoryView-j83Wuxis.js → ClosingHistoryView-DOmSMiGH.js} +22 -22
- package/dist/{ClosingTemplateView-ZubBNFCd.js → ClosingTemplateView-Bd1KfJL3.js} +14 -14
- package/dist/{DeliveryOrderPrintPreview-DfS2E2tl.js → DeliveryOrderPrintPreview-DoE0Bmx4.js} +9 -9
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CoO6g5B9.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-20eCsiTr.js} +60 -61
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DnMjbyPc.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-B05RFZv-.js} +2 -2
- package/dist/{FmMultiselectDialog-8_qMKCPt.js → FmMultiselectDialog-ChsBeANW.js} +2 -2
- package/dist/{FmMultiselectDialog-vj94RVLU.js → FmMultiselectDialog-i1uk7uNx.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-Dihv3KTq.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BpT8OBQX.js} +3 -3
- package/dist/{ImportView--0ZbHtb9.js → ImportView-CCLgSwn2.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-Bosdu_28.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-EHwf-vCH.js} +1 -1
- package/dist/{IngredientGroupView-D937cHah.js → IngredientGroupView-BnEyAtcY.js} +49 -49
- package/dist/{IngredientsView-BNdvTpOT.js → IngredientsView-DEN_EqXP.js} +14 -14
- package/dist/{IntegrationView-Dm3Eur8-.js → IntegrationView-Cu_gMMz_.js} +1663 -1572
- package/dist/{InventoryBindingForm-rBhW4Snl.js → InventoryBindingForm-COw2tcQC.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Cvpi7GQx.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DIv_DrTj.js} +14 -14
- package/dist/{InventoryBindingSummary-emUM5QuA.js → InventoryBindingSummary-Csajkxbi.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DFW-jg1P.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BE9UFVFI.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BOxIYl0Z.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Da6ffJym.js} +2 -2
- package/dist/{PublishView-CXRBcsxc.js → PublishView-qCcwOaJ8.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-BvjDpyrq.js → PurchaseOrderPrintPreview-m2n6OT7Z.js} +9 -9
- package/dist/ReceiveRequestView-fhTKkIJA.js +2866 -0
- package/dist/{RecipeView-dggwqURE.js → RecipeView-Bp_59G4J.js} +8 -8
- package/dist/{StockView-Cml9AuXX.js → StockView-Co_sOnjs.js} +15 -15
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BTZa1E_o.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Npu98N-x.js} +1 -1
- package/dist/{SupplierView-CnD2QpE7.js → SupplierView-Bp4ez39s.js} +11 -11
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-DIbaHfbR.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-JTXbmabq.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DeD1jiXL.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Dn2j9Xls.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-Y0eaTjgd.js → TransferDetails.vue_vue_type_script_setup_true_lang-BSOi6Bbh.js} +374 -374
- package/dist/{TransferTemplateView-DytfORlu.js → TransferTemplateView-C5jzqjPy.js} +354 -354
- package/dist/{UnitView-ZUo-3Em1.js → UnitView-XcXvbWUz.js} +6 -6
- package/dist/{WarehouseView-DlZirt8V.js → WarehouseView-B37E963Z.js} +5 -5
- package/dist/{WastageTemplateView-5Qvs2GZC.js → WastageTemplateView-Dn2vSoCa.js} +14 -14
- package/dist/api/netsuite.d.ts +2 -0
- package/dist/{app-xCn1wZY9.js → app-CaXDnJ-Z.js} +1517 -1479
- package/dist/app.js +1 -1
- package/dist/{closing-template-DS8zFVJt.js → closing-template-CgLIA5Fw.js} +1 -1
- package/dist/{date2-hHwvNr68.js → date2-Dc5sFY0E.js} +1 -1
- package/dist/{dayjs.min-PqgQ_K75.js → dayjs.min-B-H7eU1F.js} +12 -12
- package/dist/{decimal-DOCxaZjf.js → decimal-BEqE-6GW.js} +2 -2
- package/dist/{defineDeepModel-CTlh0zvq.js → defineDeepModel-CXxtm-xp.js} +1 -1
- package/dist/{duplicate-template-F8fz-36_.js → duplicate-template-BX6XhNvd.js} +1 -1
- package/dist/feature-BsDnCbpL.js +25312 -0
- package/dist/{format-time-from-id-DTsuaGJG.js → format-time-from-id-Dhlv9sZk.js} +1 -1
- package/dist/{format-unit-display-DS3MzSfd.js → format-unit-display-B1WhMzNf.js} +246 -247
- package/dist/helper/reactivity.d.ts +11 -0
- package/dist/helper/reactivity.spec.d.ts +1 -0
- package/dist/{import-export.helper-BAUfb01o.js → import-export.helper-DaGtyevy.js} +5 -5
- package/dist/{index-CYZHYBBP.js → index-B2ziwUTD.js} +1 -1
- package/dist/{index-BX9ig-2t.js → index-CikPk76E.js} +3 -3
- package/dist/{index-D_kOnYds.js → index-CqbsiJk1.js} +60 -60
- package/dist/{lodash-Cqi23PoA.js → lodash-rwAZ9bXl.js} +1 -1
- package/dist/{netsuite-Cg_AEH3H.js → netsuite-SdH9FL9h.js} +254 -239
- package/dist/{purchase-order-template-Dh3D_2Tz.js → purchase-order-template-Daxs7lNG.js} +1 -1
- package/dist/{rules-C_FnXd1e.js → rules-81GqVkEm.js} +3 -3
- package/dist/{stock-DJDm1iIR.js → stock-BEmy7_Qs.js} +1 -1
- package/dist/{stock-BPdGitCC.js → stock-CpYHrEjC.js} +3 -3
- package/dist/stores/integration/netsuite.d.ts +86 -0
- package/dist/stores/inventory.d.ts +10 -669
- package/dist/{supplier-BtZVHCAl.js → supplier-Bw4fRGiq.js} +2 -2
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-n26Kr4C5.js → use-ingredient-select-dialog-CGTZ9UUP.js} +2 -2
- package/dist/{use-inventory-binding-dialog-kkpC2Tzi.js → use-inventory-binding-dialog-CUh7aMb7.js} +2 -2
- package/dist/{use-template-enabled-locations-2-4ou70XAL.js → use-template-enabled-locations-2-2oPspMus.js} +2 -2
- package/dist/views/receive-request/components/netsuite/NetSuitePanel.vue.d.ts +3 -2
- package/dist/views/receive-request/components/netsuite/NetSuiteProps.d.ts +3 -2
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +518 -2225
- package/dist/views/receive-request/components/transfer-form/TransferForm2.vue.d.ts +1430 -0
- package/dist/views/receive-request/components/transfer-form/TransferFormProps.d.ts +1 -0
- package/dist/views/receive-request/components/transfer-form/composables/use-purchase-order-form-controller.d.ts +13974 -0
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +3 -2
- package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +1 -1
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +6 -6
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +7 -7
- package/dist/views/receive-request/helper/get-transfer-type.d.ts +1 -2
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +3 -2
- package/dist/views/transfer-template/components/transfer-template-import/TransferTemplateImportItemProps.d.ts +3 -2
- package/dist/views/transfer-template/helpers/import-export.helper.d.ts +4 -3
- package/dist/{vue-i18n-A7TH-x17.js → vue-i18n-Di6nYtv0.js} +378 -378
- package/dist/{xlsx-DRYtBAdX.js → xlsx-DXn_bv49.js} +1 -1
- package/dist/{xlsx.util-DGBUU4BN.js → xlsx.util-BawfHUuI.js} +1 -1
- package/package.json +3 -3
- package/dist/ReceiveRequestView-TwL3yVCN.js +0 -2821
- package/dist/feature-UnTx1VJG.js +0 -20162
- package/dist/views/receive-request/constants/purchase-order-transaction-type.d.ts +0 -4
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { m as e,
|
|
1
|
+
import { m as e, W as jt, X as Vt, Y as Bt, Z as qt, _ as je, $ as Ht, a0 as Be, O as qe, a1 as bt, a2 as St, a3 as R, a4 as O, s as A, e as ve, a5 as Oe, B as ee, A as ie, a6 as Kt, L as j, a7 as vt, N as V, a8 as Yt, a9 as Gt, aa as Jt, ab as Qe, ac as zt, o as Qt, j as Wt, v as dt, a as Zt, u as Ce } from "./app-CaXDnJ-Z.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 me, resolveComponent as ke, openBlock as z, createBlock as tn, withCtx as re, createVNode as oe, createElementVNode as M, createElementBlock as ae, Fragment as
|
|
6
|
-
import { u as rn } from "./feature-
|
|
4
|
+
import { _ as L } from "./lodash-rwAZ9bXl.js";
|
|
5
|
+
import { defineComponent as en, ref as He, computed as me, 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-BsDnCbpL.js";
|
|
7
7
|
var on = Object.defineProperty, g = (r, a) => on(r, "name", { value: a, configurable: !0 }), he = "MYR";
|
|
8
8
|
e.enum([
|
|
9
9
|
"custbody_fm_do_id",
|
|
@@ -456,7 +456,7 @@ var k;
|
|
|
456
456
|
(function(r) {
|
|
457
457
|
r.A = "Pending Approval", r.B = "Pending Fulfillment", r.C = "Rejected", r.D = "Partially Fulfilled", r.E = "Pending Receipt/Partially Fulfilled", r.F = "Pending Receipt", r.G = "Received", r.H = "Closed";
|
|
458
458
|
})(k || (k = {}));
|
|
459
|
-
var
|
|
459
|
+
var de = e.nativeEnum(k), yn = 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(yn),
|
|
476
476
|
totalResults: e.number()
|
|
477
477
|
})
|
|
478
478
|
});
|
|
@@ -483,7 +483,7 @@ var Tt = jt.extend({
|
|
|
483
483
|
}).extend({
|
|
484
484
|
nsConfig: qt,
|
|
485
485
|
measurements: e.array(Tt)
|
|
486
|
-
}),
|
|
486
|
+
}), En = e.object({
|
|
487
487
|
itemVendorPrice: e.object({
|
|
488
488
|
itemvendorpricelines: e.object({
|
|
489
489
|
items: e.array(e.object({
|
|
@@ -548,7 +548,7 @@ e.object({
|
|
|
548
548
|
refName: e.string()
|
|
549
549
|
}),
|
|
550
550
|
itemVendor: e.object({
|
|
551
|
-
items: e.array(
|
|
551
|
+
items: e.array(En),
|
|
552
552
|
totalResults: e.number()
|
|
553
553
|
}),
|
|
554
554
|
lastModifiedDate: e.string(),
|
|
@@ -870,7 +870,7 @@ e.object({
|
|
|
870
870
|
externalId: e.string().nullish()
|
|
871
871
|
});
|
|
872
872
|
function Ze(r) {
|
|
873
|
-
return
|
|
873
|
+
return Oe.FCurrency.safeParse(r.trim().toUpperCase()).success;
|
|
874
874
|
}
|
|
875
875
|
g(Ze, "isCurrencySupported");
|
|
876
876
|
var lt;
|
|
@@ -883,8 +883,8 @@ var lt;
|
|
|
883
883
|
throw new Error(`Missing unit type in NetSuite assembly item ${n.id}`);
|
|
884
884
|
if (o.netSuiteId !== n.unitsType.id)
|
|
885
885
|
throw new Error(`Unit type mismatch for NetSuite assembly item ${n.id}: expected unit type ID ${n.unitsType.id}, got ${o.netSuiteId}`);
|
|
886
|
-
const m = n.subsidiary.items.map((N) => N.id), l =
|
|
887
|
-
prefix:
|
|
886
|
+
const m = n.subsidiary.items.map((N) => N.id), l = R({
|
|
887
|
+
prefix: O.Enum.sku
|
|
888
888
|
}), f = (v = t == null ? void 0 : t.netsuiteCustomAttributes) == null ? void 0 : v.reduce((N, b) => {
|
|
889
889
|
const D = b.compute(s);
|
|
890
890
|
return {
|
|
@@ -908,7 +908,7 @@ var lt;
|
|
|
908
908
|
...N,
|
|
909
909
|
[b.fieldId]: D
|
|
910
910
|
};
|
|
911
|
-
}, {}),
|
|
911
|
+
}, {}), y = n.currency.refName.trim().toUpperCase(), E = n.cost ?? n.lastPurchasePrice, _ = {
|
|
912
912
|
_id: l,
|
|
913
913
|
name: n.itemId,
|
|
914
914
|
code: n.id,
|
|
@@ -917,13 +917,13 @@ var lt;
|
|
|
917
917
|
convert: null,
|
|
918
918
|
valuation: Dt(n),
|
|
919
919
|
isInactive: n.isInactive,
|
|
920
|
-
defaultCost:
|
|
920
|
+
defaultCost: E ? {
|
|
921
921
|
...I && {
|
|
922
922
|
measurement: I
|
|
923
923
|
},
|
|
924
924
|
costPerUnit: {
|
|
925
|
-
currency: Ze(
|
|
926
|
-
...A.fromNumber(
|
|
925
|
+
currency: Ze(y) ? y : he,
|
|
926
|
+
...A.fromNumber(E)
|
|
927
927
|
}
|
|
928
928
|
} : null,
|
|
929
929
|
...p
|
|
@@ -1007,8 +1007,8 @@ var mt;
|
|
|
1007
1007
|
throw new Error(`Missing unit type in NetSuite inventory item ${n.id}`);
|
|
1008
1008
|
if (o.netSuiteId !== n.unitsType.id)
|
|
1009
1009
|
throw new Error(`Unit type mismatch for NetSuite inventory item ${n.id}: expected unit type ID ${n.unitsType.id}, got ${o.netSuiteId}`);
|
|
1010
|
-
const m = n.subsidiary.items.map((N) => N.id), l =
|
|
1011
|
-
prefix:
|
|
1010
|
+
const m = n.subsidiary.items.map((N) => N.id), l = R({
|
|
1011
|
+
prefix: O.Enum.sku
|
|
1012
1012
|
}), f = (v = t == null ? void 0 : t.netsuiteCustomAttributes) == null ? void 0 : v.reduce((N, b) => {
|
|
1013
1013
|
const D = b.compute(s);
|
|
1014
1014
|
return {
|
|
@@ -1032,7 +1032,7 @@ var mt;
|
|
|
1032
1032
|
...N,
|
|
1033
1033
|
[b.fieldId]: D
|
|
1034
1034
|
};
|
|
1035
|
-
}, {}),
|
|
1035
|
+
}, {}), y = n.currency.refName.trim().toUpperCase(), E = n.cost, _ = {
|
|
1036
1036
|
_id: l,
|
|
1037
1037
|
name: n.itemId,
|
|
1038
1038
|
code: n.id,
|
|
@@ -1041,13 +1041,13 @@ var mt;
|
|
|
1041
1041
|
convert: null,
|
|
1042
1042
|
valuation: Nt(n),
|
|
1043
1043
|
isInactive: n.isInactive,
|
|
1044
|
-
defaultCost:
|
|
1044
|
+
defaultCost: E ? {
|
|
1045
1045
|
...I && {
|
|
1046
1046
|
measurement: I
|
|
1047
1047
|
},
|
|
1048
1048
|
costPerUnit: {
|
|
1049
|
-
currency: Ze(
|
|
1050
|
-
...A.fromNumber(
|
|
1049
|
+
currency: Ze(y) ? y : he,
|
|
1050
|
+
...A.fromNumber(E)
|
|
1051
1051
|
}
|
|
1052
1052
|
} : null,
|
|
1053
1053
|
...p
|
|
@@ -1145,7 +1145,7 @@ var te;
|
|
|
1145
1145
|
const { poItem: n, nsItemSetting: i, nsUnitTypes: o, overrideCost: m = !0, customAttributes: l } = t;
|
|
1146
1146
|
let f;
|
|
1147
1147
|
if (m && n.totalCost) {
|
|
1148
|
-
const
|
|
1148
|
+
const y = A.divide([
|
|
1149
1149
|
n.totalCost,
|
|
1150
1150
|
n.quantity
|
|
1151
1151
|
]);
|
|
@@ -1154,26 +1154,26 @@ var te;
|
|
|
1154
1154
|
value: n.totalCost
|
|
1155
1155
|
})),
|
|
1156
1156
|
rate: Number(A.toFormatString({
|
|
1157
|
-
value:
|
|
1157
|
+
value: y
|
|
1158
1158
|
}))
|
|
1159
1159
|
};
|
|
1160
1160
|
}
|
|
1161
1161
|
let d;
|
|
1162
1162
|
if (n.measurement) {
|
|
1163
|
-
const
|
|
1164
|
-
for (const
|
|
1165
|
-
for (const _ of (
|
|
1166
|
-
if (_.id ===
|
|
1163
|
+
const y = n.measurement.id;
|
|
1164
|
+
for (const E of o)
|
|
1165
|
+
for (const _ of (E == null ? void 0 : E.measurements) || [])
|
|
1166
|
+
if (_.id === y) {
|
|
1167
1167
|
d = _.netSuiteId;
|
|
1168
1168
|
break;
|
|
1169
1169
|
}
|
|
1170
1170
|
} else
|
|
1171
|
-
d = (p = o.find((
|
|
1172
|
-
const I = l == null ? void 0 : l.reduce((
|
|
1173
|
-
const _ =
|
|
1171
|
+
d = (p = o.find((y) => y.id == n.sku.unit._id)) == null ? void 0 : p.baseUnitUnitOfMeasureId;
|
|
1172
|
+
const I = l == null ? void 0 : l.reduce((y, E) => {
|
|
1173
|
+
const _ = E.compute(t, E.extraParams);
|
|
1174
1174
|
return {
|
|
1175
|
-
...
|
|
1176
|
-
[
|
|
1175
|
+
...y,
|
|
1176
|
+
[E.fieldId]: _
|
|
1177
1177
|
};
|
|
1178
1178
|
}, {});
|
|
1179
1179
|
return {
|
|
@@ -1203,18 +1203,18 @@ var te;
|
|
|
1203
1203
|
if (n.measurement) {
|
|
1204
1204
|
const I = n.measurement.id;
|
|
1205
1205
|
for (const p of o)
|
|
1206
|
-
for (const
|
|
1207
|
-
if (
|
|
1208
|
-
l =
|
|
1206
|
+
for (const y of (p == null ? void 0 : p.measurements) || [])
|
|
1207
|
+
if (y.id === I) {
|
|
1208
|
+
l = y.netSuiteId;
|
|
1209
1209
|
break;
|
|
1210
1210
|
}
|
|
1211
1211
|
} else
|
|
1212
1212
|
l = (d = o.find((I) => I.id == n.sku.unit._id)) == null ? void 0 : d.baseUnitUnitOfMeasureId;
|
|
1213
1213
|
const f = m == null ? void 0 : m.reduce((I, p) => {
|
|
1214
|
-
const
|
|
1214
|
+
const y = p.compute(t, p.extraParams);
|
|
1215
1215
|
return {
|
|
1216
1216
|
...I,
|
|
1217
|
-
[p.fieldId]:
|
|
1217
|
+
[p.fieldId]: y
|
|
1218
1218
|
};
|
|
1219
1219
|
}, {});
|
|
1220
1220
|
return {
|
|
@@ -1257,14 +1257,14 @@ var te;
|
|
|
1257
1257
|
g(s, "toPurchaseOrderItemUpdateDto"), a.toPurchaseOrderItemUpdateDto = s;
|
|
1258
1258
|
})(r.ToNetSuite || (r.ToNetSuite = {})), function(a) {
|
|
1259
1259
|
function u(s) {
|
|
1260
|
-
var
|
|
1261
|
-
const { nsOrderItem: t, sku: n, measurement: i, context: o, currency: m } = s, l = (_ = (
|
|
1260
|
+
var y, E, _;
|
|
1261
|
+
const { nsOrderItem: t, sku: n, measurement: i, context: o, currency: m } = s, l = (_ = (E = (y = o == null ? void 0 : o.options) == null ? void 0 : y.purchaseOrderItem) == null ? void 0 : E.customAttributes) == null ? void 0 : _.reduce((S, v) => {
|
|
1262
1262
|
const C = v.compute(s, v.extraParams);
|
|
1263
1263
|
return {
|
|
1264
1264
|
...S,
|
|
1265
1265
|
[v.fieldId]: C
|
|
1266
1266
|
};
|
|
1267
|
-
}, {}), f = A.fromNumber(t.quantity), d = t.amount ? A.fromNumber(t.amount) : A.fromNumber(0), I =
|
|
1267
|
+
}, {}), 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;
|
|
1268
1268
|
return {
|
|
1269
1269
|
id: "",
|
|
1270
1270
|
externalId: String(t.line),
|
|
@@ -1293,7 +1293,7 @@ var te;
|
|
|
1293
1293
|
...C,
|
|
1294
1294
|
[N.fieldId]: b
|
|
1295
1295
|
};
|
|
1296
|
-
}, {}), I = A.fromNumber(t.quantity), p = A.fromNumber(l),
|
|
1296
|
+
}, {}), I = A.fromNumber(t.quantity), p = A.fromNumber(l), y = Oe.FCurrency.safeParse(f), E = y.success ? y.data : he;
|
|
1297
1297
|
return {
|
|
1298
1298
|
id: "",
|
|
1299
1299
|
externalId: String(t.orderLine),
|
|
@@ -1305,7 +1305,7 @@ var te;
|
|
|
1305
1305
|
cost: {
|
|
1306
1306
|
amount: p.amount,
|
|
1307
1307
|
precision: p.precision,
|
|
1308
|
-
currency:
|
|
1308
|
+
currency: E
|
|
1309
1309
|
},
|
|
1310
1310
|
measurement: i ?? null,
|
|
1311
1311
|
...d
|
|
@@ -1503,19 +1503,19 @@ var Pe;
|
|
|
1503
1503
|
})(Pe || (Pe = {}));
|
|
1504
1504
|
function Ct(r) {
|
|
1505
1505
|
switch (k[r.id]) {
|
|
1506
|
-
case
|
|
1506
|
+
case de.enum.A:
|
|
1507
1507
|
return j.Enum.REQUESTING;
|
|
1508
|
-
case
|
|
1509
|
-
case
|
|
1508
|
+
case de.enum.B:
|
|
1509
|
+
case de.enum.D:
|
|
1510
1510
|
return j.Enum.PROCESSING;
|
|
1511
|
-
case
|
|
1511
|
+
case de.enum.C:
|
|
1512
1512
|
return j.Enum.REJECT;
|
|
1513
|
-
case
|
|
1514
|
-
case
|
|
1513
|
+
case de.enum.E:
|
|
1514
|
+
case de.enum.F:
|
|
1515
1515
|
return j.Enum.RECEIVING;
|
|
1516
|
-
case
|
|
1516
|
+
case de.enum.G:
|
|
1517
1517
|
return j.Enum.COMPLETE;
|
|
1518
|
-
case
|
|
1518
|
+
case de.enum.H:
|
|
1519
1519
|
return j.Enum.CLOSE;
|
|
1520
1520
|
}
|
|
1521
1521
|
throw new Error(`Invalid NetSuite Transfer Order status with ${r.id}`);
|
|
@@ -1589,18 +1589,18 @@ g(Ut, "transformTransferOrderPreparingShipmentMilestoneFromNetSuite");
|
|
|
1589
1589
|
var It;
|
|
1590
1590
|
(function(r) {
|
|
1591
1591
|
(function(a) {
|
|
1592
|
-
function u({ setting: t, purchaseOrderRequest: n, status: i =
|
|
1592
|
+
function u({ setting: t, purchaseOrderRequest: n, status: i = de.enum.A, overrideItemCost: o = !0, customItemAttributes: m, customFields: l }) {
|
|
1593
1593
|
const { purchaseOrder: f } = n;
|
|
1594
1594
|
if (!f)
|
|
1595
1595
|
throw new Error("Purchase order request does not have a purchase order");
|
|
1596
1596
|
if (n.netSuite.subsidiary === void 0)
|
|
1597
1597
|
throw new Error("Purchase order request does not have a NetSuite subsidiary");
|
|
1598
|
-
const d = f.items.map((
|
|
1599
|
-
const
|
|
1598
|
+
const d = f.items.map((y) => {
|
|
1599
|
+
const E = t.items.find((_) => _.id === y.sku._id);
|
|
1600
1600
|
return te.ToNetSuite.toCreateDto({
|
|
1601
|
-
poItem:
|
|
1601
|
+
poItem: y,
|
|
1602
1602
|
nsUnitTypes: t.units,
|
|
1603
|
-
nsItemSetting:
|
|
1603
|
+
nsItemSetting: E,
|
|
1604
1604
|
overrideCost: o,
|
|
1605
1605
|
customAttributes: m
|
|
1606
1606
|
});
|
|
@@ -1632,7 +1632,7 @@ var It;
|
|
|
1632
1632
|
g(u, "toCreateDto"), a.toCreateDto = u;
|
|
1633
1633
|
function c({ setting: t, purchaseOrder: n, overrideItemCost: i, customItemAttributes: o, includeItems: m = !1, orderStatus: l, customFields: f }) {
|
|
1634
1634
|
const d = n.items.map((I) => {
|
|
1635
|
-
const p = t.items.find((
|
|
1635
|
+
const p = t.items.find((y) => y.id === I.sku._id);
|
|
1636
1636
|
return te.ToNetSuite.toTransferOrderItemUpdateDto({
|
|
1637
1637
|
poItem: I,
|
|
1638
1638
|
nsUnitTypes: t.units,
|
|
@@ -1668,7 +1668,7 @@ var It;
|
|
|
1668
1668
|
})(r.ToNetSuite || (r.ToNetSuite = {})), function(a) {
|
|
1669
1669
|
function u(s) {
|
|
1670
1670
|
var $, Se, we, it, st, rt, ot, at, ut;
|
|
1671
|
-
const { fromLocation: t, toLocation: n, nsTransferOrder: i, orderItemMapping: o, nsItemFulfillments: m, orderItemMappingByFulfillment: l, nsItemReceipts: f, orderItemMappingByReceipt: d, context: I, nsSystemNotes: p } = s,
|
|
1671
|
+
const { fromLocation: t, toLocation: n, nsTransferOrder: i, orderItemMapping: o, nsItemFulfillments: m, orderItemMappingByFulfillment: l, nsItemReceipts: f, orderItemMappingByReceipt: d, context: I, nsSystemNotes: p } = s, y = {
|
|
1672
1672
|
_id: t.doc._id,
|
|
1673
1673
|
internal: t.type,
|
|
1674
1674
|
contactName: t.doc.profile.name,
|
|
@@ -1684,7 +1684,7 @@ var It;
|
|
|
1684
1684
|
country: ((st = t.doc.profile.address) == null ? void 0 : st.country) || "",
|
|
1685
1685
|
postcode: ((rt = t.doc.profile.address) == null ? void 0 : rt.postcode) || ""
|
|
1686
1686
|
}
|
|
1687
|
-
},
|
|
1687
|
+
}, E = (ut = (at = (ot = I.options) == null ? void 0 : ot.netSuite) == null ? void 0 : at.additionalInfo) == null ? void 0 : ut.reduce((P, Y) => {
|
|
1688
1688
|
const Ie = Y.compute(s, Y.extraParams);
|
|
1689
1689
|
return {
|
|
1690
1690
|
...P,
|
|
@@ -1698,7 +1698,7 @@ var It;
|
|
|
1698
1698
|
name: i.subsidiary.refName
|
|
1699
1699
|
},
|
|
1700
1700
|
additionalInfo: {
|
|
1701
|
-
...
|
|
1701
|
+
...E
|
|
1702
1702
|
}
|
|
1703
1703
|
}, S = m.map((P) => {
|
|
1704
1704
|
const Y = l[P.id];
|
|
@@ -1717,13 +1717,13 @@ var It;
|
|
|
1717
1717
|
context: I
|
|
1718
1718
|
});
|
|
1719
1719
|
}), 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 = {
|
|
1720
|
-
_id:
|
|
1721
|
-
prefix:
|
|
1720
|
+
_id: R({
|
|
1721
|
+
prefix: O.Enum.purchaseOrder,
|
|
1722
1722
|
dateTime: N.toISOString()
|
|
1723
1723
|
}),
|
|
1724
1724
|
version: "2",
|
|
1725
1725
|
status: Ct(i.orderStatus),
|
|
1726
|
-
supplier:
|
|
1726
|
+
supplier: y,
|
|
1727
1727
|
seqNumber: parseInt(i.custbody_fm_po_num ?? "0"),
|
|
1728
1728
|
items: C,
|
|
1729
1729
|
effectiveAt: w.toISOString(),
|
|
@@ -1817,12 +1817,12 @@ var pt;
|
|
|
1817
1817
|
(function(r) {
|
|
1818
1818
|
(function(a) {
|
|
1819
1819
|
function u({ locationDb: t, setting: n, purchaseOrder: i, status: o = X.enum.A, overrideItemCost: m = !0, customItemAttributes: l, customFields: f }) {
|
|
1820
|
-
const { netSuiteFromId: d, netSuiteToId: I } = Je(n.locations, n.vendors, t, i.supplier._id), p = i.items.map((
|
|
1821
|
-
const
|
|
1820
|
+
const { netSuiteFromId: d, netSuiteToId: I } = Je(n.locations, n.vendors, t, i.supplier._id), p = i.items.map((y) => {
|
|
1821
|
+
const E = n.items.find((_) => _.id === y.sku._id);
|
|
1822
1822
|
return te.ToNetSuite.toCreateDto({
|
|
1823
|
-
poItem:
|
|
1823
|
+
poItem: y,
|
|
1824
1824
|
nsUnitTypes: n.units,
|
|
1825
|
-
nsItemSetting:
|
|
1825
|
+
nsItemSetting: E,
|
|
1826
1826
|
overrideCost: m,
|
|
1827
1827
|
customAttributes: [
|
|
1828
1828
|
{
|
|
@@ -1865,12 +1865,12 @@ var pt;
|
|
|
1865
1865
|
const { netSuiteToId: d } = Je(n.locations, n.vendors, t, i.supplier._id);
|
|
1866
1866
|
i != null && i.effectiveAt || ie(i._id);
|
|
1867
1867
|
const I = i.items.map((p) => {
|
|
1868
|
-
const
|
|
1868
|
+
const y = n.items.find((E) => E.id === p.sku._id);
|
|
1869
1869
|
return te.ToNetSuite.toPurchaseOrderItemUpdateDto({
|
|
1870
1870
|
nsLocationId: d,
|
|
1871
1871
|
poItem: p,
|
|
1872
1872
|
nsUnitTypes: n.units,
|
|
1873
|
-
nsItemSetting:
|
|
1873
|
+
nsItemSetting: y,
|
|
1874
1874
|
overrideCost: o,
|
|
1875
1875
|
customAttributes: m
|
|
1876
1876
|
});
|
|
@@ -1943,12 +1943,12 @@ var pt;
|
|
|
1943
1943
|
measurement: we,
|
|
1944
1944
|
context: m
|
|
1945
1945
|
})), se;
|
|
1946
|
-
}, []),
|
|
1946
|
+
}, []), y = new Date(t.createdDate), [E, _, S] = t.tranDate.split("-"), v = new Date(Number(E), Number(_) - 1, Number(S)), C = wt(t);
|
|
1947
1947
|
return {
|
|
1948
1948
|
purchaseOrder: {
|
|
1949
|
-
_id:
|
|
1950
|
-
prefix:
|
|
1951
|
-
dateTime:
|
|
1949
|
+
_id: R({
|
|
1950
|
+
prefix: O.Enum.purchaseOrder,
|
|
1951
|
+
dateTime: y.toISOString()
|
|
1952
1952
|
}),
|
|
1953
1953
|
version: "2",
|
|
1954
1954
|
status: At(t.orderStatus),
|
|
@@ -1985,8 +1985,8 @@ var ze;
|
|
|
1985
1985
|
(function(a) {
|
|
1986
1986
|
function u(c) {
|
|
1987
1987
|
const t = {
|
|
1988
|
-
id:
|
|
1989
|
-
prefix:
|
|
1988
|
+
id: R({
|
|
1989
|
+
prefix: O.Enum.measurement
|
|
1990
1990
|
}),
|
|
1991
1991
|
name: c.unitName,
|
|
1992
1992
|
abbrev: c.abbreviation,
|
|
@@ -2010,8 +2010,8 @@ var gt;
|
|
|
2010
2010
|
(function(r) {
|
|
2011
2011
|
(function(a) {
|
|
2012
2012
|
function u(c, s) {
|
|
2013
|
-
let t = c.uom.items, n =
|
|
2014
|
-
prefix:
|
|
2013
|
+
let t = c.uom.items, n = R({
|
|
2014
|
+
prefix: O.Enum.unit
|
|
2015
2015
|
});
|
|
2016
2016
|
const i = {
|
|
2017
2017
|
_id: n,
|
|
@@ -2064,12 +2064,12 @@ function Tn(r, a) {
|
|
|
2064
2064
|
}, u;
|
|
2065
2065
|
}
|
|
2066
2066
|
g(Tn, "convertToUnitWithNsConfig");
|
|
2067
|
-
var
|
|
2067
|
+
var yt;
|
|
2068
2068
|
(function(r) {
|
|
2069
2069
|
(function(a) {
|
|
2070
2070
|
function u(c) {
|
|
2071
|
-
const s = c.addressBook.items.find((o) => o.defaultBilling), t =
|
|
2072
|
-
prefix:
|
|
2071
|
+
const s = c.addressBook.items.find((o) => o.defaultBilling), t = R({
|
|
2072
|
+
prefix: O.Enum.supplier
|
|
2073
2073
|
}), n = {
|
|
2074
2074
|
_id: t,
|
|
2075
2075
|
name: c.companyName,
|
|
@@ -2091,7 +2091,7 @@ var Et;
|
|
|
2091
2091
|
}
|
|
2092
2092
|
g(u, "transform"), a.transform = u;
|
|
2093
2093
|
})(r.FromNetsuite || (r.FromNetsuite = {}));
|
|
2094
|
-
})(
|
|
2094
|
+
})(yt || (yt = {}));
|
|
2095
2095
|
function kt(r) {
|
|
2096
2096
|
let a = {
|
|
2097
2097
|
line1: "",
|
|
@@ -2152,18 +2152,18 @@ function hn(r, a, u, c, s) {
|
|
|
2152
2152
|
}
|
|
2153
2153
|
for (let d = 0; d < o.length; d++) {
|
|
2154
2154
|
const I = o[d], p = [];
|
|
2155
|
-
for (const
|
|
2156
|
-
const
|
|
2157
|
-
if (!
|
|
2158
|
-
p.push(
|
|
2155
|
+
for (const y of I.received) {
|
|
2156
|
+
const E = y.externalId;
|
|
2157
|
+
if (!E) {
|
|
2158
|
+
p.push(y);
|
|
2159
2159
|
continue;
|
|
2160
2160
|
}
|
|
2161
|
-
const _ = (l = a.find((C) => C.lineid ===
|
|
2162
|
-
...
|
|
2161
|
+
const _ = (l = a.find((C) => C.lineid === E)) == null ? void 0 : l.transferorderitemlineid, S = t && _ ? n[_] : void 0, v = {
|
|
2162
|
+
...y,
|
|
2163
2163
|
id: S
|
|
2164
2164
|
};
|
|
2165
2165
|
if (r === ee.Enum[2] && (!S || S === ""))
|
|
2166
|
-
throw new Error(`Cannot find mapped item ID for external line id ${
|
|
2166
|
+
throw new Error(`Cannot find mapped item ID for external line id ${E} in delivery order`);
|
|
2167
2167
|
p.push(v);
|
|
2168
2168
|
}
|
|
2169
2169
|
o[d] = {
|
|
@@ -2174,18 +2174,18 @@ function hn(r, a, u, c, s) {
|
|
|
2174
2174
|
if (m)
|
|
2175
2175
|
for (let d = 0; d < m.length; d++) {
|
|
2176
2176
|
const I = m[d], p = [];
|
|
2177
|
-
for (const
|
|
2178
|
-
const
|
|
2179
|
-
if (!
|
|
2180
|
-
p.push(
|
|
2177
|
+
for (const y of I.items) {
|
|
2178
|
+
const E = y.externalId;
|
|
2179
|
+
if (!E) {
|
|
2180
|
+
p.push(y);
|
|
2181
2181
|
continue;
|
|
2182
2182
|
}
|
|
2183
|
-
const _ = (f = a.find((C) => C.lineid ===
|
|
2184
|
-
...
|
|
2183
|
+
const _ = (f = a.find((C) => C.lineid === E)) == null ? void 0 : f.transferorderitemlineid, S = t && _ ? n[_] : y.id, v = {
|
|
2184
|
+
...y,
|
|
2185
2185
|
id: S
|
|
2186
2186
|
};
|
|
2187
2187
|
if (r === ee.Enum[2] && (!S || S === ""))
|
|
2188
|
-
throw new Error(`Cannot find mapped item ID for order external id ${
|
|
2188
|
+
throw new Error(`Cannot find mapped item ID for order external id ${E} in delivery fulfillment`);
|
|
2189
2189
|
p.push(v);
|
|
2190
2190
|
}
|
|
2191
2191
|
m[d] = {
|
|
@@ -2258,7 +2258,7 @@ var pe;
|
|
|
2258
2258
|
g(u, "toCreateDto"), a.toCreateDto = u;
|
|
2259
2259
|
})(r.ToNetSuite || (r.ToNetSuite = {})), function(a) {
|
|
2260
2260
|
function u(s, t, n, i) {
|
|
2261
|
-
const { cost: o, currency: m } = Xe(t, String(s.line), s.item.id), l = A.fromNumber(s.adjustQtyBy), f = A.fromNumber(o), d =
|
|
2261
|
+
const { cost: o, currency: m } = Xe(t, String(s.line), s.item.id), l = A.fromNumber(s.adjustQtyBy), f = A.fromNumber(o), d = Oe.FCurrency.safeParse(m), I = d.success ? d.data : he;
|
|
2262
2262
|
return {
|
|
2263
2263
|
id: "",
|
|
2264
2264
|
externalId: String(s.line),
|
|
@@ -2299,12 +2299,12 @@ var pe;
|
|
|
2299
2299
|
g(c, "toPurchaseOrderItem"), a.toPurchaseOrderItem = c;
|
|
2300
2300
|
}(r.FromNetSuite || (r.FromNetSuite = {}));
|
|
2301
2301
|
})(pe || (pe = {}));
|
|
2302
|
-
var
|
|
2302
|
+
var Et;
|
|
2303
2303
|
(function(r) {
|
|
2304
2304
|
(function(a) {
|
|
2305
2305
|
function u(s) {
|
|
2306
2306
|
const { setting: t, sourceLocationId: n, destinationLocationId: i, subsidiaryId: o, effectiveAt: m, orderItems: l, newAdjustmentId: f } = s, d = l.map((I) => {
|
|
2307
|
-
const p = t.items.find((
|
|
2307
|
+
const p = t.items.find((y) => y.id === I.sku._id);
|
|
2308
2308
|
return pe.ToNetSuite.toCreateDto({
|
|
2309
2309
|
orderItem: I,
|
|
2310
2310
|
nsUnitTypes: t.units,
|
|
@@ -2354,7 +2354,7 @@ var yt;
|
|
|
2354
2354
|
id: t.id,
|
|
2355
2355
|
refNo: t.tranId,
|
|
2356
2356
|
recordType: Be.Enum.inventoryTransfer
|
|
2357
|
-
},
|
|
2357
|
+
}, y = {
|
|
2358
2358
|
received: t.inventory.items.map((S) => {
|
|
2359
2359
|
const v = n[S.line].sku, C = n[S.line].measurement;
|
|
2360
2360
|
return pe.FromNetSuite.toPurchaseOrderReceived(S, t.glImpacts ?? [], v, C);
|
|
@@ -2367,13 +2367,13 @@ var yt;
|
|
|
2367
2367
|
deliveryOrderNumber: "",
|
|
2368
2368
|
netSuite: I,
|
|
2369
2369
|
effectiveAt: f.toISOString()
|
|
2370
|
-
},
|
|
2370
|
+
}, E = t.inventory.items.map((S) => {
|
|
2371
2371
|
const v = n[S.line].sku, C = n[S.line].measurement;
|
|
2372
2372
|
return pe.FromNetSuite.toPurchaseOrderItem(S, v, C);
|
|
2373
2373
|
});
|
|
2374
2374
|
return {
|
|
2375
|
-
_id:
|
|
2376
|
-
prefix:
|
|
2375
|
+
_id: R({
|
|
2376
|
+
prefix: O.Enum.purchaseOrder,
|
|
2377
2377
|
dateTime: i.toISOString()
|
|
2378
2378
|
}),
|
|
2379
2379
|
version: "2",
|
|
@@ -2381,9 +2381,9 @@ var yt;
|
|
|
2381
2381
|
status: j.Enum.COMPLETE,
|
|
2382
2382
|
supplier: d,
|
|
2383
2383
|
seqNumber: t.custbody_fm_po_num ?? 0,
|
|
2384
|
-
items:
|
|
2384
|
+
items: E,
|
|
2385
2385
|
deliveryOrder: [
|
|
2386
|
-
|
|
2386
|
+
y
|
|
2387
2387
|
],
|
|
2388
2388
|
request: t.custbody_fm_po_request_id ? {
|
|
2389
2389
|
id: t.custbody_fm_po_request_id,
|
|
@@ -2419,7 +2419,7 @@ var yt;
|
|
|
2419
2419
|
id: n.subsidiary.id,
|
|
2420
2420
|
name: n.subsidiary.refName
|
|
2421
2421
|
}
|
|
2422
|
-
},
|
|
2422
|
+
}, E = {
|
|
2423
2423
|
received: n.inventory.items.map((w) => {
|
|
2424
2424
|
const U = i[w.line].sku, B = i[w.line].measurement;
|
|
2425
2425
|
return pe.FromNetSuite.toPurchaseOrderReceived(w, n.glImpacts ?? [], U, B);
|
|
@@ -2437,8 +2437,8 @@ var yt;
|
|
|
2437
2437
|
return pe.FromNetSuite.toPurchaseOrderItem(w, U, B);
|
|
2438
2438
|
});
|
|
2439
2439
|
return {
|
|
2440
|
-
_id:
|
|
2441
|
-
prefix:
|
|
2440
|
+
_id: R({
|
|
2441
|
+
prefix: O.Enum.purchaseOrder,
|
|
2442
2442
|
dateTime: o.toISOString()
|
|
2443
2443
|
}),
|
|
2444
2444
|
version: "2",
|
|
@@ -2448,7 +2448,7 @@ var yt;
|
|
|
2448
2448
|
seqNumber: n.custbody_fm_po_num ?? 0,
|
|
2449
2449
|
items: _,
|
|
2450
2450
|
deliveryOrder: [
|
|
2451
|
-
|
|
2451
|
+
E
|
|
2452
2452
|
],
|
|
2453
2453
|
request: n.custbody_fm_po_request_id ? {
|
|
2454
2454
|
id: n.custbody_fm_po_request_id,
|
|
@@ -2459,15 +2459,15 @@ var yt;
|
|
|
2459
2459
|
}
|
|
2460
2460
|
g(c, "transformTransferOut"), a.transformTransferOut = c;
|
|
2461
2461
|
}(r.FromNetSuite || (r.FromNetSuite = {}));
|
|
2462
|
-
})(
|
|
2462
|
+
})(Et || (Et = {}));
|
|
2463
2463
|
function ge(r, a, u, c) {
|
|
2464
2464
|
const s = {};
|
|
2465
2465
|
return c.forEach((t) => {
|
|
2466
|
-
"itemType" in t && t.itemType.id === "Service" || (s[t.line] =
|
|
2466
|
+
"itemType" in t && t.itemType.id === "Service" || (s[t.line] = Rt(r, a, u, t.item.id, t.units));
|
|
2467
2467
|
}), s;
|
|
2468
2468
|
}
|
|
2469
2469
|
g(ge, "validateOrderItems");
|
|
2470
|
-
function
|
|
2470
|
+
function Rt(r, a, u, c, s) {
|
|
2471
2471
|
const t = u.items.find((f) => f.netSuiteId === c);
|
|
2472
2472
|
if (!t)
|
|
2473
2473
|
throw new Error(`SKU with ID ${c} not found in settings`);
|
|
@@ -2493,7 +2493,7 @@ function Ot(r, a, u, c, s) {
|
|
|
2493
2493
|
measurement: l
|
|
2494
2494
|
};
|
|
2495
2495
|
}
|
|
2496
|
-
g(
|
|
2496
|
+
g(Rt, "validateNetSuiteOrderItem");
|
|
2497
2497
|
function Nn(r, a) {
|
|
2498
2498
|
const u = r.items.reduce((c, s) => {
|
|
2499
2499
|
const { id: t, quantity: n } = s;
|
|
@@ -2614,17 +2614,17 @@ function Mn(r) {
|
|
|
2614
2614
|
const p = s[d._id];
|
|
2615
2615
|
if (!p)
|
|
2616
2616
|
throw new Error(`Missing NetSuite assembly item config for SKU with ID ${d._id}`);
|
|
2617
|
-
const
|
|
2618
|
-
if (!
|
|
2617
|
+
const y = t[p.netSuiteId];
|
|
2618
|
+
if (!y)
|
|
2619
2619
|
throw new Error(`Missing replica for NetSuite ID ${p.netSuiteId} for SKU with ID ${d._id}`);
|
|
2620
|
-
if (!
|
|
2620
|
+
if (!y.skuCache)
|
|
2621
2621
|
throw new Error(`Replica for NetSuite ID ${p.netSuiteId} is missing skuCache. Expected parent item replica.`);
|
|
2622
|
-
if (
|
|
2623
|
-
throw new Error(`Replica for NetSuite ID ${p.netSuiteId} has itemType '${
|
|
2624
|
-
if (
|
|
2625
|
-
throw new Error(`SKU ID mismatch: expected replica skuCache._id to be '${d._id}', but got '${
|
|
2622
|
+
if (y.itemType !== V.Enum.Assembly)
|
|
2623
|
+
throw new Error(`Replica for NetSuite ID ${p.netSuiteId} has itemType '${y.itemType}'. Expected 'Assembly'.`);
|
|
2624
|
+
if (y.skuCache._id !== d._id)
|
|
2625
|
+
throw new Error(`SKU ID mismatch: expected replica skuCache._id to be '${d._id}', but got '${y.skuCache._id}'`);
|
|
2626
2626
|
I = {
|
|
2627
|
-
...
|
|
2627
|
+
...y.skuCache,
|
|
2628
2628
|
customAttributes: d.customAttributes
|
|
2629
2629
|
};
|
|
2630
2630
|
} catch (p) {
|
|
@@ -2692,17 +2692,17 @@ function Fn(r) {
|
|
|
2692
2692
|
const p = s[d._id];
|
|
2693
2693
|
if (!p)
|
|
2694
2694
|
throw new Error(`Missing NetSuite inventory item config for SKU with ID ${d._id}`);
|
|
2695
|
-
const
|
|
2696
|
-
if (!
|
|
2695
|
+
const y = t[p.netSuiteId];
|
|
2696
|
+
if (!y)
|
|
2697
2697
|
throw new Error(`Missing replica for NetSuite ID ${p.netSuiteId} for SKU with ID ${d._id}`);
|
|
2698
|
-
if (!
|
|
2698
|
+
if (!y.skuCache)
|
|
2699
2699
|
throw new Error(`Replica for NetSuite ID ${p.netSuiteId} is missing skuCache. Expected parent item replica.`);
|
|
2700
|
-
if (
|
|
2701
|
-
throw new Error(`Replica for NetSuite ID ${p.netSuiteId} has itemType '${
|
|
2702
|
-
if (
|
|
2703
|
-
throw new Error(`SKU ID mismatch: expected replica skuCache._id to be '${d._id}', but got '${
|
|
2700
|
+
if (y.itemType !== V.Enum.InvtPart)
|
|
2701
|
+
throw new Error(`Replica for NetSuite ID ${p.netSuiteId} has itemType '${y.itemType}'. Expected 'InvtPart'.`);
|
|
2702
|
+
if (y.skuCache._id !== d._id)
|
|
2703
|
+
throw new Error(`SKU ID mismatch: expected replica skuCache._id to be '${d._id}', but got '${y.skuCache._id}'`);
|
|
2704
2704
|
I = {
|
|
2705
|
-
...
|
|
2705
|
+
...y.skuCache,
|
|
2706
2706
|
customAttributes: d.customAttributes
|
|
2707
2707
|
};
|
|
2708
2708
|
} catch (p) {
|
|
@@ -3031,12 +3031,12 @@ function nt(r, a, u = "1") {
|
|
|
3031
3031
|
return c;
|
|
3032
3032
|
}
|
|
3033
3033
|
g(nt, "resolvePurchaseOrderReceivedConflicts");
|
|
3034
|
-
var
|
|
3034
|
+
var ce;
|
|
3035
3035
|
(function(r) {
|
|
3036
3036
|
r.ITEM_FULFILLMENT_CREATED = "ITEM_FULFILLMENT_CREATED", r.ITEM_FULFILLMENT_UPDATED = "ITEM_FULFILLMENT_UPDATED", r.ITEM_FULFILLMENT_DELETED = "ITEM_FULFILLMENT_DELETED";
|
|
3037
|
-
})(
|
|
3037
|
+
})(ce || (ce = {}));
|
|
3038
3038
|
var kn = 'Record [$] item on line [$], field "$" changed from "$" to "$"';
|
|
3039
|
-
function
|
|
3039
|
+
function Rn(r, a, u) {
|
|
3040
3040
|
var t, n, i;
|
|
3041
3041
|
const c = Object.keys(Gt.shape), s = [];
|
|
3042
3042
|
for (const o of a) {
|
|
@@ -3046,7 +3046,7 @@ function On(r, a, u) {
|
|
|
3046
3046
|
});
|
|
3047
3047
|
if (!m)
|
|
3048
3048
|
s.push({
|
|
3049
|
-
type:
|
|
3049
|
+
type: ce.ITEM_FULFILLMENT_CREATED,
|
|
3050
3050
|
message: `New Item Fulfillment ${(t = o.netSuite) == null ? void 0 : t.id} created`,
|
|
3051
3051
|
data: o
|
|
3052
3052
|
});
|
|
@@ -3062,7 +3062,7 @@ function On(r, a, u) {
|
|
|
3062
3062
|
if (!L.isEqual(f, d)) {
|
|
3063
3063
|
let I = d, p = f;
|
|
3064
3064
|
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()), s.push({
|
|
3065
|
-
type:
|
|
3065
|
+
type: ce.ITEM_FULFILLMENT_UPDATED,
|
|
3066
3066
|
message: ne(kn, [
|
|
3067
3067
|
"Item Fulfillment Field",
|
|
3068
3068
|
`${(n = o.netSuite) == null ? void 0 : n.id}`,
|
|
@@ -3082,9 +3082,9 @@ function On(r, a, u) {
|
|
|
3082
3082
|
}
|
|
3083
3083
|
return s;
|
|
3084
3084
|
}
|
|
3085
|
-
g(
|
|
3086
|
-
function
|
|
3087
|
-
const u = a.filter((t) => t.type ===
|
|
3085
|
+
g(Rn, "detectItemFulfillmentConflicts");
|
|
3086
|
+
function On(r, a) {
|
|
3087
|
+
const u = a.filter((t) => t.type === ce.ITEM_FULFILLMENT_CREATED || t.type === ce.ITEM_FULFILLMENT_UPDATED || t.type === ce.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 = [];
|
|
3088
3088
|
if (u.length === 0)
|
|
3089
3089
|
return r;
|
|
3090
3090
|
for (const t of r) {
|
|
@@ -3094,7 +3094,7 @@ function Rn(r, a) {
|
|
|
3094
3094
|
items: o
|
|
3095
3095
|
};
|
|
3096
3096
|
for (const l of n)
|
|
3097
|
-
if (l.type ===
|
|
3097
|
+
if (l.type === ce.ITEM_FULFILLMENT_UPDATED) {
|
|
3098
3098
|
const f = l.data.field, d = l.data.incomingValue, I = t[f];
|
|
3099
3099
|
d !== I && (m = {
|
|
3100
3100
|
...t,
|
|
@@ -3104,63 +3104,63 @@ function Rn(r, a) {
|
|
|
3104
3104
|
c.push(m);
|
|
3105
3105
|
}
|
|
3106
3106
|
for (const t of u)
|
|
3107
|
-
t.type ===
|
|
3107
|
+
t.type === ce.ITEM_FULFILLMENT_CREATED && c.push({
|
|
3108
3108
|
...t.data,
|
|
3109
|
-
id: t.data.id ||
|
|
3110
|
-
prefix:
|
|
3109
|
+
id: t.data.id || R({
|
|
3110
|
+
prefix: O.Enum.deliveryFulfillment
|
|
3111
3111
|
})
|
|
3112
3112
|
});
|
|
3113
3113
|
const s = [];
|
|
3114
3114
|
for (const t of c)
|
|
3115
3115
|
t.id ? s.push(t) : (console.warn("Missing delivery fulfillment id, generating new id"), s.push({
|
|
3116
3116
|
...t,
|
|
3117
|
-
id:
|
|
3118
|
-
prefix:
|
|
3117
|
+
id: R({
|
|
3118
|
+
prefix: O.Enum.deliveryFulfillment
|
|
3119
3119
|
})
|
|
3120
3120
|
}));
|
|
3121
3121
|
return s;
|
|
3122
3122
|
}
|
|
3123
|
-
g(
|
|
3124
|
-
var
|
|
3123
|
+
g(On, "resolveDeliveryFulfillmentConflicts");
|
|
3124
|
+
var le;
|
|
3125
3125
|
(function(r) {
|
|
3126
3126
|
r.ITEM_RECEIPT_CREATED = "ITEM_RECEIPT_CREATED", r.ITEM_RECEIPT_UPDATED = "ITEM_RECEIPT_UPDATED", r.ITEM_RECEIPT_DELETED = "ITEM_RECEIPT_DELETED";
|
|
3127
|
-
})(
|
|
3127
|
+
})(le || (le = {}));
|
|
3128
3128
|
var W = /* @__PURE__ */ g((r) => r === "" ? null : r, "normalizeNullOrEmpty"), Ln = 'Record [$] item on line [$], field "$" changed from "$" to "$"';
|
|
3129
|
-
function
|
|
3129
|
+
function Ot(r, a, u) {
|
|
3130
3130
|
var i, o, m, l, f, d, I;
|
|
3131
3131
|
const c = Object.keys(Jt.shape), s = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set();
|
|
3132
3132
|
for (const p of r) {
|
|
3133
|
-
const
|
|
3134
|
-
if (E) {
|
|
3135
|
-
if (s.has(E))
|
|
3136
|
-
throw new Error(`Duplicate NetSuite ID found: ${E}`);
|
|
3137
|
-
s.add(E);
|
|
3138
|
-
}
|
|
3133
|
+
const y = W((i = p.netSuite) == null ? void 0 : i.id), E = W(p.id);
|
|
3139
3134
|
if (y) {
|
|
3140
|
-
if (
|
|
3141
|
-
throw new Error(`Duplicate
|
|
3142
|
-
|
|
3135
|
+
if (s.has(y))
|
|
3136
|
+
throw new Error(`Duplicate NetSuite ID found: ${y}`);
|
|
3137
|
+
s.add(y);
|
|
3138
|
+
}
|
|
3139
|
+
if (E) {
|
|
3140
|
+
if (t.has(E))
|
|
3141
|
+
throw new Error(`Duplicate delivery order ID found: ${E}`);
|
|
3142
|
+
t.add(E);
|
|
3143
3143
|
}
|
|
3144
3144
|
}
|
|
3145
3145
|
const n = [];
|
|
3146
3146
|
for (const p of a) {
|
|
3147
|
-
const
|
|
3148
|
-
if (!
|
|
3147
|
+
const y = W(p.id), E = W((o = p.netSuite) == null ? void 0 : o.id);
|
|
3148
|
+
if (!E)
|
|
3149
3149
|
continue;
|
|
3150
3150
|
const _ = r.find((S) => {
|
|
3151
3151
|
var D;
|
|
3152
3152
|
const v = W(S.id), C = W((D = S.netSuite) == null ? void 0 : D.id);
|
|
3153
|
-
return C &&
|
|
3153
|
+
return C && E && C === E || v && v === y;
|
|
3154
3154
|
});
|
|
3155
3155
|
if (!_)
|
|
3156
3156
|
n.push({
|
|
3157
|
-
type:
|
|
3157
|
+
type: le.ITEM_RECEIPT_CREATED,
|
|
3158
3158
|
message: `New Item Receipt ${(m = p.netSuite) == null ? void 0 : m.id} created`,
|
|
3159
3159
|
data: p
|
|
3160
3160
|
});
|
|
3161
3161
|
else {
|
|
3162
3162
|
const S = W(_.id), v = W((l = _.netSuite) == null ? void 0 : l.id);
|
|
3163
|
-
if (v &&
|
|
3163
|
+
if (v && E && v !== E || y && S && S !== y)
|
|
3164
3164
|
throw new Error(`Inconsistent data for Item Receipt ${(f = p.netSuite) == null ? void 0 : f.id} (or ${p.id})`);
|
|
3165
3165
|
for (const b of c) {
|
|
3166
3166
|
if (b === "adjustment" || b === "id")
|
|
@@ -3175,7 +3175,7 @@ function Rt(r, a, u) {
|
|
|
3175
3175
|
continue;
|
|
3176
3176
|
let w = F, U = D;
|
|
3177
3177
|
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({
|
|
3178
|
-
type:
|
|
3178
|
+
type: le.ITEM_RECEIPT_UPDATED,
|
|
3179
3179
|
message: ne(Ln, [
|
|
3180
3180
|
"Item Receipt Field",
|
|
3181
3181
|
`${(d = p.netSuite) == null ? void 0 : d.id}`,
|
|
@@ -3196,9 +3196,9 @@ function Rt(r, a, u) {
|
|
|
3196
3196
|
}
|
|
3197
3197
|
return n;
|
|
3198
3198
|
}
|
|
3199
|
-
g(
|
|
3199
|
+
g(Ot, "detectItemReceiptConflicts");
|
|
3200
3200
|
function Lt(r, a) {
|
|
3201
|
-
const u = a.filter((t) => t.type ===
|
|
3201
|
+
const u = a.filter((t) => t.type === le.ITEM_RECEIPT_CREATED || t.type === le.ITEM_RECEIPT_UPDATED || t.type === le.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 = [];
|
|
3202
3202
|
if (u.length === 0)
|
|
3203
3203
|
return r;
|
|
3204
3204
|
for (const t of r) {
|
|
@@ -3211,7 +3211,7 @@ function Lt(r, a) {
|
|
|
3211
3211
|
received: o
|
|
3212
3212
|
};
|
|
3213
3213
|
for (const l of n)
|
|
3214
|
-
if (l.type ===
|
|
3214
|
+
if (l.type === le.ITEM_RECEIPT_UPDATED) {
|
|
3215
3215
|
const f = l.data.field, d = l.data.incomingValue, I = t[f];
|
|
3216
3216
|
d !== I && (m = {
|
|
3217
3217
|
...t,
|
|
@@ -3221,12 +3221,12 @@ function Lt(r, a) {
|
|
|
3221
3221
|
c.push(m);
|
|
3222
3222
|
}
|
|
3223
3223
|
for (const t of u)
|
|
3224
|
-
if (t.type ===
|
|
3224
|
+
if (t.type === le.ITEM_RECEIPT_CREATED) {
|
|
3225
3225
|
const n = new Date(t.data.createdAt), i = new Date(t.data.effectiveAt);
|
|
3226
3226
|
c.push({
|
|
3227
3227
|
...t.data,
|
|
3228
|
-
id: t.data.id ||
|
|
3229
|
-
prefix:
|
|
3228
|
+
id: t.data.id || R({
|
|
3229
|
+
prefix: O.Enum.deliveryOrder
|
|
3230
3230
|
}),
|
|
3231
3231
|
effectiveAt: J(n, i) ? void 0 : i.toISOString()
|
|
3232
3232
|
});
|
|
@@ -3235,8 +3235,8 @@ function Lt(r, a) {
|
|
|
3235
3235
|
for (const t of c)
|
|
3236
3236
|
t.id ? s.push(t) : (console.warn("Missing delivery order id, generating new id"), s.push({
|
|
3237
3237
|
...t,
|
|
3238
|
-
id:
|
|
3239
|
-
prefix:
|
|
3238
|
+
id: R({
|
|
3239
|
+
prefix: O.Enum.deliveryOrder
|
|
3240
3240
|
})
|
|
3241
3241
|
}));
|
|
3242
3242
|
return s;
|
|
@@ -3341,10 +3341,10 @@ function xn(r, a, u, c = !1) {
|
|
|
3341
3341
|
const f = !!u.processedAt, d = !!u.rejectedAt;
|
|
3342
3342
|
if (r.purchaseOrder.status === j.Enum.REQUESTING && (f || d))
|
|
3343
3343
|
continue;
|
|
3344
|
-
const p = r.purchaseOrderRequest[o] ? new Date(r.purchaseOrderRequest[o]).toISOString() : null,
|
|
3344
|
+
const p = r.purchaseOrderRequest[o] ? new Date(r.purchaseOrderRequest[o]).toISOString() : null, y = u[o] ? new Date(u[o]).toISOString() : null;
|
|
3345
3345
|
s.push({
|
|
3346
3346
|
type: G.PURCHASE_ORDER_REQUEST_UPDATED,
|
|
3347
|
-
message: K("Transfer Order", (n = r.purchaseOrder.netSuite) == null ? void 0 : n.id, o,
|
|
3347
|
+
message: K("Transfer Order", (n = r.purchaseOrder.netSuite) == null ? void 0 : n.id, o, y, p),
|
|
3348
3348
|
data: {
|
|
3349
3349
|
field: o,
|
|
3350
3350
|
incomingValue: r.purchaseOrderRequest[o],
|
|
@@ -3387,8 +3387,8 @@ function $n(r, a, u, c, s) {
|
|
|
3387
3387
|
const m = new Date(ie(u.purchaseOrder._id)), l = new Date(u.purchaseOrder.effectiveAt);
|
|
3388
3388
|
t = {
|
|
3389
3389
|
...u.purchaseOrder,
|
|
3390
|
-
_id: (s == null ? void 0 : s.purchaseOrderId) || u.purchaseOrder._id ||
|
|
3391
|
-
prefix:
|
|
3390
|
+
_id: (s == null ? void 0 : s.purchaseOrderId) || u.purchaseOrder._id || R({
|
|
3391
|
+
prefix: O.Enum.purchaseOrder
|
|
3392
3392
|
}),
|
|
3393
3393
|
effectiveAt: J(m, l) ? void 0 : l.toISOString(),
|
|
3394
3394
|
items: i
|
|
@@ -3453,16 +3453,16 @@ e.object({
|
|
|
3453
3453
|
incomingValue: e.any(),
|
|
3454
3454
|
existingValue: e.any()
|
|
3455
3455
|
});
|
|
3456
|
-
var
|
|
3456
|
+
var ye;
|
|
3457
3457
|
(function(r) {
|
|
3458
3458
|
r.PURCHASE_ORDER_CREATED = "PURCHASE_ORDER_CREATED", r.PURCHASE_ORDER_UPDATED = "PURCHASE_ORDER_UPDATED", r.ITEM_RECEIPT_CREATED = "ITEM_RECEIPT_CREATED", r.ITEM_RECEIPT_UPDATED = "ITEM_RECEIPT_UPDATED", r.ITEM_RECEIPT_DELETED = "ITEM_RECEIPT_DELETED", r.ITEM_RECEIPT_ITEM_CREATED = "ITEM_RECEIPT_ITEM_CREATED", r.ITEM_RECEIPT_ITEM_UPDATED = "ITEM_RECEIPT_ITEM_UPDATED", r.ITEM_RECEIPT_ITEM_DELETED = "ITEM_RECEIPT_ITEM_DELETED";
|
|
3459
|
-
})(
|
|
3459
|
+
})(ye || (ye = {}));
|
|
3460
3460
|
function jn(r, a) {
|
|
3461
3461
|
var s;
|
|
3462
3462
|
const u = [];
|
|
3463
3463
|
if (!a)
|
|
3464
3464
|
return u.push({
|
|
3465
|
-
type:
|
|
3465
|
+
type: ye.PURCHASE_ORDER_CREATED,
|
|
3466
3466
|
message: "Purchase order not found",
|
|
3467
3467
|
data: r
|
|
3468
3468
|
}), u.push(..._e(r.items, [], "", "2")), u;
|
|
@@ -3491,7 +3491,7 @@ function jn(r, a) {
|
|
|
3491
3491
|
continue;
|
|
3492
3492
|
const m = i && typeof i == "string" ? new Date(i).toISOString() : null, l = o && typeof o == "string" ? new Date(o).toISOString() : null;
|
|
3493
3493
|
u.push({
|
|
3494
|
-
type:
|
|
3494
|
+
type: ye.PURCHASE_ORDER_UPDATED,
|
|
3495
3495
|
message: K("Purchase Order", (s = r.netSuite) == null ? void 0 : s.id, t, l, m),
|
|
3496
3496
|
data: {
|
|
3497
3497
|
field: t,
|
|
@@ -3501,7 +3501,7 @@ function jn(r, a) {
|
|
|
3501
3501
|
});
|
|
3502
3502
|
}
|
|
3503
3503
|
}
|
|
3504
|
-
return u.push(...
|
|
3504
|
+
return u.push(...Ot((a == null ? void 0 : a.deliveryOrder) ?? [], r.deliveryOrder ?? [], a ? (a == null ? void 0 : a.version) || "1" : r.version)), u;
|
|
3505
3505
|
}
|
|
3506
3506
|
g(jn, "detectPurchaseOrderConflicts");
|
|
3507
3507
|
function Vn(r, a, u, c) {
|
|
@@ -3511,7 +3511,7 @@ function Vn(r, a, u, c) {
|
|
|
3511
3511
|
throw new Error("No order lines found");
|
|
3512
3512
|
if (s) {
|
|
3513
3513
|
for (const n of a)
|
|
3514
|
-
if (n.type ===
|
|
3514
|
+
if (n.type === ye.PURCHASE_ORDER_UPDATED) {
|
|
3515
3515
|
const i = n.data.field, o = n.data.incomingValue, m = s[i];
|
|
3516
3516
|
o !== m && (s = {
|
|
3517
3517
|
...s,
|
|
@@ -3531,18 +3531,18 @@ function Vn(r, a, u, c) {
|
|
|
3531
3531
|
}
|
|
3532
3532
|
for (const n of a)
|
|
3533
3533
|
switch (n.type) {
|
|
3534
|
-
case
|
|
3534
|
+
case ye.PURCHASE_ORDER_CREATED:
|
|
3535
3535
|
const i = new Date(ie(u._id)), o = new Date(u.effectiveAt);
|
|
3536
3536
|
s = {
|
|
3537
3537
|
...u,
|
|
3538
|
-
_id: u._id ||
|
|
3539
|
-
prefix:
|
|
3538
|
+
_id: u._id || R({
|
|
3539
|
+
prefix: O.Enum.purchaseOrder
|
|
3540
3540
|
}),
|
|
3541
3541
|
effectiveAt: J(i, o) ? void 0 : o.toISOString(),
|
|
3542
3542
|
items: t
|
|
3543
3543
|
};
|
|
3544
3544
|
break;
|
|
3545
|
-
case
|
|
3545
|
+
case ye.PURCHASE_ORDER_UPDATED:
|
|
3546
3546
|
if (s) {
|
|
3547
3547
|
const m = n.data.field, l = n.data.incomingValue;
|
|
3548
3548
|
s[m], s = {
|
|
@@ -3696,15 +3696,15 @@ function Hn(r, a, u) {
|
|
|
3696
3696
|
};
|
|
3697
3697
|
}
|
|
3698
3698
|
g(Hn, "resolveUnitTypeConflicts");
|
|
3699
|
-
var
|
|
3699
|
+
var Ee;
|
|
3700
3700
|
(function(r) {
|
|
3701
3701
|
r.PURCHASE_ORDER_CREATED = "PURCHASE_ORDER_CREATED", r.PURCHASE_ORDER_UPDATED = "PURCHASE_ORDER_UPDATED";
|
|
3702
|
-
})(
|
|
3702
|
+
})(Ee || (Ee = {}));
|
|
3703
3703
|
function Kn(r, a) {
|
|
3704
3704
|
var c;
|
|
3705
3705
|
const u = [];
|
|
3706
3706
|
if (a || u.push({
|
|
3707
|
-
type:
|
|
3707
|
+
type: Ee.PURCHASE_ORDER_CREATED,
|
|
3708
3708
|
message: "Purchase order not found",
|
|
3709
3709
|
data: r
|
|
3710
3710
|
}), !a)
|
|
@@ -3748,7 +3748,7 @@ function Kn(r, a) {
|
|
|
3748
3748
|
o = i && typeof i == "string" ? new Date(i).toISOString() : null, m = n && typeof n == "string" ? new Date(n).toISOString() : null;
|
|
3749
3749
|
}
|
|
3750
3750
|
u.push({
|
|
3751
|
-
type:
|
|
3751
|
+
type: Ee.PURCHASE_ORDER_UPDATED,
|
|
3752
3752
|
message: K("Inventory Transfer", (c = r.netSuite) == null ? void 0 : c.id, t, o, m),
|
|
3753
3753
|
data: {
|
|
3754
3754
|
field: t,
|
|
@@ -3771,7 +3771,7 @@ function Yn(r, a, u, c) {
|
|
|
3771
3771
|
return c;
|
|
3772
3772
|
if (s) {
|
|
3773
3773
|
for (const n of a)
|
|
3774
|
-
if (n.type ===
|
|
3774
|
+
if (n.type === Ee.PURCHASE_ORDER_UPDATED) {
|
|
3775
3775
|
const i = n.data.field, o = n.data.incomingValue;
|
|
3776
3776
|
s = {
|
|
3777
3777
|
...s,
|
|
@@ -3785,18 +3785,18 @@ function Yn(r, a, u, c) {
|
|
|
3785
3785
|
}
|
|
3786
3786
|
for (const n of a)
|
|
3787
3787
|
switch (n.type) {
|
|
3788
|
-
case
|
|
3788
|
+
case Ee.PURCHASE_ORDER_CREATED:
|
|
3789
3789
|
const i = new Date(ie(u._id)), o = new Date(u.effectiveAt);
|
|
3790
3790
|
s = {
|
|
3791
3791
|
...u,
|
|
3792
|
-
_id: u._id ||
|
|
3793
|
-
prefix:
|
|
3792
|
+
_id: u._id || R({
|
|
3793
|
+
prefix: O.Enum.purchaseOrder
|
|
3794
3794
|
}),
|
|
3795
3795
|
effectiveAt: J(i, o) ? void 0 : o.toISOString(),
|
|
3796
3796
|
items: t
|
|
3797
3797
|
};
|
|
3798
3798
|
break;
|
|
3799
|
-
case
|
|
3799
|
+
case Ee.PURCHASE_ORDER_UPDATED:
|
|
3800
3800
|
if (s) {
|
|
3801
3801
|
const m = n.data.field, l = n.data.incomingValue, f = s[m];
|
|
3802
3802
|
if (m === "version" && l !== f)
|
|
@@ -4202,7 +4202,7 @@ function fi(r) {
|
|
|
4202
4202
|
};
|
|
4203
4203
|
}
|
|
4204
4204
|
g(fi, "transformChildToFdoNetSuiteItem");
|
|
4205
|
-
const
|
|
4205
|
+
const ue = Qt((r, a) => {
|
|
4206
4206
|
const u = Me(), c = Xt();
|
|
4207
4207
|
return a.onError(async (s) => {
|
|
4208
4208
|
if (s instanceof Wt)
|
|
@@ -4258,6 +4258,16 @@ const le = Qt((r, a) => {
|
|
|
4258
4258
|
const t = ((i = u.currentBusiness.value) == null ? void 0 : i._id) ?? "", n = `${r.netSuiteBackendUrl}/${t}/v2/inventory-item/${s}/average-cost`;
|
|
4259
4259
|
return await a.post(n);
|
|
4260
4260
|
},
|
|
4261
|
+
async getAllItemReplicas() {
|
|
4262
|
+
var n;
|
|
4263
|
+
const s = ((n = u.currentBusiness.value) == null ? void 0 : n._id) ?? "", t = `${r.netSuiteBackendUrl}/${s}/v2/sync/item-replica`;
|
|
4264
|
+
return await a.get(t);
|
|
4265
|
+
},
|
|
4266
|
+
async publishItemsToInventory() {
|
|
4267
|
+
var n;
|
|
4268
|
+
const s = ((n = u.currentBusiness.value) == null ? void 0 : n._id) ?? "", t = `${r.netSuiteBackendUrl}/${s}/v2/sync/publish-items-to-inventory`;
|
|
4269
|
+
return await a.post(t);
|
|
4270
|
+
},
|
|
4261
4271
|
async createInventoryTransfer(s, t) {
|
|
4262
4272
|
var o;
|
|
4263
4273
|
const n = ((o = u.currentBusiness.value) == null ? void 0 : o._id) ?? "", i = `${r.netSuiteBackendUrl}/${n}/v2/inventory-transfer/${s}/create`;
|
|
@@ -4319,7 +4329,7 @@ const le = Qt((r, a) => {
|
|
|
4319
4329
|
},
|
|
4320
4330
|
urls: r
|
|
4321
4331
|
};
|
|
4322
|
-
}), Ii = { class: "flex flex-col" }, pi = { class: "text-sm" }, gi = { class: "text-sm" },
|
|
4332
|
+
}), Ii = { class: "flex flex-col" }, pi = { class: "text-sm" }, gi = { class: "text-sm" }, yi = { class: "text-sm" }, Ei = { 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 = {
|
|
4323
4333
|
key: 0,
|
|
4324
4334
|
class: "text-xs"
|
|
4325
4335
|
}, hi = {
|
|
@@ -4347,7 +4357,7 @@ const le = Qt((r, a) => {
|
|
|
4347
4357
|
code: "",
|
|
4348
4358
|
name: "",
|
|
4349
4359
|
childName: ""
|
|
4350
|
-
}), i =
|
|
4360
|
+
}), i = Oi(), o = Me(), m = me(() => {
|
|
4351
4361
|
var d;
|
|
4352
4362
|
const f = `business_${((d = o.currentBusiness.value) == null ? void 0 : d._id) ?? ""}`;
|
|
4353
4363
|
return $e[f].code;
|
|
@@ -4356,8 +4366,8 @@ const le = Qt((r, a) => {
|
|
|
4356
4366
|
return `Overwrite with "${f ?? "N/A"}"`;
|
|
4357
4367
|
}
|
|
4358
4368
|
return (f, d) => {
|
|
4359
|
-
const I = ke("FmButton"), p = ke("FmLabel"),
|
|
4360
|
-
return z(), tn(
|
|
4369
|
+
const I = ke("FmButton"), p = ke("FmLabel"), y = ke("FmSelect"), E = ke("FmDialog");
|
|
4370
|
+
return z(), tn(E, {
|
|
4361
4371
|
modelValue: s.value,
|
|
4362
4372
|
"onUpdate:modelValue": d[4] || (d[4] = (_) => s.value = _),
|
|
4363
4373
|
overlay: !0,
|
|
@@ -4381,7 +4391,7 @@ const le = Qt((r, a) => {
|
|
|
4381
4391
|
])),
|
|
4382
4392
|
"dialog-footer": re(() => [
|
|
4383
4393
|
M("div", Fi, [
|
|
4384
|
-
f.readonly ? Ae("", !0) : (z(), ae(
|
|
4394
|
+
f.readonly ? Ae("", !0) : (z(), ae(Re, { key: 0 }, [
|
|
4385
4395
|
d[17] || (d[17] = M("span", { class: "text-sm mb-2 font-bold" }, " This will overwrite the code and uom only.", -1)),
|
|
4386
4396
|
M("div", wi, [
|
|
4387
4397
|
oe(I, {
|
|
@@ -4431,9 +4441,9 @@ const le = Qt((r, a) => {
|
|
|
4431
4441
|
])),
|
|
4432
4442
|
_: 1
|
|
4433
4443
|
}),
|
|
4434
|
-
M("span",
|
|
4444
|
+
M("span", yi, x(f.sku.unit.name), 1)
|
|
4435
4445
|
]),
|
|
4436
|
-
f.readonly ? (z(), ae(
|
|
4446
|
+
f.readonly ? (z(), ae(Re, { key: 0 }, [
|
|
4437
4447
|
d[14] || (d[14] = M("hr", { class: "my-2" }, null, -1)),
|
|
4438
4448
|
oe(p, null, {
|
|
4439
4449
|
default: re(() => d[9] || (d[9] = [
|
|
@@ -4441,8 +4451,8 @@ const le = Qt((r, a) => {
|
|
|
4441
4451
|
])),
|
|
4442
4452
|
_: 1
|
|
4443
4453
|
}),
|
|
4444
|
-
M("div",
|
|
4445
|
-
(z(!0), ae(
|
|
4454
|
+
M("div", Ei, [
|
|
4455
|
+
(z(!0), ae(Re, null, nn(t.value, (_, S) => (z(), ae("div", {
|
|
4446
4456
|
key: S,
|
|
4447
4457
|
class: "rounded border-1 flex flex-col p-2"
|
|
4448
4458
|
}, [
|
|
@@ -4469,7 +4479,7 @@ const le = Qt((r, a) => {
|
|
|
4469
4479
|
]))), 128)),
|
|
4470
4480
|
t.value.length === 0 ? (z(), ae("span", hi, "No custom code found.")) : Ae("", !0)
|
|
4471
4481
|
])
|
|
4472
|
-
], 64)) : (z(), ae(
|
|
4482
|
+
], 64)) : (z(), ae(Re, { key: 1 }, [
|
|
4473
4483
|
d[16] || (d[16] = M("hr", { class: "my-2" }, null, -1)),
|
|
4474
4484
|
oe(p, null, {
|
|
4475
4485
|
default: re(() => d[15] || (d[15] = [
|
|
@@ -4477,7 +4487,7 @@ const le = Qt((r, a) => {
|
|
|
4477
4487
|
])),
|
|
4478
4488
|
_: 1
|
|
4479
4489
|
}),
|
|
4480
|
-
oe(
|
|
4490
|
+
oe(y, {
|
|
4481
4491
|
modelValue: n.value,
|
|
4482
4492
|
"onUpdate:modelValue": d[1] || (d[1] = (_) => n.value = _),
|
|
4483
4493
|
items: t.value,
|
|
@@ -4520,7 +4530,7 @@ const le = Qt((r, a) => {
|
|
|
4520
4530
|
name: "name"
|
|
4521
4531
|
}
|
|
4522
4532
|
};
|
|
4523
|
-
function
|
|
4533
|
+
function Ri() {
|
|
4524
4534
|
return {
|
|
4525
4535
|
setting: {
|
|
4526
4536
|
_id: "",
|
|
@@ -4537,11 +4547,12 @@ function Oi() {
|
|
|
4537
4547
|
skuSubsidiaries: {},
|
|
4538
4548
|
isReady: !1,
|
|
4539
4549
|
skuOptions: {},
|
|
4540
|
-
businessSubsidiaryName: ""
|
|
4550
|
+
businessSubsidiaryName: "",
|
|
4551
|
+
itemReplicas: []
|
|
4541
4552
|
};
|
|
4542
4553
|
}
|
|
4543
|
-
const T = He(
|
|
4544
|
-
function
|
|
4554
|
+
const T = He(Ri());
|
|
4555
|
+
function Oi() {
|
|
4545
4556
|
const r = Zt(), a = me(() => T.value.setting.items.groupBy("netSuiteId", (i) => i.id)), u = me(() => T.value.setting.units.flatMap((i) => i.measurements).groupBy("netSuiteId", (i) => i.id)), c = me(() => T.value.setting.items.groupBy((i) => i.id)), s = me(
|
|
4546
4557
|
() => T.value.setting.units.groupBy(
|
|
4547
4558
|
(i) => i.netSuiteId,
|
|
@@ -4593,7 +4604,7 @@ function Ri() {
|
|
|
4593
4604
|
continue;
|
|
4594
4605
|
const I = l.measurement, p = l.code;
|
|
4595
4606
|
if (!d.find(
|
|
4596
|
-
(
|
|
4607
|
+
(E) => E.value.code === p && E.value.fmMeasurementId === (I == null ? void 0 : I.id)
|
|
4597
4608
|
)) {
|
|
4598
4609
|
if (!I) {
|
|
4599
4610
|
o[m] = `Invalid custom code "${p}" for base unit "${f.unit.abbrev}".`;
|
|
@@ -4776,11 +4787,11 @@ function Ri() {
|
|
|
4776
4787
|
);
|
|
4777
4788
|
if (m.includeChildren) {
|
|
4778
4789
|
const I = T.value.setting.childItems.filter((p) => {
|
|
4779
|
-
let
|
|
4790
|
+
let y = p.subsidiaryIds;
|
|
4780
4791
|
if (p.includeChildren == !0)
|
|
4781
|
-
for (const
|
|
4782
|
-
|
|
4783
|
-
return
|
|
4792
|
+
for (const E of p.subsidiaryIds)
|
|
4793
|
+
y = y.concat(f[E]);
|
|
4794
|
+
return y = [...new Set(y)], p.parentNetSuiteId === m.netSuiteId && console.log(p), p.parentNetSuiteId === m.netSuiteId && y.some((E) => l.includes(E));
|
|
4784
4795
|
}).flatMap((p) => p.unitTypeId);
|
|
4785
4796
|
return T.value.setting.units.filter((p) => I.includes(p.netSuiteId)).flatMap((p) => p.measurements).map((p) => p.id);
|
|
4786
4797
|
}
|
|
@@ -4788,29 +4799,29 @@ function Ri() {
|
|
|
4788
4799
|
},
|
|
4789
4800
|
async readSetting() {
|
|
4790
4801
|
var m;
|
|
4791
|
-
const o = await
|
|
4802
|
+
const o = await ue().readSetting();
|
|
4792
4803
|
if (o) {
|
|
4793
4804
|
if (this.state.setting = o, (m = T.value.setting.subsidiaries) != null && m.length) {
|
|
4794
4805
|
const { flat: f, tree: d } = Z(T.value.setting.subsidiaries);
|
|
4795
4806
|
for (const p of o.vendors) {
|
|
4796
|
-
const
|
|
4797
|
-
this.state.vendorSubsidiary[p.id] = (
|
|
4807
|
+
const y = f.find((E) => E.id === p.subsidiaryId);
|
|
4808
|
+
this.state.vendorSubsidiary[p.id] = (y == null ? void 0 : y.fullName) || "";
|
|
4798
4809
|
}
|
|
4799
4810
|
for (const p of o.items) {
|
|
4800
|
-
const
|
|
4811
|
+
const y = [];
|
|
4801
4812
|
for (const _ of p.subsidiaryIds) {
|
|
4802
4813
|
const S = f.find((v) => v.id === _);
|
|
4803
|
-
S &&
|
|
4814
|
+
S && y.push(S.fullName || "");
|
|
4804
4815
|
}
|
|
4805
|
-
const
|
|
4816
|
+
const E = $t(
|
|
4806
4817
|
d,
|
|
4807
4818
|
p.subsidiaryIds,
|
|
4808
4819
|
p.includeChildren
|
|
4809
4820
|
);
|
|
4810
4821
|
this.state.skuSubsidiaries[p.id] = {
|
|
4811
4822
|
includeChildren: p.includeChildren,
|
|
4812
|
-
flattenedSubsidiaryNames:
|
|
4813
|
-
subsidiaryTree:
|
|
4823
|
+
flattenedSubsidiaryNames: y,
|
|
4824
|
+
subsidiaryTree: E
|
|
4814
4825
|
};
|
|
4815
4826
|
}
|
|
4816
4827
|
const I = f.find((p) => p.id === T.value.setting.subsidiaryId);
|
|
@@ -4845,18 +4856,22 @@ function Ri() {
|
|
|
4845
4856
|
this.state.isReady = !0;
|
|
4846
4857
|
},
|
|
4847
4858
|
async updateLocationConfigs(i) {
|
|
4848
|
-
const m = await
|
|
4859
|
+
const m = await ue().updateLocationConfigs(i);
|
|
4849
4860
|
m && (this.state.setting = m);
|
|
4850
4861
|
},
|
|
4851
4862
|
async updateSupplierConfigs(i) {
|
|
4852
|
-
const m = await
|
|
4863
|
+
const m = await ue().updateSupplierConfigs(i);
|
|
4853
4864
|
m && (this.state.setting = m);
|
|
4854
4865
|
},
|
|
4866
|
+
async getAllItemReplicas() {
|
|
4867
|
+
const i = ue();
|
|
4868
|
+
this.state.itemReplicas = await i.getAllItemReplicas();
|
|
4869
|
+
},
|
|
4855
4870
|
async getNetSuiteVendorOptions() {
|
|
4856
|
-
return await
|
|
4871
|
+
return await ue().getNetSuiteVendorOptions();
|
|
4857
4872
|
},
|
|
4858
4873
|
async getNetSuiteLocations() {
|
|
4859
|
-
const o = await
|
|
4874
|
+
const o = await ue().getNetSuiteLocation();
|
|
4860
4875
|
return console.log(o), o;
|
|
4861
4876
|
},
|
|
4862
4877
|
getVendorSubsidiaryName(i) {
|
|
@@ -4870,7 +4885,7 @@ function Ri() {
|
|
|
4870
4885
|
};
|
|
4871
4886
|
},
|
|
4872
4887
|
async syncPurchaseOrder(i, o) {
|
|
4873
|
-
const m =
|
|
4888
|
+
const m = ue();
|
|
4874
4889
|
let l = o;
|
|
4875
4890
|
if (!l) {
|
|
4876
4891
|
const f = Ce(), d = f.currentLocation.doc._id;
|
|
@@ -4883,17 +4898,17 @@ function Ri() {
|
|
|
4883
4898
|
const l = `business_${((p = Me().currentBusiness.value) == null ? void 0 : p._id) ?? ""}`, f = $e[l].code, d = c.value.get(i._id);
|
|
4884
4899
|
let I = null;
|
|
4885
4900
|
if (d && d.length > 0) {
|
|
4886
|
-
const
|
|
4887
|
-
|
|
4888
|
-
const
|
|
4901
|
+
const y = d[0];
|
|
4902
|
+
y[f] && (I = y[f]);
|
|
4903
|
+
const E = T.value.setting.units.find((S) => {
|
|
4889
4904
|
var v;
|
|
4890
4905
|
return S.id === ((v = i.unit) == null ? void 0 : v._id);
|
|
4891
|
-
}), _ =
|
|
4906
|
+
}), _ = y.netSuiteId;
|
|
4892
4907
|
if (o) {
|
|
4893
|
-
const S =
|
|
4908
|
+
const S = E == null ? void 0 : E.measurements.find((v) => v.id === o);
|
|
4894
4909
|
if (S) {
|
|
4895
4910
|
const v = ["ZPH"], N = T.value.setting.childItems.filter(
|
|
4896
|
-
(b) => b.parentNetSuiteId === _ && b.unitTypeId === (
|
|
4911
|
+
(b) => b.parentNetSuiteId === _ && b.unitTypeId === (E == null ? void 0 : E.netSuiteId) && b.unitOfMeasureId === S.netSuiteId && b.externalId && !v.some((D) => {
|
|
4897
4912
|
var F;
|
|
4898
4913
|
return (F = b.externalId) == null ? void 0 : F.startsWith(D);
|
|
4899
4914
|
})
|
|
@@ -4905,10 +4920,10 @@ function Ri() {
|
|
|
4905
4920
|
return I;
|
|
4906
4921
|
},
|
|
4907
4922
|
async getNetSuiteLocationOptions() {
|
|
4908
|
-
return await
|
|
4923
|
+
return await ue().getNetSuiteLocationOptions();
|
|
4909
4924
|
},
|
|
4910
4925
|
async getItemAverageCosts() {
|
|
4911
|
-
const i =
|
|
4926
|
+
const i = ue(), m = Ce().currentLocation.doc._id;
|
|
4912
4927
|
return await i.getItemAverageCosts(m);
|
|
4913
4928
|
}
|
|
4914
4929
|
};
|
|
@@ -4963,7 +4978,7 @@ function Li(r) {
|
|
|
4963
4978
|
}
|
|
4964
4979
|
}, d = o.childItems.reduce(
|
|
4965
4980
|
(I, p) => {
|
|
4966
|
-
const
|
|
4981
|
+
const y = a("code", void 0, p), E = a("name", void 0, p), _ = o.unit.measurements.find(
|
|
4967
4982
|
(b) => b.netSuiteId === p.unitOfMeasureId
|
|
4968
4983
|
);
|
|
4969
4984
|
let S = i.unit.measurements.find((b) => b.id === (_ == null ? void 0 : _.id)), v, C = S == null ? void 0 : S.abbrev;
|
|
@@ -4985,10 +5000,10 @@ function Li(r) {
|
|
|
4985
5000
|
}
|
|
4986
5001
|
const N = p.name || "N/A (childName not found)";
|
|
4987
5002
|
return I.push({
|
|
4988
|
-
label: `${N} (${
|
|
5003
|
+
label: `${N} (${y})`,
|
|
4989
5004
|
value: {
|
|
4990
|
-
code:
|
|
4991
|
-
name:
|
|
5005
|
+
code: y,
|
|
5006
|
+
name: E,
|
|
4992
5007
|
childName: N,
|
|
4993
5008
|
externalId: p.externalId || "N/A (externalId not found)",
|
|
4994
5009
|
fmMeasurementId: S == null ? void 0 : S.id,
|
|
@@ -5018,6 +5033,6 @@ const Pi = {
|
|
|
5018
5033
|
export {
|
|
5019
5034
|
Ke as S,
|
|
5020
5035
|
ki as _,
|
|
5021
|
-
|
|
5022
|
-
|
|
5036
|
+
ue as a,
|
|
5037
|
+
Oi as u
|
|
5023
5038
|
};
|