@feedmepos/mf-inventory-portal 0.0.25-dev.9 → 0.0.26-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 (116) hide show
  1. package/dist/{App-9zSE_swt.js → App-CipfIdtR.js} +71 -72
  2. package/dist/ApprovalView-IC33yBg7.js +143 -0
  3. package/dist/{BindingsDialog-eGbOIQkw.js → BindingsDialog-EN6Kbnu7.js} +2 -2
  4. package/dist/{BindingsPicker-CVXrd29s.js → BindingsPicker-DQ_LEoqq.js} +3 -3
  5. package/dist/BindingsTable-DGXpAyM4.js +120 -0
  6. package/dist/ClosingDraftView-DR9xsW9I.js +1348 -0
  7. package/dist/ClosingTemplateView-CC1T7ovX.js +1804 -0
  8. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C9un0wCK.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CovzlB-s.js} +43 -43
  9. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BRSABJnM.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BxEtsFXp.js} +29 -29
  10. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DeRvrF7O.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-B8H6vFJ5.js} +1 -1
  11. package/dist/{IngredientGroupView-ZWCOAljO.js → IngredientGroupView-DRPbXH8d.js} +24 -24
  12. package/dist/IngredientsView-DSHcH30X.js +1731 -0
  13. package/dist/{IntegrationView-DO3Ambro.js → IntegrationView-BgACk-jP.js} +605 -669
  14. package/dist/{InventoryBindingForm-BjtFP29c.js → InventoryBindingForm-Fs-CHoT-.js} +1 -1
  15. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CFMZ4VsK.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DVHQjAEC.js} +63 -63
  16. package/dist/{InventoryBindingSummary-C6DkVX-B.js → InventoryBindingSummary-CHWMtGtk.js} +1 -1
  17. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-nb1t6u2V.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Cu9V-8Cf.js} +1 -1
  18. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BcMAXo4F.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CyVRCAqv.js} +12 -12
  19. package/dist/PublishView-CI7o5a0F.js +222 -0
  20. package/dist/{PurchaseOrderPrintPreview-_MCAsdw9.js → PurchaseOrderPrintPreview-CO4a811o.js} +1 -1
  21. package/dist/ReceiveRequestView-KH5wY5BA.js +2562 -0
  22. package/dist/{RecipeView-dmmjklwh.js → RecipeView-DxVbUxOG.js} +47 -47
  23. package/dist/StockView-CiHPAaYh.js +1840 -0
  24. package/dist/{SupplierView-CO5460uC.js → SupplierView-DPj87kld.js} +448 -461
  25. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-CfPPCFh8.js +1566 -0
  26. package/dist/TransferTemplateView-3W29v8hd.js +1420 -0
  27. package/dist/{UnitView-DbYzxCXF.js → UnitView-WCtNQFf8.js} +23 -23
  28. package/dist/{WarehouseView-BII4SEVC.js → WarehouseView-tgFFbQY7.js} +40 -40
  29. package/dist/api/bill.d.ts +12 -2
  30. package/dist/api/closing-draft.d.ts +1 -0
  31. package/dist/api/inventory.d.ts +8 -7
  32. package/dist/api/netsuite.d.ts +22 -5
  33. package/dist/api/purchase-order.d.ts +6 -1
  34. package/dist/api/stock.d.ts +1 -0
  35. package/dist/{app-IM1yJnE8.js → app-Ba80HxT3.js} +38448 -34777
  36. package/dist/app.d.ts +965 -120
  37. package/dist/app.js +1 -1
  38. package/dist/components/FmDroppableField.vue.d.ts +1 -1
  39. package/dist/components/FmMultiselectDialog.d.ts +23 -0
  40. package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +1 -1
  41. package/dist/components/shell/inventory/binding-ui.vue.d.ts +1 -1
  42. package/dist/{decimal-DQUpCN-B.js → decimal-DFqusYHB.js} +1 -1
  43. package/dist/{format-unit-display-COuIZISg.js → format-unit-display-Bsod5Ra6.js} +232 -238
  44. package/dist/helper/country.d.ts +1 -0
  45. package/dist/helper/fuzzy.d.ts +1 -1
  46. package/dist/helper/number.d.ts +1 -1
  47. package/dist/index-0ekVGPtB.js +12197 -0
  48. package/dist/index-ZAEVHtfa.js +84 -0
  49. package/dist/{stock-BJUTiXXk.js → stock-Cn6EQvTz.js} +29 -25
  50. package/dist/stores/feature.d.ts +11 -6
  51. package/dist/stores/helper/generate-backend-urls.d.ts +0 -1
  52. package/dist/stores/integration/index.d.ts +2 -0
  53. package/dist/stores/integration/netsuite.d.ts +22 -5
  54. package/dist/stores/inventory.d.ts +141 -8
  55. package/dist/stores/location.d.ts +0 -9
  56. package/dist/stores/stock.d.ts +5 -0
  57. package/dist/stores/warehouse.d.ts +4 -7
  58. package/dist/style.css +1 -1
  59. package/dist/{supplier-CM-qQVyI.js → supplier-P1gi71dg.js} +4 -4
  60. package/dist/tsconfig.app.tsbuildinfo +1 -1
  61. package/dist/{use-ingredient-select-dialog-Cn79xFNg.js → use-ingredient-select-dialog-BW5imbB5.js} +1 -1
  62. package/dist/{use-inventory-binding-dialog-zwOG19YV.js → use-inventory-binding-dialog-BYxb8nXg.js} +1 -1
  63. package/dist/views/adjustment-template/wastage-template/actions.d.ts +0 -24
  64. package/dist/views/adjustment-template/wastage-template/table.d.ts +0 -24
  65. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +92 -8
  66. package/dist/views/closing-draft/composables/use-closing-draft-actions.d.ts +4 -1
  67. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +552 -48
  68. package/dist/views/closing-draft/helpers/export-draft.helper.d.ts +1 -1
  69. package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +1 -1
  70. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +12 -36
  71. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +12 -36
  72. package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +3 -3
  73. package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +2 -2
  74. package/dist/views/ingredients/composables/use-ingredient-table.d.ts +1 -1
  75. package/dist/views/receive-request/components/netsuite/NetSuiteProps.d.ts +2 -0
  76. package/dist/views/receive-request/components/transfer-details/TransferDetailsProps.d.ts +4 -1
  77. package/dist/views/receive-request/components/transfer-form/NetSuiteField.vue.d.ts +2 -0
  78. package/dist/views/receive-request/components/transfer-form/SparkIcon.vue.d.ts +1 -1
  79. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +529 -489
  80. package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +8 -4
  81. package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +382 -2
  82. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +5 -2
  83. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +1238 -972
  84. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +1080 -1003
  85. package/dist/views/receive-request/import/XilnexImportDialog.vue.d.ts +22 -0
  86. package/dist/views/receive-request/import/XilnexImportForm.vue.d.ts +17 -0
  87. package/dist/views/receive-request/import/XilnexResult.vue.d.ts +17 -0
  88. package/dist/views/receive-request/import/export.d.ts +14 -0
  89. package/dist/views/receive-request/import/props.d.ts +7 -0
  90. package/dist/views/stock/components/StockRecordCard.vue.d.ts +6 -1
  91. package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +6 -4
  92. package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItemTable.vue.d.ts +220 -0
  93. package/dist/views/transfer-template/components/transfer-template-form/composables/use-template-enabled-locations-2.d.ts +0 -8
  94. package/dist/views/transfer-template/components/transfer-template-form/composables/use-template-enabled-locations.d.ts +0 -1
  95. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +7 -2
  96. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +530 -530
  97. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +530 -530
  98. package/dist/views/transfer-template/composables/useTransferTemplateHelper.d.ts +305 -0
  99. package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +8 -14
  100. package/dist/vue-i18n-CjtRsQMl.js +2365 -0
  101. package/package.json +7 -7
  102. package/dist/ApprovalView-C2tg-wsm.js +0 -138
  103. package/dist/BindingsTable-CCsQEFnu.js +0 -145
  104. package/dist/ClosingDraftView-BI8b3CJ9.js +0 -1225
  105. package/dist/ClosingTemplateView-miJnC-ML.js +0 -1859
  106. package/dist/IngredientsView-5-pSX6y_.js +0 -1718
  107. package/dist/PublishView-DOMQdIJ7.js +0 -192
  108. package/dist/ReceiveRequestView-902hWGtz.js +0 -1877
  109. package/dist/StockView-C4lEYLXU.js +0 -7847
  110. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-D6sZDCEY.js +0 -1328
  111. package/dist/TransferTemplateView-C9UwNTnY.js +0 -1371
  112. package/dist/components/FmAutocompleteTextField.vue.d.ts +0 -31
  113. package/dist/feature-DMBVVBsQ.js +0 -1005
  114. package/dist/index-CIrsMt6f.js +0 -35546
  115. package/dist/views/dev/components/AutocompleteTextField.vue.d.ts +0 -2
  116. package/dist/vue-i18n-CzPFJ9JY.js +0 -2365
