@feedmepos/mf-inventory-portal 0.0.22-dev.9 → 0.0.23-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 (163) hide show
  1. package/dist/App-Y3Ez8Rjf.js +255 -0
  2. package/dist/ApprovalView-BUU1G4Q2.js +141 -0
  3. package/dist/{BindingsDialog-GzX9Bo2g.js → BindingsDialog-8wc4Q0JQ.js} +13 -12
  4. package/dist/{BindingsPicker-SbOetc0-.js → BindingsPicker-DGWN1LQc.js} +19 -18
  5. package/dist/{BindingsTable-CAcE5y8U.js → BindingsTable-7NJP2jT6.js} +20 -16
  6. package/dist/ClosingTemplateView-9s7vmwaT.js +1833 -0
  7. package/dist/FmDroppableField-8RzKjEdL.js +154 -0
  8. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-B4DDh9-a.js +267 -0
  9. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-5DINn0ZB.js +436 -0
  10. package/dist/FmMultiselectDialog-7hok9sJP.js +411 -0
  11. package/dist/FmUnitInput.vue_vue_type_script_setup_true_lang-CxR1FCft.js +326 -0
  12. package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-FQ0HjuL3.js +51 -0
  13. package/dist/IngredientGroupView-C3maHTCg.js +610 -0
  14. package/dist/IngredientsView-DCR3IBkR.js +1613 -0
  15. package/dist/IntegrationView-gO4h89Wj.js +1227 -0
  16. package/dist/InventoryBindingForm-dh3GeyG-.js +4 -0
  17. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-CJuo3i7W.js +278 -0
  18. package/dist/InventoryBindingSummary-BPoPcEoe.js +75 -0
  19. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-1FCwvO8A.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-olm8sZKt.js} +1 -1
  20. package/dist/PremiumBadge.vue_vue_type_script_setup_true_lang-BezTV43V.js +116 -0
  21. package/dist/{PurchaseOrderPrintPreview-5HIWHR_f.js → PurchaseOrderPrintPreview-Dix_fIoo.js} +14 -13
  22. package/dist/ReceiveRequestView-DdPiYb2P.js +4082 -0
  23. package/dist/RecipeView-C4-a4IEW.js +597 -0
  24. package/dist/Standalone.vue.d.ts +2 -0
  25. package/dist/StockView-Du2txrIP.js +7778 -0
  26. package/dist/SupplierView-D_09FbQh.js +1474 -0
  27. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-C9MOos--.js +1144 -0
  28. package/dist/TransferTemplateView-j3CRy6Lc.js +1262 -0
  29. package/dist/{UnitView-BpU0Yk7X.js → UnitView-BXw2Vwq1.js} +30 -29
  30. package/dist/{WarehouseView-DqxWgogc.js → WarehouseView-CKamiETC.js} +205 -202
  31. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  32. package/dist/api/bill.d.ts +86 -240
  33. package/dist/api/closing-template.d.ts +6 -4
  34. package/dist/api/inventory.d.ts +281 -88
  35. package/dist/api/netsuite.d.ts +32 -1
  36. package/dist/api/purchase-order-template.d.ts +4 -2
  37. package/dist/api/supplier.d.ts +1 -0
  38. package/dist/app-GUbzqEtW.js +33456 -0
  39. package/dist/app.d.ts +259 -6
  40. package/dist/app.js +8 -7
  41. package/dist/array-hChJVZLE.js +43 -0
  42. package/dist/components/FmFilterableMenuOptions.vue.d.ts +54 -0
  43. package/dist/components/FmMinMaxInputRules.d.ts +2 -0
  44. package/dist/components/FmMultiselectDialog.vue.d.ts +3 -9
  45. package/dist/components/FmMultiselectDialogProps.d.ts +0 -2
  46. package/dist/components/FmUnitInputRules.d.ts +2 -0
  47. package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +5 -5
  48. package/dist/components/map/GoogleMap.vue.d.ts +4 -4
  49. package/dist/components/shell/inventory/binding-dialog.vue.d.ts +2 -2
  50. package/dist/components/shell/inventory/binding-ui.vue.d.ts +2 -2
  51. package/dist/date2-CLE9fB2R.js +117 -0
  52. package/dist/dayjs.min-CY1d38w7.js +282 -0
  53. package/dist/{decimal-DWbwRn_v.js → decimal-SIjO6Mjw.js} +1 -1
  54. package/dist/defineDeepModel-l40rX7kr.js +13 -0
  55. package/dist/extensions/array.d.ts +1 -0
  56. package/dist/feature-BXruKUhX.js +78 -0
  57. package/dist/{format-time-from-id-BnmaRuab.js → format-time-from-id-CcFsBXmk.js} +1 -1
  58. package/dist/format-unit-display-DEKg8cJm.js +1198 -0
  59. package/dist/fuzzy-CVOV9zJc.js +41 -0
  60. package/dist/googlemap-Dm8ERVai.js +97 -0
  61. package/dist/helper/rules.d.ts +7 -0
  62. package/dist/helper/rules.spec.d.ts +1 -0
  63. package/dist/helper/xlsx.util.d.ts +7 -0
  64. package/dist/index-BX5KZXhI.js +22279 -0
  65. package/dist/index-CVsyOEb1.js +10545 -0
  66. package/dist/index-m9e9nYfl.js +45 -0
  67. package/dist/netsuite-DAKRv7zr.js +146 -0
  68. package/dist/normalizeArguments-DP7Hrren.js +1552 -0
  69. package/dist/router/name.d.ts +1 -0
  70. package/dist/rules-DlnN8IP3.js +198 -0
  71. package/dist/stores/integration/foodmarkethub.d.ts +391 -0
  72. package/dist/stores/integration/index.d.ts +7 -0
  73. package/dist/stores/integration/netsuite.d.ts +102 -0
  74. package/dist/stores/inventory.d.ts +295 -9
  75. package/dist/stores/location.d.ts +508 -485
  76. package/dist/stores/supplier.d.ts +124 -4
  77. package/dist/stores/warehouse.d.ts +7 -4
  78. package/dist/style.css +1 -1
  79. package/dist/supplier-B21WlSAM.js +77 -0
  80. package/dist/tsconfig.app.tsbuildinfo +1 -1
  81. package/dist/use-inventory-binding-dialog-D3x6xj2O.js +95 -0
  82. package/dist/{use-template-enabled-locations-2-ClBq9FjN.js → use-template-enabled-locations-2-z-b-UXef.js} +9 -8
  83. package/dist/useTabStorage-BkIVScW_.js +25 -0
  84. package/dist/views/closing-template/closing-template-import/ClosingTemplateImport.vue.d.ts +2 -0
  85. package/dist/views/closing-template/closing-template-import/ClosingTemplateImportItem.vue.d.ts +12 -0
  86. package/dist/views/closing-template/closing-template-import/ClosingTemplateImportItemProps.d.ts +7 -0
  87. package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +1 -1
  88. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +877 -1002
  89. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +882 -1013
  90. package/dist/views/closing-template/helpers/import-export.helper.d.ts +58 -0
  91. package/dist/views/ingredient-group/IngredientGroupView.vue.d.ts +3 -0
  92. package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialog.vue.d.ts +31 -0
  93. package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialogProps.d.ts +12 -0
  94. package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupForm.vue.d.ts +20 -0
  95. package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupFormProps.d.ts +12 -0
  96. package/dist/views/ingredient-group/composables/use-ingredient-group-actions.d.ts +24 -0
  97. package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +215 -0
  98. package/dist/views/ingredients/components/convert/ConvertForm.vue.d.ts +2 -2
  99. package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +2 -2
  100. package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +5 -5
  101. package/dist/views/ingredients/composables/use-ingredient-form.d.ts +2 -2
  102. package/dist/views/ingredients/composables/use-ingredient-table.d.ts +1 -1
  103. package/dist/views/integration/FoodMarketHub.vue.d.ts +2 -0
  104. package/dist/views/integration/NetSuite.vue.d.ts +2 -0
  105. package/dist/views/integration/components/ApplyProductDialog.vue.d.ts +7 -7
  106. package/dist/views/integration/components/ApplyProductDialogV4.vue.d.ts +7 -7
  107. package/dist/views/receive-request/components/transfer-details/TransferDetailsProps.d.ts +1 -0
  108. package/dist/views/receive-request/components/transfer-form/NetSuiteField.vue.d.ts +49 -0
  109. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +1913 -53
  110. package/dist/views/receive-request/components/transfer-form/TransferFormProps.d.ts +1 -0
  111. package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +2 -2
  112. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +1 -1
  113. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +2370 -327
  114. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +2304 -261
  115. package/dist/views/recipe/components/recipe-form/RecipeForm.vue.d.ts +2 -2
  116. package/dist/views/recipe/composables/use-recipe-form.d.ts +2 -2
  117. package/dist/views/stock/components/StockRecordCard.vue.d.ts +43 -120
  118. package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +34 -4
  119. package/dist/views/stock/composables/use-stock-action.d.ts +2 -2
  120. package/dist/views/stock/helper/compute-summary-total.d.ts +2 -2
  121. package/dist/views/supplier/components/supplier-import/SupplierImport.vue.d.ts +2 -0
  122. package/dist/views/supplier/components/supplier-import/SupplierImportItem.vue.d.ts +12 -0
  123. package/dist/views/supplier/components/supplier-import/SupplierImportItemProps.d.ts +6 -0
  124. package/dist/views/supplier/composables/use-supplier-actions.d.ts +10 -0
  125. package/dist/views/supplier/helpers/import-export.helper.d.ts +50 -0
  126. package/dist/views/transfer-template/components/transfer-template-details/TransferTemplateDetails.vue.d.ts +0 -2
  127. package/dist/views/transfer-template/components/transfer-template-details/TransferTemplateDetailsProps.d.ts +0 -1
  128. package/dist/views/transfer-template/components/transfer-template-form/composables/use-template-enabled-locations.d.ts +71 -82
  129. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +38 -1
  130. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +1 -1
  131. package/dist/views/transfer-template/components/transfer-template-import/TransferTemplateImport.vue.d.ts +2 -0
  132. package/dist/views/transfer-template/components/transfer-template-import/TransferTemplateImportItem.vue.d.ts +12 -0
  133. package/dist/views/transfer-template/components/transfer-template-import/TransferTemplateImportItemProps.d.ts +9 -0
  134. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +1279 -1528
  135. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +2207 -446
  136. package/dist/views/transfer-template/helpers/import-export.helper.d.ts +76 -0
  137. package/dist/views/transfer-template/helpers/remove-deleted-skus.helper.d.ts +1 -251
  138. package/dist/views/transfer-template/helpers/template-item.error.helper.d.ts +1 -0
  139. package/dist/views/unit/composables/use-unit-form.d.ts +2 -2
  140. package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +14 -8
  141. package/dist/{xlsx-DiOKvJ6l.js → xlsx-6mM1eNiL.js} +1525 -1525
  142. package/dist/xlsx.util-BLftcF4q.js +78 -0
  143. package/package.json +7 -4
  144. package/dist/ApprovalView-BPsScR5_.js +0 -129
  145. package/dist/ClosingTemplateView-DECwEnlK.js +0 -1066
  146. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DnogYrRE.js +0 -372
  147. package/dist/IngredientsView-8fT1Ljd5.js +0 -1758
  148. package/dist/IntegrationView-CjGLRM78.js +0 -1141
  149. package/dist/PremiumBadge.vue_vue_type_script_setup_true_lang-DlhNc8Vk.js +0 -88
  150. package/dist/ReceiveRequestView-CXZv8g5U.js +0 -215
  151. package/dist/RecipeView-sB0Lgmob.js +0 -581
  152. package/dist/StockView-CY2kNohB.js +0 -1892
  153. package/dist/SupplierView-DTqeZPts.js +0 -827
  154. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-BBby29tW.js +0 -762
  155. package/dist/TransferDialog.vue_vue_type_script_setup_true_lang-ByNQap9n.js +0 -1498
  156. package/dist/TransferTemplateView-DkRVfAox.js +0 -1277
  157. package/dist/app-BuyAj4kw.js +0 -69068
  158. package/dist/defineDeepModel-DuVmbMwq.js +0 -13
  159. package/dist/id-to-date-CI5Vv0Ji.js +0 -30
  160. package/dist/purchase-order-transaction-type-DrFJFvtK.js +0 -676
  161. package/dist/stores/netsuite.d.ts +0 -49
  162. package/dist/supplier-BQyK2eSZ.js +0 -69
  163. package/dist/xlsx.util-CZ7zYxdP.js +0 -109
