@feedmepos/mf-inventory-portal 1.2.49 → 1.2.50-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 (91) hide show
  1. package/dist/{App-w_Dbl-jn.js → App-DkCjc9Ei.js} +72 -68
  2. package/dist/{ApprovalView-CuOM9Ych.js → ApprovalView-CVBi-iKx.js} +34 -34
  3. package/dist/{BindingsDialog-DkMSnr51.js → BindingsDialog-D1EDPBOt.js} +2 -2
  4. package/dist/{BindingsPicker-DrXdWUTh.js → BindingsPicker-BhtMvuQY.js} +2 -2
  5. package/dist/{BindingsTable-Bj0eBYdU.js → BindingsTable-UI5TuSBx.js} +4 -4
  6. package/dist/{ClosingDraftView-D1oohB8Y.js → ClosingDraftView-Dsj4ZYEi.js} +19 -18
  7. package/dist/{ClosingHistoryView-BCYNhLDg.js → ClosingHistoryView-DoW-S9iS.js} +3 -3
  8. package/dist/{ClosingTemplateView-DIvZkCgT.js → ClosingTemplateView-vvlSzfDQ.js} +18 -17
  9. package/dist/{DeliveryOrderPrintPreview-C83_a-LI.js → DeliveryOrderPrintPreview-obetnJsJ.js} +1 -1
  10. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Bmas1qkC.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BQiI8aOT.js} +4 -4
  11. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CQ_Er40u.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-B746F-IR.js} +12 -12
  12. package/dist/{FmMultiselectDialog-BtvZkE6p.js → FmMultiselectDialog-CCvkuTS3.js} +1 -1
  13. package/dist/FmMultiselectDialog-NSDOnWEh.js +621 -0
  14. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BN9OeQF3.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DWwF_0sR.js} +3 -3
  15. package/dist/{ImportView-CRdvYxW3.js → ImportView-COQQTu8N.js} +7 -7
  16. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-D6J1wcU6.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-BeXoFMVr.js} +1 -1
  17. package/dist/{IngredientGroupView-DCdnjh-f.js → IngredientGroupView-RR_JvJ28.js} +108 -107
  18. package/dist/{IngredientsView-DhZadYV8.js → IngredientsView-C3X5o2k_.js} +126 -125
  19. package/dist/{IntegrationView-B_D6Sgj-.js → IntegrationView-B5eHHOqw.js} +80 -80
  20. package/dist/{InventoryBindingForm-CM47I9t9.js → InventoryBindingForm-BUmVxK-a.js} +1 -1
  21. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-BYKUWI9e.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-jXzjJ0Kk.js} +4 -4
  22. package/dist/{InventoryBindingSummary-BSuJMrFU.js → InventoryBindingSummary-BX1xdZX3.js} +1 -1
  23. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-9TTwcC8s.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BCcSPsw6.js} +1 -1
  24. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-D2vWMBZF.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BUPtyu3J.js} +2 -2
  25. package/dist/{PublishView-DxhE5g9_.js → PublishView-CzxnrErB.js} +3 -3
  26. package/dist/{PurchaseOrderPrintPreview-BzIwRI7z.js → PurchaseOrderPrintPreview-fVyn0zFN.js} +1 -1
  27. package/dist/ReceiveRequestView-CkYyKxe-.js +3028 -0
  28. package/dist/{RecipeView-Azx2MoPR.js → RecipeView-DFCFRYey.js} +83 -82
  29. package/dist/{StockView-D51RBHWQ.js → StockView-BRcgulQk.js} +113 -112
  30. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-R0yauCbz.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BOYDCjdV.js} +1 -1
  31. package/dist/{SupplierView-BeHjJ0xJ.js → SupplierView-DIPr4lvP.js} +28 -27
  32. package/dist/SurchargeView-Cszy8Wqp.js +460 -0
  33. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-DG1p3Rim.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-v8ef-mpz.js} +2 -2
  34. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js +84 -0
  35. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-cPIomfPb.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-B-oyRnPC.js} +13 -13
  36. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BZR_EozX.js → TransferDetails.vue_vue_type_script_setup_true_lang-BlLY3DLp.js} +15 -15
  37. package/dist/{TransferTemplateView-BwdhVKO4.js → TransferTemplateView-DSpZoO9t.js} +16 -16
  38. package/dist/{UnitView-BT23dBtV.js → UnitView-IJsE_qkc.js} +20 -19
  39. package/dist/{WarehouseView-PWigQlHk.js → WarehouseView-Dyd2kUli.js} +21 -20
  40. package/dist/{WastageTemplateView-BGO19Pux.js → WastageTemplateView-Dk_bWOam.js} +165 -164
  41. package/dist/api/netsuite.d.ts +8 -0
  42. package/dist/api/surcharge.d.ts +31 -0
  43. package/dist/{app-C0a15lwm.js → app-DavdITF-.js} +4511 -4408
  44. package/dist/app-DiX-EfV6.js +8167 -0
  45. package/dist/app.d.ts +52 -0
  46. package/dist/app.js +1 -1
  47. package/dist/{closing-template-C9jSN68K.js → closing-template-DR9_kQ8D.js} +1 -1
  48. package/dist/component-DpCUABT3.js +82 -0
  49. package/dist/components/FmInventoryTableToolbar.vue.d.ts +8 -0
  50. package/dist/components/FmMultiselectDialogProps.d.ts +5 -0
  51. package/dist/{date2-DND2dkpu.js → date2-8GI9HBWH.js} +1 -1
  52. package/dist/{dayjs.min-CvewwBuM.js → dayjs.min-BlY4XBqj.js} +1 -1
  53. package/dist/{decimal-C11049RC.js → decimal-DL6mE527.js} +2 -2
  54. package/dist/{defineDeepModel-BYmk9G2K.js → defineDeepModel-BfjUieWa.js} +1 -1
  55. package/dist/{duplicate-template-CJLrmGdo.js → duplicate-template-Bgv9_gY3.js} +1 -1
  56. package/dist/{feature-D2GGGVQh.js → feature-Cw8ehb86.js} +3442 -2812
  57. package/dist/{format-time-from-id-DuUqVP8F.js → format-time-from-id-BGWQ_4he.js} +1 -1
  58. package/dist/{format-unit-display-BwBGMuCk.js → format-unit-display-DLGhl4yz.js} +11 -11
  59. package/dist/{import-export.helper-ejk_vT2V.js → import-export.helper-BquBG7Ja.js} +5 -5
  60. package/dist/{index-D65a-5cn.js → index-CU0XsNCT.js} +1 -1
  61. package/dist/{index-C9F5LU0v.js → index-CUO2gkjR.js} +3 -3
  62. package/dist/{index-Cy-YW3O0.js → index-E5tuyI2k.js} +1 -1
  63. package/dist/{lodash-DNLSknxF.js → lodash-CBzRp2rs.js} +1 -1
  64. package/dist/netsuite-fKE8zkqA.js +5402 -0
  65. package/dist/{purchase-order-template-C7J9I7o4.js → purchase-order-template-3KsyDF00.js} +1 -1
  66. package/dist/router/name.d.ts +1 -0
  67. package/dist/{rules-DQNuaKK6.js → rules-nrlXpIxl.js} +3 -3
  68. package/dist/{stock-bYU0NTHD.js → stock-BDzZUQ12.js} +1 -1
  69. package/dist/{stock-1aynIWpi.js → stock-BOXAynI6.js} +3 -3
  70. package/dist/stores/integration/netsuite.d.ts +5 -0
  71. package/dist/stores/surcharge.d.ts +18 -0
  72. package/dist/style.css +1 -1
  73. package/dist/{supplier-B72SAF3j.js → supplier-ImcuOQDw.js} +2 -2
  74. package/dist/surcharge-B8ym7Px4.js +71 -0
  75. package/dist/tsconfig.app.tsbuildinfo +1 -1
  76. package/dist/{use-ingredient-select-dialog-DO20RWUv.js → use-ingredient-select-dialog-DyzX-ffV.js} +2 -2
  77. package/dist/{use-inventory-binding-dialog-R2VQakMR.js → use-inventory-binding-dialog-CSGz0tLk.js} +2 -2
  78. package/dist/{use-template-enabled-locations-2-C7L_vyIF.js → use-template-enabled-locations-2-BgCxeCaB.js} +2 -2
  79. package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +714 -0
  80. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +5 -0
  81. package/dist/views/surcharge/SurchargeView.vue.d.ts +2 -0
  82. package/dist/vue-i18n-DQB_dR_X.js +2365 -0
  83. package/dist/{xlsx-DZcSBj-s.js → xlsx-qb-9b1qs.js} +1 -1
  84. package/dist/{xlsx.util-DMCjqrHn.js → xlsx.util-BCW4ouE2.js} +1 -1
  85. package/package.json +2 -2
  86. package/dist/FmMultiselectDialog-IU5C9o_F.js +0 -598
  87. package/dist/ReceiveRequestView-C5wqi0jE.js +0 -2913
  88. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-cfFHDIwQ.js +0 -162
  89. package/dist/app-uBuHtW8m.js +0 -8127
  90. package/dist/netsuite-TqUeqkqw.js +0 -5131
  91. package/dist/vue-i18n-BLzLoy1U.js +0 -2365
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as I, computed as x, openBlock as l, createElementBlock as d, createElementVNode as e, normalizeClass as b, toDisplayString as u, unref as p, ref as D, resolveComponent as B, Fragment as $, createVNode as k, createCommentVNode as N, withCtx as C, renderList as E } from "vue";
2
2
  import { useI18n as F, useCoreStore as A } from "@feedmepos/mf-common";
