@feedmepos/mf-inventory-portal 1.2.23 → 1.2.25-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.
Files changed (61) hide show
  1. package/dist/App-svECebjK.js +297 -0
  2. package/dist/{ApprovalView-C15FSJQX.js → ApprovalView-CMSf_J2n.js} +13 -13
  3. package/dist/{BindingsDialog-DyEAwfOs.js → BindingsDialog-DENEjolJ.js} +2 -2
  4. package/dist/{BindingsPicker-BwkIrvXh.js → BindingsPicker-BYImJRaj.js} +1 -1
  5. package/dist/{BindingsTable-DbSRsazC.js → BindingsTable-BrGqgucq.js} +1 -1
  6. package/dist/{ClosingDraftView-DkT7ssTD.js → ClosingDraftView-uGF3mkBd.js} +5 -4
  7. package/dist/ClosingHistoryView-BKgZsXZU.js +355 -0
  8. package/dist/{ClosingTemplateView-pdiWLX1d.js → ClosingTemplateView-BQmC4An_.js} +2 -2
  9. package/dist/{DeliveryOrderPrintPreview-B_bL2AV7.js → DeliveryOrderPrintPreview-CqfFyoTx.js} +9 -9
  10. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Dl4NAEX2.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CCTMmG94.js} +21 -21
  11. package/dist/{FmMultiselectDialog-CzoBlXFC.js → FmMultiselectDialog-_MlkbNly.js} +1 -1
  12. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-FLXqyc8j.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DmLhEVWi.js} +1 -1
  13. package/dist/{ImportView-BkW7pYIh.js → ImportView-D-d9ATVE.js} +4 -6
  14. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DgQwpfVr.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-CdX2Uvdb.js} +1 -1
  15. package/dist/{IngredientGroupView-BHUq8eUh.js → IngredientGroupView-BcaX4ZRX.js} +2 -2
  16. package/dist/{IngredientsView-DIVZSAFN.js → IngredientsView-DxA8tI-v.js} +7 -7
  17. package/dist/{IntegrationView-2flRWenk.js → IntegrationView-BtzwigHc.js} +141 -141
  18. package/dist/{InventoryBindingForm-CF9Szzug.js → InventoryBindingForm-CIlQbCPQ.js} +1 -1
  19. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-YxSxYZcR.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BH6zgB9N.js} +3 -3
  20. package/dist/{InventoryBindingSummary-c6MF5Yb4.js → InventoryBindingSummary-DCLkDnck.js} +1 -1
  21. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-NEHvo5li.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BdUVlwac.js} +1 -1
  22. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CJMpmYyw.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CNn57Gsw.js} +1 -1
  23. package/dist/{PublishView-C7Xdnzlh.js → PublishView-Cg56zsdv.js} +4 -4
  24. package/dist/{PurchaseOrderPrintPreview-5MhPoeTI.js → PurchaseOrderPrintPreview-ab3npDLz.js} +10 -10
  25. package/dist/{ReceiveRequestView-CN9BtJeF.js → ReceiveRequestView-CZ9GoTB3.js} +8 -8
  26. package/dist/{RecipeView-ClwA5F7r.js → RecipeView-DODYvOxp.js} +3 -3
  27. package/dist/{StockView-CQu_GA9L.js → StockView-P4B0_4cp.js} +18 -17
  28. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BzuVCffs.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DDGU8k4Y.js} +1 -1
  29. package/dist/{SupplierView-ChW6ZEn_.js → SupplierView-BBFEWOUO.js} +4 -4
  30. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CVoLy3lQ.js → TransferDetails.vue_vue_type_script_setup_true_lang-CUw4_F1q.js} +174 -174
  31. package/dist/{TransferTemplateView-BXcUq5zc.js → TransferTemplateView-CZapMuRF.js} +7 -7
  32. package/dist/{UnitView-C5cjS8t2.js → UnitView-BBBwzqJ-.js} +3 -3
  33. package/dist/{WarehouseView-YRF4ujMe.js → WarehouseView-Blc2Yput.js} +1 -1
  34. package/dist/api/closing.d.ts +1 -0
  35. package/dist/api/stock.d.ts +2 -44
  36. package/dist/{app-90sUA0QM.js → app-_mYLQuxf.js} +10546 -10269
  37. package/dist/app.d.ts +99 -0
  38. package/dist/app.js +1 -1
  39. package/dist/{decimal-wb2UYLZY.js → decimal-Cb5DEV38.js} +1 -1
  40. package/dist/{format-unit-display-H61kNrbU.js → format-unit-display-DH44zkQq.js} +20 -20
  41. package/dist/{import-export.helper-CvJtTj6v.js → import-export.helper-cLaJAcgW.js} +1 -1
  42. package/dist/{index-Cpl4tL8O.js → index-CCIRnIFI.js} +1 -1
  43. package/dist/{index-4YIXJDBZ.js → index-YHqLg0qR.js} +1 -1
  44. package/dist/{purchase-order-template-DJTIqx45.js → purchase-order-template-Dt5KDXNO.js} +1 -1
  45. package/dist/router/name.d.ts +1 -0
  46. package/dist/stock-CV3z7I58.js +74 -0
  47. package/dist/stock-CrjsQRTg.js +83 -0
  48. package/dist/stores/inventory.d.ts +1 -0
  49. package/dist/{supplier-CezSNyT3.js → supplier-CbaxXdZ-.js} +1 -1
  50. package/dist/tsconfig.app.tsbuildinfo +1 -1
  51. package/dist/{use-ingredient-select-dialog-BSTgdhQt.js → use-ingredient-select-dialog-CaEOT5eK.js} +1 -1
  52. package/dist/{use-inventory-binding-dialog-nVuvOIzy.js → use-inventory-binding-dialog-C6OfhRBn.js} +1 -1
  53. package/dist/views/closing-history/ClosingHistoryView.vue.d.ts +2 -0
  54. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +4 -2
  55. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +6 -3
  56. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +6 -3
  57. package/dist/views/stock/components/dialog/RecalculationDialog.vue.d.ts +11 -0
  58. package/dist/views/stock/components/dialog/RecalculationDialogProps.d.ts +3 -0
  59. package/package.json +1 -1
  60. package/dist/App-CzxvakHO.js +0 -286
  61. package/dist/stock-Cg3h8ddl.js +0 -146
