@feedmepos/mf-inventory-portal 1.6.0-dev.7 → 1.6.1-dev.0

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 (93) hide show
  1. package/dist/{App-CfPro_9C.js → App-CL5dPCEj.js} +4 -4
  2. package/dist/{ApprovalView-DSN8Po9S.js → ApprovalView-DKJibNlK.js} +7 -7
  3. package/dist/{BindingsDialog-Bnuqm3nG.js → BindingsDialog-DLJXu8Dw.js} +2 -2
  4. package/dist/{BindingsPicker-Dd4REc66.js → BindingsPicker-CW6Tk9JI.js} +2 -2
  5. package/dist/{BindingsTable-C-HtmMpH.js → BindingsTable-3JJEAQz3.js} +3 -3
  6. package/dist/{ClosingDraftView-CTtxiXwh.js → ClosingDraftView-DVoWnPTQ.js} +27 -28
  7. package/dist/{ClosingHistoryView-cvmoaHAt.js → ClosingHistoryView-qWjIbBsX.js} +5 -5
  8. package/dist/{ClosingTemplateView-BBxNHF64.js → ClosingTemplateView-C3Hf510z.js} +14 -14
  9. package/dist/{DefaultView-CsqggsmN.js → DefaultView-wBhT3ag9.js} +2 -2
  10. package/dist/{DeliveryOrderPrintPreview-DKEmN4tO.js → DeliveryOrderPrintPreview-VnG9wrNu.js} +2 -2
  11. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CLMHR5Fy.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C4pvSYN-.js} +2 -2
  12. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-24Qj9QM3.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Bkh9LvJQ.js} +2 -2
  13. package/dist/{FmMultiselectDialog-DXBkITTj.js → FmMultiselectDialog-C7P1UET0.js} +2 -2
  14. package/dist/{FmMultiselectDialog-C70WEGrm.js → FmMultiselectDialog-Dru64kWF.js} +1 -1
  15. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-B8QH4-MU.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BklBxBGT.js} +5 -5
  16. package/dist/{ImportView-BNS7vOnx.js → ImportView-C9w-sF5E.js} +6 -6
  17. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CGoVzY_5.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-BuphGYe2.js} +1 -1
  18. package/dist/{IngredientGroupView-Db80oGZN.js → IngredientGroupView-BZqXPr_n.js} +21 -21
  19. package/dist/{IngredientsView-q6E2tmIN.js → IngredientsView-DgTPgkN9.js} +17 -17
  20. package/dist/{IntegrationExplorerView-4pyt5Z5K.js → IntegrationExplorerView-B8U3LTtj.js} +5 -5
  21. package/dist/IntegrationView-QyHxizvF.js +5791 -0
  22. package/dist/{InventoryBindingForm-D-j7xlaq.js → InventoryBindingForm-NRwFwJt5.js} +1 -1
  23. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-BPMTYItR.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-C-If3KBe.js} +5 -5
  24. package/dist/{InventoryBindingSummary-BS9rFFE5.js → InventoryBindingSummary-DqI3M6jQ.js} +1 -1
  25. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DvtFGe3C.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Xt_1oU-z.js} +1 -1
  26. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-54yXqcN9.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DFYTlv_K.js} +1 -1
  27. package/dist/{PublishView-xnFv__ui.js → PublishView-2ytn8EUo.js} +61 -56
  28. package/dist/{PurchaseOrderPrintPreview-CMMBoIGC.js → PurchaseOrderPrintPreview-Bqim_q38.js} +2 -2
  29. package/dist/{ReceiveRequestView-BR2e1bFZ.js → ReceiveRequestView-DIPZCXxV.js} +738 -738
  30. package/dist/{RecipeView-CHnyBJ0f.js → RecipeView-Bs326Ew3.js} +17 -17
  31. package/dist/{SettingsView-Cf6T5YmG.js → SettingsView-frX_dI_K.js} +4 -4
  32. package/dist/{StockView-Cv5M6SI4.js → StockView-Us8Wx8y_.js} +19 -19
  33. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BdJfkEW-.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Du8BI_cZ.js} +1 -1
  34. package/dist/{SupplierView-Bm3pUwbz.js → SupplierView-8dnHAbK3.js} +12 -12
  35. package/dist/{SurchargeView-CvxmTW8L.js → SurchargeView-CfqjYiBs.js} +6 -6
  36. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-Dohtj-Y_.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-_03vSZ4W.js} +2 -2
  37. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DBWoc7Cq.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CAb7UWFP.js} +1 -1
  38. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BvQoNFyl.js → TransferDetails.vue_vue_type_script_setup_true_lang-B58A7dWI.js} +179 -179
  39. package/dist/{TransferTemplateView-DwslyLh7.js → TransferTemplateView-CI84cmV5.js} +20 -20
  40. package/dist/{UnitCostHistoryView-DyYMqFXw.js → UnitCostHistoryView-DXolsbDT.js} +4 -4
  41. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-BiVS-xuv.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-Bpoawj7B.js} +10 -11
  42. package/dist/{UnitView-DWS3MozP.js → UnitView-DT3fcagF.js} +7 -7
  43. package/dist/{WarehouseView-BWO6YSsg.js → WarehouseView-C1BHChSJ.js} +5 -5
  44. package/dist/{WastageTemplateView-BtCHJ60X.js → WastageTemplateView-Bc5CZJ58.js} +14 -14
  45. package/dist/{app-BS8Y8XB1.js → app-DpMCzQql.js} +228 -23
  46. package/dist/app.d.ts +205 -0
  47. package/dist/app.js +1 -1
  48. package/dist/{closing-template-Dnukh28P.js → closing-template-CaFX19g1.js} +1 -1
  49. package/dist/{date2-DOWGtN_k.js → date2-DBsUy1HH.js} +1 -1
  50. package/dist/{dayjs.min-D3dSrhTX.js → dayjs.min-BVKjPmJE.js} +1 -1
  51. package/dist/{decimal-Bk_LcBc8.js → decimal-DKl2dUd0.js} +2 -2
  52. package/dist/{defineDeepModel-s_J1LoEM.js → defineDeepModel-YeHxg9wN.js} +1 -1
  53. package/dist/{duplicate-template-BTf1Xhvo.js → duplicate-template-Dyx4X380.js} +1 -1
  54. package/dist/{feature-DDV6dfk3.js → feature-ltFu24H8.js} +2 -2
  55. package/dist/{format-time-from-id-Q4wzJvY5.js → format-time-from-id-D3lPFiqA.js} +1 -1
  56. package/dist/{format-unit-display-B8tTISaS.js → format-unit-display-CD8C9YZc.js} +12 -12
  57. package/dist/{import-export.helper-BK3vn2Ss.js → import-export.helper-BJ5Lz4Gg.js} +6 -6
  58. package/dist/{index-CY7iF8Ji.js → index-B8xTUvTH.js} +1 -1
  59. package/dist/{index-C74Cmjq-.js → index-JOemzj27.js} +1 -1
  60. package/dist/{index-fQ54arbf.js → index-TQKBiFuU.js} +3 -3
  61. package/dist/{inventory-core-dart.default-Dl166D_R.js → inventory-core-dart.default-Xz0fuxVn.js} +355 -328
  62. package/dist/{lz-string-wIxbEJut.js → lz-string-DAdPi3YY.js} +1 -1
  63. package/dist/{netsuite-BeD5zM7r.js → netsuite-qr2wHoV5.js} +1570 -1509
  64. package/dist/{number-B5DVgaWM.js → number-xgIylzEb.js} +3 -3
  65. package/dist/{predefined-templates-DZNPHq12.js → predefined-templates-j5MqD37J.js} +1 -1
  66. package/dist/{purchase-order-template-aR89SUGU.js → purchase-order-template-CglLUVxv.js} +1 -1
  67. package/dist/{recalculationUtils-DjE7iLEk.js → recalculationUtils-O8dnzyPD.js} +1 -1
  68. package/dist/{rules-C_1llraF.js → rules-BPu-CBAX.js} +2 -2
  69. package/dist/{stock-DzPtGhtF.js → stock-VM7b7_Km.js} +1 -1
  70. package/dist/{supplier-Bln8QZF9.js → supplier-W00UQBDk.js} +2 -2
  71. package/dist/{surcharge-Czr01eFJ.js → surcharge-CUUDBYUf.js} +1 -1
  72. package/dist/tsconfig.app.tsbuildinfo +1 -1
  73. package/dist/{uom-rules-DGZ_Y5qW.js → uom-rules-D6eW0fAO.js} +1 -1
  74. package/dist/{use-ingredient-select-dialog-Bo31tZwb.js → use-ingredient-select-dialog-Cd700UkI.js} +2 -2
  75. package/dist/{use-inventory-binding-dialog-Cs0ag6eH.js → use-inventory-binding-dialog-Cf8wC8AI.js} +2 -2
  76. package/dist/{use-template-enabled-locations-Dz7i898A.js → use-template-enabled-locations-D1AVostH.js} +2 -2
  77. package/dist/{use-transfer-locations-DGKaXjGH.js → use-transfer-locations-uOi6cGul.js} +2 -2
  78. package/dist/{useHrmPermission-YMieTr4z.js → useHrmPermission-DEu2Lyei.js} +1 -1
  79. package/dist/{useNavigationMenu-CR9b-9EU.js → useNavigationMenu-DuIGSnMd.js} +2 -2
  80. package/dist/{useSseClient-D5xvMgqf.js → useSseClient-D1uc8ZIc.js} +3 -3
  81. package/dist/views/integration/components/binding-import/BindingImportPreview.vue.d.ts +22 -0
  82. package/dist/views/integration/components/binding-import/ImportBindings.vue.d.ts +444 -0
  83. package/dist/views/integration/helper/binding-import/configs/codemax.d.ts +3 -0
  84. package/dist/views/integration/helper/binding-import/configs/codemax.spec.d.ts +1 -0
  85. package/dist/views/integration/helper/binding-import/configs/food-market-hub.d.ts +3 -0
  86. package/dist/views/integration/helper/binding-import/configs/food-market-hub.spec.d.ts +1 -0
  87. package/dist/views/integration/helper/binding-import/core.d.ts +43 -0
  88. package/dist/views/integration/helper/binding-import/types.d.ts +100 -0
  89. package/dist/{vue-i18n-CPBfs8-Q.js → vue-i18n-DElpxFA8.js} +321 -321
  90. package/dist/{xlsx-9rrE89GF.js → xlsx.util-Cm8s0ZJD.js} +2511 -2414
  91. package/package.json +3 -3
  92. package/dist/IntegrationView-BnZlrLP_.js +0 -5100
  93. package/dist/xlsx.util-Dt_h5XF4.js +0 -101