3
- import { u as U } from "./netsuite-TqUeqkqw.js";
3
+ import { u as U } from "./netsuite-fKE8zkqA.js";
4
4
  function ee(o, n = !1) {
5
5
  var c;
6
6
  return o ? [
@@ -1,23 +1,24 @@
1
1
  import { defineComponent as ie, mergeModels as Hd, computed as E, useModel as ed, resolveComponent as D, openBlock as S, createElementBlock as w, createElementVNode as h, createVNode as C, withCtx as U, toDisplayString as A, unref as p, Fragment as oe, renderList as le, ref as k, createBlock as z, createCommentVNode as W, createTextVNode as wd, isRef as dd, normalizeClass as ae, watch as Td, createSlots as jd, normalizeStyle as Kd, Teleport as Wd } from "vue";
2
- import { u as ce } from "./supplier-B72SAF3j.js";
2
+ import { u as ce } from "./supplier-ImcuOQDw.js";
3
3
  import { D as td, R as ye } from "./row-action.enum-BcW_L_nE.js";
4
- import { c as Yd, _ as Xd, F as ve } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-cfFHDIwQ.js";
5
- import { c as we, a as ke, h as rd, i as nd, d as Zd, n as Ad, u as Pe } from "./app-C0a15lwm.js";
4
+ import { c as Yd } from "./component-DpCUABT3.js";
5
+ import { c as we, a as ke, h as rd, i as nd, d as Xd, n as Ad, u as Pe } from "./app-DavdITF-.js";
6
6
  import { useI18n as ee, useCoreStore as Ce } from "@feedmepos/mf-common";
7
- import { u as Ve } from "./netsuite-TqUeqkqw.js";
8
- import { useDialog as Ne, useSnackbar as Se, useProxiedModel as od, useDialogChild as qd, useBreakpoints as zd } from "@feedmepos/ui-library";
9
- import { u as Jd, _ as Qd } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
7
+ import { u as Ve } from "./netsuite-fKE8zkqA.js";
8
+ import { useDialog as Ne, useSnackbar as Se, useProxiedModel as od, useDialogChild as Zd, useBreakpoints as qd } from "@feedmepos/ui-library";
9
+ import { u as zd, _ as Jd } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
10
10
  import { F as B } from "./form-mode.enum-BKiNVH6A.js";
11
- import { R as Z, g as et } from "./rules-DQNuaKK6.js";
12
- import { a as dt } from "./FmMultiselectDialog-IU5C9o_F.js";
13
- import { _ as tt } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
14
- import { _ as rt } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-BN9OeQF3.js";
15
- import { u as xe } from "./feature-D2GGGVQh.js";
16
- import { u as nt } from "./purchase-order-template-C7J9I7o4.js";
17
- import { _ as ot } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CQ_Er40u.js";
11
+ import { R as Z, g as Qd } from "./rules-nrlXpIxl.js";
12
+ import { a as et } from "./FmMultiselectDialog-NSDOnWEh.js";
13
+ import { _ as dt } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
14
+ import { _ as tt } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-DWwF_0sR.js";
15
+ import { u as xe } from "./feature-Cw8ehb86.js";
16
+ import { u as rt } from "./purchase-order-template-3KsyDF00.js";
17
+ import { _ as nt, F as ve } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js";
18
+ import { _ as ot } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-B746F-IR.js";
18
19
  import { defineStore as at } from "pinia";
19
- import { b as Rd, d as Md, s as it, r as $t } from "./xlsx.util-DMCjqrHn.js";
20
- import { f as lt } from "./date2-DND2dkpu.js";
20
+ import { b as Rd, d as Md, s as it, r as $t } from "./xlsx.util-BCW4ouE2.js";
21
+ import { f as lt } from "./date2-8GI9HBWH.js";
21
22
  import { F as st } from "./FmDroppableField-J0xUsOTV.js";
22
23
  function ut(e, d) {
23
24
  const { t } = ee(), r = Ve();
@@ -106,13 +107,13 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
106
107
  })), y = ((N = o.value) == null ? void 0 : N.map((f) => f.skuId)) ?? [], g = E(
107
108
  () => {
108
109
  var f;
109
- return ((f = Zd(d.currentCountry.value)) == null ? void 0 : f.currency) ?? "MYR";
110
+ return ((f = Xd(d.currentCountry.value)) == null ? void 0 : f.currency) ?? "MYR";
110
111
  }
111
112
  );