@@ -1,8 +1,7 @@
1
- import { ref as x, onUnmounted as F, defineComponent as h, watch as P, onMounted as U, computed as g, resolveComponent as b, openBlock as S, createElementBlock as I, unref as v, createVNode as _, createElementVNode as p, toDisplayString as w, createBlock as G, createCommentVNode as M } from "vue";
2
- import { u as k, a as D, b as H, R as e, g as s, c as W } from "./app-IM1yJnE8.js";
3
- import { useCoreStore as A, useI18n as B } from "@feedmepos/mf-common";
4
- import { useRouter as C, useRoute as K } from "vue-router";
5
- import { u as O } from "./feature-DMBVVBsQ.js";
1
+ import { ref as U, onUnmounted as F, defineComponent as h, watch as P, onMounted as x, computed as g, resolveComponent as b, openBlock as S, createElementBlock as I, unref as v, createVNode as _, createElementVNode as p, toDisplayString as w, createBlock as B, createCommentVNode as k } from "vue";
2
+ import { u as M, a as D, b as H, R as e, c as G, g as r, d as W } from "./app-Ba80HxT3.js";
3
+ import { useCoreStore as A, useI18n as O } from "@feedmepos/mf-common";
4
+ import { useRouter as L, useRoute as K } from "vue-router";
6
5
  import { u as $ } from "./useTabStorage-BkIVScW_.js";
