@feedmepos/mf-inventory-portal 1.2.13 → 1.2.14

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 (76) hide show
  1. package/dist/App-BKUu2y4m.js +286 -0
  2. package/dist/{ApprovalView-BWX6xBQs.js → ApprovalView-BXIr-aOO.js} +26 -26
  3. package/dist/{BindingsDialog-CuwkcDKX.js → BindingsDialog-BDxyU1ai.js} +2 -2
  4. package/dist/{BindingsPicker-BibFsY0g.js → BindingsPicker-CtlglFHZ.js} +10 -10
  5. package/dist/{BindingsTable-AdjKwSPH.js → BindingsTable-CAkqyxwU.js} +1 -1
  6. package/dist/{ClosingDraftView-DWFHP9nE.js → ClosingDraftView-uqekYW8F.js} +44 -44
  7. package/dist/{ClosingTemplateView-DOCF5f_u.js → ClosingTemplateView-T75Sz9_T.js} +26 -26
  8. package/dist/{DeliveryOrderPrintPreview-DNDtL_Vo.js → DeliveryOrderPrintPreview-DHhQSQ2B.js} +10 -10
  9. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BWhINOE8.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Dcof4mm-.js} +15 -15
  10. package/dist/{FmMultiselectDialog-Dfo04ak5.js → FmMultiselectDialog-WIXHw0Uk.js} +4 -4
  11. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DGVs4zLl.js → FmUnitInput.vue_vue_type_script_setup_true_lang-V7qRyodl.js} +54 -54
  12. package/dist/ImportView-D6K4u2to.js +1303 -0
  13. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BESx2u4Y.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DXSaHlBC.js} +1 -1
  14. package/dist/{IngredientGroupView-M9sXlnE0.js → IngredientGroupView-337gZxja.js} +19 -20
  15. package/dist/IngredientsView-BFB5W9wU.js +2240 -0
  16. package/dist/{IntegrationView-BlUNz1yc.js → IntegrationView-DBZir_ru.js} +3 -3
  17. package/dist/{InventoryBindingForm-CvQ5zh6v.js → InventoryBindingForm-D4T5aJjL.js} +1 -1
  18. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-BEAEmPsU.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CxeoVbtU.js} +12 -12
  19. package/dist/{InventoryBindingSummary-CsJ-6G2P.js → InventoryBindingSummary-Cb0OLH16.js} +1 -1
  20. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DjN_ktl1.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BBayB4R3.js} +1 -1
  21. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BN_e7k7U.js → PremiumBadge.vue_vue_type_script_setup_true_lang-C9en2Mi_.js} +1 -1
  22. package/dist/{PublishView-DZgCyLK2.js → PublishView-BM5b29AM.js} +25 -25
  23. package/dist/{PurchaseOrderPrintPreview-CB2xvQ33.js → PurchaseOrderPrintPreview-Dml3m5ao.js} +12 -12
  24. package/dist/{ReceiveRequestView-DgDHOS-Y.js → ReceiveRequestView-Ceya3bOZ.js} +131 -132
  25. package/dist/RecipeView-Bw3qnkmy.js +636 -0
  26. package/dist/{StockView-eJOngk08.js → StockView-Dum7wayi.js} +165 -166
  27. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BMFfegsk.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BCMz3BUb.js} +1 -1
  28. package/dist/{SupplierView-BS8rBAKC.js → SupplierView-BRePnXQP.js} +4 -4
  29. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-4Kll7qk7.js +3385 -0
  30. package/dist/{TransferTemplateView-By5Ci4Yg.js → TransferTemplateView-DzcNysRM.js} +166 -166
  31. package/dist/UnitView-Dd9vLRU0.js +674 -0
  32. package/dist/{WarehouseView-4ZLSJXYc.js → WarehouseView-C1T2VVo_.js} +32 -32
  33. package/dist/api/inventory.d.ts +306 -0
  34. package/dist/api/purchase-order.d.ts +1 -0
  35. package/dist/{app-D2lun71R.js → app-DU_GXTW3.js} +11730 -11115
  36. package/dist/app.d.ts +421 -0
  37. package/dist/app.js +1 -1
  38. package/dist/{closing-template-Cm1TtVzm.js → closing-template-DhM1Taa8.js} +1 -1
  39. package/dist/{decimal-eeicE4jp.js → decimal-CB27myvl.js} +1 -1
  40. package/dist/{format-unit-display-vHKazw0l.js → format-unit-display-Bou8fmKm.js} +24 -24
  41. package/dist/helper/number.d.ts +1 -0
  42. package/dist/import-export.helper-Bstm4Lwa.js +243 -0
  43. package/dist/{index-C5s-1g7c.js → index-B14XCvps.js} +1 -1
  44. package/dist/{index-DvX9cMJV.js → index-B9_waZl0.js} +1 -1
  45. package/dist/{purchase-order-template-uTs7bR89.js → purchase-order-template-DKQSKCx3.js} +1 -1
  46. package/dist/router/name.d.ts +1 -0
  47. package/dist/{stock-CL2LNdXp.js → stock-CWx63kov.js} +1 -1
  48. package/dist/stores/feature.d.ts +2 -0
  49. package/dist/stores/inventory.d.ts +26 -199
  50. package/dist/{supplier-CuzoW2k4.js → supplier-BMV0Wr8s.js} +1 -1
  51. package/dist/tsconfig.app.tsbuildinfo +1 -1
  52. package/dist/{use-ingredient-select-dialog-Cpg4lHHC.js → use-ingredient-select-dialog-B6k49FYb.js} +4 -4
  53. package/dist/{use-inventory-binding-dialog-h4M4ICQK.js → use-inventory-binding-dialog-D_ai3vrG.js} +1 -1
  54. package/dist/views/import/ImportView.vue.d.ts +3 -0
  55. package/dist/views/import/components/ImportDialog.vue.d.ts +2 -0
  56. package/dist/views/import/helper/import-export.helper.d.ts +4 -0
  57. package/dist/views/ingredients/helper/import-export.helper.d.ts +3 -1
  58. package/dist/views/receive-request/components/delivery-order-form/SystemTrailDialog.vue.d.ts +17 -0
  59. package/dist/views/receive-request/components/netsuite/NetSuiteTransactionChangeLog.vue.d.ts +15 -0
  60. package/dist/views/recipe/RecipeView.vue.d.ts +1 -0
  61. package/dist/views/recipe/components/import-recipes/ImportRecipeItem.vue.d.ts +16 -0
  62. package/dist/views/recipe/components/import-recipes/ImportRecipes.vue.d.ts +2 -0
  63. package/dist/views/recipe/helper/import-recipe.d.ts +48 -0
  64. package/dist/views/unit/UnitView.vue.d.ts +1 -0
  65. package/dist/views/unit/components/import-units/ImportUnitItem.vue.d.ts +12 -0
  66. package/dist/views/unit/components/import-units/ImportUnitItemProps.d.ts +6 -0
  67. package/dist/views/unit/components/import-units/ImportUnits.vue.d.ts +9 -0
  68. package/dist/views/unit/components/import-units/ImportUnitsProps.d.ts +5 -0
  69. package/dist/views/unit/helper/import-export.helper.d.ts +40 -0
  70. package/package.json +2 -2
  71. package/dist/App-ZoXow3DD.js +0 -276
  72. package/dist/IngredientsView-DUwhH3j1.js +0 -2475
  73. package/dist/RecipeView-DQDfwCJd.js +0 -621
  74. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-w98ibfql.js +0 -3060
  75. package/dist/UnitView-DmuWMFlA.js +0 -667
  76. package/dist/array-Ca8T3f_G.js +0 -44