@@ -1,5 +1,5 @@
1
1
  import { defineStore as y } from "pinia";
2
- import { a as S, x as b } from "./app-90sUA0QM.js";
2
+ import { a as S, x as b } from "./app-_mYLQuxf.js";
3
3
  import { useDialog as A } from "@feedmepos/ui-library";
4
4
  import { useI18n as I } from "@feedmepos/mf-common";
5
5
  const h = y(
@@ -1,4 +1,4 @@
1
- import { a as P, x as g } from "./app-90sUA0QM.js";
1
+ import { a as P, x as g } from "./app-_mYLQuxf.js";
2
2
  import { useDialog as E } from "@feedmepos/ui-library";
3
3
  function B() {
4
4
  const u = P(), _ = E();
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -1455,6 +1455,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
1455
1455
  additionalInfo?: any;
1456
1456
  id: string | null;
1457
1457
  } | null | undefined;
1458
+ adjustmentIds?: string[] | null | undefined;
1459
+ adjusmentIds?: string[] | null | undefined;
1458
1460
  _id: string;
1459
1461
  from: {
1460
1462
  name: string;
@@ -1464,7 +1466,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
1464
1466
  name: string;
1465
1467
  dbName: string;
1466
1468
  };
1467
- adjustmentIds: string[];
1468
1469
  purchaseOrderId: string;
1469
1470
  processedAt: string | null;
1470
1471
  rejectedAt: string | null;
@@ -2981,6 +2982,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
2981
2982
  additionalInfo?: any;
2982
2983
  id: string | null;
2983
2984
  } | null | undefined;
2985
+ adjustmentIds?: string[] | null | undefined;
2986
+ adjusmentIds?: string[] | null | undefined;
2984
2987
  _id: string;
