@feedmepos/mf-inventory-portal 0.0.23-dev.4 → 0.0.23-dev.6

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.
Files changed (58) hide show
  1. package/dist/{App-DReDvY0M.js → App-CpS8bz8y.js} +3 -3
  2. package/dist/{ApprovalView-BMZlYmRk.js → ApprovalView-BaAkilac.js} +4 -4
  3. package/dist/{BindingsDialog-Y2K4I7H7.js → BindingsDialog-2XXRx4lk.js} +2 -2
  4. package/dist/{BindingsPicker-DKBq9c37.js → BindingsPicker-Dvim94UE.js} +2 -2
  5. package/dist/{BindingsTable-45v4SDfp.js → BindingsTable-BqEaLZBo.js} +4 -4
  6. package/dist/{ClosingTemplateView-CKJVYSbj.js → ClosingTemplateView-CuiuCYbL.js} +10 -10
  7. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CMEOp-0r.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CjPxBy2G.js} +4 -4
  8. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BhdcqRh-.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-LohSJO6y.js} +2 -2
  9. package/dist/{FmMultiselectDialog-D7YtdoyJ.js → FmMultiselectDialog-BU399-z7.js} +3 -3
  10. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-C1DjyjyH.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BRdc0tSs.js} +2 -2
  11. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-zjvFEF5C.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-r9udN1Fi.js} +1 -1
  12. package/dist/{IngredientGroupView-BuP-HGeg.js → IngredientGroupView-DQDn5HC2.js} +5 -5
  13. package/dist/IngredientsView-BkmK9Km6.js +1665 -0
  14. package/dist/{IntegrationView-kYCaKG0o.js → IntegrationView-y3_6lfnA.js} +4 -4
  15. package/dist/{InventoryBindingForm-BXHq4h-n.js → InventoryBindingForm-DvoK_yl7.js} +1 -1
  16. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CVxJ_bV3.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-Bs4QnmyR.js} +5 -5
  17. package/dist/{InventoryBindingSummary-Bjasfc_v.js → InventoryBindingSummary-Bsb96T1i.js} +1 -1
  18. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DM0C4raP.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-hFoaEGZH.js} +1 -1
  19. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-C3O3JebE.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Bbn8JMZo.js} +2 -2
  20. package/dist/{PurchaseOrderPrintPreview-CmjkfTTS.js → PurchaseOrderPrintPreview-C-_BepiN.js} +1 -1
  21. package/dist/{ReceiveRequestView-aQZJO8sq.js → ReceiveRequestView-o4YjzcbG.js} +18 -18
  22. package/dist/{RecipeView-DXO43tFi.js → RecipeView-CKXz1qAw.js} +7 -7
  23. package/dist/{StockView-D9no-mrA.js → StockView-CyY8hbMg.js} +12 -12
  24. package/dist/{SupplierView-DAx7E7sR.js → SupplierView-fwI-Y9WB.js} +2334 -787
  25. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-0CSMleWi.js +1224 -0
  26. package/dist/{TransferTemplateView-CfxdQF1t.js → TransferTemplateView-BUbVs-yI.js} +13 -13
  27. package/dist/{UnitView-CQPGZ8-r.js → UnitView-CVbxV_LV.js} +5 -5
  28. package/dist/{WarehouseView-jy-RNCgy.js → WarehouseView-koM4j5Qo.js} +4 -4
  29. package/dist/api/netsuite.d.ts +1 -1
  30. package/dist/{app-KnSMkJBV.js → app-BRONF5GM.js} +755 -748
  31. package/dist/app.js +1 -1
  32. package/dist/{date2-CIeUqUIc.js → date2-BofoGJlV.js} +1 -1
  33. package/dist/{dayjs.min-Df5jSnDJ.js → dayjs.min-Byiq9_Vp.js} +1 -1
  34. package/dist/{decimal-BAc9M88Q.js → decimal-BB1foOxB.js} +1 -1
  35. package/dist/{defineDeepModel-BfuQAIoM.js → defineDeepModel-CJyeAQ6C.js} +1 -1
  36. package/dist/{feature-dwB4OxRQ.js → feature-CKZ3kQZ2.js} +12 -6
  37. package/dist/{format-time-from-id-BbvzyIN6.js → format-time-from-id-lup3KN2m.js} +1 -1
  38. package/dist/{format-unit-display-BBWblJEt.js → format-unit-display-CG-uhy8Z.js} +8 -8
  39. package/dist/{fuzzy-B9ryZ9VZ.js → fuzzy-B7mmyoPI.js} +1 -1
  40. package/dist/{index-BN0CY3sZ.js → index-B2CSxKjC.js} +27 -21
  41. package/dist/index-BLO8M-w8.js +12087 -0
  42. package/dist/{index-Bj1fJum-.js → index-Dy5RTqm_.js} +1 -1
  43. package/dist/netsuite-rb1w7C1L.js +225 -0
  44. package/dist/{rules-C12nWDD1.js → rules-CQex0PG8.js} +3 -2
  45. package/dist/stores/feature.d.ts +1 -0
  46. package/dist/stores/integration/netsuite.d.ts +68 -1
  47. package/dist/{supplier-DJC0UZWv.js → supplier-DnK2g2O2.js} +1 -1
  48. package/dist/tsconfig.app.tsbuildinfo +1 -1
  49. package/dist/{use-inventory-binding-dialog-PEQbFRvO.js → use-inventory-binding-dialog-C18erVXs.js} +2 -2
  50. package/dist/{use-template-enabled-locations-2-k9g5t8tt.js → use-template-enabled-locations-2-fcGKuJ6x.js} +2 -2
  51. package/dist/{xlsx-B4XHad7S.js → xlsx-KAYN3sog.js} +1 -1
  52. package/dist/{xlsx.util-BSO4SHJi.js → xlsx.util-_6KMttZO.js} +1 -1
  53. package/package.json +3 -3
  54. package/dist/IngredientsView-DMRN-odY.js +0 -1613
  55. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-DCA0RUfu.js +0 -1209
  56. package/dist/index-C4yL_7rR.js +0 -10545
  57. package/dist/netsuite-ByWOS6tI.js +0 -194
  58. package/dist/normalizeArguments-DP7Hrren.js +0 -1552