@@ -1,11 +1,11 @@
1
- import { a as q, a1 as Ie, ap as U, B as Ne, aq as ye, C as he, u as J, l as L, E as De, y as le, G as ve, b as te, t as G, x as Z, aS as Oe, aK as Fe, a6 as Pe, J as Me, K as Ue, ar as Le, e as ce, f as re, R as me, v as Be, an as Qe, D as j, j as N, i as He } from "./app-D2lun71R.js";
1
+ import { a as q, $ as Ie, ao as U, X as Ne, ap as ye, W as he, u as X, l as L, aq as De, z as le, ar as ve, b as te, t as G, y as Z, aS as Oe, aL as Fe, a5 as Pe, B as Me, C as Ue, as as Le, e as ce, f as re, R as me, w as Be, am as Qe, D as j, j as N, i as He } from "./app-DU_GXTW3.js";
2
2
  import { useCoreStore as ge, useI18n as ne } from "@feedmepos/mf-common";
3
- import { useDialogChild as Ve, useSnackbar as be, useDialog as qe, FmButtonVariant as z, components as X } from "@feedmepos/ui-library";
3
+ import { useDialogChild as Ve, useSnackbar as be, useDialog as qe, FmButtonVariant as z, components as J } from "@feedmepos/ui-library";
4
4
  import { defineStore as xe } from "pinia";
