@feedmepos/mf-inventory-portal 1.2.11-dev.2 → 1.2.12-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 (70) hide show
  1. package/dist/{App-7THD1njR.js → App-DAWBJNxz.js} +44 -40
  2. package/dist/{ApprovalView-DMEJRr68.js → ApprovalView-B2WUwSN4.js} +30 -30
  3. package/dist/{BindingsDialog-BNzLPDnk.js → BindingsDialog-C3OOcB8g.js} +2 -2
  4. package/dist/{BindingsPicker-b6IVAFK_.js → BindingsPicker-R3Zz0fWB.js} +1 -1
  5. package/dist/{BindingsTable-C-4XGO_N.js → BindingsTable-B46C8p7M.js} +1 -1
  6. package/dist/{ClosingDraftView-DVTloUym.js → ClosingDraftView-a_QhmaM4.js} +180 -180
  7. package/dist/{ClosingTemplateView-C-eHKV0N.js → ClosingTemplateView-CEVmIsVw.js} +3 -3
  8. package/dist/{DeliveryOrderPrintPreview-ChIV_Wxd.js → DeliveryOrderPrintPreview-BeQFF6sn.js} +1 -1
  9. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DPkGmSYU.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DIG9NwPj.js} +3 -3
  10. package/dist/{FmMultiselectDialog-aRqxOX4h.js → FmMultiselectDialog-BunyF2O-.js} +1 -1
  11. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-_MPI8AAx.js → FmUnitInput.vue_vue_type_script_setup_true_lang-Bx0dzfHO.js} +39 -39
  12. package/dist/ImportView-CwBeBbXz.js +1220 -0
  13. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BiHvGyAN.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-CfwprwJN.js} +1 -1
  14. package/dist/{IngredientGroupView-DtExVKaV.js → IngredientGroupView-CIPTj0hf.js} +16 -17
  15. package/dist/IngredientsView-BwBaeLtw.js +2240 -0
  16. package/dist/{IntegrationView-LnHPQMs8.js → IntegrationView-CvRD-5O6.js} +57 -57
  17. package/dist/{InventoryBindingForm-Cm9TOWWe.js → InventoryBindingForm-DLQTH1di.js} +1 -1
  18. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DwGz8gLR.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-XvIklIYw.js} +31 -31
  19. package/dist/{InventoryBindingSummary-BQ6ysLf9.js → InventoryBindingSummary-BGFSPQIw.js} +1 -1
  20. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-B_ASTDtr.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-B3J0i5IU.js} +1 -1
  21. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DdFHN7A8.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CyMRTB5L.js} +1 -1
  22. package/dist/{PublishView-Dg_U3hW1.js → PublishView-7g0bx6KO.js} +16 -16
  23. package/dist/{PurchaseOrderPrintPreview-DnwHiTGF.js → PurchaseOrderPrintPreview-LEfLcjkd.js} +1 -1
  24. package/dist/{ReceiveRequestView-CIzZf6q8.js → ReceiveRequestView-DUNfHRGf.js} +193 -194
  25. package/dist/RecipeView-XzqGQg_a.js +636 -0
  26. package/dist/{StockView-D6RmCUZZ.js → StockView-vZr9etBj.js} +165 -166
  27. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BAcaiBqq.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-3_csD6uU.js} +1 -1
  28. package/dist/{SupplierView-DmJXuznz.js → SupplierView-CUORFWJW.js} +52 -52
  29. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-9wk6mQHT.js → TransferDetails.vue_vue_type_script_setup_true_lang-DhXoNkss.js} +5 -5
  30. package/dist/{TransferTemplateView-wcXRmuoK.js → TransferTemplateView-DeliKkYY.js} +97 -97
  31. package/dist/UnitView-B4NCl6jJ.js +674 -0
  32. package/dist/{WarehouseView-643lOh1p.js → WarehouseView-jLGGlnwV.js} +32 -32
  33. package/dist/api/inventory.d.ts +306 -0
  34. package/dist/{app-CsyUwsea.js → app-DJcCTZjT.js} +7663 -7341
  35. package/dist/app.d.ts +169 -0
  36. package/dist/app.js +1 -1
  37. package/dist/{closing-template-DaHVCTUh.js → closing-template-hM43IpP-.js} +1 -1
  38. package/dist/{decimal-DveC9JMl.js → decimal-BVu2HlCS.js} +1 -1
  39. package/dist/{format-unit-display-_9FgoZom.js → format-unit-display-C-M_AirC.js} +25 -25
  40. package/dist/helper/number.d.ts +1 -0
  41. package/dist/import-export.helper-C05Vl6i-.js +243 -0
  42. package/dist/{index-ChAOZMz9.js → index-CNQtmSfJ.js} +1 -1
  43. package/dist/{index-CZmm0Xbi.js → index-v6hU4gAy.js} +1 -1
  44. package/dist/{purchase-order-template-D2kAwN4O.js → purchase-order-template-BBCEFnbo.js} +1 -1
  45. package/dist/router/name.d.ts +1 -0
  46. package/dist/{stock-CL0X5Bnh.js → stock-CK3LBQmj.js} +1 -1
  47. package/dist/stores/inventory.d.ts +26 -199
  48. package/dist/{supplier-D3mOSUzY.js → supplier-CoCAyG12.js} +1 -1
  49. package/dist/tsconfig.app.tsbuildinfo +1 -1
  50. package/dist/{use-ingredient-select-dialog-Ba-l0gZ1.js → use-ingredient-select-dialog-DYfpyC4u.js} +1 -1
  51. package/dist/{use-inventory-binding-dialog-CpaprD6M.js → use-inventory-binding-dialog-CDwm6TPx.js} +1 -1
  52. package/dist/views/import/ImportView.vue.d.ts +3 -0
  53. package/dist/views/import/components/ImportDialog.vue.d.ts +2 -0
  54. package/dist/views/import/helper/import-export.helper.d.ts +4 -0
  55. package/dist/views/ingredients/helper/import-export.helper.d.ts +3 -1
  56. package/dist/views/recipe/RecipeView.vue.d.ts +1 -0
  57. package/dist/views/recipe/components/import-recipes/ImportRecipeItem.vue.d.ts +16 -0
  58. package/dist/views/recipe/components/import-recipes/ImportRecipes.vue.d.ts +2 -0
  59. package/dist/views/recipe/helper/import-recipe.d.ts +48 -0
  60. package/dist/views/unit/UnitView.vue.d.ts +1 -0
  61. package/dist/views/unit/components/import-units/ImportUnitItem.vue.d.ts +12 -0
  62. package/dist/views/unit/components/import-units/ImportUnitItemProps.d.ts +6 -0
  63. package/dist/views/unit/components/import-units/ImportUnits.vue.d.ts +9 -0
  64. package/dist/views/unit/components/import-units/ImportUnitsProps.d.ts +5 -0
  65. package/dist/views/unit/helper/import-export.helper.d.ts +40 -0
  66. package/package.json +3 -3
  67. package/dist/IngredientsView-DQUK8EMq.js +0 -2475
  68. package/dist/RecipeView-BQeJBUvu.js +0 -621
  69. package/dist/UnitView-C1cxS42T.js +0 -667
  70. package/dist/array-Ca8T3f_G.js +0 -44
