@feedmepos/mf-inventory-portal 0.0.23-dev.31 → 0.0.23-dev.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/dist/{App-CEmWJ9lp.js → App-FsTwD8n6.js} +73 -85
  2. package/dist/{ApprovalView-jDll4AVe.js → ApprovalView-BXPFwc54.js} +27 -24
  3. package/dist/{BindingsDialog-BC_gRSif.js → BindingsDialog-CHkMKliu.js} +4 -4
  4. package/dist/{BindingsPicker-BJsGoBzM.js → BindingsPicker-D12ragAp.js} +9 -8
  5. package/dist/{BindingsTable-DSdwNK_q.js → BindingsTable-COag_o6k.js} +22 -18
  6. package/dist/{ClosingTemplateView-BzG16gl5.js → ClosingTemplateView-D8jKBDLt.js} +286 -272
  7. package/dist/FmDroppableField-8RzKjEdL.js +154 -0
  8. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DW2IOPST.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BQtdWZI5.js} +23 -22
  9. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-RNrM3eSt.js +436 -0
  10. package/dist/FmMultiselectDialog-BQVgChfN.js +415 -0
  11. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DDuZEf_v.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DECE_vKa.js} +49 -48
  12. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CiNvnaaE.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-BUy5XAra.js} +5 -5
  13. package/dist/{IngredientGroupView-DL8eBhkk.js → IngredientGroupView-C5W6TKVb.js} +69 -63
  14. package/dist/{IngredientsView-B_HC9fgq.js → IngredientsView-DS18EGAg.js} +253 -245
  15. package/dist/{IntegrationView-BeFT5S24.js → IntegrationView-BCXq5C_i.js} +95 -92
  16. package/dist/{InventoryBindingForm-DJ3uwq_X.js → InventoryBindingForm-D2oUHybU.js} +1 -1
  17. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DIviTipZ.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-Do_WCGzA.js} +27 -25
  18. package/dist/{InventoryBindingSummary-CvB5j9xq.js → InventoryBindingSummary-CTzl--8n.js} +1 -1
  19. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CQPdnXEF.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CrdZrQaL.js} +1 -1
  20. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BdscwUGn.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Ce01_vRB.js} +24 -23
  21. package/dist/{PurchaseOrderPrintPreview-3_6nBajH.js → PurchaseOrderPrintPreview-C_cUNqE4.js} +14 -13
  22. package/dist/{ReceiveRequestView-B_0UldQ7.js → ReceiveRequestView-iKUSCnjc.js} +1302 -1325
  23. package/dist/{RecipeView-D9p0Ou_I.js → RecipeView-9jSzsC2o.js} +85 -79
  24. package/dist/{StockView-TIdUgG3O.js → StockView-CkLx8c-q.js} +1446 -1338
  25. package/dist/{SupplierView-B1b9Otcr.js → SupplierView-zo_pVaja.js} +809 -2345
  26. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js +135 -0
  27. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-DVkVNrNG.js +1209 -0
  28. package/dist/TransferTemplateView-CkJs2zmu.js +1261 -0
  29. package/dist/{UnitView-BrpzJ7D3.js → UnitView-DdUCn3QX.js} +44 -40
  30. package/dist/{WarehouseView-CjbdEy8o.js → WarehouseView-BSKKIUlu.js} +100 -94
  31. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  32. package/dist/api/closing.d.ts +0 -1
  33. package/dist/api/netsuite.d.ts +3 -3
  34. package/dist/app-CVmmRPWd.js +33496 -0
  35. package/dist/app.d.ts +0 -56
  36. package/dist/app.js +2 -2
  37. package/dist/components/FmMultiselectDialogProps.d.ts +0 -1
  38. package/dist/components/row-action.enum.d.ts +0 -1
  39. package/dist/composable/defineDeepModel.d.ts +1 -1
  40. package/dist/date2-B8or025L.js +117 -0
  41. package/dist/dayjs.min-CIK0S4n6.js +282 -0
  42. package/dist/{decimal-DHYZglKx.js → decimal-DnON7sYp.js} +1 -1
  43. package/dist/defineDeepModel-ZvHrR7G4.js +13 -0
  44. package/dist/{feature-G-NnqKcY.js → feature-CfLuWtSb.js} +1 -1
  45. package/dist/format-time-from-id-DgZIvkJL.js +15 -0
  46. package/dist/{format-unit-display-BWqJsV_R.js → format-unit-display-BL51mLWH.js} +171 -162
  47. package/dist/fuzzy-BrZpb26S.js +41 -0
  48. package/dist/index-20AY5LL4.js +10545 -0
  49. package/dist/index-BHBzUsyp.js +45 -0
  50. package/dist/index-Cgi2fvdH.js +22283 -0
  51. package/dist/netsuite-C6f_DtMT.js +224 -0
  52. package/dist/normalizeArguments-DP7Hrren.js +1552 -0
  53. package/dist/router/name.d.ts +0 -2
  54. package/dist/row-action.enum-PMKMRrZR.js +50 -0
  55. package/dist/rules-CyLD3MFT.js +199 -0
  56. package/dist/stores/integration/netsuite.d.ts +2 -3
  57. package/dist/stores/inventory.d.ts +4 -1
  58. package/dist/style.css +1 -1
  59. package/dist/{supplier-DTUUR48O.js → supplier-pYrSAyO6.js} +15 -15
  60. package/dist/tsconfig.app.tsbuildinfo +1 -1
  61. package/dist/{use-inventory-binding-dialog-DvC_i-Ih.js → use-inventory-binding-dialog-BRfRiwVk.js} +11 -10
  62. package/dist/use-template-enabled-locations-2-BFm4_EuV.js +86 -0
  63. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +192 -24
  64. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +193 -25
  65. package/dist/views/receive-request/components/transfer-form/NetSuiteField.vue.d.ts +0 -2
  66. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +0 -6
  67. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +0 -9
  68. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +0 -9
  69. package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +2 -2
  70. package/dist/views/stock/helper/compute-summary-total.d.ts +2 -2
  71. package/dist/xlsx-BFsAkixf.js +24004 -0
  72. package/dist/xlsx.util-ClkX4qFH.js +78 -0
  73. package/package.json +1 -1
  74. package/dist/ClosingDraftView-UfWdRXb-.js +0 -1190
  75. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-jUYB4L8Y.js +0 -1275
  76. package/dist/TransferTemplateView-Dxk5b-2j.js +0 -1264
  77. package/dist/api/adjustment-template.d.ts +0 -23
  78. package/dist/api/closing-draft.d.ts +0 -6
  79. package/dist/app-AcMtTQ07.js +0 -84202
  80. package/dist/index-Bt8vaUdT.js +0 -12087
  81. package/dist/stock-VZXyPw2C.js +0 -125
  82. package/dist/views/adjustment-template/import/AdjustmentTemplateImport.vue.d.ts +0 -2
  83. package/dist/views/adjustment-template/import/AdjustmentTemplateImportItem.vue.d.ts +0 -18
  84. package/dist/views/adjustment-template/import/export.d.ts +0 -60
  85. package/dist/views/adjustment-template/wastage-template/WastageTemplateDetails.vue.d.ts +0 -2
  86. package/dist/views/adjustment-template/wastage-template/WastageTemplateDialog.vue.d.ts +0 -22
  87. package/dist/views/adjustment-template/wastage-template/WastageTemplatePublish.vue.d.ts +0 -6
  88. package/dist/views/adjustment-template/wastage-template/WastageTemplateView.vue.d.ts +0 -2
  89. package/dist/views/adjustment-template/wastage-template/actions.d.ts +0 -1295
  90. package/dist/views/adjustment-template/wastage-template/form/WastageTemplateForm.vue.d.ts +0 -16
  91. package/dist/views/adjustment-template/wastage-template/form/WastageTemplateItemTable.vue.d.ts +0 -35
  92. package/dist/views/adjustment-template/wastage-template/form/useAdjustmentTemplateItems.d.ts +0 -20
  93. package/dist/views/adjustment-template/wastage-template/props.d.ts +0 -29
  94. package/dist/views/adjustment-template/wastage-template/table.d.ts +0 -1273
  95. package/dist/views/closing-draft/ClosingDraftView.vue.d.ts +0 -2
  96. package/dist/views/closing-draft/components/closing-draft-action/ClosingDraftAction.vue.d.ts +0 -22
  97. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +0 -621
  98. package/dist/views/closing-draft/composables/use-closing-draft-actions.d.ts +0 -25
  99. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +0 -3621
  100. package/dist/views/closing-draft/helpers/draft-status-to-class-name.helper.d.ts +0 -1
  101. package/dist/views/closing-draft/helpers/export-draft.helper.d.ts +0 -19
  102. package/dist/views/closing-draft/helpers/get-calculated-total.helper.d.ts +0 -4
  103. package/dist/views/receive-request/components/netsuite/NetSuiteInfo.vue.d.ts +0 -12
  104. package/dist/views/receive-request/components/netsuite/NetSuiteProps.d.ts +0 -13
  105. package/dist/views/receive-request/components/netsuite/NetSuiteSync.vue.d.ts +0 -12
