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

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 (107) hide show
  1. package/dist/{App-CEmWJ9lp.js → App-DReDvY0M.js} +73 -85
  2. package/dist/{ApprovalView-jDll4AVe.js → ApprovalView-BMZlYmRk.js} +27 -24
  3. package/dist/{BindingsDialog-BC_gRSif.js → BindingsDialog-Y2K4I7H7.js} +4 -4
  4. package/dist/{BindingsPicker-BJsGoBzM.js → BindingsPicker-DKBq9c37.js} +9 -8
  5. package/dist/{BindingsTable-DSdwNK_q.js → BindingsTable-45v4SDfp.js} +22 -18
  6. package/dist/{ClosingTemplateView-BzG16gl5.js → ClosingTemplateView-CKJVYSbj.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-CMEOp-0r.js} +23 -22
  9. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BhdcqRh-.js +436 -0
  10. package/dist/FmMultiselectDialog-D7YtdoyJ.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-C1DjyjyH.js} +49 -48
  12. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CiNvnaaE.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-zjvFEF5C.js} +5 -5
  13. package/dist/{IngredientGroupView-DL8eBhkk.js → IngredientGroupView-BuP-HGeg.js} +69 -63
  14. package/dist/IngredientsView-DMRN-odY.js +1613 -0
  15. package/dist/{IntegrationView-BeFT5S24.js → IntegrationView-kYCaKG0o.js} +95 -92
  16. package/dist/{InventoryBindingForm-DJ3uwq_X.js → InventoryBindingForm-BXHq4h-n.js} +1 -1
  17. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DIviTipZ.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CVxJ_bV3.js} +27 -25
  18. package/dist/{InventoryBindingSummary-CvB5j9xq.js → InventoryBindingSummary-Bjasfc_v.js} +1 -1
  19. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CQPdnXEF.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DM0C4raP.js} +1 -1
  20. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BdscwUGn.js → PremiumBadge.vue_vue_type_script_setup_true_lang-C3O3JebE.js} +24 -23
  21. package/dist/{PurchaseOrderPrintPreview-3_6nBajH.js → PurchaseOrderPrintPreview-CmjkfTTS.js} +14 -13
  22. package/dist/{ReceiveRequestView-B_0UldQ7.js → ReceiveRequestView-aQZJO8sq.js} +1302 -1325
  23. package/dist/{RecipeView-D9p0Ou_I.js → RecipeView-DXO43tFi.js} +85 -79
  24. package/dist/{StockView-TIdUgG3O.js → StockView-D9no-mrA.js} +1446 -1338
  25. package/dist/{SupplierView-B1b9Otcr.js → SupplierView-DAx7E7sR.js} +787 -2325
  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-DCA0RUfu.js +1209 -0
  28. package/dist/TransferTemplateView-CfxdQF1t.js +1261 -0
  29. package/dist/{UnitView-BrpzJ7D3.js → UnitView-CQPGZ8-r.js} +44 -40
  30. package/dist/{WarehouseView-CjbdEy8o.js → WarehouseView-jy-RNCgy.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-KnSMkJBV.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-CIeUqUIc.js +117 -0
  41. package/dist/dayjs.min-Df5jSnDJ.js +282 -0
  42. package/dist/{decimal-DHYZglKx.js → decimal-BAc9M88Q.js} +1 -1
  43. package/dist/defineDeepModel-BfuQAIoM.js +13 -0
  44. package/dist/{feature-G-NnqKcY.js → feature-dwB4OxRQ.js} +6 -12
  45. package/dist/format-time-from-id-BbvzyIN6.js +15 -0
  46. package/dist/{format-unit-display-BWqJsV_R.js → format-unit-display-BBWblJEt.js} +171 -162
  47. package/dist/fuzzy-B9ryZ9VZ.js +41 -0
  48. package/dist/index-BN0CY3sZ.js +22277 -0
  49. package/dist/index-Bj1fJum-.js +45 -0
  50. package/dist/index-C4yL_7rR.js +10545 -0
  51. package/dist/netsuite-ByWOS6tI.js +194 -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-C12nWDD1.js +198 -0
  56. package/dist/stores/feature.d.ts +0 -1
  57. package/dist/stores/integration/netsuite.d.ts +2 -70
  58. package/dist/stores/inventory.d.ts +4 -1
  59. package/dist/style.css +1 -1
  60. package/dist/{supplier-DTUUR48O.js → supplier-DJC0UZWv.js} +15 -15
  61. package/dist/tsconfig.app.tsbuildinfo +1 -1
  62. package/dist/{use-inventory-binding-dialog-DvC_i-Ih.js → use-inventory-binding-dialog-PEQbFRvO.js} +11 -10
  63. package/dist/use-template-enabled-locations-2-k9g5t8tt.js +86 -0
  64. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +192 -24
  65. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +193 -25
  66. package/dist/views/receive-request/components/transfer-form/NetSuiteField.vue.d.ts +0 -2
  67. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +0 -6
  68. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +0 -9
  69. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +0 -9
  70. package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +2 -2
  71. package/dist/views/stock/helper/compute-summary-total.d.ts +2 -2
  72. package/dist/xlsx-B4XHad7S.js +24004 -0
  73. package/dist/xlsx.util-BSO4SHJi.js +78 -0
  74. package/package.json +3 -3
  75. package/dist/ClosingDraftView-UfWdRXb-.js +0 -1190
  76. package/dist/IngredientsView-B_HC9fgq.js +0 -1657
  77. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-jUYB4L8Y.js +0 -1275
  78. package/dist/TransferTemplateView-Dxk5b-2j.js +0 -1264
  79. package/dist/api/adjustment-template.d.ts +0 -23
  80. package/dist/api/closing-draft.d.ts +0 -6
  81. package/dist/app-AcMtTQ07.js +0 -84202
  82. package/dist/index-Bt8vaUdT.js +0 -12087
  83. package/dist/stock-VZXyPw2C.js +0 -125
  84. package/dist/views/adjustment-template/import/AdjustmentTemplateImport.vue.d.ts +0 -2
  85. package/dist/views/adjustment-template/import/AdjustmentTemplateImportItem.vue.d.ts +0 -18
  86. package/dist/views/adjustment-template/import/export.d.ts +0 -60
  87. package/dist/views/adjustment-template/wastage-template/WastageTemplateDetails.vue.d.ts +0 -2
  88. package/dist/views/adjustment-template/wastage-template/WastageTemplateDialog.vue.d.ts +0 -22
  89. package/dist/views/adjustment-template/wastage-template/WastageTemplatePublish.vue.d.ts +0 -6
  90. package/dist/views/adjustment-template/wastage-template/WastageTemplateView.vue.d.ts +0 -2
  91. package/dist/views/adjustment-template/wastage-template/actions.d.ts +0 -1295
  92. package/dist/views/adjustment-template/wastage-template/form/WastageTemplateForm.vue.d.ts +0 -16
  93. package/dist/views/adjustment-template/wastage-template/form/WastageTemplateItemTable.vue.d.ts +0 -35
  94. package/dist/views/adjustment-template/wastage-template/form/useAdjustmentTemplateItems.d.ts +0 -20
  95. package/dist/views/adjustment-template/wastage-template/props.d.ts +0 -29
  96. package/dist/views/adjustment-template/wastage-template/table.d.ts +0 -1273
  97. package/dist/views/closing-draft/ClosingDraftView.vue.d.ts +0 -2
  98. package/dist/views/closing-draft/components/closing-draft-action/ClosingDraftAction.vue.d.ts +0 -22
  99. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +0 -621
  100. package/dist/views/closing-draft/composables/use-closing-draft-actions.d.ts +0 -25
  101. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +0 -3621
  102. package/dist/views/closing-draft/helpers/draft-status-to-class-name.helper.d.ts +0 -1
  103. package/dist/views/closing-draft/helpers/export-draft.helper.d.ts +0 -19
  104. package/dist/views/closing-draft/helpers/get-calculated-total.helper.d.ts +0 -4
  105. package/dist/views/receive-request/components/netsuite/NetSuiteInfo.vue.d.ts +0 -12
  106. package/dist/views/receive-request/components/netsuite/NetSuiteProps.d.ts +0 -13
  107. package/dist/views/receive-request/components/netsuite/NetSuiteSync.vue.d.ts +0 -12
@@ -0,0 +1,194 @@
1
+ import { j as b, h as S, u as p } from "./app-KnSMkJBV.js";
2
+ import { useCoreStore as I } from "@feedmepos/mf-common";
3
+ import { useSnackbar as N } from "@feedmepos/ui-library";
4
+ import { ref as h, computed as y } from "vue";
5
+ const v = b((m, l) => {
6
+ const t = I(), i = N();
7
+ return l.onError(async (n) => {
8
+ if (n instanceof S)
9
+ throw i == null || i.open({
10
+ title: n.title,
11
+ message: n.message,
12
+ type: "error"
13
+ }), n;
14
+ }), {
15
+ async readSetting() {
16
+ var s;
17
+ const n = ((s = t.currentBusiness.value) == null ? void 0 : s._id) ?? "", e = `${m.netSuiteBackendUrl}/${n}/settings`;
18
+ return await l.get(e);
19
+ },
20
+ async syncPurchaseOrder(n, e) {
21
+ var o;
22
+ const s = ((o = t.currentBusiness.value) == null ? void 0 : o._id) ?? "", a = `${m.netSuiteBackendUrl}/${s}/sync/purchase-order`;
23
+ return await l.post(a, {
24
+ purchaseOrderId: n,
25
+ locationId: e
26
+ });
27
+ },
28
+ urls: m
29
+ };
30
+ });
31
+ function L() {
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 u = h(L());
49
+ function w() {
50
+ const m = y(() => u.value.setting.items.groupBy("netSuiteId", (t) => t.id)), l = y(() => u.value.setting.units.flatMap((t) => t.measurements).groupBy("netSuiteId", (t) => t.id));
51
+ return {
52
+ // state
53
+ get isReady() {
54
+ return u.value.isReady;
55
+ },
56
+ get isEnabled() {
57
+ return u.value.setting.enable;
58
+ },
59
+ get isBusinessLocation() {
60
+ return p().businessLevel;
61
+ },
62
+ get state() {
63
+ return u.value;
64
+ },
65
+ get netSuiteItemIdToSkuId() {
66
+ return m.value;
67
+ },
68
+ get netSuiteMeasurementIdToMeasurementId() {
69
+ return l.value;
70
+ },
71
+ getNetSuiteVendor(t) {
72
+ return u.value.setting.vendors.find((i) => i.id === t);
73
+ },
74
+ getNetSuiteLocation(t) {
75
+ const [i, n] = t.split("_");
76
+ return u.value.setting.locations.find((s) => s.id == n && s.type == i);
77
+ },
78
+ getLocationSubsidiary(t) {
79
+ var s;
80
+ if (!t)
81
+ return {
82
+ id: void 0,
83
+ name: "",
84
+ fullName: ""
85
+ };
86
+ const i = ((s = u.value.setting.locations.find((a) => a.netSuiteId === t)) == null ? void 0 : s.subsidiaryId) ?? null, { flat: n } = g(u.value.setting.subsidiaries), e = n.find((a) => a.id === i);
87
+ return {
88
+ id: e == null ? void 0 : e.id,
89
+ name: (e == null ? void 0 : e.name) || "",
90
+ fullName: `${(e == null ? void 0 : e.fullName) ?? ""}`
91
+ };
92
+ },
93
+ currentLocationSubsidiary() {
94
+ var o;
95
+ const t = p(), i = t.currentLocation.doc._id, n = t.currentLocation.type, e = ((o = u.value.setting.locations.find(
96
+ (r) => r.id === i && r.type == n
97
+ )) == null ? void 0 : o.subsidiaryId) ?? null, { flat: s } = g(u.value.setting.subsidiaries), a = s.find((r) => r.id === e);
98
+ return {
99
+ id: a == null ? void 0 : a.id,
100
+ name: (a == null ? void 0 : a.name) || "",
101
+ fullName: `${(a == null ? void 0 : a.fullName) ?? ""}`
102
+ };
103
+ },
104
+ currentVendorSubsidiary(t) {
105
+ var s;
106
+ const i = ((s = u.value.setting.vendors.find((a) => a.id === t)) == null ? void 0 : s.subsidiaryId) ?? null, { flat: n } = g(u.value.setting.subsidiaries), e = n.find((a) => a.id === i);
107
+ return {
108
+ id: e == null ? void 0 : e.id,
109
+ name: (e == null ? void 0 : e.name) || "",
110
+ fullName: `${(e == null ? void 0 : e.fullName) ?? ""}`
111
+ };
112
+ },
113
+ get subsidiaryOptions() {
114
+ const { flat: t } = g(u.value.setting.subsidiaries);
115
+ return t.map((i) => ({
116
+ label: `${"   ".repeat(i.depth)}${i.name}`,
117
+ value: {
118
+ id: i.id,
119
+ name: i.name
120
+ }
121
+ }));
122
+ },
123
+ getAvailableItems(t) {
124
+ const { available: i } = g(u.value.setting.subsidiaries, t);
125
+ return u.value.setting.items.filter((n) => n.subsidiaryIds.some((e) => i.includes(e))).map((n) => n.id);
126
+ },
127
+ getAvailableMeasurements(t, i) {
128
+ const n = u.value.setting.items.find((r) => r.id === t);
129
+ if (!n)
130
+ return [];
131
+ const { available: e, flatMapping: s } = g(
132
+ u.value.setting.subsidiaries,
133
+ i
134
+ ), o = u.value.setting.childItems.filter((r) => {
135
+ let c = r.subsidiaryIds;
136
+ if (r.includeChildren == !0)
137
+ for (const f of r.subsidiaryIds)
138
+ c = c.concat(s[f]);
139
+ return c = [...new Set(c)], r.parentNetSuiteId === n.netSuiteId && c.some((f) => e.includes(f));
140
+ }).flatMap((r) => r.unitTypeId);
141
+ return u.value.setting.units.filter((r) => o.includes(r.netSuiteId)).flatMap((r) => r.measurements).map((r) => r.id);
142
+ },
143
+ async readSetting() {
144
+ console.log("netsuite init");
145
+ const i = await v().readSetting();
146
+ if (i) {
147
+ this.state.setting = i;
148
+ const { flat: n } = g(u.value.setting.subsidiaries);
149
+ for (const e of i.vendors) {
150
+ const s = n.find((a) => a.id === e.subsidiaryId);
151
+ this.state.vendorSubsidiary[e.id] = (s == null ? void 0 : s.fullName) || "";
152
+ }
153
+ }
154
+ this.state.isReady = !0;
155
+ },
156
+ getVendorSubsidiaryName(t) {
157
+ return this.state.vendorSubsidiary[t] || "";
158
+ },
159
+ async syncPurchaseOrder(t) {
160
+ const i = v(), n = p(), e = n.currentLocation.doc._id, s = n.currentLocation.type;
161
+ await i.syncPurchaseOrder(t, `${s}_${e}`);
162
+ }
163
+ };
164
+ }
165
+ function g(m, l) {
166
+ const t = [], i = [];
167
+ function n(o, r, c = !1) {
168
+ return m.filter((d) => d.parentId === r).map((d) => ((c || d.id === l || !l) && t.push(d.id), {
169
+ id: d.id,
170
+ name: d.name,
171
+ country: d.country,
172
+ currency: d.currency,
173
+ parentId: d.parentId,
174
+ depth: o,
175
+ children: n(o + 1, d.id, c || d.id === l)
176
+ }));
177
+ }
178
+ const e = n(0, null), s = {};
179
+ function a(o, r = "") {
180
+ const c = o.fullName || o.name, f = r ? `${r} : ${c}` : c;
181
+ i.push({ ...o, fullName: f }), s[o.id] = [o.id];
182
+ for (const d of o.children)
183
+ a(d, f), s[o.id].push(...s[d.id]);
184
+ }
185
+ return e.forEach((o) => a(o)), {
186
+ tree: e,
187
+ available: t,
188
+ flat: i,
189
+ flatMapping: s
190
+ };
191
+ }
192
+ export {
193
+ w as u
194
+ };