@feedmepos/mf-inventory-portal 0.0.23-dev.2 → 0.0.23-dev.21

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 (112) hide show
  1. package/dist/{App-DRE3c1lJ.js → App-CvIvF0fg.js} +59 -51
  2. package/dist/{ApprovalView-B4ZYcS3B.js → ApprovalView-BOn2HDVY.js} +20 -23
  3. package/dist/{BindingsDialog-Df1yrWHU.js → BindingsDialog-9qfADiSA.js} +7 -7
  4. package/dist/{BindingsPicker-BERMWh4w.js → BindingsPicker-CpV9uOqj.js} +7 -8
  5. package/dist/{BindingsTable-DRIapOWW.js → BindingsTable-BYScxUTj.js} +16 -20
  6. package/dist/ClosingDraftView-DM7-3zOd.js +1116 -0
  7. package/dist/{ClosingTemplateView-CbFn3Sdy.js → ClosingTemplateView-Cye5VPAM.js} +66 -76
  8. package/dist/{FmDroppableField-8RzKjEdL.js → FmDroppableField-AIKfZo3H.js} +1 -1
  9. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CQUsooGm.js +282 -0
  10. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BHSGZyJL.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CFQc-CBX.js} +121 -119
  11. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DH5IQchQ.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-2r8mut0B.js} +7 -7
  12. package/dist/{IngredientGroupView-DoETcEvV.js → IngredientGroupView-RNokzPJa.js} +30 -36
  13. package/dist/IngredientsView-M7K_GAEO.js +1660 -0
  14. package/dist/{IntegrationView-D1HeBiGF.js → IntegrationView-D9a8d1sO.js} +18 -20
  15. package/dist/{InventoryBindingForm-Dmz9BQ37.js → InventoryBindingForm-B0Gx5N1p.js} +1 -1
  16. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DoyqVBOd.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DEOudgKD.js} +15 -17
  17. package/dist/{InventoryBindingSummary-DrpwiRGZ.js → InventoryBindingSummary-C16Nc5aN.js} +1 -1
  18. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-yNEswIEI.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CZiypEex.js} +1 -1
  19. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-Br4_VUza.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BbYZwclN.js} +8 -8
  20. package/dist/{PurchaseOrderPrintPreview-cp671yWE.js → PurchaseOrderPrintPreview-DdKF8g0J.js} +13 -14
  21. package/dist/ReceiveRequestView-DBPRR6fz.js +4186 -0
  22. package/dist/{RecipeView-CD_dAWLo.js → RecipeView-CzUgVxKz.js} +58 -63
  23. package/dist/{StockView-DfUzFC1b.js → StockView-DCO3N1FS.js} +1338 -1446
  24. package/dist/{SupplierView-DB-zrNxh.js → SupplierView-CzV6DYSj.js} +2345 -783
  25. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-00pcY0qu.js +1228 -0
  26. package/dist/TransferTemplateView-uL5PId9-.js +1265 -0
  27. package/dist/{UnitView-BlC9-WOA.js → UnitView-d-mCs-cS.js} +40 -44
  28. package/dist/{WarehouseView-CgEY87Lo.js → WarehouseView-B7z8m-Hv.js} +67 -73
  29. package/dist/api/adjustment-template.d.ts +23 -0
  30. package/dist/api/bill.d.ts +2 -2
  31. package/dist/api/closing-draft.d.ts +6 -0
  32. package/dist/api/closing.d.ts +1 -0
  33. package/dist/api/netsuite.d.ts +69 -0
  34. package/dist/app-CTCC1zfY.js +58871 -0
  35. package/dist/app.d.ts +56 -0
  36. package/dist/app.js +2 -2
  37. package/dist/components/FmMinMaxInputRules.d.ts +4 -1
  38. package/dist/components/FmMultiselectDialogProps.d.ts +1 -0
  39. package/dist/components/row-action.enum.d.ts +1 -0
  40. package/dist/composable/defineDeepModel.d.ts +1 -1
  41. package/dist/{decimal-D7BCubZO.js → decimal-DhUR6QsF.js} +1 -1
  42. package/dist/{feature-BR-MsGYt.js → feature-DiGS5Fa4.js} +23 -9
  43. package/dist/format-unit-display-MRARpSlY.js +1210 -0
  44. package/dist/index-BSN3RnCl.js +12087 -0
  45. package/dist/netsuite-CIibMNer.js +251 -0
  46. package/dist/router/name.d.ts +2 -0
  47. package/dist/stock-COHpOTJk.js +110 -0
  48. package/dist/stores/feature.d.ts +2 -0
  49. package/dist/stores/integration/netsuite.d.ts +81 -0
  50. package/dist/stores/inventory.d.ts +1 -4
  51. package/dist/style.css +1 -1
  52. package/dist/{supplier-aBuwVukl.js → supplier-csNwTHYl.js} +15 -15
  53. package/dist/tsconfig.app.tsbuildinfo +1 -1
  54. package/dist/{use-inventory-binding-dialog-CLQ0LUmW.js → use-inventory-binding-dialog-172A48Xx.js} +10 -11
  55. package/dist/views/adjustment-template/wastage-template/WastageTemplateDetails.vue.d.ts +2 -0
  56. package/dist/views/adjustment-template/wastage-template/WastageTemplateDialog.vue.d.ts +22 -0
  57. package/dist/views/adjustment-template/wastage-template/WastageTemplatePublish.vue.d.ts +6 -0
  58. package/dist/views/adjustment-template/wastage-template/WastageTemplateView.vue.d.ts +2 -0
  59. package/dist/views/adjustment-template/wastage-template/actions.d.ts +1295 -0
  60. package/dist/views/adjustment-template/wastage-template/form/WastageTemplateForm.vue.d.ts +16 -0
  61. package/dist/views/adjustment-template/wastage-template/form/WastageTemplateItemTable.vue.d.ts +35 -0
  62. package/dist/views/adjustment-template/wastage-template/form/useAdjustmentTemplateItems.d.ts +20 -0
  63. package/dist/views/adjustment-template/wastage-template/props.d.ts +29 -0
  64. package/dist/views/adjustment-template/wastage-template/table.d.ts +1273 -0
  65. package/dist/views/closing-draft/ClosingDraftView.vue.d.ts +2 -0
  66. package/dist/views/closing-draft/components/closing-draft-action/ClosingDraftAction.vue.d.ts +22 -0
  67. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +451 -0
  68. package/dist/views/closing-draft/composables/use-closing-draft-actions.d.ts +25 -0
  69. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +2601 -0
  70. package/dist/views/closing-draft/helpers/draft-status-to-class-name.helper.d.ts +1 -0
  71. package/dist/views/closing-draft/helpers/export-draft.helper.d.ts +19 -0
  72. package/dist/views/closing-draft/helpers/get-calculated-total.helper.d.ts +4 -0
  73. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +24 -192
  74. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +24 -192
  75. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +34 -34
  76. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +1 -0
  77. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +54 -54
  78. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +54 -54
  79. package/dist/views/receive-request/helper/check-netsuite-subsidiary.helper.d.ts +1 -0
  80. package/dist/views/stock/components/StockRecordCard.vue.d.ts +1 -1
  81. package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +2 -2
  82. package/dist/views/stock/helper/compute-summary-total.d.ts +2 -2
  83. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +8 -8
  84. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +96 -96
  85. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +96 -96
  86. package/dist/{xlsx-BbtURTDy.js → xlsx-CH-bhcOL.js} +1 -1
  87. package/dist/{xlsx.util-zYS4OJFi.js → xlsx.util-4aHI7W-Z.js} +1 -1
  88. package/package.json +3 -3
  89. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-7JYNssTm.js +0 -267
  90. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-KbYSywk2.js +0 -436
  91. package/dist/FmMultiselectDialog-Da9JMCYa.js +0 -415
  92. package/dist/IngredientsView-DHAhj9pV.js +0 -1613
  93. package/dist/ReceiveRequestView-C1WBlpho.js +0 -4082
  94. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js +0 -135
  95. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-2mzqFGCz.js +0 -1144
  96. package/dist/TransferTemplateView-CaAJrqU6.js +0 -1262
  97. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  98. package/dist/app-CAyFhmAz.js +0 -33457
  99. package/dist/date2-D9i5izMt.js +0 -117
  100. package/dist/dayjs.min-SJKP9zBL.js +0 -282
  101. package/dist/defineDeepModel-DS4Shctf.js +0 -13
  102. package/dist/format-time-from-id-CUby60uW.js +0 -15
  103. package/dist/format-unit-display-D25Al2JZ.js +0 -1198
  104. package/dist/fuzzy-BryBtMz_.js +0 -41
  105. package/dist/index-ByJbUSIQ.js +0 -45
  106. package/dist/index-CFA_VFyX.js +0 -10545
  107. package/dist/index-CTvgBOum.js +0 -22280
  108. package/dist/netsuite-D0G4B60k.js +0 -146
  109. package/dist/normalizeArguments-DP7Hrren.js +0 -1552
  110. package/dist/row-action.enum-PMKMRrZR.js +0 -50
  111. package/dist/rules-DxVY0b7F.js +0 -198
  112. package/dist/use-template-enabled-locations-2-BgTiwy_3.js +0 -86