@@ -0,0 +1,224 @@
1
+ import { j as N, h as B, a as h, u as I } from "./app-CVmmRPWd.js";
2
+ import { useCoreStore as L } from "@feedmepos/mf-common";
3
+ import { useSnackbar as $ } from "@feedmepos/ui-library";
4
+ import { ref as M, computed as v } from "vue";
5
+ const b = N((g, c) => {
6
+ const y = L(), l = $();
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 = y.currentBusiness.value) == null ? void 0 : e._id) ?? "", m = `${g.netSuiteBackendUrl}/${d}/settings`;
18
+ return await c.get(m);
19
+ },
20
+ async syncPurchaseOrder(d, m) {
21
+ var t;
22
+ const e = ((t = y.currentBusiness.value) == null ? void 0 : t._id) ?? "", i = `${g.netSuiteBackendUrl}/${e}/sync/purchase-order`;
23
+ return await c.post(i, {
24
+ purchaseOrderId: d,
25
+ locationId: m
26
+ });
27
+ },
28
+ urls: g
29
+ };
30
+ });
31
+ function T() {
32
+ return {
33
+ setting: {
34
+ _id: "",
35
+ items: [],
36
+ childItems: [],
37
+ units: [],
38
+ locations: [],
39
+ subsidiaries: [],
40
+ vendors: [],
41
+ enable: !1,
42
+ syncedAt: null
43
+ },
44
+ vendorSubsidiary: {},
45
+ isReady: !1
46
+ };
47
+ }
48
+ const r = M(T());
49
+ function A() {
50
+ const g = h(), c = v(() => r.value.setting.items.groupBy("netSuiteId", (e) => e.id)), y = v(() => r.value.setting.units.flatMap((e) => e.measurements).groupBy("netSuiteId", (e) => e.id)), l = v(() => r.value.setting.items.groupBy((e) => e.id)), d = v(
51
+ () => r.value.setting.units.groupBy(
52
+ (e) => e.netSuiteId,
53
+ (e) => g.unitById[e.id]
54
+ )
55
+ ), m = v(
56
+ () => r.value.setting.units.flatMap(
57
+ (e) => e.measurements.map((i) => {
58
+ var t;
59
+ return {
60
+ unit: (t = d.value.get(e.netSuiteId)) == null ? void 0 : t[0],
61
+ measurement: i
62
+ };
63
+ })
64
+ ).groupBy(
65
+ (e) => e.measurement.netSuiteId,
66
+ (e) => {
67
+ var i;
68
+ return (i = e.unit) == null ? void 0 : i.measurements.find((t) => t.id === e.measurement.id);
69
+ }
70
+ )
71
+ );
72
+ return {
73
+ // state
74
+ get isReady() {
75
+ return r.value.isReady;
76
+ },
77
+ get isEnabled() {
78
+ return r.value.setting.enable;
79
+ },
80
+ get isBusinessLocation() {
81
+ return I().businessLevel;
82
+ },
83
+ get state() {
84
+ return r.value;
85
+ },
86
+ get netSuiteItemIdToSkuId() {
87
+ return c.value;
88
+ },
89
+ get netSuiteMeasurementIdToMeasurementId() {
90
+ return y.value;
91
+ },
92
+ get netSuiteItemBySkuId() {
93
+ return l.value;
94
+ },
95
+ get unitByNetsuiteId() {
96
+ return d.value;
97
+ },
98
+ get measurementByNetsuiteId() {
99
+ return m.value;
100
+ },
101
+ getNetSuiteVendor(e) {
102
+ return r.value.setting.vendors.find((i) => i.id === e);
103
+ },
104
+ getNetSuiteLocation(e) {
105
+ const [i, t] = e.split("_");
106
+ return r.value.setting.locations.find((s) => s.id == t && s.type == i);
107
+ },
108
+ getLocationSubsidiary(e) {
109
+ var s;
110
+ if (!e)
111
+ return {
112
+ id: void 0,
113
+ name: "",
114
+ fullName: ""
115
+ };
116
+ const i = ((s = r.value.setting.locations.find((a) => a.netSuiteId === e)) == null ? void 0 : s.subsidiaryId) ?? null, { flat: t } = f(r.value.setting.subsidiaries), n = t.find((a) => a.id === i);
117
+ return {
118
+ id: n == null ? void 0 : n.id,
119
+ name: (n == null ? void 0 : n.name) || "",
120
+ fullName: `${(n == null ? void 0 : n.fullName) ?? ""}`
121
+ };
122
+ },
123
+ currentLocationSubsidiary() {
124
+ var o;
125
+ const e = I(), i = e.currentLocation.doc._id, t = e.currentLocation.type, n = ((o = r.value.setting.locations.find(
126
+ (u) => u.id === i && u.type == t
127
+ )) == null ? void 0 : o.subsidiaryId) ?? null, { flat: s } = f(r.value.setting.subsidiaries), a = s.find((u) => u.id === n);
128
+ return {
129
+ id: a == null ? void 0 : a.id,
130
+ name: (a == null ? void 0 : a.name) || "",
131
+ fullName: `${(a == null ? void 0 : a.fullName) ?? ""}`
132
+ };
133
+ },
134
+ currentVendorSubsidiary(e) {
135
+ var s;
136
+ const i = ((s = r.value.setting.vendors.find((a) => a.id === e)) == null ? void 0 : s.subsidiaryId) ?? null, { flat: t } = f(r.value.setting.subsidiaries), n = t.find((a) => a.id === i);
137
+ return {
138
+ id: n == null ? void 0 : n.id,
139
+ name: (n == null ? void 0 : n.name) || "",
140
+ fullName: `${(n == null ? void 0 : n.fullName) ?? ""}`
141
+ };
142
+ },
143
+ get subsidiaryOptions() {
144
+ const { flat: e } = f(r.value.setting.subsidiaries);
145
+ return e.map((i) => ({
146
+ label: `${"   ".repeat(i.depth)}${i.name}`,
147
+ value: {
148
+ id: i.id,
149
+ name: i.name
150
+ }
151
+ }));
152
+ },
153
+ getAvailableItems(e) {
154
+ const { available: i } = f(r.value.setting.subsidiaries, e);
155
+ return r.value.setting.items.filter((t) => t.subsidiaryIds.some((n) => i.includes(n))).map((t) => t.id);
156
+ },
157
+ getAvailableMeasurements(e, i) {
158
+ const t = r.value.setting.items.find((u) => u.id === e);
159
+ if (!t)
160
+ return [];
161
+ const { available: n, flatMapping: s } = f(
162
+ r.value.setting.subsidiaries,
163
+ i
164
+ ), o = r.value.setting.childItems.filter((u) => {
165
+ let p = u.subsidiaryIds;
166
+ if (u.includeChildren == !0)
167
+ for (const S of u.subsidiaryIds)
168
+ p = p.concat(s[S]);
169
+ return p = [...new Set(p)], u.parentNetSuiteId === t.netSuiteId && p.some((S) => n.includes(S));
170
+ }).flatMap((u) => u.unitTypeId);
171
+ return r.value.setting.units.filter((u) => o.includes(u.netSuiteId)).flatMap((u) => u.measurements).map((u) => u.id);
172
+ },
173
+ async readSetting() {
174
+ console.log("netsuite init");
175
+ const i = await b().readSetting();
176
+ if (i) {
177
+ this.state.setting = i;
178
+ const { flat: t } = f(r.value.setting.subsidiaries);
179
+ for (const n of i.vendors) {
180
+ const s = t.find((a) => a.id === n.subsidiaryId);
181
+ this.state.vendorSubsidiary[n.id] = (s == null ? void 0 : s.fullName) || "";
182
+ }
183
+ }
184
+ this.state.isReady = !0;
185
+ },
186
+ getVendorSubsidiaryName(e) {
187
+ return this.state.vendorSubsidiary[e] || "";
188
+ },
189
+ async syncPurchaseOrder(e) {
190
+ const i = b(), t = I(), n = t.currentLocation.doc._id, s = t.currentLocation.type;
191
+ await i.syncPurchaseOrder(e, `${s}_${n}`);
192
+ }
193
+ };
194
+ }
195
+ function f(g, c) {
196
+ const y = [], l = [];
197
+ function d(t, n, s = !1) {
198
+ return g.filter((o) => o.parentId === n).map((o) => ((s || o.id === c || !c) && y.push(o.id), {
199
+ id: o.id,
200
+ name: o.name,
201
+ country: o.country,
202
+ currency: o.currency,
203
+ parentId: o.parentId,
204
+ depth: t,
205
+ children: d(t + 1, o.id, s || o.id === c)
206
+ }));
207
+ }
208
+ const m = d(0, null), e = {};
209
+ function i(t, n = "") {
210
+ const s = t.fullName || t.name, a = n ? `${n} : ${s}` : s;
211
+ l.push({ ...t, fullName: a }), e[t.id] = [t.id];
212
+ for (const o of t.children)
213
+ i(o, a), e[t.id].push(...e[o.id]);
214
+ }
215
+ return m.forEach((t) => i(t)), {
216
+ tree: m,
217
+ available: y,
218
+ flat: l,
219
+ flatMapping: e
220
+ };
221
+ }
222
+ export {
223
+ A as u
224
+ };