package/dist/app.d.ts CHANGED
@@ -347,6 +347,13 @@ export declare const i18nMessages: {
347
347
  selectFile: string;
348
348
  replaceFile: string;
349
349
  summary: string;
350
+ multiUploadTemplateInstruction: string;
351
+ importInstructions: {
352
+ step1: string;
353
+ step2: string;
354
+ step3: string;
355
+ step4: string;
356
+ };
350
357
  fileError: {
351
358
  noSheet: string;
352
359
  invalidExcel: string;
@@ -496,6 +503,10 @@ export declare const i18nMessages: {
496
503
  message: string;
497
504
  };
498
505
  };
506
+ import: {
507
+ title: string;
508
+ uploadDescription: string;
509
+ };
499
510
  };
500
511
  unit: {
501
512
  title: string;
@@ -535,6 +546,50 @@ export declare const i18nMessages: {
535
546
  message: string;
536
547
  };
537
548
  };
549
+ export: {
550
+ success: string;
551
+ filename: string;
552
+ };
553
+ import: {
554
+ title: string;
555
+ description: string;
556
+ actions: {
557
+ downloadTemplate: string;
558
+ };
559
+ template: {
560
+ success: string;
561
+ filename: string;
562
+ };
563
+ dropzone: {
564
+ label: string;
565
+ helperText: string;
566
+ selectFile: string;
567
+ };
568
+ fileError: {
569
+ title: string;
570
+ noSheet: string;
571
+ invalidExcel: string;
572
+ parseError: string;
573
+ };
574
+ summary: {
575
+ title: string;
576
+ create: string;
577
+ update: string;
578
+ error: string;
579
+ };
580
+ success: {
581
+ title: string;
582
+ message: string;
583
+ };
584
+ error: {
585
+ noData: string;
586
+ invalidContent: string;
587
+ noImportData: string;
588
+ hasErrors: string;
589
+ failed: string;
590
+ systemMessage: string;
591
+ };
592
+ };
538
593
  };