@@ -1,4 +1,4 @@
1
- import { J as h } from "./app-KnSMkJBV.js";
1
+ import { J as h } from "./app-BRONF5GM.js";
2
2
  var a = { exports: {} };
3
3
  function x(r, s = 100, u = {}) {
4
4
  if (typeof r != "function")
@@ -0,0 +1,225 @@
1
+ import { j as N, h as B, a as L, u as I } from "./app-BRONF5GM.js";
2
+ import { useCoreStore as $ } from "@feedmepos/mf-common";
3
+ import { useSnackbar as T } from "@feedmepos/ui-library";
4
+ import { ref as M, computed as p } from "vue";
5
+ const b = N((f, c) => {
6
+ const g = $(), l = T();
7
+ return c.onError(async (d) => {
8
+ if (d instanceof B)
9
+ throw l == null || l.open({
10
+ title: d.title,
11
+ message: d.message,
12
+ type: "error"
13
+ }), d;
14
+ }), {
15
+ async readSetting() {
16
+ var e;
17
+ const d = ((e = g.currentBusiness.value) == null ? void 0 : e._id) ?? "", m = `${f.netSuiteBackendUrl}/${d}/settings`;
18
+ return await c.get(m);
19
+ },
20
+ async syncTransferOrder(d, m, e) {
21
+ var t;
22
+ const i = ((t = g.currentBusiness.value) == null ? void 0 : t._id) ?? "", n = `${f.netSuiteBackendUrl}/${i}/sync/transfer-order`;
23
+ return await c.post(n, {
24
+ type: d,
25
+ id: m,
26
+ locationId: e
27
+ });
28
+ },
29
+ urls: f
30
+ };
31
+ });
32
+ function h() {
33
+ return {
34
+ setting: {
35
+ _id: "",
36
+ items: [],
37
+ childItems: [],
38
+ units: [],
39
+ locations: [],
40
+ subsidiaries: [],
41
+ vendors: [],
42
+ enable: !1,
43
+ syncedAt: null
44
+ },
45
+ vendorSubsidiary: {},
46
+ isReady: !1
47
+ };
48
+ }
49
+ const a = M(h());
50
+ function A() {
51
+ const f = L(), c = p(() => a.value.setting.items.groupBy("netSuiteId", (e) => e.id)), g = p(() => a.value.setting.units.flatMap((e) => e.measurements).groupBy("netSuiteId", (e) => e.id)), l = p(() => a.value.setting.items.groupBy((e) => e.id)), d = p(
52
+ () => a.value.setting.units.groupBy(
53
+ (e) => e.netSuiteId,
54
+ (e) => f.unitById[e.id]
55
+ )
56
+ ), m = p(
57
+ () => a.value.setting.units.flatMap(
58
+ (e) => e.measurements.map((i) => {
59
+ var n;
60
+ return {
61
+ unit: (n = d.value.get(e.netSuiteId)) == null ? void 0 : n[0],
62
+ measurement: i
63
+ };
64
+ })
65
+ ).groupBy(
66
+ (e) => e.measurement.netSuiteId,
67
+ (e) => {
68
+ var i;
69
+ return (i = e.unit) == null ? void 0 : i.measurements.find((n) => n.id === e.measurement.id);
70
+ }
71
+ )
72
+ );
73
+ return {
74
+ // state
75
+ get isReady() {
76
+ return a.value.isReady;
77
+ },
78
+ get isEnabled() {
79
+ return a.value.setting.enable;
80
+ },
81
+ get isBusinessLocation() {
82
+ return I().businessLevel;
83
+ },
84
+ get state() {
85
+ return a.value;
86
+ },
87
+ get netSuiteItemIdToSkuId() {
88
+ return c.value;
89
+ },
90
+ get netSuiteMeasurementIdToMeasurementId() {
91
+ return g.value;
92
+ },
93
+ get netSuiteItemBySkuId() {
94
+ return l.value;
95
+ },
96
+ get unitByNetsuiteId() {
97
+ return d.value;
98
+ },
99
+ get measurementByNetsuiteId() {
100
+ return m.value;
101
+ },
102
+ getNetSuiteVendor(e) {
103
+ return a.value.setting.vendors.find((i) => i.id === e);
104
+ },
105
+ getNetSuiteLocation(e) {
106
+ const [i, n] = e.split("_");
107
+ return a.value.setting.locations.find((r) => r.id == n && r.type == i);
108
+ },
109
+ getLocationSubsidiary(e) {
110
+ var r;
111
+ if (!e)
112
+ return {
113
+ id: void 0,
114
+ name: "",
115
+ fullName: ""
116
+ };
117
+ const i = ((r = a.value.setting.locations.find((s) => s.netSuiteId === e)) == null ? void 0 : r.subsidiaryId) ?? null, { flat: n } = y(a.value.setting.subsidiaries), t = n.find((s) => s.id === i);
118
+ return {
119
+ id: t == null ? void 0 : t.id,
120
+ name: (t == null ? void 0 : t.name) || "",
121
+ fullName: `${(t == null ? void 0 : t.fullName) ?? ""}`
122
+ };
123
+ },
124
+ currentLocationSubsidiary() {
125
+ var o;
126
+ const e = I(), i = e.currentLocation.doc._id, n = e.currentLocation.type, t = ((o = a.value.setting.locations.find(
127
+ (u) => u.id === i && u.type == n
128
+ )) == null ? void 0 : o.subsidiaryId) ?? null, { flat: r } = y(a.value.setting.subsidiaries), s = r.find((u) => u.id === t);
129
+ return {
130
+ id: s == null ? void 0 : s.id,
131
+ name: (s == null ? void 0 : s.name) || "",
132
+ fullName: `${(s == null ? void 0 : s.fullName) ?? ""}`
133
+ };
134
+ },
135
+ currentVendorSubsidiary(e) {
136
+ var r;
137
+ const i = ((r = a.value.setting.vendors.find((s) => s.id === e)) == null ? void 0 : r.subsidiaryId) ?? null, { flat: n } = y(a.value.setting.subsidiaries), t = n.find((s) => s.id === i);
138
+ return {
139
+ id: t == null ? void 0 : t.id,
140
+ name: (t == null ? void 0 : t.name) || "",
141
+ fullName: `${(t == null ? void 0 : t.fullName) ?? ""}`
142
+ };
143
+ },
144
+ get subsidiaryOptions() {
145
+ const { flat: e } = y(a.value.setting.subsidiaries);
146
+ return e.map((i) => ({
147
+ label: `${"   ".repeat(i.depth)}${i.name}`,
148
+ value: {
149
+ id: i.id,
150
+ name: i.name
151
+ }
152
+ }));
153
+ },
154
+ getAvailableItems(e) {
155
+ const { available: i } = y(a.value.setting.subsidiaries, e);
156
+ return a.value.setting.items.filter((n) => n.subsidiaryIds.some((t) => i.includes(t))).map((n) => n.id);
157
+ },
158
+ getAvailableMeasurements(e, i) {
159
+ const n = a.value.setting.items.find((u) => u.id === e);
160
+ if (!n)
161
+ return [];
162
+ const { available: t, flatMapping: r } = y(
163
+ a.value.setting.subsidiaries,
164
+ i
165
+ ), o = a.value.setting.childItems.filter((u) => {
166
+ let v = u.subsidiaryIds;
167
+ if (u.includeChildren == !0)
168
+ for (const S of u.subsidiaryIds)
169
+ v = v.concat(r[S]);
170
+ return v = [...new Set(v)], u.parentNetSuiteId === n.netSuiteId && v.some((S) => t.includes(S));
171
+ }).flatMap((u) => u.unitTypeId);
172
+ return a.value.setting.units.filter((u) => o.includes(u.netSuiteId)).flatMap((u) => u.measurements).map((u) => u.id);
173
+ },
174
+ async readSetting() {
175
+ console.log("netsuite init");
176
+ const i = await b().readSetting();
177
+ if (i) {
178
+ this.state.setting = i;
179
+ const { flat: n } = y(a.value.setting.subsidiaries);
180
+ for (const t of i.vendors) {
181
+ const r = n.find((s) => s.id === t.subsidiaryId);
182
+ this.state.vendorSubsidiary[t.id] = (r == null ? void 0 : r.fullName) || "";
183
+ }
184
+ }
185
+ this.state.isReady = !0;
186
+ },
187
+ getVendorSubsidiaryName(e) {
188
+ return this.state.vendorSubsidiary[e] || "";
189
+ },
190
+ async syncTransferOrder(e, i) {
191
+ const n = b(), t = I(), r = t.currentLocation.doc._id, s = t.currentLocation.type;
192
+ await n.syncTransferOrder(e, i, `${s}_${r}`);
193
+ }
194
+ };
195
+ }
196
+ function y(f, c) {
197
+ const g = [], l = [];
198
+ function d(n, t, r = !1) {
199
+ return f.filter((o) => o.parentId === t).map((o) => ((r || o.id === c || !c) && g.push(o.id), {
200
+ id: o.id,
201
+ name: o.name,
202
+ country: o.country,
203
+ currency: o.currency,
204
+ parentId: o.parentId,
205
+ depth: n,
206
+ children: d(n + 1, o.id, r || o.id === c)
207
+ }));
208
+ }
209
+ const m = d(0, null), e = {};
210
+ function i(n, t = "") {
211
+ const r = n.fullName || n.name, s = t ? `${t} : ${r}` : r;
212
+ l.push({ ...n, fullName: s }), e[n.id] = [n.id];
213
+ for (const o of n.children)
214
+ i(o, s), e[n.id].push(...e[o.id]);
215
+ }
216
+ return m.forEach((n) => i(n)), {
217
+ tree: m,
218
+ available: g,
219
+ flat: l,
220
+ flatMapping: e
221
+ };
222
+ }
223
+ export {
224
+ A as u
225
+ };
@@ -1,5 +1,5 @@
1
- import { F as s } from "./index-BN0CY3sZ.js";
2
- import { c as d, a as b } from "./date2-CIeUqUIc.js";
1
+ import { F as s } from "./index-B2CSxKjC.js";
2
+ import { c as d, a as b } from "./date2-BofoGJlV.js";
3
3
  function P(t, n) {
4
4
  return s.convertPrecision({
5
5
  value: t,
@@ -31,6 +31,7 @@ function F(t, n) {
31
31
  return t.precision >= n ? t : s.convertPrecision({ value: t, precision: n });
32
32
  }
33
33
  function h(t) {
34
+ if (t.amount === 0) return c(0);
34
35
  const n = a(t.amount), r = t.precision - n;
35
36
  return s.convertPrecision({ value: t, precision: Math.max(0, r) });
36
37
  }
@@ -10,4 +10,5 @@ export declare const useFeatureStore: () => {
10
10
  readonly enableSupplierMasterList: boolean;
11
11
  readonly mustUsePoTemplate: boolean;
12
12
  readonly mustUseDefaultCost: boolean;
13
+ readonly businessSupplierOnly: boolean;
13
14
  };
@@ -76,6 +76,73 @@ export declare function useNetSuiteStore(): {
76
76
  };
77
77
  readonly netSuiteItemIdToSkuId: Map<unknown, [string, ...string[]]>;
78
78
  readonly netSuiteMeasurementIdToMeasurementId: Map<unknown, [string, ...string[]]>;
79
+ readonly netSuiteItemBySkuId: Map<unknown, [{
80
+ pktCode?: string | null | undefined;
81
+ pktName?: string | null | undefined;
82
+ externalId?: string | null | undefined;
83
+ id: string;
84
+ netSuiteId: string;
85
+ unitTypeId: string;
86
+ unitOfMeasureId: string;
87
+ subsidiaryIds: string[];
88
+ includeChildren: boolean;
89
+ }, ...{
90
+ pktCode?: string | null | undefined;
91
+ pktName?: string | null | undefined;
92
+ externalId?: string | null | undefined;
93
+ id: string;
94
+ netSuiteId: string;
95
+ unitTypeId: string;
96
+ unitOfMeasureId: string;
97
+ subsidiaryIds: string[];
98
+ includeChildren: boolean;
99
+ }[]]>;
100
+ readonly unitByNetsuiteId: Map<unknown, [{
101
+ _id: string;
102
+ name: string;
103
+ abbrev: string;
104
+ precision: number;
105
+ measurements: {
106
+ id: string;
107
+ name: string;
108
+ abbrev: string;
109
+ conversion: {
110
+ amount: number;
111
+ precision: number;
112
+ };
113
+ }[];
114
+ }, ...{
115
+ _id: string;
116
+ name: string;
117
+ abbrev: string;
118
+ precision: number;
119
+ measurements: {
120
+ id: string;
121
+ name: string;
122
+ abbrev: string;
123
+ conversion: {
124
+ amount: number;
125
+ precision: number;
126
+ };
127
+ }[];
128
+ }[]]>;
129
+ readonly measurementByNetsuiteId: Map<unknown, [{
130
+ id: string;
131
+ name: string;
132
+ abbrev: string;
133
+ conversion: {
134
+ amount: number;
135
+ precision: number;
136
+ };
137
+ } | undefined, ...({
138
+ id: string;
139
+ name: string;
140
+ abbrev: string;
141
+ conversion: {
142
+ amount: number;
143
+ precision: number;
144
+ };
145
+ } | undefined)[]]>;
79
146
  getNetSuiteVendor(supplierId: string): FdoNetSuiteVendor | undefined;
80
147
  getNetSuiteLocation(locationId: string): FdoNetSuiteLocation | undefined;
81
148
  getLocationSubsidiary(netSuiteLocationId?: string | null): {
@@ -101,7 +168,7 @@ export declare function useNetSuiteStore(): {
101
168
  getAvailableMeasurements(skuId: string, subsidiaryId?: string | null): string[];
102
169
  readSetting(): Promise<void>;
103
170
  getVendorSubsidiaryName(supplierId: string): string;
104
- syncPurchaseOrder(purchaseOrderId: string): Promise<void>;
171
+ syncTransferOrder(type: string, id: string): Promise<void>;
105
172
  };
106
173
  export type FdoNetSuiteSubsidiaryWithChildren = FdoNetSuiteSubsidiary & {
107
174
  fullName?: string;
@@ -1,4 +1,4 @@
1
- import { j as m, u, i as y, p as b, q as v } from "./app-KnSMkJBV.js";
1
+ import { j as m, u, i as y, p as b, q as v } from "./app-BRONF5GM.js";
2
2
  import { useCoreStore as c } from "@feedmepos/mf-common";
3
3
  import { defineStore as w } from "pinia";
4
4
  import { ref as l, computed as d } from "vue";