@@ -1,36 +1,36 @@
1
1
  import { defineComponent as qe, ref as J, watch as Ge, nextTick as us, openBlock as a, createBlock as pe, Teleport as ds, createElementBlock as h, withModifiers as ms, createElementVNode as e, normalizeClass as Ue, toDisplayString as x, createCommentVNode as T, unref as _, withDirectives as ps, vModelText as fs, toRaw as vs, shallowRef as Vt, onUnmounted as ys, triggerRef as bs, computed as M, readonly as hs, h as Y, reactive as gs, onMounted as Wt, resolveComponent as se, withCtx as ie, createVNode as q, Fragment as $e, renderList as Ee, createTextVNode as ze, renderSlot as _s, isRef as Ss, resolveDynamicComponent as xs } from "vue";
2
- import { f as ks, h as Os, r as ws, s as Qt } from "./predefined-templates-DZNPHq12.js";
3
- import { f as st, p as $s } from "./format-time-from-id-Q4wzJvY5.js";
2
+ import { f as ks, h as Os, r as ws, s as Qt } from "./predefined-templates-j5MqD37J.js";
3
+ import { f as st, p as $s } from "./format-time-from-id-D3lPFiqA.js";
4
4
  import { c as Lt } from "./component-kqxARxvM.js";
5
5
  import { D as Pe, R as he } from "./row-action.enum-DQ9bJ_uv.js";
6
- import { G as Je, m as Cs, u as Me, Y as E, Z as ut, Q as fe, a as kt, _ as Ut, $ as Ds, a0 as Rs, E as Ns, c as Yt, s as Ot, q as De, L as Mt, a1 as Jt, r as et, C as Fe, w as Ae, B as at } from "./app-BS8Y8XB1.js";
7
- import { h as wt, t as As, d as Ts, a as tt } from "./date2-DOWGtN_k.js";
8
- import { j as Ps, c as Is, a as ge, t as Ke, d as ot } from "./number-B5DVgaWM.js";
9
- import { F as Xe, c as Fs, a as vt } from "./inventory-core-dart.default-Dl166D_R.js";
10
- import { L as Es } from "./lz-string-wIxbEJut.js";
6
+ import { G as Je, m as Cs, u as Me, Y as E, Z as ut, Q as fe, a as kt, _ as Ut, $ as Ds, a0 as Rs, E as Ns, c as Yt, s as Ot, q as De, L as Mt, a1 as Jt, r as et, C as Fe, w as Ae, B as at } from "./app-DpMCzQql.js";
7
+ import { h as wt, t as As, d as Ts, a as tt } from "./date2-DBsUy1HH.js";
8
+ import { j as Ps, c as Is, a as ge, t as Ke, d as ot } from "./number-xgIylzEb.js";
9
+ import { F as Xe, c as Fs, a as vt } from "./inventory-core-dart.default-Xz0fuxVn.js";
10
+ import { L as Es } from "./lz-string-DAdPi3YY.js";
11
11
  import { useI18n as dt, useCoreStore as mt } from "@feedmepos/mf-common";
12
- import { u as pt, a as $t, S as Le } from "./netsuite-BeD5zM7r.js";
12
+ import { u as pt, a as $t, S as Le } from "./netsuite-qr2wHoV5.js";
13
13
  import { useDialog as ft, useSnackbar as Qe, components as lt, FmButtonVariant as Ve, useProxiedModel as qs } from "@feedmepos/ui-library";
14
14
  import { F as We } from "./FmAdminBadge-DjnBAgyv.js";
15
- import { u as He } from "./feature-DDV6dfk3.js";
15
+ import { u as He } from "./feature-ltFu24H8.js";
16
16
  import { _ as Vs } from "./empty-placeholder-B0QU467o.js";
17
- import { a as Ls, b as Us, f as it } from "./format-unit-display-B8tTISaS.js";
18
- import { u as Ye, _ as Ms } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-Dohtj-Y_.js";
19
- import { _ as js, a as Bs, b as zs } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-B8QH4-MU.js";
17
+ import { a as Ls, b as Us, f as it } from "./format-unit-display-CD8C9YZc.js";
18
+ import { u as Ye, _ as Ms } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-_03vSZ4W.js";
19
+ import { _ as js, a as Bs, b as zs } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-BklBxBGT.js";
20
20
  import { u as Ks, R as jt } from "./usePromise-CbVUCxhj.js";
21
- import { d as Hs } from "./index-fQ54arbf.js";
22
- import { i as Gs } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-24Qj9QM3.js";
21
+ import { d as Hs } from "./index-TQKBiFuU.js";
22
+ import { i as Gs } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Bkh9LvJQ.js";
23
23
  import { F as Bt } from "./form-mode.enum-BKiNVH6A.js";