539
594
  transfer: {
540
595
  title: string;
@@ -1258,6 +1313,13 @@ export declare const i18nMessages: {
1258
1313
  selectFile: string;
1259
1314
  replaceFile: string;
1260
1315
  summary: string;
1316
+ multiUploadTemplateInstruction: string;
1317
+ importInstructions: {
1318
+ step1: string;
1319
+ step2: string;
1320
+ step3: string;
1321
+ step4: string;
1322
+ };
1261
1323
  fileError: {
1262
1324
  noSheet: string;
1263
1325
  invalidExcel: string;
@@ -1407,6 +1469,10 @@ export declare const i18nMessages: {
1407
1469
  message: string;
1408
1470
  };
1409
1471
  };
1472
+ import: {
1473
+ title: string;
1474
+ uploadDescription: string;
1475
+ };
1410
1476
  };
1411
1477
  unit: {
1412
1478
  title: string;
@@ -1446,6 +1512,50 @@ export declare const i18nMessages: {
1446
1512
  message: string;
1447
1513
  };
1448
1514
  };
1515
+ export: {
1516
+ success: string;
1517
+ filename: string;
1518
+ };
1519
+ import: {
1520
+ title: string;
1521
+ description: string;
1522
+ actions: {
1523
+ downloadTemplate: string;
1524
+ };
1525
+ template: {
1526
+ success: string;
1527
+ filename: string;
1528
+ };
1529
+ dropzone: {
1530
+ label: string;
1531
+ helperText: string;
1532
+ selectFile: string;
1533
+ };
1534
+ fileError: {
1535
+ title: string;
1536
+ noSheet: string;
1537
+ invalidExcel: string;
1538
+ parseError: string;
1539
+ };
1540
+ summary: {
1541
+ title: string;
1542
+ create: string;
1543
+ update: string;
1544
+ error: string;
1545
+ };
1546
+ success: {
1547
+ title: string;
1548
+ message: string;
1549
+ };
1550
+ error: {
1551
+ noData: string;
1552
+ invalidContent: string;
1553
+ noImportData: string;
1554
+ hasErrors: string;
1555
+ failed: string;
1556
+ systemMessage: string;
1557
+ };
1558
+ };
1449
1559
  };
1450
1560
  transfer: {
1451
1561
  title: string;
@@ -2372,6 +2482,10 @@ export declare const i18nMessages: {
2372
2482
  message: string;
2373
2483
  };
2374
2484
  };
2485
+ import: {
2486
+ title: string;
2487
+ uploadDescription: string;
2488
+ };
2375
2489
  };
2376
2490
  unit: {
2377
2491
  title: string;
@@ -2411,6 +2525,50 @@ export declare const i18nMessages: {
2411
2525
  message: string;
2412
2526
  };
2413
2527
  };