5
- import { u as Se } from "./purchase-order-template-uTs7bR89.js";
6
- import { defineComponent as oe, resolveComponent as Q, openBlock as _, createElementBlock as E, createElementVNode as C, normalizeClass as H, createTextVNode as je, toDisplayString as D, unref as I, createCommentVNode as V, createVNode as P, withCtx as ee, Fragment as B, renderList as Y, ref as k, onMounted as ze, computed as ue, watch as Ke, createSlots as Ye, createBlock as K, h as W } from "vue";
7
- import { useRouter as We } from "vue-router";
8
- import { u as ae } from "./supplier-CuzoW2k4.js";
5
+ import { u as Se } from "./purchase-order-template-DKQSKCx3.js";
6
+ import { defineComponent as oe, resolveComponent as Q, openBlock as _, createElementBlock as E, createElementVNode as C, normalizeClass as H, createTextVNode as je, toDisplayString as D, unref as I, createCommentVNode as V, createVNode as P, withCtx as ee, Fragment as B, renderList as W, ref as k, onMounted as ze, computed as ue, watch as Ke, createSlots as We, createBlock as K, h as Y } from "vue";
7
+ import { useRouter as Ye } from "vue-router";
8
+ import { u as ae } from "./supplier-BMV0Wr8s.js";
9
9
  function Te(e) {
10
10
  const t = q(), a = e.sku, u = t.skuById[a._id];
11
11
  if (u.unit._id !== a.unit._id) return !0;
@@ -109,8 +109,8 @@ function Ge(e) {
109
109
  )) == null ? void 0 : l.sheets, s = `${a == null ? void 0 : a.name} transfer templates (${Ne(/* @__PURE__ */ new Date())}).xlsx`, f = ye(i);
110
110
  return he(f, s), s;
111
111
  }