24
- import { u as Zt } from "./supplier-Bln8QZF9.js";
25
- import { u as Ws } from "./surcharge-Czr01eFJ.js";
26
- import { F as Qs } from "./decimal-Bk_LcBc8.js";
27
- import { d as Xt } from "./defineDeepModel-s_J1LoEM.js";
28
- import { u as Ys } from "./vue-i18n-CPBfs8-Q.js";
29
- import { u as Js } from "./useHrmPermission-YMieTr4z.js";
24
+ import { u as Zt } from "./supplier-W00UQBDk.js";
25
+ import { u as Ws } from "./surcharge-CUUDBYUf.js";
26
+ import { F as Qs } from "./decimal-DKl2dUd0.js";
27
+ import { d as Xt } from "./defineDeepModel-YeHxg9wN.js";
28
+ import { u as Ys } from "./vue-i18n-DElpxFA8.js";
29
+ import { u as Js } from "./useHrmPermission-DEu2Lyei.js";
30
30
  function es(b, s) {
31
31
  return s.reduce(
32
32
  (i, p) => {
33
- const u = p.received.find((v) => v.sku._id === b._id);
33
+ const u = p.received.find((f) => f.sku._id === b._id);
34
34
  return u && (i = Ps(i, u.amount)), i;
35
35
  },
36
36
  Qs.toPrecision(Is(0), b.unit.precision)
@@ -38,8 +38,8 @@ function es(b, s) {
38
38
  }
39
39
  function Zs(b) {
40
40
  var ue;
41
- const { po: s, currentLocation: o, business: i, fulfilling: p, por: u } = b, { name: v, address: t, regNo: c, legalName: d } = o.doc.profile, S = {
42
- name: v,
41
+ const { po: s, currentLocation: o, business: i, fulfilling: p, por: u } = b, { name: f, address: t, regNo: c, legalName: d } = o.doc.profile, S = {
42
+ name: f,
43
43
  legalName: d || void 0,
44
44
  registrationNumber: c || void 0,
45
45
  line1: (t == null ? void 0 : t.line1) || "",
@@ -113,7 +113,7 @@ function Zs(b) {
113
113
  }
114
114
  function ts(b) {
115
115
  var S;
116
- const { printData: s, templateType: o } = Zs(b), p = ks().getTemplateByType(o), u = !!((S = p == null ? void 0 : p.blocks) != null && S.length), v = Os(o), t = u ? p.blocks : v.blocks, c = u ? p.name : v.name, d = !u;
116
+ const { printData: s, templateType: o } = Zs(b), p = ks().getTemplateByType(o), u = !!((S = p == null ? void 0 : p.blocks) != null && S.length), f = Os(o), t = u ? p.blocks : f.blocks, c = u ? p.name : f.name, d = !u;
117
117
  try {
118
118
  const $ = ws(t, s), C = $.match(/<style>([\s\S]*?)<\/style>/), R = C ? `<style>${C[1]}</style>` : "", w = $.replace(/<style>[\s\S]*?<\/style>/, "");
119
119
  return {
@@ -157,7 +157,7 @@ const Xs = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
157
157
  function u() {
158
158
  i("update:modelValue", !1);
159
159
  }
160
- function v() {
160
+ function f() {
161
161
  var c, d;
162
162
  try {
163
163
  (d = (c = p.value) == null ? void 0 : c.contentWindow) == null || d.print();
@@ -169,7 +169,7 @@ const Xs = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
169
169
  () => o.modelValue,
170
170
  async (c) => {
171
171
  c && (await us(), t(), setTimeout(() => {
172
- v();
172
+ f();
173
173
  }, 300));
174
174
  }
175
175
  );
@@ -259,7 +259,7 @@ const Xs = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
259
259
  e("div", { class: "flex gap-2 items-center" }, [
260
260
  e("button", {
261
261
  class: "px-8 py-1.5 bg-blue-500 text-white border-none rounded text-sm cursor-pointer hover:bg-blue-700",
262
- onClick: v
262
+ onClick: f
263
263
  }, " Print "),
264
264
  e("button", {
265
265
  class: "px-2.5 py-1 bg-transparent border border-gray-300 rounded text-xl leading-none cursor-pointer text-gray-500 hover:bg-gray-100",
@@ -286,8 +286,8 @@ const Xs = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
286
286
  start: i,
287
287
  end: p
288
288
  }) {
289
- const u = o.currentLocationDBName, v = `${b.inventoryBackendUrl}/${u}/shipments`;
290
- return await s.get(`${v}?start=${i}&end=${p}`);
289
+ const u = o.currentLocationDBName, f = `${b.inventoryBackendUrl}/${u}/shipments`;
290
+ return await s.get(`${f}?start=${i}&end=${p}`);
291
291
  },
292
292
  async getShipmentsByIds(i) {
293
293
  if (i.length === 0)
@@ -394,17 +394,17 @@ const Xs = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
394
394
  setup(b) {
395
395
  const s = b, { t: o } = dt(), i = J("");
396
396
  Ge(i, (u) => {
397
- var v;
398
- (v = s.onChange) == null || v.call(s, u ?? "");
397
+ var f;
398
+ (f = s.onChange) == null || f.call(s, u ?? "");
399
399
  });
400
400
  function p() {
401
401
  i.value = "";
402
402
  }
403
- return (u, v) => (a(), h("div", nr, [
403
+ return (u, f) => (a(), h("div", nr, [
404
404
  s.message ? (a(), h("div", ar, x(s.message), 1)) : T("", !0),
405
405
  e("label", lr, x(_(o)("inventory.transfer.receiveRequest.details.rejectionReason")) + " (" + x(_(o)("inventory.common.optional")) + ")", 1),
406
406
  ps(e("textarea", {
407
- "onUpdate:modelValue": v[0] || (v[0] = (t) => i.value = t),
407
+ "onUpdate:modelValue": f[0] || (f[0] = (t) => i.value = t),
408
408
  rows: "4",
409
409
  class: "w-full mt-2 p-2 border rounded"
410
410
  }, null, 512), [
@@ -447,13 +447,13 @@ function St(b, s, o) {
447
447
  }
448
448
  function os() {
449
449
  const b = Me(), s = Ye(), o = He();
450
- async function i(u, v) {
450
+ async function i(u, f) {
451
451
  const t = b.currentLocationDBName;
452
- return u.doc.supplier.internal && u.operation === E.enum.confirmDraft && (u.operation = E.enum.submitRequest), await s.processPurchaseOrder(u, v || t);
452
+ return u.doc.supplier.internal && u.operation === E.enum.confirmDraft && (u.operation = E.enum.submitRequest), await s.processPurchaseOrder(u, f || t);
453
453
  }
454
- async function p(u, v) {
454
+ async function p(u, f) {
455
455
  const t = b.currentLocationDBName;
456
- return await s.processPurchaseOrderV2(u, v || t);
456
+ return await s.processPurchaseOrderV2(u, f || t);
457
457
  }
458
458
  return (u) => o.useOperatePurchaseOrderV2 ? p(u.operateV2, u.transferTo) : i(u.operate, u.transferTo);
459
459
  }
@@ -484,10 +484,10 @@ function zt(b) {
484
484
  };
485
485
  }
486
486
  function Kt(b, s, o, i, p) {
487
- const u = Be(b.suppliers ?? []), v = Be(s.allLocations ?? []).map(zt), t = s._currentLocation ? zt(Be(s._currentLocation)) : null, c = o.inventory ? [Be(o.inventory)] : [], d = i.state.setting ? Be(i.state.setting) : null, S = Be(p.surcharges ?? []);
487
+ const u = Be(b.suppliers ?? []), f = Be(s.allLocations ?? []).map(zt), t = s._currentLocation ? zt(Be(s._currentLocation)) : null, c = o.inventory ? [Be(o.inventory)] : [], d = i.state.setting ? Be(i.state.setting) : null, S = Be(p.surcharges ?? []);
488
488
  return {
489
489
  suppliers: u,
490
- locations: v,
490
+ locations: f,
491
491
  currentLocation: t,
492
492
  inventoryDoc: c,
493
493
  netSuiteSetting: d,
@@ -501,12 +501,12 @@ function ns() {
501
501
  o,
502
502
  i,
503
503
  p
504
- ), v = Vt(Fs({ env: u }));
505
- v.value.setUsePartialUpdates(!0);
506
- const t = Vt(v.value.state()), c = (C) => {
507
- t.value = C;
504
+ ), f = Vt(Fs({ env: u }));
505
+ f.value.setUsePartialUpdates(!0);
506
+ const t = Vt(f.value.state()), c = (C) => {
507
+ t.value = f.value.state();
508
508
  };
509
- v.value.addListener(c);
509
+ f.value.addListener(c);
510
510
  const d = (C, R, w) => {
511
511
  switch (C) {
512
512
  case yt.set:
@@ -523,7 +523,7 @@ function ns() {
523
523
  }
524
524
  R !== "remark" && R !== "ref" && bs(t);
525
525
  };
526
- v.value.addPartialListener(d);
526
+ f.value.addPartialListener(d);
527
527
  function S() {
528
528
  const C = Kt(
529
529
  b,
@@ -532,7 +532,7 @@ function ns() {
532
532
  i,
533
533
  p
534
534
  );
535
- v.value.updateFullEnv(C), t.value = v.value.state();
535
+ f.value.updateFullEnv(C), t.value = f.value.state();
536
536
  }
537
537
  Ge(
538
538
  [
@@ -548,22 +548,22 @@ function ns() {
548
548
  },
549
549
  { deep: !0 }
550
550
  ), ys(() => {
551
- v.value.removeListener(c), v.value.removePartialListener(d);
551
+ f.value.removeListener(c), f.value.removePartialListener(d);
552
552
  });
553
553
  function $(C) {
554
554
  var R;
555
555
  if (C != null && C._id) {
556
- v.value.loadPurchaseOrder(C);
556
+ f.value.loadPurchaseOrder(C);
557
557
  return;
558
558
  }
559
559
  if (!He().mustUsePoTemplate) {
560
- v.value.init();
560
+ f.value.init();
561
561
  return;
562
562
  }
563
- C != null && C.template && ((R = C.templateDoc) != null && R.purchaseOrder) ? (C.items = C.templateDoc.purchaseOrder.items, v.value.initFromTemplate(C)) : v.value.initOutletToOutlet();
563
+ C != null && C.template && ((R = C.templateDoc) != null && R.purchaseOrder) ? (C.items = C.templateDoc.purchaseOrder.items, f.value.initFromTemplate(C)) : f.value.initOutletToOutlet();
564
564
  }
565
565
  return {
566
- controller: v,
566
+ controller: f,
567
567
  state: t,
568
568
  init: $
569
569
  };
@@ -571,20 +571,20 @@ function ns() {
571
571
  var xt = /* @__PURE__ */ ((b) => (b.RECEIVE_REQUEST = "receive/request", b.APPROVAL = "approval", b))(xt || {});
572
572
  const Ze = J(), bt = J(), ht = J();
573
573
  function zl(b, s) {
574
- const o = ft(), i = Me(), p = He(), u = Zt(), v = mt(), t = Ls(), c = Us(), d = J(!1), S = Qe(), $ = Ye(), C = or(), R = J(new Array()), w = J(new Array()), U = J(
574
+ const o = ft(), i = Me(), p = He(), u = Zt(), f = mt(), t = Ls(), c = Us(), d = J(!1), S = Qe(), $ = Ye(), C = or(), R = J(new Array()), w = J(new Array()), U = J(
575
575
  s != null && s.startDate && (s != null && s.endDate) ? s : Gs()
576
576
  ), P = M(() => {
577
- const f = new Date(U.value.startDate), l = new Date(U.value.endDate);
577
+ const v = new Date(U.value.startDate), l = new Date(U.value.endDate);
578
578
  return {
579
- start: As(f).toISOString(),
579
+ start: As(v).toISOString(),
580
580
  end: Ts(l).toISOString()
581
581
  };
582
582
  }), Z = J(new Array()), z = Ns(), ue = J(null);
583
- async function re(f) {
583
+ async function re(v) {
584
584
  function l(L) {
585
585
  const H = {
586
586
  mode: Bt.CREATE,
587
- modelValue: f || void 0,
587
+ modelValue: v || void 0,
588
588
  show: !0,
589
589
  "onUpdate:show"(le) {
590
590
  Ze.value.show = le;
@@ -595,7 +595,7 @@ function zl(b, s) {
595
595
  Ze.value = H;
596
596
  }
597
597
  let k;
598
- p.mustUsePoTemplate && !(f != null && f.template) ? o.open({
598
+ p.mustUsePoTemplate && !(v != null && v.template) ? o.open({
599
599
  title: "Create transfer",
600
600
  message: "",
601
601
  primaryActions: {
@@ -613,10 +613,10 @@ function zl(b, s) {
613
613
  l(void 0);
614
614
  }) : l(k);
615
615
  }
616
- function j(f) {
616
+ function j(v) {
617
617
  const l = {
618
618
  mode: Bt.UPDATE,
619
- modelValue: Yt(f),
619
+ modelValue: Yt(v),
620
620
  show: !0,
621
621
  "onUpdate:show"(k) {
622
622
  Ze.value.show = k;
@@ -625,25 +625,25 @@ function zl(b, s) {
625
625
  };
626
626
  Ze.value = l;
627
627
  }
628
- function D(f) {
629
- if (!v.currentBusiness.value) return;
628
+ function D(v) {
629
+ if (!f.currentBusiness.value) return;
630
630
  const l = i.currentLocation;
631
631
  if (l.type === "restaurant") {
632
632
  const X = i.locationRestaurantFromCore(l.doc._id);
633
633
  X !== null && (l.doc = X);
634
634
  }
635
635
  const k = ts({
636
- po: f,
636
+ po: v,
637
637
  currentLocation: l,
638
- business: v.currentBusiness.value,
638
+ business: f.currentBusiness.value,
639
639
  fulfilling: b === "approval",
640
- por: f.request
640
+ por: v.request
641
641
  });
642
642
  if (!k) return;
643
- const L = Qt(k.html), H = u.supplierById[f.supplier._id], le = {
643
+ const L = Qt(k.html), H = u.supplierById[v.supplier._id], le = {
644
644
  recipientName: H.name,
645
645
  email: (H == null ? void 0 : H.email) ?? "",
646
- business: v.currentBusiness.value,
646
+ business: f.currentBusiness.value,
647
647
  modelValue: L,
648
648
  show: !0,
649
649
  "onUpdate:show"(X) {
@@ -655,9 +655,9 @@ function zl(b, s) {
655
655
  async function ne() {
656
656
  R.value = [], w.value = [], d.value = !0;
657
657
  try {
658
- const f = await $.getPurchaseOrders(P.value);
659
- R.value = f.sort((X, xe) => xe._id.localeCompare(X._id));
660
- const l = f.flatMap((X) => X.shipmentIds || []).filter(Boolean), k = l.length > 0 ? await C.getShipmentsByIds(l) : [];
658
+ const v = await $.getPurchaseOrders(P.value);
659
+ R.value = v.sort((X, xe) => xe._id.localeCompare(X._id));
660
+ const l = v.flatMap((X) => X.shipmentIds || []).filter(Boolean), k = l.length > 0 ? await C.getShipmentsByIds(l) : [];
661
661
  w.value = k;
662
662
  const L = await z.readCurrentLocationLastClosing(!0), H = L == null ? void 0 : L._id;
663
663
  H && (ue.value = $s(H)), await p.awaitFeatureLoaded(() => p.mustUsePoTemplate) && await c.fetchTemplates();
@@ -683,7 +683,7 @@ function zl(b, s) {
683
683
  void 0,
684
684
  P.value.start,
685
685
  P.value.end
686
- ).then((f) => f.reverse());
686
+ ).then((v) => v.reverse());
687
687
  } catch {
688
688
  S.open({
689
689
  title: "Something went wrong",
@@ -702,30 +702,30 @@ function zl(b, s) {
702
702
  return I();
703
703
  }
704
704
  }
705
- function W(f, l) {
705
+ function W(v, l) {
706
706
  U.value = {
707
- startDate: f,
707
+ startDate: v,
708
708
  endDate: l
709
709
  }, N();
710
710
  }
711
- i.watchLocation(async (f) => {
712
- if (!f) {
711
+ i.watchLocation(async (v) => {
712
+ if (!v) {
713
713
  R.value = [];
714
714
  return;
715
715
  }
716
716
  await N();
717
717
  });
718
718
  const K = J(), ce = J(Math.random().toString());
719
- async function Ce(f, l) {
719
+ async function Ce(v, l) {
720
720
  const k = Math.random().toString();
721
721
  ce.value = k, l ?? (l = Z.value.computeFirst(
722
- (X) => X.purchaseOrderId === f._id ? X : null
722
+ (X) => X.purchaseOrderId === v._id ? X : null
723
723
  ) ?? void 0);
724
724
  const L = b === "receive/request" ? i.currentLocation : l == null ? void 0 : l.to, H = b === "approval", le = {
725
725
  poRequest: l,
726
726
  purchaseOrder: {
727
- ...f,
728
- status: H && (l != null && l.rejectedAt) ? fe.Enum.REJECT : f.status
727
+ ...v,
728
+ status: H && (l != null && l.rejectedAt) ? fe.Enum.REJECT : v.status
729
729
  },
730
730
  transferTo: L == null ? void 0 : L.name,
731
731
  transferToDbName: L == null ? void 0 : L.dbName,
@@ -736,19 +736,19 @@ function zl(b, s) {
736
736
  K.value.show = X;
737
737
  },
738
738
  scope: b,
739
- receivedMap: ct(f) ?? {},
739
+ receivedMap: ct(v) ?? {},
740
740
  shipments: w.value
741
741
  };
742
742
  K.value = le;
743
743
  }
744
- async function _e(f, l, k, L, H) {
744
+ async function _e(v, l, k, L, H) {
745
745
  const le = os();
746
746
  d.value = !0;
747
747
  try {
748
748
  await le({
749
749
  operate: {
750
750
  operation: l,
751
- doc: f,
751
+ doc: v,
752
752
  options: (
753
753
  // auto receive for supplier to warehouse
754
754
  (l === E.enum.confirmDraft || // auto receive for warehouse to warehouse
@@ -758,15 +758,15 @@ function zl(b, s) {
758
758
  )
759
759
  },
760
760
  operateV2: {
761
- _id: f._id,
762
- _rev: f._rev ?? "",
761
+ _id: v._id,
762
+ _rev: v._rev ?? "",
763
763
  action: l === E.enum.submitRequest ? E.enum.confirmDraft : l,
764
764
  payloads: H ?? []
765
765
  },
766
766
  transferTo: L
767
767
  }), await new Promise((ae) => setTimeout(ae, 1e3));
768
768
  const xe = Me().currentLocationDBName.startsWith("restaurant_");
769
- l === E.enum.confirmDraft && f.effectiveAt && xe ? S.open({
769
+ l === E.enum.confirmDraft && v.effectiveAt && xe ? S.open({
770
770
  title: "Success",
771
771
  message: `${k}. The backdate will be reflected once your POS has received this change.`,
772
772
  type: "success"
@@ -780,12 +780,12 @@ function zl(b, s) {
780
780
  title: "Something went wrong",
781
781
  message: X instanceof Error ? X.message : "Please try again.",
782
782
  type: "error"
783
- }), console.error("Error when submitting PO operation", l, f, X);
783
+ }), console.error("Error when submitting PO operation", l, v, X);
784
784
  } finally {
785
785
  d.value = !1, N();
786
786
  }
787
787
  }
788
- async function Se(f, l, k) {
788
+ async function Se(v, l, k) {
789
789
  const L = ss[l];
790
790
  if (!L) {
791
791
  S.open({
@@ -814,12 +814,12 @@ function zl(b, s) {
814
814
  payload: {
815
815
  rejectReason: ae
816
816
  }
817
- }), _e(f, l, H, k, r);
817
+ }), _e(v, l, H, k, r);
818
818
  });
819
819
  return;
820
820
  }
821
821
  const X = [], xe = ns();
822
- xe.init(f), (l === E.enum.confirmDraft || l === E.enum.submitRequest) && X.push({
822
+ xe.init(v), (l === E.enum.confirmDraft || l === E.enum.submitRequest) && X.push({
823
823
  action: "confirmDraft",
824
824
  payload: xe.controller.value.toConfirmDraftData(De())
825
825
  }), o.open({
@@ -827,7 +827,7 @@ function zl(b, s) {
827
827
  message: le.message,
828
828
  primaryActions: le.primaryActions
829
829
  }).onPrimary(() => {
830
- _e(f, l, H, k, X);
830
+ _e(v, l, H, k, X);
831
831
  });
832
832
  }
833
833
  async function ve() {
@@ -842,13 +842,13 @@ function zl(b, s) {
842
842
  close: !0
843
843
  }
844
844
  }).onPrimary(() => {
845
- const f = {
845
+ const v = {
846
846
  show: !0,
847
847
  "onUpdate:show"(l) {
848
848
  ht.value.show = l;
849
849
  }
850
850
  };
851
- ht.value = f;
851
+ ht.value = v;
852
852
  });
853
853
  }
854
854
  return {
@@ -871,8 +871,8 @@ function zl(b, s) {
871
871
  };
872
872
  }
873
873
  function cr(b) {
874
- const { po: s, currentLocation: o, business: i, fulfilling: p, por: u } = b, { name: v, address: t, regNo: c, legalName: d } = o.doc.profile, S = {
875
- name: v,
874
+ const { po: s, currentLocation: o, business: i, fulfilling: p, por: u } = b, { name: f, address: t, regNo: c, legalName: d } = o.doc.profile, S = {
875
+ name: f,
876
876
  legalName: d,
877
877
  registrationNumber: c,
878
878
  line1: t == null ? void 0 : t.line1,
@@ -1022,10 +1022,10 @@ function as() {
1022
1022
  return !(!s || (s == null ? void 0 : s.status) !== fe.enum.REQUESTING);
1023
1023
  },
1024
1024
  ableToCreateFulfillment(s, o) {
1025
- var u, v;
1025
+ var u, f;
1026
1026
  if (!b.acceptRequireFulfillment || !s || !o || s.status !== fe.enum.PROCESSING || !o.processedAt)
1027
1027
  return !1;
1028
- const i = (u = o == null ? void 0 : o.from) == null ? void 0 : u.dbName, p = (v = o == null ? void 0 : o.to) == null ? void 0 : v.dbName;
1028
+ const i = (u = o == null ? void 0 : o.from) == null ? void 0 : u.dbName, p = (f = o == null ? void 0 : o.to) == null ? void 0 : f.dbName;
1029
1029
  return !(i.startsWith("restaurant_") && p.startsWith("restaurant_"));
1030
1030
  }
1031
1031
  };
@@ -1042,7 +1042,7 @@ function ls() {
1042
1042
  };
1043
1043
  }
1044
1044
  function Kl(b, s, o) {
1045
- const i = Me(), p = pt(), u = mt(), v = as(), { t } = dt(), { hasOrderDraftPermission: c } = ls(), d = He(), S = M(
1045
+ const i = Me(), p = pt(), u = mt(), f = as(), { t } = dt(), { hasOrderDraftPermission: c } = ls(), d = He(), S = M(
1046
1046
  () => d.enablePrintTemplate ? [Pe[he.PrintCustom]] : []
1047
1047
  ), $ = M(
1048
1048
  () => d.enablePurchaseOrderEmail ? [Pe[he.Email]] : []
@@ -1058,7 +1058,7 @@ function Kl(b, s, o) {
1058
1058
  ];
1059
1059
  case "RECEIVING":
1060
1060
  return [
1061
- ...v.ableToMarkReceived(D) ? [je[E.enum.completeReceive]] : [],
1061
+ ...f.ableToMarkReceived(D) ? [je[E.enum.completeReceive]] : [],
1062
1062
  Pe[he.Details],
1063
1063
  Pe[he.Print],
1064
1064
  ...S.value,
@@ -1106,15 +1106,15 @@ function Kl(b, s, o) {
1106
1106
  var W, K, ce, Ce, _e, Se, ve;
1107
1107
  const N = Yt(ne);
1108
1108
  if (D === he.Print || D === he.PrintCustom) {
1109
- const f = (I == null ? void 0 : I.toInventoryLocation) ?? i.currentLocation;
1110
- if (f.type === "restaurant") {
1111
- const k = i.locationRestaurantFromCore(f.doc._id);
1112
- k !== null && (f.doc = k);
1109
+ const v = (I == null ? void 0 : I.toInventoryLocation) ?? i.currentLocation;
1110
+ if (v.type === "restaurant") {
1111
+ const k = i.locationRestaurantFromCore(v.doc._id);
1112
+ k !== null && (v.doc = k);
1113
1113
  }
1114
1114
  ((W = I == null ? void 0 : I.netSuite) != null && W.refNo || (K = N.netSuite) != null && K.refNo) && (N.ref = [((ce = I == null ? void 0 : I.netSuite) == null ? void 0 : ce.refNo) || ((Ce = N.netSuite) == null ? void 0 : Ce.refNo)].filter((k) => k).join(" "));
1115
1115
  const l = {
1116
1116
  po: N,
1117
- currentLocation: f,
1117
+ currentLocation: v,
1118
1118
  business: u.currentBusiness.value,
1119
1119
  fulfilling: b === "approval",
1120
1120
  por: I
@@ -1220,9 +1220,9 @@ function Kl(b, s, o) {
1220
1220
  let _e = t(`inventory.transfer.status.${Ce}`), Se = `${N ?? ""}`.toLocaleLowerCase("en-us");
1221
1221
  Ce === fe.enum.CLOSE && (_e = `${t(`inventory.transfer.status.${fe.enum.COMPLETE}`)}`), Ce === "PARTIAL_RECEIVED" && Se === fe.enum.PROCESSING.toLocaleLowerCase("en-us") && (Se = fe.enum.RECEIVING.toLocaleLowerCase("en-us"));
1222
1222
  let ve = null;
1223
- const f = o.value.find((l) => l.ref === I.row.original._id);
1224
- if (f != null && f.milestones && f.milestones.length > 0) {
1225
- const l = f.milestones[f.milestones.length - 1];
1223
+ const v = o.value.find((l) => l.ref === I.row.original._id);
1224
+ if (v != null && v.milestones && v.milestones.length > 0) {
1225
+ const l = v.milestones[v.milestones.length - 1];
1226
1226
  if (l.estimatedTime) {
1227
1227
  const k = new Date(l.estimatedTime), L = k.getDate().toString().padStart(2, "0");
1228
1228
  ve = `${k.toLocaleString("en-US", { month: "short" })} ${L}`;
@@ -1505,7 +1505,7 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
1505
1505
  amount: t.quantity ?? { amount: 1, precision: 0 }
1506
1506
  })));
1507
1507
  });
1508
- const v = M(() => i.items.length <= 10);
1508
+ const f = M(() => i.items.length <= 10);
1509
1509
  return (t, c) => {
1510
1510
  const d = se("FmTable"), S = se("FmButton"), $ = se("FmForm");
1511
1511
  return a(), pe($, {
@@ -1600,7 +1600,7 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
1600
1600
  }
1601
1601
  ],
1602
1602
  "row-data": i.items,
1603
- "hide-footer": v.value
1603
+ "hide-footer": f.value
1604
1604
  }, null, 8, ["column-defs", "row-data", "hide-footer"])
1605
1605
  ])
1606
1606
  ]),
@@ -1706,7 +1706,7 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
1706
1706
  const c = s.purchaseOrder, d = s.poRequest;
1707
1707
  return c && ((S = c == null ? void 0 : c.supplier) != null && S.internal ? (!d && c.status == fe.enum.DRAFT && (t = !1), d && !(($ = d == null ? void 0 : d.netSuite) != null && $.id) && (t = !1), s.isTransferBetweenOutlets && (t = !1)) : ((c == null ? void 0 : c.status) !== fe.enum.REQUESTING && c.supplier.internal && (t = !1), !d && !((C = c == null ? void 0 : c.netSuite) != null && C.id) && (t = !1), !d && ((R = c == null ? void 0 : c.netSuite) != null && R.id) && (c == null ? void 0 : c.status) == fe.enum.REQUESTING && (t = !1))), t;
1708
1708
  });
1709
- async function v() {
1709
+ async function f() {
1710
1710
  u.value || p.open({
1711
1711
  title: "Sync with NetSuite",
1712
1712
  contentComponent: Y("div", [
@@ -1755,7 +1755,7 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
1755
1755
  variant: "secondary",
1756
1756
  label: "Sync",
1757
1757
  loading: u.value,
1758
- onClick: v,
1758
+ onClick: f,
1759
1759
  "text-color": "primary",
1760
1760
  "bg-color": "transparent",
1761
1761
  "border-color": "primary"
@@ -1804,7 +1804,7 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
1804
1804
  ((S = (d = (c = s.purchaseOrder) == null ? void 0 : c.netSuite) == null ? void 0 : d.subsidiary) == null ? void 0 : S.id) || ((R = (C = ($ = s.poRequest) == null ? void 0 : $.netSuite) == null ? void 0 : C.subsidiary) == null ? void 0 : R.id)
1805
1805
  ).fullName;
1806
1806
  }
1807
- ), v = M(() => {
1807
+ ), f = M(() => {
1808
1808
  var c, d, S, $, C, R, w, U, P, Z, z, ue;
1809
1809
  return (S = (d = (c = s.purchaseOrder) == null ? void 0 : c.netSuite) == null ? void 0 : d.additionalInfo) != null && S.transactionnumber ? (R = (C = ($ = s.purchaseOrder) == null ? void 0 : $.netSuite) == null ? void 0 : C.additionalInfo) == null ? void 0 : R.transactionnumber : (P = (U = (w = p.value) == null ? void 0 : w.netSuite) == null ? void 0 : U.additionalInfo) != null && P.transactionnumber ? (ue = (z = (Z = p.value) == null ? void 0 : Z.netSuite) == null ? void 0 : z.additionalInfo) == null ? void 0 : ue.transactionnumber : null;
1810
1810
  }), t = M(() => {
@@ -1833,9 +1833,9 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
1833
1833
  (j = (re = p.value) == null ? void 0 : re.netSuite) != null && j.id ? (a(), h("span", Cr, x((ne = (D = p.value) == null ? void 0 : D.netSuite) == null ? void 0 : ne.refNo) + " (" + x((N = (I = p.value) == null ? void 0 : I.netSuite) == null ? void 0 : N.id) + ") ", 1)) : (a(), h("span", Dr, "N/A"))
1834
1834
  ])
1835
1835
  ])) : T("", !0),
1836
- v.value ? (a(), h("div", Rr, [
1836
+ f.value ? (a(), h("div", Rr, [
1837
1837
  d[1] || (d[1] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite Transaction Number ", -1)),
1838
- e("div", Nr, x(v.value), 1)
1838
+ e("div", Nr, x(f.value), 1)
1839
1839
  ])) : T("", !0),
1840
1840
  _(o).isEnabled && c.transferType === _(et).enum.transfer && !c.isTransferBetweenOutlets ? (a(), h("div", Ar, [
1841
1841
  d[2] || (d[2] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite fulfillment IDs ", -1)),
@@ -1853,19 +1853,19 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
1853
1853
  setup(b) {
1854
1854
  const s = Qe(), o = $t();
1855
1855
  async function i(p, u) {
1856
- const v = [];
1857
- if (p && v.push(`body.message:*${p}*`), u) {
1856
+ const f = [];
1857
+ if (p && f.push(`body.message:*${p}*`), u) {
1858
1858
  const S = u.replace(/:/g, "\\:");
1859
- v.push(`${S}`);
1859
+ f.push(`${S}`);
1860
1860
  }
1861
- if (v.length === 0) {
1861
+ if (f.length === 0) {
1862
1862
  s.open({
1863
1863
  message: "Cannot open logs without valid filters.",
1864
1864
  type: "error"
1865
1865
  });
1866
1866
  return;
1867
1867
  }
1868
- const c = `attributes.pod:netsuite* AND (${v.join(" OR ")})`, { url: d } = await o.getSyncLogs(c);
1868
+ const c = `attributes.pod:netsuite* AND (${f.join(" OR ")})`, { url: d } = await o.getSyncLogs(c);
1869
1869
  s.open(
1870
1870
  {
1871
1871
  message: "Opening NetSuite logs...",
@@ -1875,9 +1875,9 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
1875
1875
  ), await new Promise((S) => setTimeout(S, 800)), window.open(d, "_blank");
1876
1876
  }
1877
1877
  return (p, u) => {
1878
- const v = se("FmButton");
1878
+ const f = se("FmButton");
1879
1879
  return a(), h("div", Ir, [
1880
- q(v, {
1880
+ q(f, {
1881
1881
  "prepend-icon": "history",
1882
1882
  variant: "secondary",
1883
1883
  label: "Logs",
@@ -1905,7 +1905,7 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
1905
1905
  purchaseOrderId: {}
1906
1906
  },
1907
1907
  setup(b) {
1908
- const s = b, o = $t(), i = J(!1), p = Me(), u = J(!0), v = J(!1), t = J(!1), c = J(!1), d = J(null), S = J([]);
1908
+ const s = b, o = $t(), i = J(!1), p = Me(), u = J(!0), f = J(!1), t = J(!1), c = J(!1), d = J(null), S = J([]);
1909
1909
  async function $() {
1910
1910
  if (!d.value) {
1911
1911
  i.value = !0;
@@ -1915,9 +1915,9 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
1915
1915
  p.currentLocation.dbName,
1916
1916
  s.purchaseOrderId
1917
1917
  );
1918
- d.value = U, v.value = !1;
1918
+ d.value = U, f.value = !1;
1919
1919
  } catch {
1920
- v.value = !0;
1920
+ f.value = !0;
1921
1921
  } finally {
1922
1922
  u.value = !1;
1923
1923
  }
@@ -1984,7 +1984,7 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
1984
1984
  ])),
1985
1985
  default: ie(() => [
1986
1986
  u.value ? (a(), h("div", qr, "Loading...")) : (a(), h("div", Vr, [
1987
- v.value ? (a(), h("p", ro, "Something went wrong.")) : (a(), h($e, { key: 0 }, [
1987
+ f.value ? (a(), h("p", ro, "Something went wrong.")) : (a(), h($e, { key: 0 }, [
1988
1988
  e("div", Lr, [
1989
1989
  P[4] || (P[4] = e("h3", { class: "fm-typo-en-body-lg-600 mb-4" }, "NetSuite Order Details", -1)),
1990
1990
  (a(!0), h($e, null, Ee(d.value, (D, ne) => (a(), h("div", {
@@ -2088,7 +2088,7 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
2088
2088
  const s = b, o = Hs(), i = M(() => o.isNetSuiteEnabled);
2089
2089
  return (p, u) => {
2090
2090
  var t, c;
2091
- const v = se("FmMenuDivider");
2091
+ const f = se("FmMenuDivider");
2092
2092
  return i.value ? (a(), h("div", no, [
2093
2093
  e("div", ao, [
2094
2094
  u[0] || (u[0] = e("span", { class: "flex-1 fm-typo-en-body-lg-600" }, "NetSuite Info", -1)),
@@ -2127,7 +2127,7 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
2127
2127
  ])
2128
2128
  ])
2129
2129
  ]),
2130
- q(v),
2130
+ q(f),
2131
2131
  q(Pr, {
2132
2132
  "po-request": p.poRequest,
2133
2133
  "purchase-order": p.purchaseOrder,
@@ -2182,22 +2182,22 @@ function is(b) {
2182
2182
  function cs(b, s) {
2183
2183
  var u;
2184
2184
  if (!b || s.length === 0) return {};
2185
- const o = b.version === Fe.enum[2], i = new Set(s.map((v) => o ? v.id : v.sku._id)), p = {};
2186
- for (const v of b.deliveryOrder ?? [])
2187
- for (const t of v.received ?? []) {
2185
+ const o = b.version === Fe.enum[2], i = new Set(s.map((f) => o ? f.id : f.sku._id)), p = {};
2186
+ for (const f of b.deliveryOrder ?? [])
2187
+ for (const t of f.received ?? []) {
2188
2188
  const c = o ? t.id : t.sku._id;
2189
2189
  c && i.has(c) && (p[c] = (p[c] ?? 0) + (((u = t.amount) == null ? void 0 : u.amount) ?? 0));
2190
2190
  }
2191
2191
  return s.reduce(
2192
- (v, t) => {
2192
+ (f, t) => {
2193
2193
  var C, R;
2194
2194
  const c = (o ? t.id : t.sku._id) ?? "", d = ((C = t.quantity) == null ? void 0 : C.amount) ?? 0, S = p[c] ?? 0, $ = ((R = t.quantity) == null ? void 0 : R.precision) ?? 0;
2195
- return v[c] = {
2195
+ return f[c] = {
2196
2196
  key: c,
2197
2197
  total: { amount: d, precision: $ },
2198
2198
  received: { amount: S, precision: $ },
2199
2199
  remaining: { amount: d - S, precision: $ }
2200
- }, v;
2200
+ }, f;
2201
2201
  },
2202
2202
  {}
2203
2203
  );
@@ -2229,10 +2229,10 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
2229
2229
  },
2230
2230
  emits: ["submitted"],
2231
2231
  setup(b, { emit: s }) {
2232
- const { t: o } = Ys(), i = He(), p = Qe(), u = J(!1), v = kt(), t = b, c = s, d = Xt("deliveryOrder"), S = Ye(), $ = M(
2232
+ const { t: o } = Ys(), i = He(), p = Qe(), u = J(!1), f = kt(), t = b, c = s, d = Xt("deliveryOrder"), S = Ye(), $ = M(
2233
2233
  () => {
2234
- var f;
2235
- return ((f = t.purchaseOrder.deliveryFullfillment) == null ? void 0 : f.findIndex(
2234
+ var v;
2235
+ return ((v = t.purchaseOrder.deliveryFullfillment) == null ? void 0 : v.findIndex(
2236
2236
  (l) => t.deliveryOrder.fullfillmentId && l.id === t.deliveryOrder.fullfillmentId
2237
2237
  )) ?? -1;
2238
2238
  }
@@ -2242,7 +2242,7 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
2242
2242
  () => cs(t.purchaseOrder, P.value)
2243
2243
  ), z = M(
2244
2244
  () => t.purchaseOrder.items.map(
2245
- (f, l) => M({
2245
+ (v, l) => M({
2246
2246
  get: () => {
2247
2247
  var L;
2248
2248
  const k = (L = d.received[l]) == null ? void 0 : L.amount;
@@ -2255,7 +2255,7 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
2255
2255
  )
2256
2256
  ), ue = M(
2257
2257
  () => t.purchaseOrder.items.map(
2258
- (f, l) => M({
2258
+ (v, l) => M({
2259
2259
  get: () => {
2260
2260
  var L;
2261
2261
  const k = (L = d.received[l]) == null ? void 0 : L.cost;
@@ -2270,17 +2270,17 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
2270
2270
  })
2271
2271
  )
2272
2272
  );
2273
- function re(f) {
2273
+ function re(v) {
2274
2274
  var k;
2275
- const l = !w.value[f];
2276
- if (w.value[f] = l, l) {
2277
- const L = (k = d.received[f]) == null ? void 0 : k.cost;
2278
- d.received[f].cost = L ? { ...L, precision: 4 } : { currency: De(), amount: 0, precision: 4 };
2275
+ const l = !w.value[v];
2276
+ if (w.value[v] = l, l) {
2277
+ const L = (k = d.received[v]) == null ? void 0 : k.cost;
2278
+ d.received[v].cost = L ? { ...L, precision: 4 } : { currency: De(), amount: 0, precision: 4 };
2279
2279
  } else
2280
- delete d.received[f].cost;
2280
+ delete d.received[v].cost;
2281
2281
  }
2282
2282
  const j = J([]), D = M(
2283
- () => v.skus.filter((f) => !f.isInactive).map((f) => ({ label: `${f.name} (${f.code})`, value: f._id }))
2283
+ () => f.skus.filter((v) => !v.isInactive).map((v) => ({ label: `${v.name} (${v.code})`, value: v._id }))
2284
2284
  );
2285
2285
  function ne() {
2286
2286
  j.value.push({ skuId: null, costEnabled: !1 }), d.received.push({
@@ -2289,31 +2289,31 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
2289
2289
  measurement: null
2290
2290
  });
2291
2291
  }
2292
- function I(f) {
2293
- j.value.splice(f, 1), d.received.splice(U.value + f, 1);
2292
+ function I(v) {
2293
+ j.value.splice(v, 1), d.received.splice(U.value + v, 1);
2294
2294
  }
2295
- function N(f, l) {
2296
- j.value[f].skuId = l;
2297
- const k = l ? v.skuById[l] : null;
2298
- d.received[U.value + f].sku = k;
2295
+ function N(v, l) {
2296
+ j.value[v].skuId = l;
2297
+ const k = l ? f.skuById[l] : null;
2298
+ d.received[U.value + v].sku = k;
2299
2299
  }
2300
- function W(f, l) {
2300
+ function W(v, l) {
2301
2301
  var le, X;
2302
2302
  const k = (le = t.receivedInfoMap) == null ? void 0 : le[l.sku._id], L = k ? `${o("inventory.transfer.receiveRequest.details.received")} ${Ae.toFormatString({ value: k.received })} / ${it(l.quantity, l.sku.unit, l.measurement)}` : void 0;
2303
- return (((X = z.value[f]) == null ? void 0 : X.value) ?? 0) > 0 ? L : L ? `${L} · ${nt}` : nt;
2303
+ return (((X = z.value[v]) == null ? void 0 : X.value) ?? 0) > 0 ? L : L ? `${L} · ${nt}` : nt;
2304
2304
  }
2305
- function K(f, l) {
2305
+ function K(v, l) {
2306
2306
  var le;
2307
2307
  const L = (((le = ce.value[l]) == null ? void 0 : le.value) ?? 0) <= 0;
2308
2308
  let H;
2309
- if (f.skuId && Z.value[f.skuId]) {
2310
- const X = Z.value[f.skuId], xe = Ae.toFormatString({ value: X.received });
2309
+ if (v.skuId && Z.value[v.skuId]) {
2310
+ const X = Z.value[v.skuId], xe = Ae.toFormatString({ value: X.received });
2311
2311
  H = `${o("inventory.transfer.receiveRequest.details.received")} ${xe}`;
2312
2312
  }
2313
2313
  return L ? H ? `${H} · ${nt}` : nt : H;
2314
2314
  }
2315
2315
  const ce = M(
2316
- () => j.value.map((f, l) => {
2316
+ () => j.value.map((v, l) => {
2317
2317
  const k = U.value + l;
2318
2318
  return M({
2319
2319
  get: () => {
@@ -2327,7 +2327,7 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
2327
2327
  });
2328
2328
  })
2329
2329
  ), Ce = M(
2330
- () => j.value.map((f, l) => {
2330
+ () => j.value.map((v, l) => {
2331
2331
  const k = U.value + l;
2332
2332
  return M({
2333
2333
  get: () => {
@@ -2344,15 +2344,15 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
2344
2344
  });
2345
2345
  })
2346
2346
  );
2347
- function _e(f) {
2348
- const l = j.value[f], k = U.value + f;
2347
+ function _e(v) {
2348
+ const l = j.value[v], k = U.value + v;
2349
2349
  l.costEnabled = !l.costEnabled, l.costEnabled ? d.received[k].cost = { currency: De(), amount: 0, precision: 4 } : delete d.received[k].cost;
2350
2350
  }
2351
2351
  Ge(
2352
2352
  () => u.value,
2353
- (f) => {
2353
+ (v) => {
2354
2354
  var xe, ae, r;
2355
- if (!f) {
2355
+ if (!v) {
2356
2356
  j.value = [], w.value = {};
2357
2357
  return;
2358
2358
  }
@@ -2428,7 +2428,7 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
2428
2428
  Se.value = !1;
2429
2429
  });
2430
2430
  }
2431
- return (f, l) => {
2431
+ return (v, l) => {
2432
2432
  const k = se("FmButton"), L = se("FmStepperField"), H = se("FmSwitch"), le = se("FmSelect"), X = se("FmTextField"), xe = se("FmDialog");
2433
2433
  return a(), pe(xe, {
2434
2434
  modelValue: u.value,
@@ -2541,7 +2541,7 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
2541
2541
  label: "Receive Quantity",
2542
2542
  modelValue: ce.value[r].value,
2543
2543
  "onUpdate:modelValue": (F) => ce.value[r].value = F,
2544
- "append-text": ae.skuId ? ((O = (n = _(v).skuById[ae.skuId]) == null ? void 0 : n.unit) == null ? void 0 : O.abbrev) ?? "" : "",
2544
+ "append-text": ae.skuId ? ((O = (n = _(f).skuById[ae.skuId]) == null ? void 0 : n.unit) == null ? void 0 : O.abbrev) ?? "" : "",
2545
2545
  "helper-text": K(ae, r),
2546
2546
  disabled: ae.quantityLocked || !ae.skuId
2547
2547
  }, null, 8, ["modelValue", "onUpdate:modelValue", "append-text", "helper-text", "disabled"]),
@@ -2643,7 +2643,7 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
2643
2643
  emits: ["submitted"],
2644
2644
  setup(b, { emit: s }) {
2645
2645
  var oe, A, de;
2646
- const { t: o } = dt(), i = J(!1), p = mt(), u = b, v = s, t = Xt("", {
2646
+ const { t: o } = dt(), i = J(!1), p = mt(), u = b, f = s, t = Xt("", {
2647
2647
  default: {
2648
2648
  deliveryOrderNumber: "",
2649
2649
  remark: "",
@@ -2732,7 +2732,7 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
2732
2732
  t.received[m].amount = Ke(g, 2);
2733
2733
  }
2734
2734
  })));
2735
- function f(y) {
2735
+ function v(y) {
2736
2736
  const m = !Z.value[y];
2737
2737
  if (Z.value[y] = m, m) {
2738
2738
  const g = z.value[y];
@@ -2852,7 +2852,7 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
2852
2852
  type: "success"
2853
2853
  },
2854
2854
  1e4
2855
- ), i.value = !1, v("submitted");
2855
+ ), i.value = !1, f("submitted");
2856
2856
  }).finally(() => {
2857
2857
  G.value = !1;
2858
2858
  });
@@ -2999,7 +2999,7 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
2999
2999
  _(U) ? (a(), h("div", on, [
3000
3000
  q(ee, {
3001
3001
  "model-value": Z.value[te],
3002
- "onUpdate:modelValue": (Te) => f(te),
3002
+ "onUpdate:modelValue": (Te) => v(te),
3003
3003
  size: "sm"
3004
3004
  }, null, 8, ["model-value", "onUpdate:modelValue"]),
3005
3005
  m[7] || (m[7] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
@@ -3133,13 +3133,13 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3133
3133
  netsuiteId: {}
3134
3134
  },
3135
3135
  setup(b) {
3136
- const s = b, o = $t(), i = J(!1), p = J(!1), u = J(!1), v = J([]);
3136
+ const s = b, o = $t(), i = J(!1), p = J(!1), u = J(!1), f = J([]);
3137
3137
  async function t() {
3138
- if (!(v.value.length > 0))
3138
+ if (!(f.value.length > 0))
3139
3139
  try {
3140
3140
  p.value = !0;
3141
3141
  const S = await o.getChangeLogs(s.netsuiteId);
3142
- v.value = S, u.value = !1;
3142
+ f.value = S, u.value = !1;
3143
3143
  } catch {
3144
3144
  u.value = !0;
3145
3145
  } finally {
@@ -3197,7 +3197,7 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3197
3197
  $[4] || ($[4] = e("span", null, "Change Log Loading...", -1)),
3198
3198
  q(R, { size: "md" })
3199
3199
  ])) : T("", !0),
3200
- !p.value && v.value.length > 0 ? (a(), h("div", kn, [
3200
+ !p.value && f.value.length > 0 ? (a(), h("div", kn, [
3201
3201
  e("h3", On, [
3202
3202
  q(w, {
3203
3203
  name: "error",
@@ -3225,7 +3225,7 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3225
3225
  ])
3226
3226
  ], -1)),
3227
3227
  e("tbody", null, [
3228
- (a(!0), h($e, null, Ee(v.value, (P, Z) => (a(), h("tr", {
3228
+ (a(!0), h($e, null, Ee(f.value, (P, Z) => (a(), h("tr", {
3229
3229
  key: Z,
3230
3230
  class: "border-b border-fm-color-neutral-gray-200 last:border-b-0"
3231
3231
  }, [
@@ -3338,7 +3338,7 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3338
3338
  },
3339
3339
  emits: ["update:show", "submitted"],
3340
3340
  setup(b, { emit: s }) {
3341
- const o = b, i = s, p = ft(), u = Qe(), v = He(), t = Me(), c = mt(), { hasOrderDraftPermission: d } = ls(), S = ns();
3341
+ const o = b, i = s, p = ft(), u = Qe(), f = He(), t = Me(), c = mt(), { hasOrderDraftPermission: d } = ls(), S = ns();
3342
3342
  function $(r) {
3343
3343
  const n = r.isCustomCost, O = r.totalCost;
3344
3344
  return n != null ? n === !0 : O != null;
@@ -3398,7 +3398,7 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3398
3398
  ),
3399
3399
  purchaseOrderRequest: o.poRequest,
3400
3400
  purchaseOrder: o.purchaseOrder
3401
- }, O = v.useOperatePurchaseOrderV2, F = v.poWorkflowAllowToMarkCompleted, G = [...ne];
3401
+ }, O = f.useOperatePurchaseOrderV2, F = f.poWorkflowAllowToMarkCompleted, G = [...ne];
3402
3402
  O && !F && G.push(E.enum.completeReceive);
3403
3403
  let Q = [];
3404
3404
  try {
@@ -3540,9 +3540,9 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3540
3540
  const de = {};
3541
3541
  let y = 0;
3542
3542
  if ((r === E.enum.confirmDraft || // auto receive for warehouse to warehouse
3543
- r === E.enum.completeReceive) && v.autoReceiveWarehouse)
3543
+ r === E.enum.completeReceive) && f.autoReceiveWarehouse)
3544
3544
  de.autoReceive = !0;
3545
- else if ((r === E.enum.approveRequest || r === E.enum.processRequest) && v.acceptRequireFulfillment) {
3545
+ else if ((r === E.enum.approveRequest || r === E.enum.processRequest) && f.acceptRequireFulfillment) {
3546
3546
  const m = (Q = (G = o.poRequest) == null ? void 0 : G.from) == null ? void 0 : Q.dbName, g = (A = (oe = o.poRequest) == null ? void 0 : oe.to) == null ? void 0 : A.dbName;
3547
3547
  if (m && g && (m.startsWith("warehouse_") || g.startsWith("warehouse_"))) {
3548
3548
  const V = await new Promise((B, be) => {
@@ -3588,7 +3588,7 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3588
3588
  const Se = M(() => {
3589
3589
  var r, n;
3590
3590
  return ((r = o.purchaseOrder) == null ? void 0 : r.status) === fe.enum.RECEIVING || ((n = o.purchaseOrder) == null ? void 0 : n.status) === fe.enum.COMPLETE;
3591
- }), ve = M(() => o.purchaseOrder ? ct(o.purchaseOrder) : {}), f = M(() => {
3591
+ }), ve = M(() => o.purchaseOrder ? ct(o.purchaseOrder) : {}), v = M(() => {
3592
3592
  const r = o.purchaseOrder;
3593
3593
  if (!r) return { status: "", statusClass: "" };
3594
3594
  const { partial: n, over: O } = _t(ve.value), F = St(r.status, n, O);
@@ -3944,8 +3944,8 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3944
3944
  e("div", jn, x(_(w)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
3945
3945
  e("div", Bn, [
3946
3946
  q(G, {
3947
- label: f.value.status,
3948
- class: Ue(f.value.statusClass),
3947
+ label: v.value.status,
3948
+ class: Ue(v.value.statusClass),
3949
3949
  compact: ""
3950
3950
  }, null, 8, ["label", "class"]),
3951
3951
  P.value ? (a(), h("div", zn, [
@@ -4133,7 +4133,7 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
4133
4133
  ]),
4134
4134
  e("div", Ea, [
4135
4135
  e("div", qa, x(ee.code), 1),
4136
- _(v).enableTotalCost ? (a(), h("div", Va, [
4136
+ _(f).enableTotalCost ? (a(), h("div", Va, [
4137
4137
  e("span", La, x(_(ot)(
4138
4138
  (Oe = ee.totalCost) != null && Oe.amount ? ee.totalCost : _(S).controller.value.getItemCost(ee, _(De)()).cost
4139
4139
  )), 1),