2528
+ export: {
2529
+ success: string;
2530
+ filename: string;
2531
+ };
2532
+ import: {
2533
+ title: string;
2534
+ description: string;
2535
+ actions: {
2536
+ downloadTemplate: string;
2537
+ };
2538
+ template: {
2539
+ success: string;
2540
+ filename: string;
2541
+ };
2542
+ dropzone: {
2543
+ label: string;
2544
+ helperText: string;
2545
+ selectFile: string;
2546
+ };
2547
+ fileError: {
2548
+ title: string;
2549
+ noSheet: string;
2550
+ invalidExcel: string;
2551
+ parseError: string;
2552
+ };
2553
+ summary: {
2554
+ title: string;
2555
+ create: string;
2556
+ update: string;
2557
+ error: string;
2558
+ };
2559
+ success: {
2560
+ title: string;
2561
+ message: string;
2562
+ };
2563
+ error: {
2564
+ noData: string;
2565
+ invalidContent: string;
2566
+ noImportData: string;
2567
+ hasErrors: string;
2568
+ failed: string;
2569
+ systemMessage: string;
2570
+ };
2571
+ };
2414
2572
  };
2415
2573
  transfer: {
2416
2574
  title: string;
@@ -2905,6 +3063,13 @@ export declare const i18nMessages: {
2905
3063
  selectFile: string;
2906
3064
  replaceFile: string;
2907
3065
  summary: string;
3066
+ multiUploadTemplateInstruction: string;
3067
+ importInstructions: {
3068
+ step1: string;
3069
+ step2: string;
3070
+ step3: string;
3071
+ step4: string;
3072
+ };
2908
3073
  fileError: {
2909
3074
  noSheet: string;
2910
3075
  invalidExcel: string;
@@ -3039,6 +3204,10 @@ export declare const i18nMessages: {
3039
3204
  message: string;
3040
3205
  };
3041
3206
  };
3207
+ import: {
3208
+ title: string;
3209
+ uploadDescription: string;
3210
+ };
3042
3211
  };
3043
3212
  unit: {
3044
3213
  title: string;
package/dist/app.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "vue";
2
- import { bm as o, bn as a, bo as e, bl as m, bp as t, a as i } from "./app-CsyUwsea.js";
2
+ import { bn as o, bo as a, bp as e, bm as m, bq as t, a as i } from "./app-DJcCTZjT.js";
3
3
  export {
4
4
  o as FmApp,
5
5
  a as InventoryBindingForm,
@@ -1,4 +1,4 @@
1
- import { a8 as c } from "./app-CsyUwsea.js";
1
+ import { a6 as c } from "./app-DJcCTZjT.js";
2
2
  import { useCoreStore as l } from "@feedmepos/mf-common";
3
3
  const p = c((r, s) => {
4
4
  function o() {
@@ -1,4 +1,4 @@
1
- import "./app-CsyUwsea.js";
1
+ import "./app-DJcCTZjT.js";
2
2
  function m(a) {
3
3
  function t(o, n = !0) {
4
4
  const e = Math.round(Math.log10(o));
@@ -1,11 +1,11 @@
1
- import { a as q, a0 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, H as Me, J 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-CsyUwsea.js";
1
+ import { a as q, Z as Ie, an as U, W as Ne, ao as ye, V as he, u as Z, l as L, ap as De, y as le, aq as ve, b as te, t as G, x as J, aS as Oe, aK as Fe, a4 as Pe, z as Me, B as Ue, ar as Le, e as ce, f as re, R as me, v as Be, al as Qe, D as j, j as N, i as He } from "./app-DJcCTZjT.js";
2
2
  import { useCoreStore as ge, useI18n as ne } from "@feedmepos/mf-common";
3
3
  import { useDialogChild as Ve, useSnackbar as be, useDialog as qe, FmButtonVariant as z, components as X } from "@feedmepos/ui-library";
4
4
  import { defineStore as xe } from "pinia";
5
- import { u as Se } from "./purchase-order-template-D2kAwN4O.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-D3mOSUzY.js";
5
+ import { u as Se } from "./purchase-order-template-BBCEFnbo.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-CoCAyG12.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 Ze() {
113
+ const e = ge(), t = ae(), a = Z(), u = q(), i = e.currentBusiness.value, s = _e({
114
114
  sku: {
115
115
  unit: {
116
116
  _id: "",
@@ -220,8 +220,8 @@ function Je() {
220
220
  }), b = `${i == null ? void 0 : i.name} transfer templates import.xlsx`;
221
221
  return he(v, b), b;
222
222
  }
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);
223
+ function Je(e, t) {
224
+ const a = new Array(), u = /(.*) \(((supplier_|warehouse_|restaurant_).{24,})\)/, s = Z().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
@@ -265,7 +265,7 @@ function Ze(e, t) {
265
265
  function Xe(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 = Z().locationByDbName;
269
269
  return e.map((i) => {
270
270
  const s = new Array(), f = i.trim(), l = t.exec(f);
271
271
  if (!l)
@@ -397,18 +397,18 @@ function nt(e, t, a) {
397
397
  }
398
398
  const c = G(
399
399
  e.quantityStep,
400
- Z(l, o)
400
+ J(l, o)
401
401
  );
402
402
  (Number.isNaN(Number(e.quantityStep)) || Number(e.quantityStep) <= 0) && f.push("Amount step must be more than 0");
403
403
  const h = Oe(c), d = rt(
404
404
  e.minimumQuantity,
405
405
  e.maximumQuantity,
406
- Z(l, o)
406
+ J(l, o)
407
407
  ), m = d.min, v = d.max;
408
408
  d.compareError && f.push(d.compareError);
409
409
  const b = Fe(+e.minimumQuantity, +e.maximumQuantity), r = G(
410
410
  e.defaultQuantity,
411
- Z(l, o)
411
+ J(l, o)
412
412
  ), x = h(r);
413
413
  typeof x == "string" && f.push(`Default amount: ${x}`);
414
414
  const w = d.min && d.max ? b(`${e.defaultQuantity}`) : null;
@@ -437,7 +437,7 @@ function ot(e) {
437
437
  return t.reduce(
438
438
  (s, f) => {
439
439
  var p;
440
- const l = new Array(), o = e.Sheets[f], c = et(o), h = Ze(c.transferFrom, c.type);
440
+ const l = new Array(), o = e.Sheets[f], c = et(o), h = Je(c.transferFrom, c.type);
441
441
  l.push(...h.errors);
442
442
  const d = h.from, m = Xe(c.locations), v = m.filter((n) => n.location).map((n) => n.location);
443
443
  l.push(...m.flatMap((n) => n.errors));
@@ -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 = Z(), 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(X.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(Ze);
1037
1037
  }
1038
1038
  async function S(n) {
1039
1039
  try {
@@ -1175,8 +1175,8 @@ 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(
1178
+ return m === 0 || v ? Y("div", { class: "flex justify-end gap-4 items-center" }, [
1179
+ Y(
1180
1180
  X.FmTooltip,
1181
1181
  {},
1182
1182
  {
@@ -1184,7 +1184,7 @@ const Ce = xe(
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(X.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 b, T as U, W as E, V as $, l as T, m as N, ap as _, c as H, aq as I, o as C, t as j, L as O } from "./app-DJcCTZjT.js";
2
+ import { useCoreStore as y } 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 P() {
11
+ return `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${D()}`;
12
+ }
13
+ const B = {
14
+ _id: "",
15
+ name: "",
16
+ abbrev: "",
17
+ precision: 0,
18
+ measurements: []
19
+ };
20
+ function V(e) {
21
+ return !e || Object.keys(e).length === 0 ? "" : Object.entries(e).map(([t, a]) => `${t}: ${a}`).join(", ");
22
+ }
23
+ function w(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 L(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 ? +T((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: V(e.customAttributes)
49
+ };
50
+ }
51
+ function A() {
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 = H(), a = y(), 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 = b().skus.map(L), n = y().currentBusiness.value, s = A(), 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 = y().currentBusiness.value, a = A(), 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 Y(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 = b().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 = y().currentCountry.value, p = (i) => `${i}`.length && O()(i) === !0, f = p(`${e.pricePerUnit}`) === !0 ? {
171
+ costPerUnit: {
172
+ ...j(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 ? w(e.customAttributes) : null;
180
+ return {
181
+ type: "create",
182
+ sku: {
183
+ _id: P(),
184
+ code: e.code,
185
+ name: e.name,
186
+ unit: d ?? c.find((i) => i) ?? B,
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 = Y(e).filter((o) => o.data.code), n = b().skus, s = _(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 = w(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
+ A as b,
239
+ k as d,
240
+ J as e,
241
+ Q as g,
242
+ w 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-CsyUwsea.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-DJcCTZjT.js";
2
2
  function vl(t, e) {
3
3
  for (var r = 0; r < e.length; r++) {
4
4
  const n = e[r];