7
6
  import { u as Q } from "./googlemap-Dm8ERVai.js";
8
7
  import "./array-hChJVZLE.js";
@@ -12,9 +11,9 @@ function j() {
12
11
  isLoading: !1
13
12
  };
14
13
  }
15
- const E = x(j());
14
+ const E = U(j());
16
15
  function z() {
17
- const l = C();
16
+ const l = L();
18
17
  if (!E.value.loadingHookInstalled) {
19
18
  E.value.loadingHookInstalled = !0;
20
19
  const n = l.beforeEach(() => {
@@ -41,50 +40,50 @@ const q = {
41
40
  }, X = { class: "flex flex-col gap-12 items-center text-center px-24 max-w-[1000px]" }, Y = { class: "fm-typo-en-title-lg-600" }, Z = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, ee = { class: "flex gap-16" }, te = { href: "https://feedme.ai/product/inventory/features?tab=plans_%26_prices" }, oe = { href: "https://feedme.ai/form" }, ne = /* @__PURE__ */ h({
42
41
  __name: "InventoryView",
43
42
  setup(l) {
44
- const n = k(), i = D(), u = H(), a = A(), c = C(), o = z(), R = O(), { t: d } = B();
43
+ const n = M(), i = D(), u = H(), s = A(), m = L(), o = z(), R = G(), { t: d } = O();
45
44
  P(
46
- [() => a.sessionUser.value, () => a.currentBusiness.value],
47
- ([t, r]) => {
48
- f(t, r);
45
+ [() => s.sessionUser.value, () => s.currentBusiness.value],
46
+ ([t, a]) => {
47
+ f(t, a);
49
48
  }
50
- ), U(async () => {
51
- await R.init(), await a.readBusinesses();
52
- const t = a.sessionUser.value, r = a.currentBusiness.value;
53
- f(t, r);
49
+ ), x(async () => {
50
+ await R.init(), await s.readBusinesses();
51
+ const t = s.sessionUser.value, a = s.currentBusiness.value;
52
+ f(t, a);
54
53
  });
55
- function f(t, r) {
56
- !t || !r || T();
54
+ function f(t, a) {
55
+ !t || !a || T();
57
56
  }
58
57
  async function T() {
59
58
  return await n.init(), await u.readSetting().catch((t) => {
60
59
  console.error("error on reading netsuite store", t);
61
60
  }), await i.init();
62
61
  }
63
- const y = g(() => c.currentRoute.value.name === e.TRANSFER_TEMPLATE ? R.enablePoTemplate : !0);
64
- return (t, r) => {
65
- const m = b("FmSpacer"), N = b("FmCircularProgress"), L = b("FmButton"), V = b("RouterView");
62
+ const y = g(() => m.currentRoute.value.name === e.TRANSFER_TEMPLATE ? R.enablePoTemplate : !0);
63
+ return (t, a) => {
64
+ const c = b("FmSpacer"), N = b("FmCircularProgress"), C = b("FmButton"), V = b("RouterView");
66
65
  return S(), I("div", null, [
67
66
  v(o).isLoading ? (S(), I("div", q, [
68
- _(m),
67
+ _(c),
69
68
  p("div", null, [
70
69
  _(N, { size: "xl" })
71
70
  ]),
72
- r[0] || (r[0] = p("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading page...", -1)),
73
- _(m)
74
- ])) : y.value ? v(a).sessionUser.value ? (S(), G(V, { key: 2 })) : M("", !0) : (S(), I("div", J, [
71
+ a[0] || (a[0] = p("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading page...", -1)),
72
+ _(c)
73
+ ])) : y.value ? v(s).sessionUser.value ? (S(), B(V, { key: 2 })) : k("", !0) : (S(), I("div", J, [
75
74
  p("div", X, [
76
75
  p("div", Y, w(v(d)("inventory.common.proPlan.title")), 1),
77
76
  p("div", Z, w(v(d)("inventory.common.proPlan.subtitle")), 1)
78
77
  ]),
79
78
  p("div", ee, [
80
79
  p("a", te, [
81
- _(L, {
80
+ _(C, {
82
81
  label: v(d)("inventory.common.proPlan.comparePlans"),
83
82
  variant: "secondary"
84
83
  }, null, 8, ["label"])
85
84
  ]),
86
85
  p("a", oe, [
87
- _(L, {
86
+ _(C, {
88
87
  label: v(d)("inventory.common.proPlan.callUs"),
89
88
  "prepend-icon": "call"
90
89
  }, null, 8, ["label"])
@@ -94,66 +93,66 @@ const q = {
94
93
  ]);
95
94
  };
96
95
  }
97
- }), re = { class: "h-full flex flex-col overflow-auto py-16" }, ae = /* @__PURE__ */ h({
96
+ }), ae = { class: "h-full flex flex-col overflow-auto py-16" }, se = /* @__PURE__ */ h({
98
97
  __name: "NavigationTab",
99
98
  setup(l) {
100
- const n = K(), i = C(), u = A(), a = O(), c = $(), { t: o } = B();
101
- P([() => u.currentBusiness.value, () => n.name], ([t, r]) => {
102
- (t == null ? void 0 : t.menuVersion) === "v3" && (r === e.INGREDIENTS || r === e.RECIPE || r === e.UNIT) && i.push({ name: e.STOCK });
99
+ const n = K(), i = L(), u = A(), s = G(), m = $(), { t: o } = O();
100
+ P([() => u.currentBusiness.value, () => n.name], ([t, a]) => {
101
+ (t == null ? void 0 : t.menuVersion) === "v3" && (a === e.INGREDIENTS || a === e.RECIPE || a === e.UNIT) && i.push({ name: e.STOCK });
103
102
  });
104
103
  const R = g(() => {
105
- var r;
104
+ var a;
106
105
  const t = [
107
106
  {
108
- label: s(e.STOCK, o),
107
+ label: r(e.STOCK, o),
109
108
  // icon: 'inventory_2',
110
109
  children: [
111
110
  {
112
- label: "Stock balance",
111
+ label: o("inventory.stock.stock_balance.title"),
113
112
  value: e.STOCK
114
113
  },
115
- ...a.enableWastageTemplate ? [
114
+ ...s.enableWastageTemplate ? [
116
115
  {
117
- label: s(e.WASTAGE_TEMPLATE, o),
116
+ label: r(e.WASTAGE_TEMPLATE, o),
118
117
  value: e.WASTAGE_TEMPLATE
119
118
  }
120
119
  ] : []
121
120
  ]
122
121
  },
123
- ...a.enableClosingTemplate ? [
122
+ ...s.enableClosingTemplate ? [
124
123
  {
125
124
  label: "Closing",
126
125
  children: [
127
126
  {
128
- label: s(e.CLOSING_TEMPLATE, o),
127
+ label: r(e.CLOSING_TEMPLATE, o),
129
128
  value: e.CLOSING_TEMPLATE
130
129
  },
131
130
  {
132
- label: s(e.CLOSING_DRAFT, o),
131
+ label: r(e.CLOSING_DRAFT, o),
133
132
  value: e.CLOSING_DRAFT
134
133
  }
135
134
  ]
136
135
  }
137
136
  ] : [],
138
137
  {
139
- label: s(e.INGREDIENTS, o),
138
+ label: r(e.INGREDIENTS, o),
140
139
  // icon: 'grocery',
141
140
  value: e.INGREDIENTS
142
141
  },
143
- ...a.enableIngredientGroup ? [
142
+ ...s.enableIngredientGroup ? [
144
143
  {
145
- label: s(e.INGREDIENT_GROUP, o),
144
+ label: r(e.INGREDIENT_GROUP, o),
146
145
  // icon: 'grocery',
147
146
  value: e.INGREDIENT_GROUP
148
147
  }
149
148
  ] : [],
150
149
  {
151
- label: s(e.RECIPE, o),
150
+ label: r(e.RECIPE, o),
152
151
  // icon: 'weight',
153
152
  value: e.RECIPE
154
153
  },
155
154
  {
156
- label: s(e.UNIT, o),
155
+ label: r(e.UNIT, o),
157
156
  // icon: 'fastfood',
158
157
  value: e.UNIT
159
158
  },
@@ -162,43 +161,43 @@ const q = {
162
161
  // icon: 'swap_horiz',
163
162
  children: [
164
163
  {
165
- label: s(e.RECEIVE_REQUEST, o),
164
+ label: r(e.RECEIVE_REQUEST, o),
166
165
  value: e.RECEIVE_REQUEST
167
166
  },
168
167
  {
169
- label: s(e.APPROVAL, o),
168
+ label: r(e.APPROVAL, o),
170
169
  value: e.APPROVAL
171
170
  },
172
- ...a.enablePoTemplate ? [
171
+ ...s.enablePoTemplate ? [
173
172
  {
174
- label: s(e.TRANSFER_TEMPLATE, o),
173
+ label: r(e.TRANSFER_TEMPLATE, o),
175
174
  value: e.TRANSFER_TEMPLATE
176
175
  }
177
176
  ] : []
178
177
  ]
179
178
  },
180
179
  {
181
- label: s(e.SUPPLIER, o),
180
+ label: r(e.SUPPLIER, o),
182
181
  // icon: 'group',
183
182
  value: e.SUPPLIER
184
183
  },
185
184
  {
186
- label: s(e.WAREHOUSE, o),
185
+ label: r(e.WAREHOUSE, o),
187
186
  // icon: 'warehouse',
188
187
  value: e.WAREHOUSE
189
188
  },
190
189
  {
191
- label: s(e.PUBLISH, o),
190
+ label: r(e.PUBLISH, o),
192
191
  value: e.PUBLISH
193
192
  },
194
193
  {
195
- label: s(e.INTEGRATION, o),
194
+ label: r(e.INTEGRATION, o),
196
195
  // icon: 'integration_instructions',
197
196
  value: e.INTEGRATION
198
197
  }
199
198
  ];
200
- return ((r = u.currentBusiness.value) == null ? void 0 : r.menuVersion) === "v3" ? t.filter(
201
- (m) => m.value !== e.INGREDIENTS && m.value !== e.RECIPE && m.value !== e.UNIT
199
+ return ((a = u.currentBusiness.value) == null ? void 0 : a.menuVersion) === "v3" ? t.filter(
200
+ (c) => c.value !== e.INGREDIENTS && c.value !== e.RECIPE && c.value !== e.UNIT && c.value !== e.PUBLISH
202
201
  ) : t;
203
202
  }), d = g({
204
203
  get() {
@@ -213,24 +212,24 @@ const q = {
213
212
  var t;
214
213
  return `NavigationTab.${(t = u.currentBusiness.value) == null ? void 0 : t._id}`;
215
214
  }
216
- ), T = x(!1), y = g({
215
+ ), T = U(!1), y = g({
217
216
  get() {
218
217
  return T.value;
219
218
  },
220
219
  set(t) {
221
- T.value = t, t || c.setItem(f.value, "true");
220
+ T.value = t, t || m.setItem(f.value, "true");
222
221
  }
223
222
  });
224
223
  return P([() => f.value], () => {
225
224
  T.value = !1, setTimeout(() => {
226
- y.value = !c.getItem(f.value);
225
+ y.value = !m.getItem(f.value);
227
226
  }, 2e3);
228
- }), (t, r) => {
229
- const m = b("FmCollapsibleTabs");
230
- return S(), I("div", re, [
231
- _(m, {
227
+ }), (t, a) => {
228
+ const c = b("FmCollapsibleTabs");
229
+ return S(), I("div", ae, [
230
+ _(c, {
232
231
  modelValue: d.value,
233
- "onUpdate:modelValue": r[0] || (r[0] = (N) => d.value = N),
232
+ "onUpdate:modelValue": a[0] || (a[0] = (N) => d.value = N),
234
233
  items: R.value
235
234
  }, null, 8, ["modelValue", "items"])
236
235
  ]);
@@ -239,39 +238,39 @@ const q = {
239
238
  });
240
239
  typeof Promise.withResolvers > "u" && (Promise.withResolvers = () => {
241
240
  let l, n;
242
- return { promise: new Promise((u, a) => {
243
- l = u, n = a;
241
+ return { promise: new Promise((u, s) => {
242
+ l = u, n = s;
244
243
  }), resolve: l, reject: n };
245
244
  });
246
245
  typeof Promise.prototype.delayed > "u" && (Promise.prototype.delayed = async function(l) {
247
246
  return await new Promise((n) => setTimeout(n, l)), Promise.resolve(this);
248
247
  });
249
- const fe = /* @__PURE__ */ h({
248
+ const de = /* @__PURE__ */ h({
250
249
  __name: "App",
251
250
  setup(l) {
252
251
  const n = A(), i = Q(), u = W();
253
- U(() => {
252
+ x(() => {
254
253
  if (window.location.href.includes("print-preview")) {
255
254
  n.setEmbedded(!0);
256
255
  return;
257
256
  }
258
- n.registerSidebarComponent(ae), i.initGoogleMap(u.appApi.googleMap).catch(() => {
257
+ n.registerSidebarComponent(se), i.initGoogleMap(u.appApi.googleMap).catch(() => {
259
258
  console.error("Google map cannot be loaded");
260
259
  });
261
260
  }), P([() => n.currentCountry.value], () => {
262
- a();
261
+ s();
263
262
  });
264
- async function a() {
265
- var c;
263
+ async function s() {
264
+ var m;
266
265
  try {
267
- await n.readBusinesses(), n.currentBusiness.value = (c = n.businesses.value) == null ? void 0 : c.find((o) => o);
266
+ await n.readBusinesses(), n.currentBusiness.value = (m = n.businesses.value) == null ? void 0 : m.find((o) => o);
268
267
  } catch (o) {
269
268
  console.error("error when trying to reset businesses:", o);
270
269
  }
271
270
  }
272
- return (c, o) => (S(), G(ne));
271
+ return (m, o) => (S(), B(ne));
273
272
  }
274
273
  });
275
274
  export {
276
- fe as default
275
+ de as default
277
276
  };
@@ -0,0 +1,143 @@
1
+ import { defineComponent as oe, ref as g, watch as re, computed as b, resolveComponent as ne, openBlock as y, createBlock as K, unref as e, withCtx as x, createElementVNode as s, normalizeClass as se, createVNode as n, normalizeStyle as le, toDisplayString as ce, createElementBlock as ie, createCommentVNode as ue, Teleport as pe, mergeProps as me } from "vue";
2
+ import { u as de, aw as _, aH as fe, a9 as Q, B as _e, _ as ve, C as he, E as De, G as v } from "./app-Ba80HxT3.js";
3
+ import { a as ge, P as O, b as be, _ as ye } from "./TransferDetails.vue_vue_type_script_setup_true_lang-CfPPCFh8.js";
4
+ import { useBreakpoints as xe } from "@feedmepos/ui-library";
5
+ import { useI18n as Oe } from "@feedmepos/mf-common";
6
+ const we = { class: "flex flex-col py-8" }, Re = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pe = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, ke = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1" }, Ce = {
7
+ key: 0,
8
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1"
9
+ }, Se = { class: "pt-8" }, $e = /* @__PURE__ */ oe({
10
+ __name: "ApprovalView",
11
+ setup(Te) {
12
+ const o = ge(O.APPROVAL), { columnDefs: W } = be(O.APPROVAL, o), X = de();
13
+ _.object({
14
+ name: _.string().optional().nullable(),
15
+ start: _.date().optional().nullable(),
16
+ end: _.date().optional().nullable()
17
+ });
18
+ const w = g({
19
+ name: "",
20
+ ...fe()
21
+ }), a = g({
22
+ startDate: Q(w.value.start ?? /* @__PURE__ */ new Date()),
23
+ endDate: Q(w.value.end ?? /* @__PURE__ */ new Date())
24
+ });
25
+ re([() => a.value.startDate], () => {
26
+ if (!a.value.startDate)
27
+ return;
28
+ if (!a.value.endDate) {
29
+ a.value.endDate = a.value.startDate;
30
+ return;
31
+ }
32
+ const c = new Date(a.value.startDate);
33
+ if (new Date(a.value.endDate).getTime() < c.getTime()) {
34
+ a.value.endDate = a.value.startDate;
35
+ return;
36
+ }
37
+ });
38
+ const h = g(""), { breakpoints: R } = xe(), D = b(() => R.value.xs || R.value.sm), Z = b(() => D.value ? 10 : 20), B = _e(), { t: P } = Oe(), I = b(() => [
39
+ {
40
+ label: P("inventory.common.refresh"),
41
+ value: "refresh"
42
+ }
43
+ ]);
44
+ function ee(c) {
45
+ switch (c) {
46
+ case "refresh":
47
+ return o.fetchData();
48
+ }
49
+ }
50
+ return (c, l) => {
51
+ const te = ne("FmTable");
52
+ return y(), K(ve, {
53
+ title: e(P)("inventory.transfer.approval.title"),
54
+ actions: I.value,
55
+ "onClick:action": ee
56
+ }, {
57
+ default: x(() => [
58
+ s("div", {
59
+ class: se([
60
+ "flex flex-col gap-8 max-h-full",
61
+ {
62
+ "p-0": D.value,
63
+ "px-24 ": !D.value
64
+ }
65
+ ])
66
+ }, [
67
+ n(he, {
68
+ searchable: "",
69
+ "change-location": "",
70
+ search: h.value,
71
+ "onUpdate:search": l[0] || (l[0] = (r) => h.value = r)
72
+ }, null, 8, ["search"]),
73
+ n(te, {
74
+ style: le(e(B).tableHeight),
75
+ "column-defs": e(W),
76
+ "row-data": e(o).purchaseRequests.value,
77
+ "search-value": h.value,
78
+ loading: !e(X)._currentLocation || e(o).loading.value,
79
+ onRowClick: l[1] || (l[1] = (r) => e(o).promptShowTransferDetails(
80
+ r.original.purchaseOrder,
81
+ r.original
82
+ )),
83
+ "page-size": Z.value
84
+ }, {
85
+ "list-row": x((r) => [
86
+ n(De, {
87
+ row: r,
88
+ onRowClick: (t) => e(o).promptShowTransferDetails(t.purchaseOrder, t)
89
+ }, {
90
+ default: x((t) => {
91
+ var k, C, S, i, T, A, V, L, u, z, M, p, $, m, E, F, Y, q, H, d, N, j, G, U, f, J;
92
+ return [
93
+ s("div", we, [
94
+ s("div", Re, [
95
+ n(e(v), {
96
+ render: (S = (C = (k = t.purchaseOrder__id) == null ? void 0 : k.column) == null ? void 0 : C.columnDef) == null ? void 0 : S.cell,
97
+ props: (T = (i = t.purchaseOrder__id) == null ? void 0 : i.getContext) == null ? void 0 : T.call(i)
98
+ }, null, 8, ["render", "props"])
99
+ ]),
100
+ s("div", Pe, [
101
+ n(e(v), {
102
+ render: (L = (V = (A = t.to_name) == null ? void 0 : A.column) == null ? void 0 : V.columnDef) == null ? void 0 : L.cell,
103
+ props: (z = (u = t.to_name) == null ? void 0 : u.getContext) == null ? void 0 : z.call(u)
104
+ }, null, 8, ["render", "props"])
105
+ ]),
106
+ s("div", ke, ce((E = (m = ($ = (p = (M = r.original.purchaseOrder) == null ? void 0 : M.items) == null ? void 0 : p.map) == null ? void 0 : $.call(p, (ae) => `${ae.name}`)) == null ? void 0 : m.join) == null ? void 0 : E.call(m, ", ")), 1),
107
+ (F = r.original.purchaseOrder) != null && F.ref ? (y(), ie("div", Ce, [
108
+ n(e(v), {
109
+ render: (H = (q = (Y = t.purchaseOrder_ref) == null ? void 0 : Y.column) == null ? void 0 : q.columnDef) == null ? void 0 : H.cell,
110
+ props: (N = (d = t.purchaseOrder_ref) == null ? void 0 : d.getContext) == null ? void 0 : N.call(d)
111
+ }, null, 8, ["render", "props"])
112
+ ])) : ue("", !0),
113
+ s("div", Se, [
114
+ n(e(v), {
115
+ render: (U = (G = (j = t.purchaseOrder_status) == null ? void 0 : j.column) == null ? void 0 : G.columnDef) == null ? void 0 : U.cell,
116
+ props: (J = (f = t.purchaseOrder_status) == null ? void 0 : f.getContext) == null ? void 0 : J.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
+ (y(), K(pe, { to: "body" }, [
129
+ n(ye, me({
130
+ scope: e(O).APPROVAL
131
+ }, e(o).transferDetailsProps.value, {
132
+ onSubmitted: e(o).fetchData
133
+ }), null, 16, ["scope", "onSubmitted"])
134
+ ]))
135
+ ]),
136
+ _: 1
137
+ }, 8, ["title", "actions"]);
138
+ };
139
+ }
140
+ });
141
+ export {
142
+ $e as default
143
+ };
@@ -1,6 +1,6 @@
1
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-CFMZ4VsK.js";
3
- import { a as L, aQ as S } from "./app-IM1yJnE8.js";
2
+ import { _ as V } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-DVHQjAEC.js";
3
+ import { a as L, aQ as S } from "./app-Ba80HxT3.js";
4
4
  const U = {
5
5
  key: 0,
6
6
  class: "flex justify-end gap-8 items-center"
@@ -1,12 +1,12 @@
1
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 { a as M, aQ as x, H as z } from "./app-IM1yJnE8.js";
2
+ import { a as M, aQ as x, J as z } from "./app-Ba80HxT3.js";
3
3
  const F = {
4
4
  key: 0,
5
5
  class: "flex flex-col gap-16"
6
6
  }, K = { class: "flex justify-end gap-8 items-center" }, w = {
7
7
  key: 1,
8
8
  class: "p-24 flex items-center justify-center gap-16"
9
- }, H = /* @__PURE__ */ S({
9
+ }, N = /* @__PURE__ */ S({
10
10
  __name: "BindingsPicker",
11
11
  setup(L) {
12
12
  const d = M(), 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) => ({
@@ -119,5 +119,5 @@ const F = {
119
119
  }
120
120
  });
121
121
  export {
122
- H as default
122
+ N as default
123
123
  };
@@ -0,0 +1,120 @@
1
+ import { defineComponent as x, ref as r, provide as C, computed as g, resolveComponent as h, openBlock as l, createElementBlock as u, createStaticVNode as F, Fragment as L, renderList as I, createElementVNode as p, toDisplayString as v, createVNode as w, withModifiers as N, onMounted as E, onUnmounted as z, createBlock as M } from "vue";
2
+ import { F as b, a as P, aQ as R } from "./app-Ba80HxT3.js";
3
+ import "@feedmepos/ui-library";
4
+ import "@feedmepos/mf-common";
5
+ const U = { class: "" }, D = ["onClick"], O = { class: "flex-grow-0 flex-shrink-0 basis-5/12 py-8 pl-8" }, V = { class: "flex-grow-0 flex-shrink-0 basis-3/12 py-8" }, S = { class: "flex-grow-0 flex-shrink-0 basis-3/12 py-8" }, $ = { class: "flex-grow-0 flex-shrink-0 basis-1/12 py-4" }, T = /* @__PURE__ */ x({
6
+ __name: "binding-ui",
7
+ props: {
8
+ items: { default: () => [] },
9
+ recipes: { default: () => [] },
10
+ skus: { default: () => [] },
11
+ type: { default: "Product" },
12
+ editable: { type: Boolean, default: !1 }
13
+ },
14
+ emits: ["click:open-binding-dialog"],
15
+ setup(_, { emit: a }) {
16
+ const d = r({
17
+ isOpen: !1,
18
+ initialValue: [],
19
+ context: "",
20
+ name: ""
21
+ });
22
+ C("closeDialog", () => {
23
+ d.value.isOpen = !d.value.isOpen;
24
+ });
25
+ const i = _, f = a, m = g(() => i.items.map((s) => ({
26
+ key: s.key,
27
+ name: s.name,
28
+ _skuLinked: s.bindings.filter(
29
+ ({ type: t, id: e }) => t === b.enum.SKU && i.skus.some((c) => c._id === e)
30
+ ).length,
31
+ _recipeLinked: s.bindings.filter(
32
+ ({ type: t, id: e }) => t === b.enum.RECIPE && i.recipes.some((c) => c._id === e)
33
+ ).length,
34
+ onUpdate: async () => {
35
+ i.editable && f("click:open-binding-dialog", i.type, s);
36
+ }
37
+ })));
38
+ return (k, s) => {
39
+ const t = h("FmButton");
40
+ return l(), u("div", U, [
41
+ s[0] || (s[0] = F('<div class="flex font-bold bg-[#F7F8FA]"><div class="flex-grow-0 flex-shrink-0 basis-5/12 py-8"></div><div class="flex-grow-0 flex-shrink-0 basis-3/12 py-8">Ingredient</div><div class="flex-grow-0 flex-shrink-0 basis-3/12 py-8">Recipe</div><div class="flex-grow-0 flex-shrink-0 basis-1/12 py-8"></div></div>', 1)),
42
+ (l(!0), u(L, null, I(m.value, (e) => (l(), u("div", {
43
+ key: e.key,
44
+ class: "cursor-pointer flex border-t border-[rgba(17,32,47,0.15] items-center",
45
+ onClick: e.onUpdate
46
+ }, [
47
+ p("div", O, v(e.name), 1),
48
+ p("div", V, v(e._skuLinked ? `${e._skuLinked} linked` : "Not linked"), 1),
49
+ p("div", S, v(e._recipeLinked ? `${e._recipeLinked} linked` : "Not linked"), 1),
50
+ p("div", $, [
51
+ w(t, {
52
+ variant: "tertiary",
53
+ icon: "edit",
54
+ "icon-color": "#000",
55
+ size: "md",
56
+ disabled: !i.editable,
57
+ type: "button",
58
+ onClick: N(e.onUpdate, ["stop"])
59
+ }, null, 8, ["disabled", "onClick"])
60
+ ])
61
+ ], 8, D))), 128))
62
+ ]);
63
+ };
64
+ }
65
+ }), A = {
66
+ key: 1,
67
+ class: "p-24 flex items-center justify-center gap-16"
68
+ }, K = /* @__PURE__ */ x({
69
+ __name: "BindingsTable",
70
+ setup(_) {
71
+ const a = P(), d = r(!0), i = r(new Array()), f = g(() => a.recipes), m = g(() => a.skus), k = r(""), s = R(e), t = r();
72
+ async function e() {
73
+ await a.readInventory(), t.value = s.onMessage(
74
+ "props:grouped-bindings",
75
+ (n) => {
76
+ d.value = !1, i.value = n;
77
+ }
78
+ ), s.sendMessage("props:grouped-bindings");
79
+ }
80
+ async function c(n, o) {
81
+ s.sendMessage("@click:open-binding-dialog", {
82
+ key: n,
83
+ binding: o
84
+ });
85
+ }
86
+ const y = r();
87
+ return E(() => {
88
+ const n = y.value;
89
+ n && new ResizeObserver(() => {
90
+ s.sendMessage("resize", n.scrollHeight);
91
+ }).observe(n);
92
+ }), z(() => {
93
+ var n, o;
94
+ (o = (n = t.value) == null ? void 0 : n.removeEventListener) == null || o.call(n);
95
+ }), (n, o) => {
96
+ const B = h("FmCircularProgress");
97
+ return l(), u("div", {
98
+ class: "bg-white",
99
+ ref_key: "resizeableRef",
100
+ ref: y
101
+ }, [
102
+ d.value ? (l(), u("div", A, [
103
+ w(B, { size: "md" }),
104
+ o[0] || (o[0] = p("div", null, "Loading bindings table...", -1))
105
+ ])) : (l(), M(T, {
106
+ key: 0,
107
+ items: i.value,
108
+ recipes: f.value,
109
+ skus: m.value,
110
+ type: k.value,
111
+ editable: "",
112
+ "onClick:openBindingDialog": c
113
+ }, null, 8, ["items", "recipes", "skus", "type"]))
114
+ ], 512);
115
+ };
116
+ }
117
+ });
118
+ export {
119
+ K as default
120
+ };