@@ -0,0 +1,255 @@
1
+ import { ref as L, onUnmounted as k, defineComponent as h, watch as b, onMounted as U, computed as R, resolveComponent as T, openBlock as S, createElementBlock as I, unref as v, createVNode as E, createElementVNode as p, toDisplayString as w, createBlock as B, createCommentVNode as F } from "vue";
2
+ import { u as M, a as D, R as e, g as s, b as H } from "./app-GUbzqEtW.js";
3
+ import { useCoreStore as x, useI18n as G } from "@feedmepos/mf-common";
4
+ import { useRouter as A, useRoute as K } from "vue-router";
5
+ import { u as V } from "./feature-BXruKUhX.js";
6
+ import { u as $ } from "./netsuite-DAKRv7zr.js";
7
+ import { u as Q } from "./useTabStorage-BkIVScW_.js";
8
+ import { _ as W } from "./_plugin-vue_export-helper-CHgC5LLL.js";
9
+ import { u as j } from "./googlemap-Dm8ERVai.js";
10
+ import "./array-hChJVZLE.js";
11
+ function z() {
12
+ return {
13
+ loadingHookInstalled: !1,
14
+ isLoading: !1
15
+ };
16
+ }
17
+ const _ = L(z());
18
+ function q() {
19
+ const l = A();
20
+ if (!_.value.loadingHookInstalled) {
21
+ _.value.loadingHookInstalled = !0;
22
+ const n = l.beforeEach(() => {
23
+ _.value.isLoading = !0;
24
+ }), i = l.afterEach(() => {
25
+ _.value.isLoading = !1;
26
+ });
27
+ k(() => {
28
+ _.value.loadingHookInstalled = !1, n(), i();
29
+ });
30
+ }
31
+ return {
32
+ get isLoading() {
33
+ return _.value.isLoading;
34
+ }
35
+ };
36
+ }
37
+ const J = {
38
+ key: 0,
39
+ class: "flex flex-col items-center w-full h-full gap-24"
40
+ }, X = {
41
+ key: 1,
42
+ class: "flex flex-col pt-[200px] gap-32 items-center"
43
+ }, Y = { class: "flex flex-col gap-12 items-center text-center px-24 max-w-[1000px]" }, Z = { class: "fm-typo-en-title-lg-600" }, ee = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, te = { class: "flex gap-16" }, oe = { href: "https://feedme.ai/product/inventory/features?tab=plans_%26_prices" }, ne = { href: "https://feedme.ai/form" }, re = /* @__PURE__ */ h({
44
+ __name: "InventoryView",
45
+ setup(l) {
46
+ const n = M(), i = D(), u = $(), a = x(), c = A(), o = q(), y = V(), { t: f } = G();
47
+ b(
48
+ [() => a.sessionUser.value, () => a.currentBusiness.value],
49
+ ([t, r]) => {
50
+ d(t, r);
51
+ }
52
+ ), U(() => {
53
+ const t = a.sessionUser.value, r = a.currentBusiness.value;
54
+ d(t, r);
55
+ });
56
+ function d(t, r) {
57
+ !t || !r || g();
58
+ }
59
+ async function g() {
60
+ return await n.init(), await u.readSetting().catch((t) => {
61
+ console.error("error on reading netsuite store", t);
62
+ }), await i.init();
63
+ }
64
+ const N = R(() => c.currentRoute.value.name === e.TRANSFER_TEMPLATE ? y.enablePoTemplate : !0);
65
+ return (t, r) => {
66
+ const m = T("FmSpacer"), P = T("FmCircularProgress"), C = T("FmButton"), O = T("RouterView");
67
+ return S(), I("div", null, [
68
+ v(o).isLoading ? (S(), I("div", J, [
69
+ E(m),
70
+ p("div", null, [
71
+ E(P, { size: "xl" })
72
+ ]),
73
+ r[0] || (r[0] = p("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading page...", -1)),
74
+ E(m)
75
+ ])) : N.value ? v(a).sessionUser.value ? (S(), B(O, { key: 2 })) : F("", !0) : (S(), I("div", X, [
76
+ p("div", Y, [
77
+ p("div", Z, w(v(f)("inventory.common.proPlan.title")), 1),
78
+ p("div", ee, w(v(f)("inventory.common.proPlan.subtitle")), 1)
79
+ ]),
80
+ p("div", te, [
81
+ p("a", oe, [
82
+ E(C, {
83
+ label: v(f)("inventory.common.proPlan.comparePlans"),
84
+ variant: "secondary"
85
+ }, null, 8, ["label"])
86
+ ]),
87
+ p("a", ne, [
88
+ E(C, {
89
+ label: v(f)("inventory.common.proPlan.callUs"),
90
+ "prepend-icon": "call"
91
+ }, null, 8, ["label"])
92
+ ])
93
+ ])
94
+ ]))
95
+ ]);
96
+ };
97
+ }
98
+ }), se = { class: "h-full flex flex-col overflow-auto py-16" }, ae = /* @__PURE__ */ h({
99
+ __name: "NavigationTab",
100
+ setup(l) {
101
+ const n = K(), i = A(), u = x(), a = V(), c = Q(), { t: o } = G();
102
+ b([() => u.currentBusiness.value, () => n.name], ([t, r]) => {
103
+ (t == null ? void 0 : t.menuVersion) === "v3" && (r === e.INGREDIENTS || r === e.RECIPE || r === e.UNIT) && i.push({ name: e.STOCK });
104
+ });
105
+ const y = R(() => {
106
+ var r;
107
+ const t = [
108
+ {
109
+ label: s(e.STOCK, o),
110
+ // icon: 'inventory_2',
111
+ children: [
112
+ {
113
+ label: "Stock balance",
114
+ value: e.STOCK
115
+ },
116
+ {
117
+ label: s(e.CLOSING_TEMPLATE, o),
118
+ value: e.CLOSING_TEMPLATE
119
+ }
120
+ ]
121
+ },
122
+ {
123
+ label: s(e.INGREDIENTS, o),
124
+ // icon: 'grocery',
125
+ value: e.INGREDIENTS
126
+ },
127
+ {
128
+ label: s(e.INGREDIENT_GROUP, o),
129
+ // icon: 'grocery',
130
+ value: e.INGREDIENT_GROUP
131
+ },
132
+ {
133
+ label: s(e.RECIPE, o),
134
+ // icon: 'weight',
135
+ value: e.RECIPE
136
+ },
137
+ {
138
+ label: s(e.UNIT, o),
139
+ // icon: 'fastfood',
140
+ value: e.UNIT
141
+ },
142
+ {
143
+ label: o("inventory.transfer.title"),
144
+ // icon: 'swap_horiz',
145
+ children: [
146
+ {
147
+ label: s(e.RECEIVE_REQUEST, o),
148
+ value: e.RECEIVE_REQUEST
149
+ },
150
+ {
151
+ label: s(e.APPROVAL, o),
152
+ value: e.APPROVAL
153
+ },
154
+ ...a.enablePoTemplate ? [
155
+ {
156
+ label: s(e.TRANSFER_TEMPLATE, o),
157
+ value: e.TRANSFER_TEMPLATE
158
+ }
159
+ ] : []
160
+ ]
161
+ },
162
+ {
163
+ label: s(e.SUPPLIER, o),
164
+ // icon: 'group',
165
+ value: e.SUPPLIER
166
+ },
167
+ {
168
+ label: s(e.WAREHOUSE, o),
169
+ // icon: 'warehouse',
170
+ value: e.WAREHOUSE
171
+ },
172
+ {
173
+ label: s(e.INTEGRATION, o),
174
+ // icon: 'integration_instructions',
175
+ value: e.INTEGRATION
176
+ }
177
+ ];
178
+ return ((r = u.currentBusiness.value) == null ? void 0 : r.menuVersion) === "v3" ? t.filter(
179
+ (m) => m.value !== e.INGREDIENTS && m.value !== e.RECIPE && m.value !== e.UNIT
180
+ ) : t;
181
+ }), f = R({
182
+ get() {
183
+ if (n.name)
184
+ return String(n.name);
185
+ },
186
+ set(t) {
187
+ t && i.push({ name: t });
188
+ }
189
+ }), d = R(
190
+ () => {
191
+ var t;
192
+ return `NavigationTab.${(t = u.currentBusiness.value) == null ? void 0 : t._id}`;
193
+ }
194
+ ), g = L(!1), N = R({
195
+ get() {
196
+ return g.value;
197
+ },
198
+ set(t) {
199
+ g.value = t, t || c.setItem(d.value, "true");
200
+ }
201
+ });
202
+ return b([() => d.value], () => {
203
+ g.value = !1, setTimeout(() => {
204
+ N.value = !c.getItem(d.value);
205
+ }, 2e3);
206
+ }), (t, r) => {
207
+ const m = T("FmCollapsibleTabs");
208
+ return S(), I("div", se, [
209
+ E(m, {
210
+ modelValue: f.value,
211
+ "onUpdate:modelValue": r[0] || (r[0] = (P) => f.value = P),
212
+ items: y.value
213
+ }, null, 8, ["modelValue", "items"])
214
+ ]);
215
+ };
216
+ }
217
+ }), le = /* @__PURE__ */ W(ae, [["__scopeId", "data-v-0fe980e2"]]);
218
+ typeof Promise.withResolvers > "u" && (Promise.withResolvers = () => {
219
+ let l, n;
220
+ return { promise: new Promise((u, a) => {
221
+ l = u, n = a;
222
+ }), resolve: l, reject: n };
223
+ });
224
+ typeof Promise.prototype.delayed > "u" && (Promise.prototype.delayed = async function(l) {
225
+ return await new Promise((n) => setTimeout(n, l)), Promise.resolve(this);
226
+ });
227
+ const Se = /* @__PURE__ */ h({
228
+ __name: "App",
229
+ setup(l) {
230
+ const n = x(), i = j(), u = H();
231
+ U(() => {
232
+ if (window.location.href.includes("print-preview")) {
233
+ n.setEmbedded(!0);
234
+ return;
235
+ }
236
+ n.registerSidebarComponent(le), i.initGoogleMap(u.appApi.googleMap).catch(() => {
237
+ console.error("Google map cannot be loaded");
238
+ });
239
+ }), b([() => n.currentCountry.value], () => {
240
+ a();
241
+ });
242
+ async function a() {
243
+ var c;
244
+ try {
245
+ await n.readBusinesses(), n.currentBusiness.value = (c = n.businesses.value) == null ? void 0 : c.find((o) => o);
246
+ } catch (o) {
247
+ console.error("error when trying to reset businesses:", o);
248
+ }
249
+ }
250
+ return (c, o) => (S(), B(re));
251
+ }
252
+ });
253
+ export {
254
+ Se as default
255
+ };
@@ -0,0 +1,141 @@
1
+ import { defineComponent as ae, ref as g, watch as oe, computed as b, resolveComponent as re, openBlock as x, createBlock as J, unref as e, withCtx as y, createElementVNode as s, normalizeClass as ne, createVNode as n, normalizeStyle as se, toDisplayString as le, createElementBlock as ce, createCommentVNode as ie, Teleport as pe, mergeProps as ue } from "vue";
2
+ import { u as me, w as v } from "./app-GUbzqEtW.js";
3
+ import { b as de, u as fe, _ as ve, a as _e } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-5DINn0ZB.js";
4
+ import { a as he, b as De, _ as ge } from "./TransferDetails.vue_vue_type_script_setup_true_lang-C9MOos--.js";
5
+ import { c as K } from "./date2-CLE9fB2R.js";
6
+ import { _ as be, F as _ } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
7
+ import { useBreakpoints as xe } from "@feedmepos/ui-library";
8
+ import { useI18n as ye } from "@feedmepos/mf-common";
9
+ const we = { class: "flex flex-col py-8" }, Re = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ke = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, Oe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1" }, Se = {
10
+ key: 0,
11
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1"
12
+ }, Te = { class: "pt-8" }, Ne = /* @__PURE__ */ ae({
13
+ __name: "ApprovalView",
14
+ setup(Ce) {
15
+ const o = he("approval"), { columnDefs: Q } = De("approval", o), W = me();
16
+ v.object({
17
+ name: v.string().optional().nullable(),
18
+ start: v.date().optional().nullable(),
19
+ end: v.date().optional().nullable()
20
+ });
21
+ const w = g({
22
+ name: "",
23
+ ...de()
24
+ }), a = g({
25
+ startDate: K(w.value.start ?? /* @__PURE__ */ new Date()),
26
+ endDate: K(w.value.end ?? /* @__PURE__ */ new Date())
27
+ });
28
+ oe([() => a.value.startDate], () => {
29
+ if (!a.value.startDate)
30
+ return;
31
+ if (!a.value.endDate) {
32
+ a.value.endDate = a.value.startDate;
33
+ return;
34
+ }
35
+ const c = new Date(a.value.startDate);
36
+ if (new Date(a.value.endDate).getTime() < c.getTime()) {
37
+ a.value.endDate = a.value.startDate;
38
+ return;
39
+ }
40
+ });
41
+ const h = g(""), { breakpoints: R } = xe(), D = b(() => R.value.xs || R.value.sm), X = b(() => D.value ? 10 : 20), Z = fe(), { t: k } = ye(), B = b(() => [
42
+ {
43
+ label: k("common.refresh"),
44
+ value: "refresh"
45
+ }
46
+ ]);
47
+ function I(c) {
48
+ switch (c) {
49
+ case "refresh":
50
+ return o.fetchData();
51
+ }
52
+ }
53
+ return (c, l) => {
54
+ const ee = re("FmTable");
55
+ return x(), J(ve, {
56
+ title: e(k)("inventory.transfer.approval.title"),
57
+ actions: B.value,
58
+ "onClick:action": I
59
+ }, {
60
+ default: y(() => [
61
+ s("div", {
62
+ class: ne([
63
+ "flex flex-col gap-8 max-h-full",
64
+ {
65
+ "p-0": D.value,
66
+ "px-24 ": !D.value
67
+ }
68
+ ])
69
+ }, [
70
+ n(_e, {
71
+ searchable: "",
72
+ "change-location": "",
73
+ search: h.value,
74
+ "onUpdate:search": l[0] || (l[0] = (r) => h.value = r)
75
+ }, null, 8, ["search"]),
76
+ n(ee, {
77
+ style: se(e(Z).tableHeight),
78
+ "column-defs": e(Q),
79
+ "row-data": e(o).purchaseRequests.value,
80
+ "search-value": h.value,
81
+ loading: !e(W)._currentLocation || e(o).loading.value,
82
+ onRowClick: l[1] || (l[1] = (r) => e(o).promptShowTransferDetails(r.original.purchaseOrder, r.original)),
83
+ "page-size": X.value
84
+ }, {
85
+ "list-row": y((r) => [
86
+ n(be, {
87
+ row: r,
88
+ onRowClick: (t) => e(o).promptShowTransferDetails(t.purchaseOrder, t)
89
+ }, {
90
+ default: y((t) => {
91
+ var O, S, T, i, C, z, F, M, p, $, V, u, Y, m, q, L, N, P, j, d, A, E, H, U, f, G;
92
+ return [
93
+ s("div", we, [
94
+ s("div", Re, [
95
+ n(e(_), {
96
+ render: (T = (S = (O = t.purchaseOrder__id) == null ? void 0 : O.column) == null ? void 0 : S.columnDef) == null ? void 0 : T.cell,
97
+ props: (C = (i = t.purchaseOrder__id) == null ? void 0 : i.getContext) == null ? void 0 : C.call(i)
98
+ }, null, 8, ["render", "props"])
99
+ ]),
100
+ s("div", ke, [
101
+ n(e(_), {
102
+ render: (M = (F = (z = t.to_name) == null ? void 0 : z.column) == null ? void 0 : F.columnDef) == null ? void 0 : M.cell,
103
+ props: ($ = (p = t.to_name) == null ? void 0 : p.getContext) == null ? void 0 : $.call(p)
104
+ }, null, 8, ["render", "props"])
105
+ ]),
106
+ s("div", Oe, le((q = (m = (Y = (u = (V = r.original.purchaseOrder) == null ? void 0 : V.items) == null ? void 0 : u.map) == null ? void 0 : Y.call(u, (te) => `${te.name}`)) == null ? void 0 : m.join) == null ? void 0 : q.call(m, ", ")), 1),
107
+ (L = r.original.purchaseOrder) != null && L.ref ? (x(), ce("div", Se, [
108
+ n(e(_), {
109
+ render: (j = (P = (N = t.purchaseOrder_ref) == null ? void 0 : N.column) == null ? void 0 : P.columnDef) == null ? void 0 : j.cell,
110
+ props: (A = (d = t.purchaseOrder_ref) == null ? void 0 : d.getContext) == null ? void 0 : A.call(d)
111
+ }, null, 8, ["render", "props"])
112
+ ])) : ie("", !0),
113
+ s("div", Te, [
114
+ n(e(_), {
115
+ render: (U = (H = (E = t.purchaseOrder_status) == null ? void 0 : E.column) == null ? void 0 : H.columnDef) == null ? void 0 : U.cell,
116
+ props: (G = (f = t.purchaseOrder_status) == null ? void 0 : f.getContext) == null ? void 0 : G.call(f)
117
+ }, null, 8, ["render", "props"])
118
+ ])
119
+ ])
120
+ ];
121
+ }),
122
+ _: 2
123
+ }, 1032, ["row", "onRowClick"])
124
+ ]),
125
+ _: 1
126
+ }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"])
127
+ ], 2),
128
+ (x(), J(pe, { to: "body" }, [
129
+ n(ge, ue(e(o).transferDetailsProps.value, {
130
+ onSubmitted: e(o).fetchData
131
+ }), null, 16, ["onSubmitted"])
132
+ ]))
133
+ ]),
134
+ _: 1
135
+ }, 8, ["title", "actions"]);
136
+ };
137
+ }
138
+ });
139
+ export {
140
+ Ne as default
141
+ };
@@ -1,18 +1,19 @@
1
- import { defineComponent as C, ref as o, onMounted as M, onUnmounted as F, watch as x, resolveComponent as l, openBlock as i, createElementBlock as d, createBlock as I, withCtx as R, createVNode as a, createCommentVNode as z, createElementVNode as P } from "vue";
2
- import { u as V, ao as L, _ as S } from "./app-BuyAj4kw.js";
1
+ import { defineComponent as C, ref as o, onMounted as M, onUnmounted as F, watch as x, resolveComponent as l, openBlock as i, createElementBlock as c, createBlock as I, withCtx as R, createVNode as a, createCommentVNode as z, createElementVNode as P } from "vue";
2
+ import { _ as V } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-CJuo3i7W.js";
3
+ import { a as L, G as S } from "./app-GUbzqEtW.js";
3
4
  const U = {
4
5
  key: 0,
5
6
  class: "flex justify-end gap-8 items-center"
6
7
  }, E = {
7
8
  key: 1,
8
9
  class: "p-24 flex items-center justify-center gap-16"
9
- }, A = /* @__PURE__ */ C({
10
+ }, D = /* @__PURE__ */ C({
10
11
  __name: "BindingsDialog",
11
12
  setup(N) {
12
- const p = V(), u = o(!0), s = o(new Array()), c = o(), t = L(y);
13
+ const p = L(), d = o(!0), s = o(new Array()), u = o(), t = S(y);
13
14
  async function y() {
14
- await p.readInventory(), c.value = t.onMessage("props:inventory-bindings", (e) => {
15
- u.value = !1, s.value = e;
15
+ await p.readInventory(), u.value = t.onMessage("props:inventory-bindings", (e) => {
16
+ d.value = !1, s.value = e;
16
17
  }).onMessage("props:inventory-bindings:validate", () => {
17
18
  var e;
18
19
  (e = f.value) == null || e.validateInputs();
@@ -36,7 +37,7 @@ const U = {
36
37
  }).observe(e);
37
38
  }), F(() => {
38
39
  var e, n;
39
- (n = (e = c.value) == null ? void 0 : e.removeEventListener) == null || n.call(e);
40
+ (n = (e = u.value) == null ? void 0 : e.removeEventListener) == null || n.call(e);
40
41
  }), x([() => s.value], ([e]) => {
41
42
  t.sendMessage("@update:inventory-bindings", e);
42
43
  });
@@ -47,12 +48,12 @@ const U = {
47
48
  const f = o();
48
49
  return (e, n) => {
49
50
  const g = l("FmButton"), B = l("FmForm"), h = l("FmCircularProgress");
50
- return i(), d("div", {
51
+ return i(), c("div", {
51
52
  class: "bg-white",
52
53
  ref_key: "resizeableRef",
53
54
  ref: m
54
55
  }, [
55
- u.value ? (i(), d("div", E, [
56
+ d.value ? (i(), c("div", E, [
56
57
  a(h, { size: "md" }),
57
58
  n[2] || (n[2] = P("div", null, "Loading bindings dialog...", -1))
58
59
  ])) : (i(), I(B, {
@@ -63,13 +64,13 @@ const U = {
63
64
  class: "flex flex-col gap-16"
64
65
  }, {
65
66
  default: R(() => [
66
- a(S, {
67
+ a(V, {
67
68
  "model-value": s.value,
68
69
  "onUpdate:modelValue": n[0] || (n[0] = (w) => s.value = w),
69
70
  "iframe-mode": "",
70
71
  "onClick:pickInventoryBindings": k
71
72
  }, null, 8, ["model-value"]),
72
- r.value ? z("", !0) : (i(), d("div", U, [
73
+ r.value ? z("", !0) : (i(), c("div", U, [
73
74
  a(g, {
74
75
  type: "button",
75
76
  variant: "tertiary",
@@ -89,5 +90,5 @@ const U = {
89
90
  }
90
91
  });
91
92
  export {
92
- A as default
93
+ D as default
93
94
  };
@@ -1,22 +1,23 @@
1
- import { defineComponent as S, computed as u, ref as l, onMounted as U, onUnmounted as V, resolveComponent as E, openBlock as p, createElementBlock as f, createVNode as r, createElementVNode as k } from "vue";
2
- import { u as M, ao as x, y as z } from "./app-BuyAj4kw.js";
3
- const F = {
1
+ import { defineComponent as S, computed as r, ref as l, onMounted as U, onUnmounted as V, resolveComponent as E, openBlock as p, createElementBlock as f, createVNode as u, createElementVNode as k } from "vue";
2
+ import { F as M } from "./FmMultiselectDialog-7hok9sJP.js";
3
+ import { a as x, G as F } from "./app-GUbzqEtW.js";
4
+ const z = {
4
5
  key: 0,
5
6
  class: "flex flex-col gap-16"
6
7
  }, K = { class: "flex justify-end gap-8 items-center" }, w = {
7
8
  key: 1,
8
9
  class: "p-24 flex items-center justify-center gap-16"
9
- }, N = /* @__PURE__ */ S({
10
+ }, A = /* @__PURE__ */ S({
10
11
  __name: "BindingsPicker",
11
12
  setup(L) {
12
- const d = M(), C = u(() => d.recipes), I = u(() => d.skus), g = l(!0), i = l(new Array()), a = l("RECIPE"), c = u(() => a.value === "SKU" ? I.value.map((s) => ({
13
+ const d = x(), C = r(() => d.recipes), I = r(() => d.skus), g = l(!0), i = l(new Array()), a = l("RECIPE"), c = r(() => a.value === "SKU" ? I.value.map((s) => ({
13
14
  label: s.name,
14
15
  sublabel: s.code,
15
16
  value: s
16
17
  })) : C.value.map((s) => ({
17
18
  label: s.name,
18
19
  value: s
19
- }))), b = u({
20
+ }))), b = r({
20
21
  get() {
21
22
  if (a.value === "SKU") {
22
23
  const e = i.value.filter((n) => n.type === "SKU");
@@ -62,9 +63,9 @@ const F = {
62
63
  ];
63
64
  }
64
65
  }
65
- }), y = l(), o = x(B);
66
+ }), _ = l(), o = F(B);
66
67
  async function B() {
67
- await d.readInventory(), y.value = o.onMessage(
68
+ await d.readInventory(), _.value = o.onMessage(
68
69
  "props:binding-items",
69
70
  (e) => {
70
71
  g.value = !1, a.value = e.type, i.value = e.bindings;
@@ -77,38 +78,38 @@ const F = {
77
78
  function R() {
78
79
  o.sendMessage("@submit:items", i.value);
79
80
  }
80
- const _ = l();
81
+ const y = l();
81
82
  return U(() => {
82
- const e = _.value;
83
+ const e = y.value;
83
84
  e && new ResizeObserver(() => {
84
85
  o.sendMessage("resize", e.scrollHeight);
85
86
  }).observe(e);
86
87
  }), V(() => {
87
88
  var e, s;
88
- (s = (e = y.value) == null ? void 0 : e.removeEventListener) == null || s.call(e);
89
+ (s = (e = _.value) == null ? void 0 : e.removeEventListener) == null || s.call(e);
89
90
  }), (e, s) => {
90
91
  const n = E("FmButton"), t = E("FmCircularProgress");
91
92
  return p(), f("div", {
92
93
  class: "bg-white",
93
94
  ref_key: "resizeableRef",
94
- ref: _
95
+ ref: y
95
96
  }, [
96
97
  g.value ? (p(), f("div", w, [
97
- r(t, { size: "md" }),
98
+ u(t, { size: "md" }),
98
99
  s[1] || (s[1] = k("div", null, "Loading bindings dialog...", -1))
99
- ])) : (p(), f("div", F, [
100
- r(z, {
100
+ ])) : (p(), f("div", z, [
101
+ u(M, {
101
102
  "model-value": b.value,
102
103
  "onUpdate:modelValue": s[0] || (s[0] = (m) => b.value = m),
103
104
  items: c.value
104
105
  }, null, 8, ["model-value", "items"]),
105
106
  k("div", K, [
106
- r(n, {
107
+ u(n, {
107
108
  variant: "tertiary",
108
109
  label: "Close",
109
110
  onClick: P
110
111
  }),
111
- r(n, {
112
+ u(n, {
112
113
  label: "Submit",
113
114
  onClick: R
114
115
  })
@@ -119,5 +120,5 @@ const F = {
119
120
  }
120
121
  });
121
122
  export {
122
- N as default
123
+ A as default
123
124
  };
@@ -1,7 +1,11 @@
1
1
  import { defineComponent as _, ref as c, provide as C, computed as f, resolveComponent as b, openBlock as p, createBlock as h, h as z, onMounted as B, onUnmounted as I, createElementBlock as y, createVNode as N, createElementVNode as x } from "vue";
2
- import { q as v, u as E, ao as L } from "./app-BuyAj4kw.js";
3
- import { components as F } from "@feedmepos/ui-library";
2
+ import { F as v, a as E, G as F } from "./app-GUbzqEtW.js";
3
+ import "./index-BX5KZXhI.js";
4
+ import { components as L } from "@feedmepos/ui-library";
5
+ import "./fuzzy-CVOV9zJc.js";
6
+ /* empty css */
4
7
  import "@feedmepos/mf-common";
8
+ import "./dayjs.min-CY1d38w7.js";
5
9
  const P = /* @__PURE__ */ _({
6
10
  __name: "binding-ui",
7
11
  props: {
@@ -22,17 +26,17 @@ const P = /* @__PURE__ */ _({
22
26
  C("closeDialog", () => {
23
27
  u.value.isOpen = !u.value.isOpen;
24
28
  });
25
- const o = k, m = d, a = f(() => o.items.map((e) => ({
29
+ const s = k, m = d, a = f(() => s.items.map((e) => ({
26
30
  key: e.key,
27
31
  name: e.name,
28
32
  _skuLinked: e.bindings.filter(
29
- ({ type: n, id: s }) => n === v.enum.SKU && o.skus.some((l) => l._id === s)
33
+ ({ type: n, id: o }) => n === v.enum.SKU && s.skus.some((l) => l._id === o)
30
34
  ).length,
31
35
  _recipeLinked: e.bindings.filter(
32
- ({ type: n, id: s }) => n === v.enum.RECIPE && o.recipes.some((l) => l._id === s)
36
+ ({ type: n, id: o }) => n === v.enum.RECIPE && s.recipes.some((l) => l._id === o)
33
37
  ).length,
34
38
  onUpdate: async () => {
35
- o.editable && m("click:open-binding-dialog", o.type, e);
39
+ s.editable && m("click:open-binding-dialog", s.type, e);
36
40
  }
37
41
  }))), g = [
38
42
  {
@@ -45,7 +49,7 @@ const P = /* @__PURE__ */ _({
45
49
  header: "Ingredient",
46
50
  size: 200,
47
51
  cell(i) {
48
- const e = a.value.find((s) => s.key === i.row.original.key), n = e == null ? void 0 : e._skuLinked;
52
+ const e = a.value.find((o) => o.key === i.row.original.key), n = e == null ? void 0 : e._skuLinked;
49
53
  return n === 1 ? "1 item" : n ? `${n} items` : "Not set";
50
54
  }
51
55
  },
@@ -54,7 +58,7 @@ const P = /* @__PURE__ */ _({
54
58
  header: "Recipe",
55
59
  size: 200,
56
60
  cell(i) {
57
- const e = a.value.find((s) => s.key === i.row.original.key), n = e == null ? void 0 : e._recipeLinked;
61
+ const e = a.value.find((o) => o.key === i.row.original.key), n = e == null ? void 0 : e._recipeLinked;
58
62
  return n === 1 ? "1 item" : n ? `${n} items` : "Not set";
59
63
  }
60
64
  },
@@ -64,7 +68,7 @@ const P = /* @__PURE__ */ _({
64
68
  size: 24,
65
69
  cell(i) {
66
70
  const e = a.value.find((n) => n.key === i.row.original.key);
67
- return z(F.FmButton, {
71
+ return z(L.FmButton, {
68
72
  icon: "edit",
69
73
  bgColor: "white",
70
74
  textColor: "neutral-grey-400",
@@ -90,19 +94,19 @@ const P = /* @__PURE__ */ _({
90
94
  }), R = {
91
95
  key: 1,
92
96
  class: "p-24 flex items-center justify-center gap-16"
93
- }, D = /* @__PURE__ */ _({
97
+ }, K = /* @__PURE__ */ _({
94
98
  __name: "BindingsTable",
95
99
  setup(k) {
96
- const d = E(), u = c(!0), o = c(new Array()), m = f(() => d.recipes), a = f(() => d.skus), g = c(""), i = L(n), e = c();
100
+ const d = E(), u = c(!0), s = c(new Array()), m = f(() => d.recipes), a = f(() => d.skus), g = c(""), i = F(n), e = c();
97
101
  async function n() {
98
102
  await d.readInventory(), e.value = i.onMessage(
99
103
  "props:grouped-bindings",
100
104
  (t) => {
101
- u.value = !1, o.value = t;
105
+ u.value = !1, s.value = t;
102
106
  }
103
107
  ), i.sendMessage("props:grouped-bindings");
104
108
  }
105
- async function s(t, r) {
109
+ async function o(t, r) {
106
110
  i.sendMessage("@click:open-binding-dialog", {
107
111
  key: t,
108
112
  binding: r
@@ -129,17 +133,17 @@ const P = /* @__PURE__ */ _({
129
133
  r[0] || (r[0] = x("div", null, "Loading bindings table...", -1))
130
134
  ])) : (p(), h(P, {
131
135
  key: 0,
132
- items: o.value,
136
+ items: s.value,
133
137
  recipes: m.value,
134
138
  skus: a.value,
135
139
  type: g.value,
136
140
  editable: "",
137
- "onClick:openBindingDialog": s
141
+ "onClick:openBindingDialog": o
138
142
  }, null, 8, ["items", "recipes", "skus", "type"]))
139
143
  ], 512);
140
144
  };
141
145
  }
142
146
  });
143
147
  export {
144
- D as default
148
+ K as default
145
149
  };