112
- function Je() {
113
- const e = ge(), t = ae(), a = J(), u = q(), i = e.currentBusiness.value, s = _e({
112
+ function Xe() {
113
+ const e = ge(), t = ae(), a = X(), u = q(), i = e.currentBusiness.value, s = _e({
114
114
  sku: {
115
115
  unit: {
116
116
  _id: "",
@@ -221,7 +221,7 @@ function Je() {
221
221
  return he(v, b), b;
222
222
  }
223
223
  function Ze(e, t) {
224
- const a = new Array(), u = /(.*) \(((supplier_|warehouse_|restaurant_).{24,})\)/, s = J().locationByDbName, l = ae().supplierById, o = e.trim(), c = u.exec(o);
224
+ const a = new Array(), u = /(.*) \(((supplier_|warehouse_|restaurant_).{24,})\)/, s = X().locationByDbName, l = ae().supplierById, o = e.trim(), c = u.exec(o);
225
225
  if (!c)
226
226
  return a.push(`Transfer from location value of ${o} cannot be read.`), {
227
227
  errors: a
@@ -262,10 +262,10 @@ function Ze(e, t) {
262
262
  errors: a
263
263
  };
264
264
  }
265
- function Xe(e) {
265
+ function Je(e) {
266
266
  if (!e.length || `${e[0]}`.toLocaleLowerCase() === "all")
267
267
  return [];
268
- const t = /(.*) \(((warehouse_|restaurant_).{24,})\)/, u = J().locationByDbName;
268
+ const t = /(.*) \(((warehouse_|restaurant_).{24,})\)/, u = X().locationByDbName;
269
269
  return e.map((i) => {
270
270
  const s = new Array(), f = i.trim(), l = t.exec(f);
271
271
  if (!l)
@@ -439,7 +439,7 @@ function ot(e) {
439
439
  var p;
440
440
  const l = new Array(), o = e.Sheets[f], c = et(o), h = Ze(c.transferFrom, c.type);
441
441
  l.push(...h.errors);
442
- const d = h.from, m = Xe(c.locations), v = m.filter((n) => n.location).map((n) => n.location);
442
+ const d = h.from, m = Je(c.locations), v = m.filter((n) => n.location).map((n) => n.location);
443
443
  l.push(...m.flatMap((n) => n.errors));
444
444
  const b = tt(o).filter((n) => n.data.code), r = b.map(
445
445
  (n, y) => nt(n.data, y, b)
@@ -575,7 +575,7 @@ const st = { class: "flex items-center gap-12 pl-8" }, it = { class: "flex flex-
575
575
  P(i, { "z-index": 50 }, {
576
576
  content: ee(() => [
577
577
  C("ol", null, [
578
- (_(!0), E(B, null, Y(t.errors, (o, c) => (_(), E("li", { key: c }, D(o), 1))), 128))
578
+ (_(!0), E(B, null, W(t.errors, (o, c) => (_(), E("li", { key: c }, D(o), 1))), 128))
579
579
  ])
580
580
  ]),
581
581
  default: ee(() => [
@@ -701,7 +701,7 @@ const st = { class: "flex items-center gap-12 pl-8" }, it = { class: "flex flex-
701
701
  onFileUpload: r[0] || (r[0] = (p) => t.value = p),
702
702
  label: I(m)("inventory.ingredient.import.uploadTemplate"),
703
703
  "button-label": I(m)("inventory.ingredient.import.selectFile")
704
- }, Ye({ _: 2 }, [
704
+ }, We({ _: 2 }, [
705
705
  t.value ? {
706
706
  name: "default",
707
707
  fn: ee(({ openFileDialog: p }) => [
@@ -747,7 +747,7 @@ const st = { class: "flex items-center gap-12 pl-8" }, it = { class: "flex flex-
747
747
  ]))
748
748
  ], 2),
749
749
  l.value.length ? (_(), E("div", vt, [
750
- (_(!0), E(B, null, Y(l.value, (n, y) => (_(), E("div", {
750
+ (_(!0), E(B, null, W(l.value, (n, y) => (_(), E("div", {
751
751
  key: y,
752
752
  class: "flex gap-8 items-center"
753
753
  }, [
@@ -766,7 +766,7 @@ const st = { class: "flex items-center gap-12 pl-8" }, it = { class: "flex flex-
766
766
  ]), 1032, ["class", "label", "button-label"]),
767
767
  d.value ? (_(), E("div", bt, [
768
768
  C("div", xt, D(I(m)("inventory.ingredient.import.summary")), 1),
769
- (_(!0), E(B, null, Y(o.value, (p, n) => (_(), K(pe, {
769
+ (_(!0), E(B, null, W(o.value, (p, n) => (_(), K(pe, {
770
770
  key: n,
771
771
  name: p.template.name,
772
772
  "transfer-type": typeof p.template.purchaseOrder.supplier.internal == "string" ? I(A).TRANSFER : I(A).PURCHASE,
@@ -775,7 +775,7 @@ const st = { class: "flex items-center gap-12 pl-8" }, it = { class: "flex flex-
775
775
  errors: p.errors,
776
776
  type: "create"
777
777
  }, null, 8, ["name", "transfer-type", "locations", "items", "errors"]))), 128)),
778
- (_(!0), E(B, null, Y(c.value, (p) => (_(), K(pe, {
778
+ (_(!0), E(B, null, W(c.value, (p) => (_(), K(pe, {
779
779
  key: p.template._id,
780
780
  name: p.template.name,
781
781
  "transfer-type": typeof p.template.purchaseOrder.supplier.internal == "string" ? I(A).TRANSFER : I(A).PURCHASE,
@@ -802,7 +802,7 @@ function Tt(e) {
802
802
  return u && u == i;
803
803
  }
804
804
  const _t = xe("transferTemplateActions", () => {
805
- const e = qe(), t = be(), a = J(), u = Ce(), i = Le(), s = Se(), f = te(), l = We(), { t: o } = ne(), c = k({});
805
+ const e = qe(), t = be(), a = X(), u = Ce(), i = Le(), s = Se(), f = te(), l = Ye(), { t: o } = ne(), c = k({});
806
806
  function h() {
807
807
  c.value = {
808
808
  mode: ce.CREATE,
@@ -882,7 +882,7 @@ const _t = xe("transferTemplateActions", () => {
882
882
  props: ["modelValue"],
883
883
  emits: ["update:modelValue"],
884
884
  setup(R) {
885
- return () => W(X.FmTextField, {
885
+ return () => Y(J.FmTextField, {
886
886
  modelValue: R.modelValue,
887
887
  "onUpdate:modelValue": (g) => $ = g,
888
888
  label: "New Template Name",
@@ -1033,7 +1033,7 @@ const _t = xe("transferTemplateActions", () => {
1033
1033
  return;
1034
1034
  }
1035
1035
  e.close(), S(n);
1036
- }).onTertiary(Je);
1036
+ }).onTertiary(Xe);
1037
1037
  }
1038
1038
  async function S(n) {
1039
1039
  try {
@@ -1175,16 +1175,16 @@ const Ce = xe(
1175
1175
  },
1176
1176
  cell(d) {
1177
1177
  const m = Number(d.getValue()) || 0, v = d.row.original.purchaseOrder.items.some(Te);
1178
- return m === 0 || v ? W("div", { class: "flex justify-end gap-4 items-center" }, [
1179
- W(
1180
- X.FmTooltip,
1178
+ return m === 0 || v ? Y("div", { class: "flex justify-end gap-4 items-center" }, [
1179
+ Y(
1180
+ J.FmTooltip,
1181
1181
  {},
1182
1182
  {
1183
1183
  content() {
1184
1184
  return v ? "The template is invalid due to invalid unit on some of the items. Please update this template." : "The template is invalid due to deleted ingredients. Please update this template.";
1185
1185
  },
1186
1186
  default() {
1187
- return W(X.FmIcon, {
1187
+ return Y(J.FmIcon, {
1188
1188
  name: "error",
1189
1189
  color: "system-error-300",
1190
1190
  size: "sm"
@@ -36,3 +36,4 @@ export declare function countDivisibleByTrailingZero(n: number | BigInt): number
36
36
  * Documentation at: https://www.notion.so/feedmepos/Precision-Handling-Logic-8e2211106b4a4a0f9fae8ee9c1e897da?pvs=4
37
37
  */
38
38
  export declare function getAllowedPrecision(unit: FdoInventoryUnit, measurement?: FdoUnitMeasurement | null): number;
39
+ export declare const isNumeric: (value: any) => boolean | 0;
@@ -0,0 +1,243 @@
1
+ import { a as y, V as U, X as E, W as $, l as _, n as N, aq as H, c as T, ar as I, p as C, t as O, a3 as P, O as j } from "./app-DU_GXTW3.js";
2
+ import { useCoreStore as b } from "@feedmepos/mf-common";
3
+ import { r as D } from "./random-CSbEbElR.js";
4
+ function k() {
5
+ return {
6
+ low: 6,
7
+ mid: 14
8
+ };
9
+ }
10
+ function B() {
11
+ return `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${D()}`;
12
+ }
13
+ const V = {
14
+ _id: "",
15
+ name: "",
16
+ abbrev: "",
17
+ precision: 0,
18
+ measurements: []
19
+ };
20
+ function L(e) {
21
+ return !e || Object.keys(e).length === 0 ? "" : Object.entries(e).map(([t, a]) => `${t}: ${a}`).join(", ");
22
+ }
23
+ function A(e) {
24
+ if (!e || e.trim() === "")
25
+ return;
26
+ const t = {}, a = e.split(",").map((n) => n.trim());
27
+ for (const n of a) {
28
+ const s = n.indexOf(":");
29
+ if (s > 0) {
30
+ const c = n.substring(0, s).trim(), r = n.substring(s + 1).trim();
31
+ c && r && (t[c] = r);
32
+ }
33
+ }
34
+ return Object.keys(t).length > 0 ? t : void 0;
35
+ }
36
+ function Y(e) {
37
+ var a, n, s, c, r;
38
+ return {
39
+ code: e.code,
40
+ name: e.name,
41
+ unit: e.unit.name,
42
+ baseUnit: e.unit.abbrev,
43
+ measurementName: ((a = e.unit.measurements.find((m) => m.id === e.trackingMeasurement)) == null ? void 0 : a.abbrev) ?? e.unit.abbrev,
44
+ valuationMethod: e.valuation ?? "WAVG",
45
+ pricePerUnit: (n = e.defaultCost) != null && n.costPerUnit ? +_((s = e.defaultCost) == null ? void 0 : s.costPerUnit) : 0,
46
+ thresholdLow: ((c = e.thresholds) == null ? void 0 : c.low) ?? k().low,
47
+ thresholdMid: ((r = e.thresholds) == null ? void 0 : r.mid) ?? k().mid,
48
+ customAttributes: L(e.customAttributes)
49
+ };
50
+ }
51
+ function w() {
52
+ var s;
53
+ const e = [
54
+ {
55
+ id: "code",
56
+ name: "Code"
57
+ },
58
+ {
59
+ id: "name",
60
+ name: "Name"
61
+ },
62
+ {
63
+ id: "unit",
64
+ name: "Unit"
65
+ },
66
+ {
67
+ id: "baseUnit",
68
+ name: "Base unit"
69
+ },
70
+ {
71
+ id: "measurementName",
72
+ name: "Measurement Name"
73
+ }
74
+ ], t = T(), a = b(), n = N(a.currentCountry.value);
75
+ return t.enableTotalCost && e.push(
76
+ {
77
+ id: "valuationMethod",
78
+ name: "Valuation method"
79
+ },
80
+ {
81
+ id: "pricePerUnit",
82
+ name: `Price per unit (${n == null ? void 0 : n.currency})`
83
+ }
84
+ ), ((s = a.currentBusiness.value) == null ? void 0 : s.menuVersion) === "v4" && e.push(
85
+ {
86
+ id: "thresholdLow",
87
+ name: "Show RED when remaining"
88
+ },
89
+ {
90
+ id: "thresholdMid",
91
+ name: "Show YELLOW when remaining"
92
+ }
93
+ ), e.push({
94
+ id: "customAttributes",
95
+ name: "Custom Attributes"
96
+ }), e;
97
+ }
98
+ function J() {
99
+ const t = y().skus.map(Y), n = b().currentBusiness.value, s = w(), c = [
100
+ ["Business name:", n == null ? void 0 : n.name],
101
+ ["Business ID:", n == null ? void 0 : n._id],
102
+ ["Menu version", n == null ? void 0 : n.menuVersion],
103
+ [],
104
+ s.map((o) => o.name),
105
+ ...t.map((o) => s.map((u) => o[u.id]))
106
+ ], r = s.map((o) => `system:${o.id}`), m = U(c, r), d = `${n == null ? void 0 : n.name} ingredients (${E(/* @__PURE__ */ new Date())}).xlsx`;
107
+ return $(m, d), d;
108
+ }
109
+ function K() {
110
+ const t = b().currentBusiness.value, a = w(), n = [
111
+ ["Business name:", t == null ? void 0 : t.name],
112
+ ["Business ID:", t == null ? void 0 : t._id],
113
+ ["Menu version", t == null ? void 0 : t.menuVersion],
114
+ [],
115
+ a.map((m) => m.name)
116
+ ], s = a.map((m) => `system:${m.id}`), c = U(n, s), r = "FeedMe ingredients template.xlsx";
117
+ return $(c, r), r;
118
+ }
119
+ function F(e) {
120
+ const [
121
+ t,
122
+ a,
123
+ n,
124
+ s,
125
+ c,
126
+ r,
127
+ ...m
128
+ ] = I(e);
129
+ if (!t || !t.length || t.some((l) => l.length && !l.startsWith("system:")))
130
+ throw new Error("Missing meta header. Excel file does not come from the template.");
131
+ const d = t.map((l) => l.split(":")[1]), u = ["code", "name", "unit", "baseUnit", "measurementName"].filter((l) => !d.includes(l));
132
+ if (u.length)
133
+ throw new Error(
134
+ `Missing meta headers (${u.join()}). Excel file does not come from the template.`
135
+ );
136
+ return m.map((l, p) => {
137
+ const f = {};
138
+ for (const v in d) {
139
+ const g = d[v];
140
+ Object.assign(f, { [g]: l[v] });
141
+ }
142
+ return {
143
+ index: p,
144
+ data: f
145
+ };
146
+ });
147
+ }
148
+ function R(e, t, a, { ignoreErrors: n = !1 } = {}) {
149
+ var M;
150
+ const c = y().units, r = new Array(), m = a.filter((i) => i.data.code === e.code);
151
+ m.length > 1 && r.push(
152
+ `Code ${e.code} is already used in row ${m.map((i) => i.index + 6).join()}.`
153
+ );
154
+ const d = c.find((i) => {
155
+ var S, x;
156
+ return i.abbrev === e.baseUnit && ((S = i.name) == null ? void 0 : S.trim()) === ((x = e.unit) == null ? void 0 : x.trim());
157
+ }), o = d == null ? void 0 : d.measurements.find((i) => i.abbrev === e.measurementName);
158
+ if (!d)
159
+ r.push(`Cannot find base unit of symbol ${e.baseUnit}.`);
160
+ else if (e.baseUnit !== e.measurementName && !o) {
161
+ const i = `Cannot find unit conversion for ${e.baseUnit} with symbol ${e.measurementName || "[empty]"}.`;
162
+ r.push(i);
163
+ }
164
+ const u = C.options.find(
165
+ (i) => i === e.valuationMethod
166
+ );
167
+ e.valuationMethod && !u && r.push(
168
+ `Expected valuation method to be one of ${C.options.join()} but got ${e.valuationMethod} instead.`
169
+ );
170
+ const l = b().currentCountry.value, p = (i) => `${i}`.length && j()(i) === !0, f = p(`${e.pricePerUnit}`) === !0 ? {
171
+ costPerUnit: {
172
+ ...O(Number(e.pricePerUnit) || 0, P(Number(e.pricePerUnit) || 0)),
173
+ currency: ((M = N(l)) == null ? void 0 : M.currency) ?? "MYR"
174
+ },
175
+ measurement: o
176
+ } : void 0, v = p(`${e.thresholdLow}`) && p(`${e.thresholdMid}`) ? {
177
+ low: Number(e.thresholdLow) || 0,
178
+ mid: Number(e.thresholdMid) || 0
179
+ } : void 0, g = "customAttributes" in e ? A(e.customAttributes) : null;
180
+ return {
181
+ type: "create",
182
+ sku: {
183
+ _id: B(),
184
+ code: e.code,
185
+ name: e.name,
186
+ unit: d ?? c.find((i) => i) ?? V,
187
+ trackingMeasurement: o == null ? void 0 : o.id,
188
+ valuation: u,
189
+ defaultCost: f,
190
+ thresholds: v,
191
+ ...g !== null && { customAttributes: g }
192
+ },
193
+ errors: r,
194
+ excelRowNumber: t + 6
195
+ };
196
+ }
197
+ function Q(e) {
198
+ try {
199
+ const t = F(e).filter((o) => o.data.code), n = y().skus, s = H(n, "code"), c = t.filter((o) => !s[o.data.code]), r = t.filter((o) => s[o.data.code]), m = c.map(
200
+ (o) => R(o.data, o.index, t)
201
+ ), d = r.map((o) => {
202
+ const u = R(o.data, o.index, t), h = s[o.data.code];
203
+ let l = h.customAttributes;
204
+ return "customAttributes" in o.data && (l = A(o.data.customAttributes)), {
205
+ ...u,
206
+ type: "update",
207
+ original: h,
208
+ sku: {
209
+ // to maintain original props not in the import excel, e.g. inventory binding, etc...
210
+ ...h,
211
+ code: u.sku.code || h.code,
212
+ name: u.sku.name || h.name,
213
+ unit: u.sku.unit || h.unit,
214
+ trackingMeasurement: u.sku.trackingMeasurement || h.trackingMeasurement,
215
+ valuation: u.sku.valuation || h.valuation,
216
+ defaultCost: u.sku.defaultCost || h.defaultCost,
217
+ thresholds: u.sku.thresholds || h.thresholds,
218
+ customAttributes: l
219
+ }
220
+ };
221
+ });
222
+ return {
223
+ invalidExcel: !1,
224
+ importCreateResult: m,
225
+ importUpdateResult: d
226
+ };
227
+ } catch (t) {
228
+ return {
229
+ invalidExcel: !0,
230
+ invalidExcelMessage: (t == null ? void 0 : t.message) ?? "Invalid excel",
231
+ importCreateResult: [],
232
+ importUpdateResult: []
233
+ };
234
+ }
235
+ }
236
+ export {
237
+ K as a,
238
+ w as b,
239
+ k as d,
240
+ J as e,
241
+ Q as g,
242
+ A as s
243
+ };
@@ -1,4 +1,4 @@
1
- import { b5 as x, bd as V, be as q, bf as Ne, bg as cl, bh as sr, bi as Lt, bj as fl, bk as $l } from "./app-D2lun71R.js";
1
+ import { b6 as x, be as V, bf as q, bg as Ne, bh as cl, bi as sr, bj as Lt, bk as fl, bl as $l } from "./app-DU_GXTW3.js";
2
2
  function vl(t, e) {
3
3
  for (var r = 0; r < e.length; r++) {
4
4
  const n = e[r];
@@ -1,5 +1,5 @@
1
1
  import { ref as b, computed as u } from "vue";
2
- import { u as d, b6 as p, aY as v, c as m, b as h } from "./app-D2lun71R.js";
2
+ import { u as d, b7 as p, aY as v, c as m, b as h } from "./app-DU_GXTW3.js";
3
3
  import { useSnackbar as E } from "@feedmepos/ui-library";
4
4
  function I() {
5
5
  return {
@@ -1,4 +1,4 @@
1
- import { a8 as s } from "./app-D2lun71R.js";
1
+ import { a7 as s } from "./app-DU_GXTW3.js";
2
2
  import { useCoreStore as c } from "@feedmepos/mf-common";
3
3
  const u = s((n, a) => {
4
4
  function o() {
@@ -15,6 +15,7 @@ export declare enum RouteName {
15
15
  APPROVAL = "APPROVAL",
16
16
  SUPPLIER = "SUPPLIER",
17
17
  PUBLISH = "PUBLISH",
18
+ IMPORT = "IMPORT",
18
19
  INTEGRATION = "INTEGRATION",
19
20
  DEV = "DEV",
20
21
  IFRAME_INVENTORY_BINDINGS_TABLE = "IFRAME_INVENTORY_BINDINGS_TABLE",
@@ -1,4 +1,4 @@
1
- import { a8 as m, u as k, a as l, az as B, a1 as p } from "./app-D2lun71R.js";
1
+ import { a7 as m, u as k, a as l, aA as B, $ as p } from "./app-DU_GXTW3.js";
2
2
  import { useCoreStore as v } from "@feedmepos/mf-common";
3
3
  import { useSnackbar as $ } from "@feedmepos/ui-library";
4
4
  import { ref as y, computed as b } from "vue";
@@ -27,6 +27,7 @@ export interface FeatureState {
27
27
  inventory_pos_transfer_require_fulfillment: boolean;
28
28
  inventory_backdate_receive: boolean;
29
29
  inventory_purchase_order_custom_cost: boolean;
30
+ inventory_bulk_import: boolean;
30
31
  }
31
32
  export declare const useFeatureStore: () => {
32
33
  readonly businessDbName: string;
@@ -58,6 +59,7 @@ export declare const useFeatureStore: () => {
58
59
  readonly enablePOSTransferRequireFulfillment: boolean;
59
60
  readonly enableBackdateReceive: boolean;
60
61
  readonly enablePurchaseOrderReceiveWithCustomCost: boolean;
62
+ readonly enableBulkImport: boolean;
61
63
  init(): Promise<void>;
62
64
  awaitFeatureLoaded(callback: () => boolean): Promise<boolean>;
63
65
  };