@@ -0,0 +1,251 @@
1
+ import { N as L, m as $, a as M, u as N } from "./app-CTCC1zfY.js";
2
+ import { useCoreStore as _ } from "@feedmepos/mf-common";
3
+ import { useSnackbar as k } from "@feedmepos/ui-library";
4
+ import { ref as C, computed as S } from "vue";
5
+ const h = L((g, l) => {
6
+ const p = _(), m = k();
7
+ return l.onError(async (o) => {
8
+ if (o instanceof $)
9
+ throw m == null || m.open({
10
+ title: o.title,
11
+ message: o.message,
12
+ type: "error"
13
+ }), o;
14
+ }), {
15
+ async readSetting() {
16
+ var e;
17
+ const o = ((e = p.currentBusiness.value) == null ? void 0 : e._id) ?? "", f = `${g.netSuiteBackendUrl}/${o}/settings`;
18
+ return await l.get(f);
19
+ },
20
+ async syncTransferOrder(o, f, e, i) {
21
+ var r;
22
+ const n = ((r = p.currentBusiness.value) == null ? void 0 : r._id) ?? "", t = `${g.netSuiteBackendUrl}/${n}/sync/transfer-order`;
23
+ return await l.post(t, {
24
+ type: o,
25
+ locationId: f,
26
+ purchaseOrderId: e,
27
+ purchaseOrderRequestId: i
28
+ });
29
+ },
30
+ urls: g
31
+ };
32
+ });
33
+ function O() {
34
+ return {
35
+ setting: {
36
+ _id: "",
37
+ items: [],
38
+ childItems: [],
39
+ units: [],
40
+ locations: [],
41
+ subsidiaries: [],
42
+ vendors: [],
43
+ enable: !1,
44
+ syncedAt: null
45
+ },
46
+ vendorSubsidiary: {},
47
+ isReady: !1
48
+ };
49
+ }
50
+ const a = C(O());
51
+ function E() {
52
+ const g = M(), l = S(() => a.value.setting.items.groupBy("netSuiteId", (e) => e.id)), p = S(() => a.value.setting.units.flatMap((e) => e.measurements).groupBy("netSuiteId", (e) => e.id)), m = S(() => a.value.setting.items.groupBy((e) => e.id)), o = S(
53
+ () => a.value.setting.units.groupBy(
54
+ (e) => e.netSuiteId,
55
+ (e) => g.unitById[e.id]
56
+ )
57
+ ), f = S(
58
+ () => a.value.setting.units.flatMap(
59
+ (e) => e.measurements.map((i) => {
60
+ var n;
61
+ return {
62
+ unit: (n = o.value.get(e.netSuiteId)) == null ? void 0 : n[0],
63
+ measurement: i
64
+ };
65
+ })
66
+ ).groupBy(
67
+ (e) => e.measurement.netSuiteId,
68
+ (e) => {
69
+ var i;
70
+ return (i = e.unit) == null ? void 0 : i.measurements.find((n) => n.id === e.measurement.id);
71
+ }
72
+ )
73
+ );
74
+ return {
75
+ // state
76
+ get isReady() {
77
+ return a.value.isReady;
78
+ },
79
+ get isEnabled() {
80
+ return a.value.setting.enable;
81
+ },
82
+ get isBusinessLocation() {
83
+ return N().businessLevel;
84
+ },
85
+ get state() {
86
+ return a.value;
87
+ },
88
+ get netSuiteItemIdToSkuId() {
89
+ return l.value;
90
+ },
91
+ get netSuiteMeasurementIdToMeasurementId() {
92
+ return p.value;
93
+ },
94
+ get netSuiteItemBySkuId() {
95
+ return m.value;
96
+ },
97
+ get unitByNetsuiteId() {
98
+ return o.value;
99
+ },
100
+ get measurementByNetsuiteId() {
101
+ return f.value;
102
+ },
103
+ getNetSuiteVendor(e) {
104
+ return a.value.setting.vendors.find((i) => i.id === e);
105
+ },
106
+ getNetSuiteLocation(e) {
107
+ const [i, n] = e.split("_");
108
+ return a.value.setting.locations.find((r) => r.id == n && r.type == i);
109
+ },
110
+ getLocationSubsidiary(e) {
111
+ var r;
112
+ if (!e)
113
+ return {
114
+ id: void 0,
115
+ name: "",
116
+ fullName: ""
117
+ };
118
+ 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);
119
+ return {
120
+ id: t == null ? void 0 : t.id,
121
+ name: (t == null ? void 0 : t.name) || "",
122
+ fullName: `${(t == null ? void 0 : t.fullName) ?? ""}`
123
+ };
124
+ },
125
+ currentLocationSubsidiary() {
126
+ var d;
127
+ const e = N(), i = e.currentLocation.doc._id, n = e.currentLocation.type, t = ((d = a.value.setting.locations.find(
128
+ (u) => u.id === i && u.type == n
129
+ )) == null ? void 0 : d.subsidiaryId) ?? null, { flat: r } = y(a.value.setting.subsidiaries), s = r.find((u) => u.id === t);
130
+ return {
131
+ id: s == null ? void 0 : s.id,
132
+ name: (s == null ? void 0 : s.name) || "",
133
+ fullName: `${(s == null ? void 0 : s.fullName) ?? ""}`
134
+ };
135
+ },
136
+ currentVendorSubsidiary(e) {
137
+ var r;
138
+ 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);
139
+ return {
140
+ id: t == null ? void 0 : t.id,
141
+ name: (t == null ? void 0 : t.name) || "",
142
+ fullName: `${(t == null ? void 0 : t.fullName) ?? ""}`
143
+ };
144
+ },
145
+ get subsidiaryOptions() {
146
+ const { flat: e } = y(a.value.setting.subsidiaries);
147
+ return e.map((i) => ({
148
+ label: `${"   ".repeat(i.depth)}${i.name}`,
149
+ value: {
150
+ id: i.id,
151
+ name: i.name
152
+ }
153
+ }));
154
+ },
155
+ getAvailableItems(e) {
156
+ const { available: i } = y(a.value.setting.subsidiaries, e);
157
+ return a.value.setting.items.filter((n) => n.subsidiaryIds.some((t) => i.includes(t))).map((n) => n.id);
158
+ },
159
+ getAvailableMeasurements(e, i) {
160
+ const n = a.value.setting.items.find((u) => u.id === e);
161
+ if (!n)
162
+ return [];
163
+ const { available: t, flatMapping: r } = y(
164
+ a.value.setting.subsidiaries,
165
+ i
166
+ ), d = a.value.setting.childItems.filter((u) => {
167
+ let c = u.subsidiaryIds;
168
+ if (u.includeChildren == !0)
169
+ for (const b of u.subsidiaryIds)
170
+ c = c.concat(r[b]);
171
+ return c = [...new Set(c)], u.parentNetSuiteId === n.netSuiteId && c.some((b) => t.includes(b));
172
+ }).flatMap((u) => u.unitTypeId);
173
+ return a.value.setting.units.filter((u) => d.includes(u.netSuiteId)).flatMap((u) => u.measurements).map((u) => u.id);
174
+ },
175
+ async readSetting() {
176
+ console.log("netsuite init");
177
+ const i = await h().readSetting();
178
+ if (i) {
179
+ this.state.setting = i;
180
+ const { flat: n } = y(a.value.setting.subsidiaries);
181
+ for (const t of i.vendors) {
182
+ const r = n.find((s) => s.id === t.subsidiaryId);
183
+ this.state.vendorSubsidiary[t.id] = (r == null ? void 0 : r.fullName) || "";
184
+ }
185
+ }
186
+ this.state.isReady = !0;
187
+ },
188
+ getVendorSubsidiaryName(e) {
189
+ return this.state.vendorSubsidiary[e] || "";
190
+ },
191
+ async syncTransferOrder(e, i, n) {
192
+ const t = h(), r = N(), s = r.currentLocation.doc._id, d = r.currentLocation.type;
193
+ await t.syncTransferOrder(e, `${d}_${s}`, i, n);
194
+ },
195
+ getItemPKTCode(e, i) {
196
+ const n = m.value.get(e._id);
197
+ let t = null;
198
+ if (n && n.length > 0) {
199
+ const r = n[0];
200
+ r.pktCode && (t = r.pktCode);
201
+ const s = a.value.setting.units.find((u) => {
202
+ var c;
203
+ return u.id === ((c = e.unit) == null ? void 0 : c._id);
204
+ }), d = r.netSuiteId;
205
+ if (i) {
206
+ const u = s == null ? void 0 : s.measurements.find((c) => c.id === i);
207
+ if (u) {
208
+ const c = ["ZPH"], I = a.value.setting.childItems.filter(
209
+ (v) => v.parentNetSuiteId === d && v.unitTypeId === (s == null ? void 0 : s.netSuiteId) && v.unitOfMeasureId === u.netSuiteId && v.externalId && !c.some((T) => {
210
+ var B;
211
+ return (B = v.externalId) == null ? void 0 : B.startsWith(T);
212
+ })
213
+ )[0];
214
+ I && (I.pktCode && (t = I.pktCode), I.externalId && (t = I.externalId));
215
+ }
216
+ }
217
+ }
218
+ return t;
219
+ }
220
+ };
221
+ }
222
+ function y(g, l) {
223
+ const p = [], m = [];
224
+ function o(n, t, r = !1) {
225
+ return g.filter((d) => d.parentId === t).map((d) => ((r || d.id === l || !l) && p.push(d.id), {
226
+ id: d.id,
227
+ name: d.name,
228
+ country: d.country,
229
+ currency: d.currency,
230
+ parentId: d.parentId,
231
+ depth: n,
232
+ children: o(n + 1, d.id, r || d.id === l)
233
+ }));
234
+ }
235
+ const f = o(0, null), e = {};
236
+ function i(n, t = "") {
237
+ const r = n.fullName || n.name, s = t ? `${t} : ${r}` : r;
238
+ m.push({ ...n, fullName: s }), e[n.id] = [n.id];
239
+ for (const d of n.children)
240
+ i(d, s), e[n.id].push(...e[d.id]);
241
+ }
242
+ return f.forEach((n) => i(n)), {
243
+ tree: f,
244
+ available: p,
245
+ flat: m,
246
+ flatMapping: e
247
+ };
248
+ }
249
+ export {
250
+ E as u
251
+ };
@@ -5,6 +5,8 @@ export declare enum RouteName {
5
5
  UNIT = "UNIT",
6
6
  STOCK = "STOCK",
7
7
  CLOSING_TEMPLATE = "CLOSING_TEMPLATE",
8
+ CLOSING_DRAFT = "CLOSING_DRAFT",
9
+ WASTAGE_TEMPLATE = "WASTAGE_TEMPLATE",
8
10
  WAREHOUSE = "WAREHOUSE",
9
11
  RECEIVE_REQUEST = "RECEIVE_REQUEST",
10
12
  TRANSFER_TEMPLATE = "TRANSFER_TEMPLATE",
@@ -0,0 +1,110 @@
1
+ import { N as l, u as m, a as B, ae as k } from "./app-CTCC1zfY.js";
2
+ import { useCoreStore as p } from "@feedmepos/mf-common";
3
+ import { useSnackbar as v } from "@feedmepos/ui-library";
4
+ import { ref as y } from "vue";
5
+ const $ = l((o, t) => {
6
+ const s = m(), u = p(), c = v();
7
+ return t.onError(async (e) => {
8
+ e.name === "SvcForbiddenError" && (c == null || c.open({
9
+ title: e.title,
10
+ message: e.message,
11
+ type: "error"
12
+ }));
13
+ }), {
14
+ async readStockBalance() {
15
+ const e = s.currentLocationDBName, n = `${o.inventoryBackendUrl}/${e}/stock-balance`;
16
+ return await t.get(n);
17
+ },
18
+ async readSkuBalance() {
19
+ var r;
20
+ const e = s.currentLocationDBName, n = `${o.inventoryBackendUrl}/${e}/sku/balance`;
21
+ return (((r = u.currentBusiness.value) == null ? void 0 : r.menuVersion) ?? "") === "v3" ? await t.get(n) : await t.get(`${n}?useInventoryDoc=true`);
22
+ },
23
+ async readSingleAdjustment(e) {
24
+ const n = s.currentLocationDBName, a = `${o.inventoryBackendUrl}/${n}/adjustment`;
25
+ return await t.get(`${a}?adjustmentId=${e}`);
26
+ },
27
+ async readStockAdjustment(e, n, a) {
28
+ const r = s.currentLocationDBName, i = `${o.inventoryBackendUrl}/${r}/sku`;
29
+ return await t.get(`${i}?skuId=${e}&start=${n}&end=${a}`);
30
+ },
31
+ async convertSku(e) {
32
+ var i;
33
+ const n = s.currentLocationDBName, a = `${o.inventoryBackendUrl}/${n}/sku/convert`;
34
+ return (((i = u.currentBusiness.value) == null ? void 0 : i.menuVersion) ?? "") === "v3" ? await t.post(a, e) : await t.post(`${a}?useInventoryDoc=true`, e);
35
+ },
36
+ async adjustSku(e) {
37
+ var i;
38
+ const n = s.currentLocationDBName, a = `${o.inventoryBackendUrl}/${n}/sku/adjust`;
39
+ return (((i = u.currentBusiness.value) == null ? void 0 : i.menuVersion) ?? "") === "v3" ? await t.post(a, e) : await t.post(`${a}?useInventoryDoc=true`, e);
40
+ },
41
+ recalculation: {
42
+ getRecalculateAbility() {
43
+ var r;
44
+ const n = `business_${(r = u.currentBusiness.value) == null ? void 0 : r._id}`, a = `${o.inventoryBackendUrl}/${n}/stock/operations/recalculate`;
45
+ return t.get(a);
46
+ },
47
+ startRecalculateTask() {
48
+ var r;
49
+ const n = `business_${(r = u.currentBusiness.value) == null ? void 0 : r._id}`, a = `${o.inventoryBackendUrl}/${n}/stock/operations/recalculate?refundFromPreviousAdjustment=true`;
50
+ return t.post(a);
51
+ }
52
+ }
53
+ };
54
+ });
55
+ function S() {
56
+ return {
57
+ stockBalance: {
58
+ _id: "",
59
+ items: []
60
+ },
61
+ productBalance: []
62
+ };
63
+ }
64
+ const d = y(S()), N = () => {
65
+ const o = $();
66
+ return {
67
+ // state
68
+ get stockBalance() {
69
+ return d.value.stockBalance;
70
+ },
71
+ set stockBalance(t) {
72
+ d.value.stockBalance = t;
73
+ },
74
+ get productBalance() {
75
+ return d.value.productBalance;
76
+ },
77
+ set productBalance(t) {
78
+ d.value.productBalance = t;
79
+ },
80
+ // actions
81
+ async readStockBalance() {
82
+ this.stockBalance = await o.readStockBalance();
83
+ },
84
+ async readProductBalance() {
85
+ this.productBalance = [];
86
+ const t = B(), s = k({
87
+ recipes: t.recipes,
88
+ skus: t.skus,
89
+ inventoryBindingMapping: {},
90
+ stockBalance: this.stockBalance
91
+ // silent: true
92
+ });
93
+ function u(c, e) {
94
+ return Object.prototype.hasOwnProperty.call(c, e);
95
+ }
96
+ for (const c in s.convertCountdown)
97
+ if (u(s.convertCountdown, c)) {
98
+ const e = s.convertCountdown[c];
99
+ this.productBalance.push({
100
+ id: c,
101
+ count: e
102
+ });
103
+ }
104
+ }
105
+ };
106
+ };
107
+ export {
108
+ $ as a,
109
+ N as u
110
+ };
@@ -9,4 +9,6 @@ export declare const useFeatureStore: () => {
9
9
  readonly enablePoTemplate: boolean;
10
10
  readonly enableSupplierMasterList: boolean;
11
11
  readonly mustUsePoTemplate: boolean;
12
+ readonly mustUseDefaultCost: boolean;
13
+ readonly businessSupplierOnly: boolean;
12
14
  };
@@ -1,7 +1,10 @@
1
1
  export interface NetSuiteState {
2
2
  setting: Omit<FdoNetSuiteSetting, 'realm' | 'accessToken'>;
3
+ vendorSubsidiary: Record<string, string>;
4
+ isReady: boolean;
3
5
  }
4
6
  export declare function useNetSuiteStore(): {
7
+ readonly isReady: boolean;
5
8
  readonly isEnabled: boolean;
6
9
  readonly isBusinessLocation: boolean;
7
10
  readonly state: {
@@ -17,6 +20,7 @@ export declare function useNetSuiteStore(): {
17
20
  unitTypeId: string;
18
21
  unitOfMeasureId: string;
19
22
  subsidiaryIds: string[];
23
+ includeChildren: boolean;
20
24
  }[];
21
25
  locations: {
22
26
  type: "restaurant" | "warehouse";
@@ -39,6 +43,8 @@ export declare function useNetSuiteStore(): {
39
43
  parentNetSuiteId: string;
40
44
  unitTypeId: string;
41
45
  unitOfMeasureId: string;
46
+ subsidiaryIds: string[];
47
+ includeChildren: boolean;
42
48
  }[];
43
49
  units: {
44
50
  id: string;
@@ -47,6 +53,7 @@ export declare function useNetSuiteStore(): {
47
53
  netSuiteId: string;
48
54
  }[];
49
55
  netSuiteId: string;
56
+ baseUnitUnitOfMeasureId: string;
50
57
  }[];
51
58
  subsidiaries: {
52
59
  parentId?: string | undefined;
@@ -64,9 +71,78 @@ export declare function useNetSuiteStore(): {
64
71
  subsidiaryId: string;
65
72
  }[];
66
73
  };
74
+ vendorSubsidiary: Record<string, string>;
75
+ isReady: boolean;
67
76
  };
68
77
  readonly netSuiteItemIdToSkuId: Map<unknown, [string, ...string[]]>;
69
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)[]]>;
70
146
  getNetSuiteVendor(supplierId: string): FdoNetSuiteVendor | undefined;
71
147
  getNetSuiteLocation(locationId: string): FdoNetSuiteLocation | undefined;
72
148
  getLocationSubsidiary(netSuiteLocationId?: string | null): {
@@ -89,7 +165,11 @@ export declare function useNetSuiteStore(): {
89
165
  value: FdoPurchaseOrderSubsidiaryNetSuiteSetting;
90
166
  }[];
91
167
  getAvailableItems(subsidiaryId?: string | null): string[];
168
+ getAvailableMeasurements(skuId: string, subsidiaryId?: string | null): string[];
92
169
  readSetting(): Promise<void>;
170
+ getVendorSubsidiaryName(supplierId: string): string;
171
+ syncTransferOrder(type: string, poId: string, porId?: string): Promise<void>;
172
+ getItemPKTCode(sku: FdoInventorySku, measurementId?: string | null): string | null;
93
173
  };
94
174
  export type FdoNetSuiteSubsidiaryWithChildren = FdoNetSuiteSubsidiary & {
95
175
  fullName?: string;
@@ -100,4 +180,5 @@ export declare function buildSubsidiaryTree(data: FdoNetSuiteSubsidiary[], subsi
100
180
  tree: FdoNetSuiteSubsidiaryWithChildren[];
101
181
  available: string[];
102
182
  flat: FdoNetSuiteSubsidiaryWithChildren[];
183
+ flatMapping: Record<string, string[]>;
103
184
  };
@@ -1958,11 +1958,8 @@ export declare function useInventoryStore(): {
1958
1958
  };
1959
1959
  closing: {
1960
1960
  closedBy?: {
1961
- faceId?: unknown;
1962
1961
  name: string;
1963
- role: string;
1964
- _id: string;
1965
- passcode: string;
1962
+ id: string;
1966
1963
  } | null | undefined;
1967
1964
  _id?: string | undefined;
1968
1965
  skus?: {
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .fm-forecast-notification-low{background-color:var(--fm-color-system-red-100);color:var(--fm-color-system-red-400)}.fm-forecast-notification-mid{background-color:var(--fm-color-system-orange-100);color:var(--fm-color-system-orange-400)}.fm-forecast-notification-high{background-color:var(--fm-color-system-green-100);color:var(--fm-color-system-green-400)}.fm-forecast-notification-indicator{display:inline-block;height:12px;width:12px;border-radius:9999px}.fm-forecast-notification-indicator-low{background-color:var(--fm-color-system-red-400)}.fm-forecast-notification-indicator-mid{background-color:var(--fm-color-system-orange-400)}.fm-forecast-notification-indicator-high{background-color:var(--fm-color-system-green-400)}.fade-enter-active,.fade-leave-active{transition:opacity .5s ease}.fade-enter-from,.fade-leave-to{opacity:0}.fade-enter-active[data-v-fa6c2f94],.fade-leave-active[data-v-fa6c2f94]{transition:opacity .25s ease}.fade-enter[data-v-fa6c2f94],.fade-leave-to[data-v-fa6c2f94]{opacity:0}.fm-droppable-field[data-v-e121b2c1]{display:flex;flex-direction:column;gap:4px}.fm-droppable-field__container[data-v-e121b2c1]{position:relative;background-color:var(--fm-color-neutral-white);padding:12px;border-radius:8px;border-width:2px;border-style:dashed;border-color:var(--fm-color-neutral-gray-300);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center}.fm-droppable-field__container--disabled[data-v-e121b2c1]{cursor:not-allowed;color:var(--fm-color-neutral-gray-200);border-color:var(--fm-color-neutral-gray-200)}.fm-droppable-field__container--dragging[data-v-e121b2c1]{border-color:var(--fm-color-primary)}.fm-droppable-field__container--invalid[data-v-e121b2c1]{border-color:var(--fm-color-system-red-300)}.fm-droppable-field__container[data-v-e121b2c1]:hover:not(.fm-droppable-field__container--disabled){border-color:var(--fm-color-neutral-gray-400)}.fm-droppable-field__input[data-v-e121b2c1]{cursor:pointer;opacity:0;position:absolute;top:0;left:0;height:100%;width:100%}.fm-droppable-field__input[data-v-e121b2c1]:disabled{display:none;cursor:not-allowed}.map-button[data-v-272f5e8b]{border-top-width:1px;border-top-color:var(--fm-color-neutral-gray-200);color:var(--fm-color-neutral-gray-400);padding:.2rem 1rem;border-radius:8px}table[data-v-92a03d5c]{width:100%;border-spacing:unset;line-height:inherit}table td[data-v-92a03d5c],table th[data-v-92a03d5c]{padding:3px 5px;vertical-align:top}hr[data-v-92a03d5c]{border-collapse:unset;background:#888;height:2px;border:0px}.text-left[data-v-92a03d5c]{text-align:left}.text-right[data-v-92a03d5c]{text-align:right}.purchase-box[data-v-92a03d5c]{max-width:800px;margin:auto;padding:30px;border:1px solid #eee;box-shadow:0 0 10px #00000026;font-size:16px;line-height:1.5;font-family:Helvetica Neue,Helvetica,Helvetica,Arial,sans-serif;color:#555}.title[data-v-92a03d5c]{padding-bottom:0;font-size:30px;color:#333}.header[data-v-92a03d5c]{font-weight:600;color:#333}.sub-header[data-v-92a03d5c]{font-size:18px;color:#333}.caption[data-v-92a03d5c]{font-size:14px;color:#666}.address[data-v-92a03d5c]{font-size:16px;line-height:1.2;color:#666}.purchase-body[data-v-92a03d5c]{margin-top:30px}.item-header[data-v-92a03d5c]{border:0px;background:#ccc;color:#444}.v-enter-active[data-v-0fe980e2],.v-leave-active[data-v-0fe980e2]{transition:opacity .1s ease}.v-enter-from[data-v-0fe980e2],.v-leave-to[data-v-0fe980e2]{opacity:0}.fm-status-badge{font-size:.875rem;font-weight:600;line-height:1.125rem;letter-spacing:.0125em;text-decoration-line:none;border-radius:8px;display:flex;align-items:center;padding-left:8px;padding-right:8px;height:22px}.fm-status-badge-draft{background-color:var(--fm-color-neutral-gray-100);color:var(--fm-color-neutral-gray-500)}.fm-status-badge-receiving{background-color:var(--fm-color-system-blue-100);color:var(--fm-color-system-blue-400)}.fm-status-badge-cancel{background-color:var(--fm-color-system-red-100);color:var(--fm-color-system-red-400)}.fm-status-badge-complete{background-color:var(--fm-color-system-green-100);color:var(--fm-color-system-green-400)}.fm-status-badge-processing,.fm-status-badge-requesting{background-color:var(--fm-color-system-orange-100);color:var(--fm-color-system-orange-400)}.fm-status-badge-transfer-info,.fm-status-badge-info-secondary{background-color:var(--fm-color-system-blue-100);color:var(--fm-color-system-blue-400)}.fm-status-badge-success-secondary{background-color:var(--fm-color-system-green-100);color:var(--fm-color-system-green-400)}
1
+ .fade-enter-active,.fade-leave-active{transition:opacity .5s ease}.fade-enter-from,.fade-leave-to{opacity:0}.fade-enter-active[data-v-0b70e452],.fade-leave-active[data-v-0b70e452]{transition:opacity .25s ease}.fade-enter[data-v-0b70e452],.fade-leave-to[data-v-0b70e452]{opacity:0}.fm-forecast-notification-low{background-color:var(--fm-color-system-red-100);color:var(--fm-color-system-red-400)}.fm-forecast-notification-mid{background-color:var(--fm-color-system-orange-100);color:var(--fm-color-system-orange-400)}.fm-forecast-notification-high{background-color:var(--fm-color-system-green-100);color:var(--fm-color-system-green-400)}.fm-forecast-notification-indicator{display:inline-block;height:12px;width:12px;border-radius:9999px}.fm-forecast-notification-indicator-low{background-color:var(--fm-color-system-red-400)}.fm-forecast-notification-indicator-mid{background-color:var(--fm-color-system-orange-400)}.fm-forecast-notification-indicator-high{background-color:var(--fm-color-system-green-400)}.fm-droppable-field[data-v-e121b2c1]{display:flex;flex-direction:column;gap:4px}.fm-droppable-field__container[data-v-e121b2c1]{position:relative;background-color:var(--fm-color-neutral-white);padding:12px;border-radius:8px;border-width:2px;border-style:dashed;border-color:var(--fm-color-neutral-gray-300);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center}.fm-droppable-field__container--disabled[data-v-e121b2c1]{cursor:not-allowed;color:var(--fm-color-neutral-gray-200);border-color:var(--fm-color-neutral-gray-200)}.fm-droppable-field__container--dragging[data-v-e121b2c1]{border-color:var(--fm-color-primary)}.fm-droppable-field__container--invalid[data-v-e121b2c1]{border-color:var(--fm-color-system-red-300)}.fm-droppable-field__container[data-v-e121b2c1]:hover:not(.fm-droppable-field__container--disabled){border-color:var(--fm-color-neutral-gray-400)}.fm-droppable-field__input[data-v-e121b2c1]{cursor:pointer;opacity:0;position:absolute;top:0;left:0;height:100%;width:100%}.fm-droppable-field__input[data-v-e121b2c1]:disabled{display:none;cursor:not-allowed}.map-button[data-v-272f5e8b]{border-top-width:1px;border-top-color:var(--fm-color-neutral-gray-200);color:var(--fm-color-neutral-gray-400);padding:.2rem 1rem;border-radius:8px}table[data-v-92a03d5c]{width:100%;border-spacing:unset;line-height:inherit}table td[data-v-92a03d5c],table th[data-v-92a03d5c]{padding:3px 5px;vertical-align:top}hr[data-v-92a03d5c]{border-collapse:unset;background:#888;height:2px;border:0px}.text-left[data-v-92a03d5c]{text-align:left}.text-right[data-v-92a03d5c]{text-align:right}.purchase-box[data-v-92a03d5c]{max-width:800px;margin:auto;padding:30px;border:1px solid #eee;box-shadow:0 0 10px #00000026;font-size:16px;line-height:1.5;font-family:Helvetica Neue,Helvetica,Helvetica,Arial,sans-serif;color:#555}.title[data-v-92a03d5c]{padding-bottom:0;font-size:30px;color:#333}.header[data-v-92a03d5c]{font-weight:600;color:#333}.sub-header[data-v-92a03d5c]{font-size:18px;color:#333}.caption[data-v-92a03d5c]{font-size:14px;color:#666}.address[data-v-92a03d5c]{font-size:16px;line-height:1.2;color:#666}.purchase-body[data-v-92a03d5c]{margin-top:30px}.item-header[data-v-92a03d5c]{border:0px;background:#ccc;color:#444}.v-enter-active[data-v-fb8b7488],.v-leave-active[data-v-fb8b7488]{transition:opacity .1s ease}.v-enter-from[data-v-fb8b7488],.v-leave-to[data-v-fb8b7488]{opacity:0}.fm-status-badge{font-size:.875rem;font-weight:600;line-height:1.125rem;letter-spacing:.0125em;text-decoration-line:none;border-radius:8px;display:flex;align-items:center;padding-left:8px;padding-right:8px;height:22px}.fm-status-badge-draft{background-color:var(--fm-color-neutral-gray-100);color:var(--fm-color-neutral-gray-500)}.fm-status-badge-receiving{background-color:var(--fm-color-system-blue-100);color:var(--fm-color-system-blue-400)}.fm-status-badge-cancel{background-color:var(--fm-color-system-red-100);color:var(--fm-color-system-red-400)}.fm-status-badge-complete{background-color:var(--fm-color-system-green-100);color:var(--fm-color-system-green-400)}.fm-status-badge-processing,.fm-status-badge-requesting{background-color:var(--fm-color-system-orange-100);color:var(--fm-color-system-orange-400)}.fm-status-badge-transfer-info,.fm-status-badge-info-secondary{background-color:var(--fm-color-system-blue-100);color:var(--fm-color-system-blue-400)}.fm-status-badge-success-secondary{background-color:var(--fm-color-system-green-100);color:var(--fm-color-system-green-400)}
@@ -1,16 +1,16 @@
1
- import { j as m, u, i as y, p as b, q as v } from "./app-CAyFhmAz.js";
1
+ import { N as m, u, o as y, af as b, ag as v } from "./app-CTCC1zfY.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";
5
- const a = m((t, p) => {
6
- function i() {
5
+ const i = m((t, p) => {
6
+ function a() {
7
7
  var o;
8
8
  const s = c(), e = u(), r = e.businessLevel, n = `business_${((o = s.currentBusiness.value) == null ? void 0 : o._id) ?? ""}`, S = e.currentLocation.dbName;
9
9
  return r ? n : S;
10
10
  }
11
11
  return {
12
12
  async readSuppliers() {
13
- const s = i(), e = `${t.inventoryBackendUrl}/${s}/supplier`;
13
+ const s = a(), e = `${t.inventoryBackendUrl}/${s}/supplier`;
14
14
  return await p.get(e);
15
15
  },
16
16
  async readLocationSuppliers() {
@@ -23,40 +23,40 @@ const a = m((t, p) => {
23
23
  return await p.get(r);
24
24
  },
25
25
  async createSupplier(s) {
26
- const e = i(), r = `${t.inventoryBackendUrl}/${e}/supplier`;
26
+ const e = a(), r = `${t.inventoryBackendUrl}/${e}/supplier`;
27
27
  return await p.post(r, s);
28
28
  },
29
29
  async importSuppliers(s) {
30
- const e = i(), r = `${t.inventoryBackendUrl}/${e}/supplier/import`;
30
+ const e = a(), r = `${t.inventoryBackendUrl}/${e}/supplier/import`;
31
31
  return await p.post(r, s);
32
32
  },
33
33
  async updateSupplier(s) {
34
- const e = i(), r = `${t.inventoryBackendUrl}/${e}/supplier`;
34
+ const e = a(), r = `${t.inventoryBackendUrl}/${e}/supplier`;
35
35
  return await p.put(r, s);
36
36
  },
37
37
  async deleteSupplier(s) {
38
- const e = i(), r = `${t.inventoryBackendUrl}/${e}/supplier`;
38
+ const e = a(), r = `${t.inventoryBackendUrl}/${e}/supplier`;
39
39
  return await p.delete(r, s);
40
40
  }
41
41
  };
42
42
  }), f = w("supplier", () => {
43
- const t = l(new Array()), p = l(new Array()), i = d(() => [...t.value, ...p.value]), s = d(() => y(i.value, "_id"));
43
+ const t = l(new Array()), p = l(new Array()), a = d(() => [...t.value, ...p.value]), s = d(() => y(a.value, "_id"));
44
44
  return {
45
45
  async readSuppliers() {
46
- const e = a();
46
+ const e = i();
47
47
  t.value = await e.readLocationSuppliers(), p.value = await e.readBusinessSuppliers();
48
48
  },
49
49
  async createSupplier(e) {
50
- await a().createSupplier(e);
50
+ await i().createSupplier(e);
51
51
  },
52
52
  async updateSupplier(e) {
53
- await a().updateSupplier(e);
53
+ await i().updateSupplier(e);
54
54
  },
55
55
  async deleteSupplier(e) {
56
- await a().deleteSupplier(e);
56
+ await i().deleteSupplier(e);
57
57
  },
58
58
  async importSuppliers(e) {
59
- await a().importSuppliers(e);
59
+ await i().importSuppliers(e);
60
60
  },
61
61
  async init() {
62
62
  const e = b();
@@ -66,7 +66,7 @@ const a = m((t, p) => {
66
66
  throw r instanceof v || e.error("Error at reading suppliers"), r;
67
67
  }
68
68
  },
69
- suppliers: i,
69
+ suppliers: a,
70
70
  locationSuppliers: t,
71
71
  businessSuppliers: p,
72
72
  supplierById: s