112
113
  n.open({
113
114
  title: i("inventory.supplier.supplyItems.selectItem"),
114
115
  closeButton: !0,
115
- contentComponent: dt,
116
+ contentComponent: et,
116
117
  contentComponentProps: {
117
118
  modelValue: y,
118
119
  items: c
@@ -183,7 +184,7 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
183
184
  h("div", pt, [
184
185
  h("div", ft, [
185
186
  h("div", mt, [
186
- C(tt, { "z-index": 50 }, {
187
+ C(dt, { "z-index": 50 }, {
187
188
  default: U(() => [
188
189
  h("div", yt, A(p(i)("inventory.supplier.supplyItems.title")), 1)
189
190
  ]),
@@ -216,7 +217,7 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
216
217
  ]),
217
218
  h("div", Ct, [
218
219
  h("div", Nt, [
219
- C(rt, {
220
+ C(tt, {
220
221
  "model-value": v(N),
221
222
  unit: u(N),
222
223
  "onUpdate:modelValue": (T) => m(N, T),
@@ -554,7 +555,7 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
554
555
  },
555
556
  emits: ["update:show", "submitted"],
556
557
  setup(e, { expose: d, emit: t }) {
557
- const r = Ve(), n = e, i = t, o = k(!1), l = Se(), s = Ne(), { t: u } = ee(), v = ce(), m = nt(), c = ke(), y = k(!1), g = E(() => {
558
+ const r = Ve(), n = e, i = t, o = k(!1), l = Se(), s = Ne(), { t: u } = ee(), v = ce(), m = rt(), c = ke(), y = k(!1), g = E(() => {
558
559
  switch (n.mode) {
559
560
  case B.READ:
560
561
  return "";
@@ -710,7 +711,7 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
710
711
  var $e;
711
712
  const re = {
712
713
  amount: 1,
713
- precision: et(K.unit)
714
+ precision: Qd(K.unit)
714
715
  };
715
716
  return {
716
717
  sku: K,
@@ -2697,7 +2698,7 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
2697
2698
  }, v1 = { class: "fm-typo-en-body-lg-600" }, g1 = /* @__PURE__ */ ie({
2698
2699
  __name: "SupplierImport",
2699
2700
  setup(e) {
2700
- const d = k(null), t = qd(), r = Se(), n = k(!1), i = k(!1), o = k(new Array()), l = k([]), s = k([]), u = E(
2701
+ const d = k(null), t = Zd(), r = Se(), n = k(!1), i = k(!1), o = k(new Array()), l = k([]), s = k([]), u = E(
2701
2702
  () => !!o.value.length || l.value.some((y) => y.errors.length) || s.value.some((y) => y.errors.length)
2702
2703
  ), v = E(
2703
2704
  () => !!l.value.length || !!s.value.length
@@ -2942,7 +2943,7 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
2942
2943
  }), b1 = { class: "flex flex-col py-8" }, _1 = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, P1 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, C1 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, N1 = {
2943
2944
  key: 0,
2944
2945
  class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
2945
- }, S1 = "You are managing business-level supplier list. These suppliers will be made visible to all locations.", Y1 = /* @__PURE__ */ ie({
2946
+ }, S1 = "You are managing business-level supplier list. These suppliers will be made visible to all locations.", X1 = /* @__PURE__ */ ie({
2946
2947
  __name: "SupplierView",
2947
2948
  setup(e) {
2948
2949
  const { importSuppliers: d, exportSuppliers: t } = h1(), r = ce(), n = Pe(), i = xe(), o = Ve(), l = k(!1), s = Ne(), u = Se(), { t: v } = ee();
@@ -3032,7 +3033,7 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
3032
3033
  if ($ === "refresh")
3033
3034
  return c();
3034
3035
  }
3035
- const V = k(""), { breakpoints: Y } = zd(), X = E(() => Y.value.xs || Y.value.sm), te = E(() => X.value ? 10 : 20), _ = Jd(), x = E(() => [
3036
+ const V = k(""), { breakpoints: Y } = qd(), X = E(() => Y.value.xs || Y.value.sm), te = E(() => X.value ? 10 : 20), _ = zd(), x = E(() => [
3036
3037
  {
3037
3038
  label: v("inventory.supplier.create.title"),
3038
3039
  value: "create",
@@ -3057,7 +3058,7 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
3057
3058
  ]);
3058
3059
  return ($, a) => {
3059
3060
  const H = D("FmTable");
3060
- return S(), z(Qd, {
3061
+ return S(), z(Jd, {
3061
3062
  title: p(v)("inventory.supplier.title"),
3062
3063
  actions: x.value,
3063
3064
  "onClick:action": T,
@@ -3092,7 +3093,7 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
3092
3093
  "page-size": te.value
3093
3094
  }, {
3094
3095
  "list-row": U((I) => [
3095
- C(Xd, {
3096
+ C(nt, {
3096
3097
  row: I,
3097
3098
  onRowClick: f
3098
3099
  }, {
@@ -3149,5 +3150,5 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
3149
3150
  }
3150
3151
  });
3151
3152
  export {
3152
- Y1 as default
3153
+ X1 as default
3153
3154
  };
@@ -0,0 +1,460 @@
1
+ import { defineComponent as pe, ref as v, computed as c, watch as R, onMounted as fe, resolveComponent as p, openBlock as j, createElementBlock as ye, Fragment as ge, createVNode as n, unref as s, withCtx as f, createElementVNode as u, normalizeClass as G, normalizeStyle as he, toDisplayString as E, withDirectives as be, vModelText as _e, createBlock as Se, withModifiers as xe, createCommentVNode as Fe } from "vue";
2
+ import { u as ke, _ as we } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
3
+ import { a as Ie, u as Ce, J as V, j as Le, s as Ve } from "./app-DavdITF-.js";
4
+ import { u as Ae } from "./surcharge-B8ym7Px4.js";
5
+ import { useSnackbar as De, useDialog as Me, useBreakpoints as Oe } from "@feedmepos/ui-library";
6
+ import { _ as Pe } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-B746F-IR.js";
7
+ import { a as Te } from "./FmMultiselectDialog-NSDOnWEh.js";
8
+ import { useI18n as Be } from "@feedmepos/mf-common";
9
+ import { u as ze } from "./supplier-ImcuOQDw.js";
10
+ import { u as Ee } from "./feature-Cw8ehb86.js";
11
+ import { D as Ne, P as $e, L as Ue } from "./app-DiX-EfV6.js";
12
+ import { D as H, R as A } from "./row-action.enum-BcW_L_nE.js";
13
+ import { c as qe } from "./component-DpCUABT3.js";
14
+ const Je = { class: "flex flex-col py-8" }, Re = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, je = { class: "flex flex-col h-full justify-between" }, Ge = { class: "space-y-16" }, He = ["placeholder"], Ke = { class: "flex flex-col gap-16" }, Qe = { class: "flex flex-col gap-8" }, We = { class: "flex-1 fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Xe = { class: "flex flex-col gap-12" }, Ye = { class: "flex flex-col gap-4" }, Ze = { class: "flex items-center gap-8" }, pt = /* @__PURE__ */ pe({
15
+ __name: "SurchargeView",
16
+ setup(et) {
17
+ const y = De(), N = Me(), D = Ie(), x = Ae(), F = Ce(), M = ze(), K = Ee(), g = v(!1), Q = c(() => x.surcharges), k = v(""), { breakpoints: $ } = Oe(), O = c(() => $.value.xs || $.value.sm), W = c(() => O.value ? 10 : 20), X = ke(), { t: a } = Be(), Y = c(() => F.businessLevel);
18
+ R(Y, T);
19
+ const Z = c(() => (F.businessLevel || K.businessSupplierOnly ? M.businessSuppliers : M.locationSuppliers).map((t) => ({ label: t.name, value: t._id }))), ee = c(() => [
20
+ {
21
+ key: "supplierId",
22
+ type: "string",
23
+ entity: "supplier",
24
+ options: Z.value
25
+ },
26
+ {
27
+ key: "totalCost",
28
+ type: "number"
29
+ }
30
+ ]), te = c(() => D.skus.map((e) => ({
31
+ label: `${e.code} - ${e.name}`,
32
+ sublabel: e.code,
33
+ value: e,
34
+ disabled: e.isInactive,
35
+ tags: e.isInactive ? ["Inactive"] : ["Active"]
36
+ }))), w = c(() => {
37
+ var t;
38
+ const e = (t = o.value.value) == null ? void 0 : t.skuId;
39
+ return e ? D.skus.find((r) => r._id === e) : null;
40
+ });
41
+ function ae() {
42
+ var i;
43
+ const e = (i = o.value.value) == null ? void 0 : i.skuId, t = e ? D.skus.find((d) => d._id === e) : null, r = [
44
+ {
45
+ type: "string",
46
+ key: "tags",
47
+ entity: "item",
48
+ values: ["Inactive", "Active"]
49
+ }
50
+ ];
51
+ N.open({
52
+ title: a("inventory.surcharge.form.value.itemPlaceholder"),
53
+ closeButton: !0,
54
+ contentComponent: Te,
55
+ contentComponentProps: {
56
+ modelValue: t ? [t] : [],
57
+ items: te.value,
58
+ virtualScroll: !0,
59
+ filterAttributes: r,
60
+ maxSelections: 1
61
+ },
62
+ primaryActions: {
63
+ text: a("common.confirm"),
64
+ close: !0
65
+ },
66
+ secondaryActions: {
67
+ text: a("common.close"),
68
+ close: !0,
69
+ variant: "tertiary"
70
+ }
71
+ }).onPrimary((d) => {
72
+ d && d.length > 0 ? z(d[0]._id) : z(null);
73
+ });
74
+ }
75
+ const _ = v(!1), P = v(""), o = v({
76
+ _id: "",
77
+ name: "",
78
+ value: {
79
+ amount: {
80
+ currency: V(),
81
+ amount: 0,
82
+ precision: 0
83
+ }
84
+ },
85
+ rule: null,
86
+ businessId: "",
87
+ applyTo: "purchaseOrder"
88
+ }), S = v(), h = v(""), b = v(null), oe = c(() => [
89
+ {
90
+ label: a("inventory.surcharge.actions.create"),
91
+ value: "create",
92
+ isPrimary: !0,
93
+ prependIcon: "add"
94
+ }
95
+ ]);
96
+ async function T() {
97
+ try {
98
+ await M.readSuppliers();
99
+ } catch {
100
+ y.open({ message: a("Failed to fetch suppliers"), type: "error" });
101
+ }
102
+ }
103
+ async function le() {
104
+ o.value.rule = b.value ? $e.build(b.value) : null, g.value = !0;
105
+ try {
106
+ S.value ? (await x.update(o.value._id, o.value), y.open({
107
+ title: a("Success"),
108
+ message: a("Order surcharge updated successfully"),
109
+ type: "success"
110
+ })) : (await x.create(o.value), y.open({
111
+ title: a("Success"),
112
+ message: a("Order surcharge created successfully"),
113
+ type: "success"
114
+ })), _.value = !1, o.value = {
115
+ _id: "",
116
+ name: "",
117
+ value: { amount: { currency: V(), amount: 0, precision: 0 } },
118
+ rule: null,
119
+ businessId: "",
120
+ applyTo: "purchaseOrder"
121
+ }, S.value = void 0;
122
+ } catch (e) {
123
+ e instanceof Le || y.open({
124
+ title: a("Error"),
125
+ message: a("Failed to save order surcharge"),
126
+ type: "error"
127
+ });
128
+ } finally {
129
+ g.value = !1;
130
+ }
131
+ }
132
+ async function re(e) {
133
+ g.value = !0;
134
+ try {
135
+ await x.delete(e._id), y.open({
136
+ title: a("Success"),
137
+ message: a("inventory.surcharge.delete.success", { name: e.name }),
138
+ type: "success"
139
+ }), _.value = !1;
140
+ } catch (t) {
141
+ y.open({
142
+ title: a("inventory.surcharge.delete.error"),
143
+ message: a("inventory.surcharge.delete.errorMessage", { name: e.name }),
144
+ type: "error"
145
+ }), console.error("failed to delete surcharge", t);
146
+ } finally {
147
+ g.value = !1;
148
+ }
149
+ }
150
+ function ne() {
151
+ S.value && N.open({
152
+ title: a("inventory.surcharge.delete.title", { name: o.value.name }),
153
+ closeButton: !1,
154
+ message: a("inventory.surcharge.delete.message"),
155
+ primaryActions: {
156
+ text: a("common.delete"),
157
+ close: !0,
158
+ variant: "destructive"
159
+ },
160
+ secondaryActions: {
161
+ text: a("common.cancel"),
162
+ close: !0
163
+ }
164
+ }).onPrimary(() => re(o.value));
165
+ }
166
+ function se(e, t) {
167
+ if (e === A.Edit) {
168
+ U(t);
169
+ return;
170
+ }
171
+ if (e === A.Delete) {
172
+ o.value = JSON.parse(JSON.stringify(t)), S.value = t, ne();
173
+ return;
174
+ }
175
+ }
176
+ function ue(e) {
177
+ switch (e) {
178
+ case "create": {
179
+ if (g.value) {
180
+ y.open({
181
+ title: "Loading data...",
182
+ message: "Please wait.",
183
+ type: "info"
184
+ });
185
+ return;
186
+ }
187
+ P.value = "inventory.surcharge.actions.create";
188
+ const t = V();
189
+ o.value = {
190
+ _id: "",
191
+ name: "",
192
+ value: {
193
+ amount: {
194
+ currency: t,
195
+ amount: 0,
196
+ precision: 0
197
+ }
198
+ },
199
+ rule: null,
200
+ businessId: "",
201
+ applyTo: "purchaseOrder"
202
+ }, S.value = void 0, b.value = null, h.value = "", _.value = !0;
203
+ break;
204
+ }
205
+ }
206
+ }
207
+ function U(e) {
208
+ P.value = "inventory.surcharge.actions.edit", o.value = JSON.parse(JSON.stringify(e)), S.value = e, b.value = e.rule ? Ue.build(e.rule) : null, h.value = "", _.value = !0;
209
+ }
210
+ function q() {
211
+ var t;
212
+ if (h.value !== "")
213
+ return h.value;
214
+ const e = (t = o.value.value) == null ? void 0 : t.amount;
215
+ return e ? Ve.toFormatString({
216
+ value: {
217
+ amount: e.amount,
218
+ precision: e.precision
219
+ }
220
+ }) : "0";
221
+ }
222
+ let B = null;
223
+ function ie(e) {
224
+ h.value = e, B && clearTimeout(B), B = setTimeout(() => {
225
+ var I, L;
226
+ const t = parseFloat(e) || 0, r = (I = o.value.value) == null ? void 0 : I.amount, i = (r == null ? void 0 : r.precision) ?? 0, d = (r == null ? void 0 : r.currency) ?? V(), C = (L = o.value.value) == null ? void 0 : L.skuId;
227
+ o.value.value = {
228
+ amount: {
229
+ amount: Math.round(t * Math.pow(10, i)),
230
+ precision: i,
231
+ currency: d
232
+ },
233
+ ...C && { skuId: C }
234
+ }, h.value = "";
235
+ }, 500);
236
+ }
237
+ function z(e) {
238
+ const t = o.value.value;
239
+ if (e)
240
+ o.value.value = {
241
+ ...t,
242
+ skuId: e
243
+ };
244
+ else {
245
+ const { skuId: r, ...i } = t || {};
246
+ o.value.value = i;
247
+ }
248
+ }
249
+ const ce = c(() => [
250
+ {
251
+ accessorKey: "name",
252
+ header: () => a("inventory.surcharge.table.name"),
253
+ enableSorting: !0,
254
+ size: "auto"
255
+ },
256
+ {
257
+ id: "action",
258
+ header: "",
259
+ cell(e) {
260
+ return qe(
261
+ [H[A.Edit], H[A.Delete]],
262
+ (t) => {
263
+ se(t, e.row.original);
264
+ }
265
+ );
266
+ },
267
+ enableSorting: !1,
268
+ size: 40
269
+ }
270
+ ]), me = c(() => {
271
+ let e = Q.value;
272
+ if (k.value) {
273
+ const t = k.value.toLowerCase();
274
+ e = e.filter((r) => r.name.toLowerCase().includes(t));
275
+ }
276
+ return e;
277
+ });
278
+ return fe(() => {
279
+ T(), x.browse();
280
+ }), R(
281
+ () => F._currentLocation,
282
+ () => {
283
+ F._currentLocation && T();
284
+ }
285
+ ), (e, t) => {
286
+ const r = p("FmTable"), i = p("FmFormGroup"), d = p("FmLabel"), C = p("FmTextField"), I = p("FmButton"), L = p("FmIcon"), de = p("FmCard"), ve = p("FmSideSheet");
287
+ return j(), ye(ge, null, [
288
+ n(we, {
289
+ title: s(a)("inventory.surcharge.title"),
290
+ actions: oe.value,
291
+ "onClick:action": ue
292
+ }, {
293
+ default: f(() => [
294
+ u("div", {
295
+ class: G([
296
+ "flex flex-col gap-8 max-h-full",
297
+ {
298
+ "p-0": O.value,
299
+ "px-24 ": !O.value
300
+ }
301
+ ])
302
+ }, [
303
+ n(Pe, {
304
+ searchable: "",
305
+ search: k.value,
306
+ "onUpdate:search": t[0] || (t[0] = (l) => k.value = l)
307
+ }, null, 8, ["search"]),
308
+ n(r, {
309
+ style: he(s(X).tableHeight),
310
+ "column-defs": ce.value,
311
+ "row-data": me.value,
312
+ "search-value": k.value,
313
+ loading: g.value || !s(F)._currentLocation,
314
+ "page-size": W.value,
315
+ onRowClick: t[1] || (t[1] = (l) => U(l.original))
316
+ }, {
317
+ "list-row": f((l) => [
318
+ u("div", Je, [
319
+ u("div", Re, E(l.original.name), 1)
320
+ ])
321
+ ]),
322
+ _: 1
323
+ }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"])
324
+ ], 2)
325
+ ]),
326
+ _: 1
327
+ }, 8, ["title", "actions"]),
328
+ n(ve, {
329
+ modelValue: _.value,
330
+ "onUpdate:modelValue": t[8] || (t[8] = (l) => _.value = l),
331
+ header: s(a)(P.value),
332
+ "max-width": 800
333
+ }, {
334
+ "side-sheet-footer": f(() => [
335
+ n(I, {
336
+ variant: "primary",
337
+ class: "w-full",
338
+ onClick: le,
339
+ loading: g.value,
340
+ label: s(a)("inventory.surcharge.actions.save")
341
+ }, null, 8, ["loading", "label"])
342
+ ]),
343
+ default: f(() => [
344
+ u("div", je, [
345
+ u("div", Ge, [
346
+ n(i, {
347
+ modelValue: o.value.name,
348
+ "onUpdate:modelValue": t[3] || (t[3] = (l) => o.value.name = l),
349
+ label: s(a)("inventory.surcharge.form.name"),
350
+ required: !0,
351
+ rules: [(l) => !!l.trim().length || s(a)("inventory.surcharge.form.nameRequired")]
352
+ }, {
353
+ default: f(() => [
354
+ be(u("input", {
355
+ "onUpdate:modelValue": t[2] || (t[2] = (l) => o.value.name = l),
356
+ class: "w-full p-8 border rounded-md outline-none focus:border-blue-500",
357
+ placeholder: s(a)("inventory.surcharge.form.namePlaceholder")
358
+ }, null, 8, He), [
359
+ [_e, o.value.name]
360
+ ])
361
+ ]),
362
+ _: 1
363
+ }, 8, ["modelValue", "label", "rules"]),
364
+ u("div", Ke, [
365
+ u("div", Qe, [
366
+ n(d, {
367
+ label: s(a)("inventory.surcharge.form.rules.title"),
368
+ required: ""
369
+ }, null, 8, ["label"]),
370
+ u("div", We, E(s(a)("inventory.surcharge.form.rules.description")), 1)
371
+ ]),
372
+ n(de, {
373
+ variant: "outlined",
374
+ class: "p-16"
375
+ }, {
376
+ default: f(() => {
377
+ var l;
378
+ return [
379
+ u("div", Xe, [
380
+ u("div", Ye, [
381
+ n(i, {
382
+ "model-value": parseFloat(q()),
383
+ label: s(a)("inventory.surcharge.form.value.amount"),
384
+ required: !0,
385
+ rules: [(m) => m > 0 || "Amount must be greater than 0"]
386
+ }, {
387
+ default: f(() => [
388
+ n(C, {
389
+ "model-value": q(),
390
+ "onUpdate:modelValue": t[4] || (t[4] = (m) => ie(m)),
391
+ onBlur: t[5] || (t[5] = () => h.value = ""),
392
+ type: "number",
393
+ step: 0.01
394
+ }, null, 8, ["model-value"])
395
+ ]),
396
+ _: 1
397
+ }, 8, ["model-value", "label", "rules"]),
398
+ n(i, {
399
+ "model-value": (l = o.value.value) == null ? void 0 : l.skuId,
400
+ label: s(a)("inventory.surcharge.form.value.item"),
401
+ "label-mark": "optional"
402
+ }, {
403
+ default: f(() => [
404
+ u("div", {
405
+ class: "flex items-center justify-between p-12 border border-fm-color-neutral-gray-300 rounded-md cursor-pointer hover:border-fm-color-neutral-gray-400 transition-colors",
406
+ onClick: ae
407
+ }, [
408
+ u("span", {
409
+ class: G([
410
+ "line-clamp-1 fm-typo-en-body-lg-400",
411
+ w.value ? "text-fm-color-typo-primary" : "text-fm-color-typo-tertiary"
412
+ ])
413
+ }, E(w.value ? `${w.value.code} - ${w.value.name}` : s(a)("inventory.surcharge.form.value.itemPlaceholder")), 3),
414
+ u("div", Ze, [
415
+ w.value ? (j(), Se(I, {
416
+ key: 0,
417
+ variant: "tertiary",
418
+ icon: "close",
419
+ onClick: t[6] || (t[6] = xe((m) => z(null), ["stop"]))
420
+ })) : Fe("", !0),
421
+ n(L, {
422
+ name: "arrow_drop_down",
423
+ size: "md"
424
+ })
425
+ ])
426
+ ])
427
+ ]),
428
+ _: 1
429
+ }, 8, ["model-value", "label"]),
430
+ n(s(Ne), {
431
+ modelValue: b.value,
432
+ "onUpdate:modelValue": t[7] || (t[7] = (m) => b.value = m),
433
+ attributes: ee.value
434
+ }, null, 8, ["modelValue", "attributes"]),
435
+ n(i, {
436
+ "model-value": b.value,
437
+ rules: [(m) => {
438
+ var J;
439
+ return !!((J = m == null ? void 0 : m.rules) != null && J.length) || "At least one rule is required";
440
+ }]
441
+ }, null, 8, ["model-value", "rules"])
442
+ ])
443
+ ])
444
+ ];
445
+ }),
446
+ _: 1
447
+ })
448
+ ])
449
+ ])
450
+ ])
451
+ ]),
452
+ _: 1
453
+ }, 8, ["modelValue", "header"])
454
+ ], 64);
455
+ };
456
+ }
457
+ });
458
+ export {
459
+ pt as default
460
+ };
@@ -1,9 +1,9 @@
1
1
  import { defineComponent as I, ref as m, resolveComponent as p, openBlock as i, createBlock as O, withCtx as u, createVNode as y, createElementBlock as v, toDisplayString as g, createElementVNode as T, h as B } from "vue";
2
2
  import { F as L } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
3
- import { o as U, u as _ } from "./app-C0a15lwm.js";
3
+ import { o as U, u as _ } from "./app-DavdITF-.js";
4
4
  import { useCoreStore as A } from "@feedmepos/mf-common";
5
5
  import { useDialog as C, components as V } from "@feedmepos/ui-library";
6
- import { u as F, a as j } from "./closing-template-C9jSN68K.js";
6
+ import { u as F, a as j } from "./closing-template-DR9_kQ8D.js";
7
7
  const q = U((o, t) => {
8
8
  const c = _(), l = A();
9
9
  return {