2985
2988
  from: {
2986
2989
  name: string;
@@ -2990,7 +2993,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
2990
2993
  name: string;
2991
2994
  dbName: string;
2992
2995
  };
2993
- adjustmentIds: string[];
2994
2996
  purchaseOrderId: string;
2995
2997
  processedAt: string | null;
2996
2998
  rejectedAt: string | null;
@@ -2923,6 +2923,8 @@ export declare function useReceiveRequestForm(scope: PO_SCOPE, initialDateRange?
2923
2923
  additionalInfo?: any;
2924
2924
  id: string | null;
2925
2925
  } | null | undefined;
2926
+ adjustmentIds?: string[] | null | undefined;
2927
+ adjusmentIds?: string[] | null | undefined;
2926
2928
  _id: string;
2927
2929
  from: {
2928
2930
  name: string;
@@ -2932,7 +2934,6 @@ export declare function useReceiveRequestForm(scope: PO_SCOPE, initialDateRange?
2932
2934
  name: string;
2933
2935
  dbName: string;
2934
2936
  };
2935
- adjustmentIds: string[];
2936
2937
  purchaseOrderId: string;
2937
2938
  processedAt: string | null;
2938
2939
  rejectedAt: string | null;
@@ -3763,6 +3764,8 @@ export declare function useReceiveRequestForm(scope: PO_SCOPE, initialDateRange?
3763
3764
  additionalInfo?: any;
3764
3765
  id: string | null;
3765
3766
  } | null | undefined;
3767
+ adjustmentIds?: string[] | null | undefined;
3768
+ adjusmentIds?: string[] | null | undefined;
3766
3769
  _id: string;
3767
3770
  from: {
3768
3771
  name: string;
@@ -3772,7 +3775,6 @@ export declare function useReceiveRequestForm(scope: PO_SCOPE, initialDateRange?
3772
3775
  name: string;
3773
3776
  dbName: string;
3774
3777
  };
3775
- adjustmentIds: string[];
3776
3778
  purchaseOrderId: string;
3777
3779
  processedAt: string | null;
3778
3780
  rejectedAt: string | null;
@@ -4512,6 +4514,8 @@ export declare function useReceiveRequestForm(scope: PO_SCOPE, initialDateRange?
4512
4514
  additionalInfo?: any;
4513
4515
  id: string | null;
4514
4516
  } | null | undefined;
4517
+ adjustmentIds?: string[] | null | undefined;
4518
+ adjusmentIds?: string[] | null | undefined;
4515
4519
  _id: string;
4516
4520
  from: {
4517
4521
  name: string;
@@ -4521,7 +4525,6 @@ export declare function useReceiveRequestForm(scope: PO_SCOPE, initialDateRange?
4521
4525
  name: string;
4522
4526
  dbName: string;
4523
4527
  };
4524
- adjustmentIds: string[];
4525
4528
  purchaseOrderId: string;
4526
4529
  processedAt: string | null;
4527
4530
  rejectedAt: string | null;
@@ -3695,6 +3695,8 @@ export declare function useReceiveRequestTable(scope: PO_SCOPE, receiveRequestFo
3695
3695
  additionalInfo?: any;
3696
3696
  id: string | null;
3697
3697
  } | null | undefined;
3698
+ adjustmentIds?: string[] | null | undefined;
3699
+ adjusmentIds?: string[] | null | undefined;
3698
3700
  _id: string;
3699
3701
  from: {
3700
3702
  name: string;
@@ -3704,7 +3706,6 @@ export declare function useReceiveRequestTable(scope: PO_SCOPE, receiveRequestFo
3704
3706
  name: string;
3705
3707
  dbName: string;
3706
3708
  };
3707
- adjustmentIds: string[];
3708
3709
  purchaseOrderId: string;
3709
3710
  processedAt: string | null;
3710
3711
  rejectedAt: string | null;
@@ -4491,6 +4492,8 @@ export declare function useReceiveRequestTable(scope: PO_SCOPE, receiveRequestFo
4491
4492
  additionalInfo?: any;
4492
4493
  id: string | null;
4493
4494
  } | null | undefined;
4495
+ adjustmentIds?: string[] | null | undefined;
4496
+ adjusmentIds?: string[] | null | undefined;
4494
4497
  _id: string;
4495
4498
  from: {
4496
4499
  name: string;
@@ -4500,7 +4503,6 @@ export declare function useReceiveRequestTable(scope: PO_SCOPE, receiveRequestFo
4500
4503
  name: string;
4501
4504
  dbName: string;
4502
4505
  };
4503
- adjustmentIds: string[];
4504
4506
  purchaseOrderId: string;
4505
4507
  processedAt: string | null;
4506
4508
  rejectedAt: string | null;
@@ -5250,6 +5252,8 @@ export declare function useReceiveRequestTable(scope: PO_SCOPE, receiveRequestFo
5250
5252
  additionalInfo?: any;
5251
5253
  id: string | null;
5252
5254
  } | null | undefined;
5255
+ adjustmentIds?: string[] | null | undefined;
5256
+ adjusmentIds?: string[] | null | undefined;
5253
5257
  _id: string;
5254
5258
  from: {
5255
5259
  name: string;
@@ -5259,7 +5263,6 @@ export declare function useReceiveRequestTable(scope: PO_SCOPE, receiveRequestFo
5259
5263
  name: string;
5260
5264
  dbName: string;
5261
5265
  };
5262
- adjustmentIds: string[];
5263
5266
  purchaseOrderId: string;
5264
5267
  processedAt: string | null;
5265
5268
  rejectedAt: string | null;
@@ -0,0 +1,11 @@
1
+ declare function open(): Promise<void>;
2
+ declare function close(): void;
3
+ declare const _default: import("vue").DefineComponent<{}, {
4
+ open: typeof open;
5
+ close: typeof close;
6
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
+ submitted: () => void;
8
+ }, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
9
+ onSubmitted?: (() => any) | undefined;
10
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
11
+ export default _default;
@@ -0,0 +1,3 @@
1
+ export interface RecalculationDialogEvents {
2
+ (e: 'submitted'): void;
3
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-inventory-portal",
3
- "version": "1.2.23",
3
+ "version": "1.2.25-dev.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -1,286 +0,0 @@
1
- import { ref as B, onUnmounted as k, defineComponent as w, watch as L, onMounted as O, computed as h, resolveComponent as P, openBlock as I, createElementBlock as A, unref as T, createVNode as g, createElementVNode as v, toDisplayString as x, createBlock as M, createCommentVNode as H } from "vue";
2
- import { u as D, a as W, b as K, R as e, c as F, m as _, g as a, d as $ } from "./app-90sUA0QM.js";
3
- import { useCoreStore as G, useI18n as V } from "@feedmepos/mf-common";
4
- import { useRouter as U, useRoute as j } from "vue-router";
5
- import { u as z } from "./useTabStorage-BkIVScW_.js";
6
- import { u as Q } from "./googlemap-Dm8ERVai.js";
7
- function q() {
8
- return {
9
- loadingHookInstalled: !1,
10
- isLoading: !1
11
- };
12
- }
13
- const b = B(q());
14
- function J() {
15
- const c = U();
16
- if (!b.value.loadingHookInstalled) {
17
- b.value.loadingHookInstalled = !0;
18
- const r = c.beforeEach(() => {
19
- b.value.isLoading = !0;
20
- }), d = c.afterEach(() => {
21
- b.value.isLoading = !1;
22
- });
23
- k(() => {
24
- b.value.loadingHookInstalled = !1, r(), d();
25
- });
26
- }
27
- return {
28
- get isLoading() {
29
- return b.value.isLoading;
30
- }
31
- };
32
- }
33
- const X = {
34
- key: 0,
35
- class: "flex flex-col items-center w-full h-full gap-24"
36
- }, Y = {
37
- key: 1,
38
- class: "flex flex-col pt-[200px] gap-32 items-center"
39
- }, Z = { class: "flex flex-col gap-12 items-center text-center px-24 max-w-[1000px]" }, ee = { class: "fm-typo-en-title-lg-600" }, te = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, oe = { class: "flex gap-16" }, ne = { href: "https://feedme.ai/product/inventory/features?tab=plans_%26_prices" }, re = { href: "https://feedme.ai/form" }, ae = /* @__PURE__ */ w({
40
- __name: "InventoryView",
41
- setup(c) {
42
- const r = D(), d = W(), f = K(), s = G(), l = U(), m = J(), o = F(), { t: E } = V();
43
- L(
44
- [() => s.sessionUser.value, () => s.currentBusiness.value],
45
- ([i, u]) => {
46
- R(i, u);
47
- }
48
- ), O(async () => {
49
- await o.init(), await s.readBusinesses();
50
- const i = s.sessionUser.value, u = s.currentBusiness.value;
51
- R(i, u);
52
- });
53
- function R(i, u) {
54
- !i || !u || C();
55
- }
56
- async function C() {
57
- return await r.init(), await f.readSetting().catch((i) => {
58
- console.error("[all] error on reading netsuite store", i);
59
- }), await d.init();
60
- }
61
- const y = h(() => l.currentRoute.value.name === e.TRANSFER_TEMPLATE ? o.enablePoTemplate : l.currentRoute.value.name === e.INGREDIENT_GROUP ? o.enableIngredientGroup : !0);
62
- return (i, u) => {
63
- const N = P("FmSpacer"), n = P("FmCircularProgress"), t = P("FmButton"), p = P("RouterView");
64
- return I(), A("div", null, [
65
- T(m).isLoading ? (I(), A("div", X, [
66
- g(N),
67
- v("div", null, [
68
- g(n, { size: "xl" })
69
- ]),
70
- u[0] || (u[0] = v("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading page...", -1)),
71
- g(N)
72
- ])) : y.value ? T(s).sessionUser.value ? (I(), M(p, { key: 2 })) : H("", !0) : (I(), A("div", Y, [
73
- v("div", Z, [
74
- v("div", ee, x(T(E)("inventory.common.proPlan.title")), 1),
75
- v("div", te, x(T(E)("inventory.common.proPlan.subtitle")), 1)
76
- ]),
77
- v("div", oe, [
78
- v("a", ne, [
79
- g(t, {
80
- label: T(E)("inventory.common.proPlan.comparePlans"),
81
- variant: "secondary"
82
- }, null, 8, ["label"])
83
- ]),
84
- v("a", re, [
85
- g(t, {
86
- label: T(E)("inventory.common.proPlan.callUs"),
87
- "prepend-icon": "call"
88
- }, null, 8, ["label"])
89
- ])
90
- ])
91
- ]))
92
- ]);
93
- };
94
- }
95
- }), se = { class: "h-full flex flex-col overflow-auto py-16" }, le = /* @__PURE__ */ w({
96
- __name: "NavigationTab",
97
- setup(c) {
98
- const r = _.object({
99
- label: _.string(),
100
- value: _.string().optional(),
101
- icon: _.string().optional(),
102
- hide: _.boolean().optional(),
103
- children: _.array(_.lazy(() => r)).optional()
104
- }), d = j(), f = U(), s = G(), l = F(), m = z(), { t: o } = V();
105
- L([() => s.currentBusiness.value, () => d.name], ([n, t]) => {
106
- (n == null ? void 0 : n.menuVersion) === "v3" && (t === e.INGREDIENTS || t === e.RECIPE || t === e.UNIT) && f.push({ name: e.STOCK });
107
- });
108
- const E = (n) => n.filter((t) => !t.hide).map((t) => t.children ? { ...t, children: E(t.children) } : t), R = (n) => n.map((t) => {
109
- delete t.hide;
110
- const p = t;
111
- return t.children && (p.children = R(t.children)), p;
112
- }), C = h(() => {
113
- var p;
114
- const n = [
115
- {
116
- label: a(e.STOCK, o),
117
- // icon: 'inventory_2',
118
- children: [
119
- {
120
- label: o("inventory.stock.stock_balance.title"),
121
- value: e.STOCK
122
- },
123
- {
124
- label: a(e.WASTAGE_TEMPLATE, o),
125
- value: e.WASTAGE_TEMPLATE,
126
- hide: !l.enableWastageTemplate
127
- }
128
- ]
129
- },
130
- {
131
- label: "Closing",
132
- hide: !l.enableClosingTemplate,
133
- children: [
134
- {
135
- label: a(e.CLOSING_TEMPLATE, o),
136
- value: e.CLOSING_TEMPLATE
137
- },
138
- {
139
- label: a(e.CLOSING_DRAFT, o),
140
- value: e.CLOSING_DRAFT
141
- }
142
- ]
143
- },
144
- {
145
- label: a(e.INGREDIENTS, o),
146
- // icon: 'grocery',
147
- value: e.INGREDIENTS
148
- },
149
- {
150
- label: a(e.INGREDIENT_GROUP, o),
151
- // icon: 'grocery',
152
- value: e.INGREDIENT_GROUP,
153
- hide: !l.enableIngredientGroup
154
- },
155
- {
156
- label: a(e.RECIPE, o),
157
- // icon: 'weight',
158
- value: e.RECIPE
159
- },
160
- {
161
- label: a(e.UNIT, o),
162
- // icon: 'fastfood',
163
- value: e.UNIT
164
- },
165
- {
166
- label: o("inventory.transfer.title"),
167
- // icon: 'swap_horiz',
168
- children: [
169
- {
170
- label: a(e.RECEIVE_REQUEST, o),
171
- value: e.RECEIVE_REQUEST
172
- },
173
- {
174
- label: a(e.APPROVAL, o),
175
- value: e.APPROVAL
176
- },
177
- {
178
- label: a(e.TRANSFER_TEMPLATE, o),
179
- value: e.TRANSFER_TEMPLATE,
180
- hide: !l.enablePoTemplate
181
- }
182
- ]
183
- },
184
- {
185
- label: a(e.SUPPLIER, o),
186
- // icon: 'group',
187
- value: e.SUPPLIER
188
- },
189
- {
190
- label: a(e.WAREHOUSE, o),
191
- // icon: 'warehouse',
192
- value: e.WAREHOUSE
193
- },
194
- {
195
- label: a(e.PUBLISH, o),
196
- value: e.PUBLISH
197
- },
198
- {
199
- label: a(e.IMPORT, o),
200
- value: e.IMPORT,
201
- hide: !l.enableBulkImport
202
- },
203
- {
204
- label: a(e.INTEGRATION, o),
205
- // icon: 'integration_instructions',
206
- value: e.INTEGRATION
207
- }
208
- ], t = R(E(n));
209
- return ((p = s.currentBusiness.value) == null ? void 0 : p.menuVersion) === "v3" ? t.filter(
210
- (S) => S.value !== e.INGREDIENTS && S.value !== e.RECIPE && S.value !== e.UNIT && S.value !== e.PUBLISH
211
- ) : t;
212
- }), y = h({
213
- get() {
214
- if (d.name)
215
- return String(d.name);
216
- },
217
- set(n) {
218
- n && f.push({ name: n });
219
- }
220
- }), i = h(
221
- () => {
222
- var n;
223
- return `NavigationTab.${(n = s.currentBusiness.value) == null ? void 0 : n._id}`;
224
- }
225
- ), u = B(!1), N = h({
226
- get() {
227
- return u.value;
228
- },
229
- set(n) {
230
- u.value = n, n || m.setItem(i.value, "true");
231
- }
232
- });
233
- return L([() => i.value], () => {
234
- u.value = !1, setTimeout(() => {
235
- N.value = !m.getItem(i.value);
236
- }, 2e3);
237
- }), (n, t) => {
238
- const p = P("FmCollapsibleTabs");
239
- return I(), A("div", se, [
240
- g(p, {
241
- modelValue: y.value,
242
- "onUpdate:modelValue": t[0] || (t[0] = (S) => y.value = S),
243
- items: C.value
244
- }, null, 8, ["modelValue", "items"])
245
- ]);
246
- };
247
- }
248
- });
249
- typeof Promise.withResolvers > "u" && (Promise.withResolvers = () => {
250
- let c, r;
251
- return { promise: new Promise((f, s) => {
252
- c = f, r = s;
253
- }), resolve: c, reject: r };
254
- });
255
- typeof Promise.prototype.delayed > "u" && (Promise.prototype.delayed = async function(c) {
256
- return await new Promise((r) => setTimeout(r, c)), Promise.resolve(this);
257
- });
258
- const fe = /* @__PURE__ */ w({
259
- __name: "App",
260
- setup(c) {
261
- const r = G(), d = Q(), f = $();
262
- O(() => {
263
- if (window.location.href.includes("print-preview")) {
264
- r.setEmbedded(!0), document.body.classList.add("print-mode");
265
- return;
266
- }
267
- r.registerSidebarComponent(le), d.initGoogleMap(f.appApi.googleMap).catch(() => {
268
- console.error("Google map cannot be loaded");
269
- });
270
- }), L([() => r.currentCountry.value], () => {
271
- s();
272
- });
273
- async function s() {
274
- var l;
275
- try {
276
- await r.readBusinesses(), r.currentBusiness.value = (l = r.businesses.value) == null ? void 0 : l.find((m) => m);
277
- } catch (m) {
278
- console.error("error when trying to reset businesses:", m);
279
- }
280
- }
281
- return (l, m) => (I(), M(ae));
282
- }
283
- });
284
- export {
285
- fe as default
286
- };
@@ -1,146 +0,0 @@
1
- import { aa as m, u as k, a as l, aC as B, a0 as p } from "./app-90sUA0QM.js";
2
- import { useCoreStore as v } from "@feedmepos/mf-common";
3
- import { useSnackbar as $ } from "@feedmepos/ui-library";
4
- import { ref as y, computed as b } from "vue";
5
- const g = m((s, a) => {
6
- const c = k(), o = v(), u = $();
7
- return a.onError(async (t) => {
8
- t.name === "SvcForbiddenError" && (u == null || u.open({
9
- title: t.title,
10
- message: t.message,
11
- type: "error"
12
- }));
13
- }), {
14
- async readStockBalance() {
15
- const t = c.currentLocationDBName, e = `${s.inventoryBackendUrl}/${t}/stock-balance`;
16
- return await a.get(e);
17
- },
18
- async readSkuBalance() {
19
- var r;
20
- const t = c.currentLocationDBName, e = `${s.inventoryBackendUrl}/${t}/sku/balance`;
21
- return (((r = o.currentBusiness.value) == null ? void 0 : r.menuVersion) ?? "") === "v3" ? await a.get(e) : await a.get(`${e}?useInventoryDoc=true`);
22
- },
23
- async readSingleAdjustment(t) {
24
- const e = c.currentLocationDBName, n = `${s.inventoryBackendUrl}/${e}/adjustment`;
25
- return await a.get(`${n}?adjustmentId=${t}`);
26
- },
27
- async readStockAdjustment(t, e, n) {
28
- const r = c.currentLocationDBName, i = `${s.inventoryBackendUrl}/${r}/sku`;
29
- return await a.get(`${i}?skuId=${t}&start=${e}&end=${n}`);
30
- },
31
- async readAdjustmentById(t) {
32
- const e = c.currentLocationDBName, n = `${s.inventoryBackendUrl}/${e}/adjustment`;
33
- return await a.get(`${n}?adjustmentId=${t}`);
34
- },
35
- async convertSku(t) {
36
- var i;
37
- const e = c.currentLocationDBName, n = `${s.inventoryBackendUrl}/${e}/sku/convert`;
38
- return (((i = o.currentBusiness.value) == null ? void 0 : i.menuVersion) ?? "") === "v3" ? await a.post(n, t) : await a.post(`${n}?useInventoryDoc=true`, t);
39
- },
40
- async adjustSku(t) {
41
- var i;
42
- const e = c.currentLocationDBName, n = `${s.inventoryBackendUrl}/${e}/sku/adjust`;
43
- return (((i = o.currentBusiness.value) == null ? void 0 : i.menuVersion) ?? "") === "v3" ? await a.post(n, t) : await a.post(`${n}?useInventoryDoc=true`, t);
44
- },
45
- async revertWastageAdjustment(t) {
46
- const e = c.currentLocationDBName, n = `${s.inventoryBackendUrl}/${e}/sku/revert-wastage-adjustment`;
47
- return await a.post(n, t);
48
- },
49
- recalculation: {
50
- getRecalculateAbility() {
51
- var r;
52
- const e = `business_${(r = o.currentBusiness.value) == null ? void 0 : r._id}`, n = `${s.inventoryBackendUrl}/${e}/stock/operations/recalculate`;
53
- return a.get(n);
54
- },
55
- startRecalculateTask() {
56
- var r;
57
- const e = `business_${(r = o.currentBusiness.value) == null ? void 0 : r._id}`, n = `${s.inventoryBackendUrl}/${e}/stock/operations/recalculate?refundFromPreviousAdjustment=true`;
58
- return a.post(n);
59
- },
60
- refreshCurrentBalances() {
61
- const t = c.currentLocationDBName, e = `${s.inventoryBackendUrl}/${t}/stock/operations/recalculate/refresh-current-balances`;
62
- return a.post(e);
63
- },
64
- calculateStockSnapshotAtDate(t, e) {
65
- const n = c.currentLocationDBName, r = `${s.inventoryBackendUrl}/${n}/stock/operations/recalculate/calculate-at-date?effectiveAt=${encodeURIComponent(t)}&closingDraftId=${encodeURIComponent(e)}`;
66
- return a.get(r);
67
- },
68
- scheduleCalculateStockSnapshotAtDate(t, e) {
69
- const n = c.currentLocationDBName, r = `${s.inventoryBackendUrl}/${n}/stock/operations/recalculate/schedule/calculate-at-date?effectiveAt=${encodeURIComponent(t)}&closingDraftId=${encodeURIComponent(e)}`;
70
- return a.get(r);
71
- }
72
- }
73
- };
74
- });
75
- function S() {
76
- return {
77
- stockBalance: {
78
- _id: "",
79
- items: []
80
- },
81
- productBalance: []
82
- };
83
- }
84
- const f = p(0), N = {
85
- id: "",
86
- balance: f,
87
- closing: null,
88
- costs: null
89
- }, d = y(S()), A = () => {
90
- const s = l(), a = b(() => {
91
- var t;
92
- const o = (t = d.value.stockBalance.skus) == null ? void 0 : t.groupBy((e) => e.id), u = (e) => {
93
- var n;
94
- return ((n = o == null ? void 0 : o.get(e)) == null ? void 0 : n[0]) ?? { ...N, id: e };
95
- };
96
- return s.skus.map((e) => u(e._id));
97
- }), c = g();
98
- return {
99
- // state
100
- get stockBalance() {
101
- return {
102
- ...d.value.stockBalance,
103
- skus: a.value
104
- };
105
- },
106
- set stockBalance(o) {
107
- d.value.stockBalance = o;
108
- },
109
- get productBalance() {
110
- return d.value.productBalance;
111
- },
112
- set productBalance(o) {
113
- d.value.productBalance = o;
114
- },
115
- // actions
116
- async readStockBalance() {
117
- this.stockBalance = await c.readStockBalance();
118
- },
119
- async readProductBalance() {
120
- this.productBalance = [];
121
- const o = l(), u = B({
122
- recipes: o.recipes,
123
- skus: o.skus,
124
- skuGroups: o.skuGroups,
125
- inventoryBindingMapping: {},
126
- stockBalance: this.stockBalance
127
- // silent: true
128
- });
129
- function t(e, n) {
130
- return Object.prototype.hasOwnProperty.call(e, n);
131
- }
132
- for (const e in u.convertCountdown)
133
- if (t(u.convertCountdown, e)) {
134
- const n = u.convertCountdown[e];
135
- this.productBalance.push({
136
- id: e,
137
- count: n
138
- });
139
- }
140
- }
141
- };
142
- };
143
- export {
144
- g as a,
145
- A as u
146
- };