@feedmepos/mf-inventory-portal 1.2.37-dev.1 → 1.2.37-dev.3

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 (75) hide show
  1. package/dist/{App-I5DkBWIc.js → App-CD8VnJ2H.js} +3 -3
  2. package/dist/{ApprovalView-C1LYZkbH.js → ApprovalView-Bolcj_tP.js} +5 -5
  3. package/dist/{BindingsDialog-D4zUelDu.js → BindingsDialog-lKTIRoyx.js} +2 -2
  4. package/dist/{BindingsPicker-DV1XU3sF.js → BindingsPicker-BND4bzyn.js} +2 -2
  5. package/dist/{BindingsTable-DfQHmg73.js → BindingsTable-g3RjbO1T.js} +3 -3
  6. package/dist/{ClosingDraftView-DBu5Z4sF.js → ClosingDraftView-CKWN87FO.js} +8 -8
  7. package/dist/ClosingHistoryView-CuNlKY6J.js +391 -0
  8. package/dist/{ClosingTemplateView-iTaF92io.js → ClosingTemplateView-DWxJYyX6.js} +14 -14
  9. package/dist/{DeliveryOrderPrintPreview-C1U0WfYR.js → DeliveryOrderPrintPreview-B3j5bRvr.js} +1 -1
  10. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CN-oASmd.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-6YZN79sn.js} +5 -5
  11. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BzCuh3H7.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BWj71msy.js} +2 -2
  12. package/dist/{FmMultiselectDialog-6SDLa-Z9.js → FmMultiselectDialog-C3-2Dr6d.js} +2 -2
  13. package/dist/{FmMultiselectDialog-D8qV-hIU.js → FmMultiselectDialog-CWgEzEwT.js} +1 -1
  14. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-7Kgt9eQq.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DLIipU_w.js} +3 -3
  15. package/dist/{ImportView-CWJMxSX9.js → ImportView-CQU75C7a.js} +6 -6
  16. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BdFvHGhO.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-BV3xSQCM.js} +1 -1
  17. package/dist/{IngredientGroupView-DMlmPiIK.js → IngredientGroupView-D3WW4zUe.js} +5 -5
  18. package/dist/{IngredientsView-DH76XhKg.js → IngredientsView-YzKkGD7A.js} +14 -14
  19. package/dist/IntegrationView-CJ3n2xwM.js +4485 -0
  20. package/dist/{InventoryBindingForm-DDemfucz.js → InventoryBindingForm-Dfo61wMe.js} +1 -1
  21. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Bw8rk2WN.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BMxnjBbe.js} +4 -4
  22. package/dist/{InventoryBindingSummary-DtmhsP7w.js → InventoryBindingSummary-3hzbFGYh.js} +1 -1
  23. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CHhLYVJc.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-J2HLdfnn.js} +1 -1
  24. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BrjIsILE.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BMZKKl_Z.js} +2 -2
  25. package/dist/{PublishView-O8bEpfge.js → PublishView-B20R6kNi.js} +3 -3
  26. package/dist/{PurchaseOrderPrintPreview-7uwMWjKM.js → PurchaseOrderPrintPreview-WC_Y24lf.js} +1 -1
  27. package/dist/{ReceiveRequestView-DL6Ft9Dv.js → ReceiveRequestView-D1laHiZU.js} +19 -19
  28. package/dist/{RecipeView-BGDhOL4y.js → RecipeView-Bbgjm3Bt.js} +8 -8
  29. package/dist/{StockView-BdNL7YNV.js → StockView-optz_EZ6.js} +15 -15
  30. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-OZQshfHV.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BBC-ZUNx.js} +1 -1
  31. package/dist/{SupplierView-C4uH2a2V.js → SupplierView-4SURx1s3.js} +11 -11
  32. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-6jvM7q55.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-dTqgPsg7.js} +2 -2
  33. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-B_b2O6uO.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BhwX2jFa.js} +1 -1
  34. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-COmk372G.js → TransferDetails.vue_vue_type_script_setup_true_lang-B3GqoprI.js} +14 -14
  35. package/dist/{TransferTemplateView-CW443auS.js → TransferTemplateView-1aLMHMeM.js} +15 -15
  36. package/dist/{UnitView-D55gcEz3.js → UnitView-CD2vaeCV.js} +6 -6
  37. package/dist/{WarehouseView-D0XPLYF_.js → WarehouseView-DUVodtRz.js} +5 -5
  38. package/dist/{WastageTemplateView-Bjxe8lP5.js → WastageTemplateView-BfTAruKY.js} +14 -14
  39. package/dist/api/closing.d.ts +1 -0
  40. package/dist/api/netsuite.d.ts +84 -0
  41. package/dist/{app-CIlq5spJ.js → app-BwepdcDI.js} +11 -7
  42. package/dist/app.js +1 -1
  43. package/dist/{closing-template-DBpMfcLc.js → closing-template-DL6w2Dg7.js} +1 -1
  44. package/dist/{date2-ryyCvQfl.js → date2-K4W_yblK.js} +1 -1
  45. package/dist/{dayjs.min-ZUp_XvV7.js → dayjs.min-CbTj4kCs.js} +1 -1
  46. package/dist/{decimal-BJzO4UcJ.js → decimal-C4tfRShD.js} +2 -2
  47. package/dist/{defineDeepModel-xjt5D_Xm.js → defineDeepModel-D0UEmaXm.js} +1 -1
  48. package/dist/{duplicate-template-DEf57E6E.js → duplicate-template-chD1EoHj.js} +1 -1
  49. package/dist/{feature-B3Lwp9eP.js → feature-B7AE08ql.js} +2 -2
  50. package/dist/{format-time-from-id-DiJOY9Yx.js → format-time-from-id-QOYFKV10.js} +1 -1
  51. package/dist/{format-unit-display-DU9lxbEz.js → format-unit-display-C1wJe-Gr.js} +10 -10
  52. package/dist/{import-export.helper-Dva61rf6.js → import-export.helper-Iwt-idQz.js} +5 -5
  53. package/dist/{index-CUTZhcVh.js → index-BHetDmy2.js} +1 -1
  54. package/dist/{index-CaCMjerv.js → index-DsXGv2ab.js} +3 -3
  55. package/dist/{index-CFubRGrG.js → index-ZPzpEsHL.js} +1 -1
  56. package/dist/{lodash-llvwR05O.js → lodash-5E2A8OkY.js} +1 -1
  57. package/dist/{netsuite-C78BfNM5.js → netsuite-DVvZz2U0.js} +921 -898
  58. package/dist/{purchase-order-template-LWFeGIIb.js → purchase-order-template-BEUYQowA.js} +1 -1
  59. package/dist/{rules-LeeMnkxz.js → rules-CQN_rhwa.js} +3 -3
  60. package/dist/{stock-B2Pm8UCL.js → stock-CEY9W-x-.js} +3 -3
  61. package/dist/{stock-A8xFNXcU.js → stock-LfuniSDW.js} +1 -1
  62. package/dist/stores/integration/netsuite.d.ts +7 -0
  63. package/dist/{supplier-BeAA-Fya.js → supplier-6OLoIB8O.js} +2 -2
  64. package/dist/tsconfig.app.tsbuildinfo +1 -1
  65. package/dist/{use-ingredient-select-dialog-CR92R-Zj.js → use-ingredient-select-dialog-zq-B-tyI.js} +2 -2
  66. package/dist/{use-inventory-binding-dialog-DWbUUSbg.js → use-inventory-binding-dialog-DCjNYz-I.js} +2 -2
  67. package/dist/{use-template-enabled-locations-2-IaeBxdZP.js → use-template-enabled-locations-2-CGOlEVFg.js} +2 -2
  68. package/dist/views/integration/components/netsuite/business/AddVendorDialog.vue.d.ts +743 -0
  69. package/dist/views/integration/components/netsuite/business/NetSuiteVendorField.vue.d.ts +73 -0
  70. package/dist/{vue-i18n-B65VyQGb.js → vue-i18n-W94mo81w.js} +356 -356
  71. package/dist/{xlsx-BSjnIEh7.js → xlsx-B-urH5Xf.js} +1 -1
  72. package/dist/{xlsx.util-1XyVyRFC.js → xlsx.util-CA9U1NRi.js} +1 -1
  73. package/package.json +1 -1
  74. package/dist/ClosingHistoryView-CqkAzOSs.js +0 -367
  75. package/dist/IntegrationView-Njvjzs6t.js +0 -4239
@@ -1,4239 +0,0 @@
1
- import { defineComponent as Q, mergeModels as Qe, useModel as ke, onMounted as ce, ref as N, computed as z, resolveComponent as F, openBlock as x, createElementBlock as _, createElementVNode as u, toDisplayString as M, unref as w, createVNode as A, createBlock as H, withCtx as L, Fragment as Y, renderList as W, normalizeClass as K, normalizeStyle as Ye, createSlots as se, createCommentVNode as U, withModifiers as Pe, reactive as Fe, watch as Ce, isRef as ie, Teleport as fe, h as C, createTextVNode as J, watchEffect as Je } from "vue";
2
- import { E as Ke } from "./empty-placeholder-wf6-BWE8.js";
3
- import { w as qe, x as Ge, c as ae, u as ne, y as Ze, a as de, N as ye, z as Ae, A as Z, s as te, B as Be, C as Ee, t as me } from "./app-CIlq5spJ.js";
4
- import { useDialogChild as We, useDialog as be, useProxiedModel as re, useSnackbar as ee, useBreakpoints as Ve, components as q } from "@feedmepos/ui-library";
5
- import { F as _e, _ as $e } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
6
- import { useI18n as $, useCoreStore as le } from "@feedmepos/mf-common";
7
- import { _ as et } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BzCuh3H7.js";
8
- import { u as tt, a as nt, b as ot, c as st } from "./index-CaCMjerv.js";
9
- import { u as oe, a as pe } from "./netsuite-C78BfNM5.js";
10
- import { b as at, a as lt } from "./FmMultiselectDialog-6SDLa-Z9.js";
11
- import { R as it, a as rt } from "./rules-LeeMnkxz.js";
12
- import { N as Le, H as Ne, b as Te } from "./app-uBuHtW8m.js";
13
- import { u as ut } from "./supplier-BeAA-Fya.js";
14
- import { u as ve } from "./vue-i18n-B65VyQGb.js";
15
- import { _ as ct, a as dt } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-7Kgt9eQq.js";
16
- import { a as he, f as Re } from "./date2-ryyCvQfl.js";
17
- import { u as De } from "./feature-B3Lwp9eP.js";
18
- import { F as Me } from "./FmDroppableField-J0xUsOTV.js";
19
- import { r as Oe, u as ze } from "./xlsx-BSjnIEh7.js";
20
- const mt = "data:image/svg+xml,%3csvg%20width='200'%20height='101'%20viewBox='0%200%20200%20101'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M98.9161%2038.4456V24.1772H108.527V27.1988H102.12V30.2202H107.347V32.7382H102.12V38.4456H98.9161Z'%20fill='%235D5359'/%3e%3cpath%20d='M110.382%2031.2276C110.382%2027.5345%20113.249%2024.1772%20117.127%2024.1772C121.174%2024.1772%20123.872%2027.7024%20123.872%2031.3953C123.872%2035.0884%20121.005%2038.6133%20117.127%2038.6133C113.08%2038.4456%20110.382%2034.9204%20110.382%2031.2276ZM117.127%2035.5919C119.487%2035.5919%20120.499%2033.4096%20120.499%2031.2276C120.499%2029.0452%20119.319%2027.0309%20117.127%2027.0309C114.935%2027.0309%20113.754%2029.213%20113.754%2031.2276C113.754%2033.5776%20114.935%2035.5919%20117.127%2035.5919Z'%20fill='%235D5359'/%3e%3cpath%20d='M126.232%2031.2276C126.232%2027.5345%20129.099%2024.1772%20132.977%2024.1772C137.024%2024.1772%20139.722%2027.7024%20139.722%2031.3953C139.722%2035.0884%20136.855%2038.6133%20132.977%2038.6133C128.93%2038.4456%20126.232%2034.9204%20126.232%2031.2276ZM132.977%2035.5919C135.337%2035.5919%20136.349%2033.4096%20136.349%2031.2276C136.349%2029.0452%20135.169%2027.0309%20132.977%2027.0309C130.785%2027.0309%20129.604%2029.213%20129.604%2031.2276C129.604%2033.5776%20130.785%2035.5919%20132.977%2035.5919Z'%20fill='%235D5359'/%3e%3cpath%20d='M142.926%2038.4455V24.345H148.153C152.874%2024.345%20155.235%2027.5343%20155.235%2031.3952C155.235%2035.5918%20152.368%2038.4455%20148.153%2038.4455H142.926ZM148.153%2027.0308H146.129V35.4238H148.153C150.513%2035.4238%20151.862%2033.5775%20151.862%2031.2272C151.862%2028.8773%20150.513%2027.0308%20148.153%2027.0308Z'%20fill='%235D5359'/%3e%3cpath%20d='M110.045%2057.5607V49.1676L107.009%2055.2107H105.324L102.12%2049.1676V57.5607H98.9161V43.4604H102.457L106.167%2050.8465L109.876%2043.4604H113.417V57.5607H110.045Z'%20fill='%235D5359'/%3e%3cpath%20d='M115.947%2057.5607L121.342%2043.4604H124.04L129.436%2057.5607H125.895L124.715%2054.3716H120.331L119.319%2057.5607H115.947ZM122.691%2046.9856L121.005%2052.1893H124.378L122.691%2046.9856Z'%20fill='%235D5359'/%3e%3cpath%20d='M131.965%2057.5607V43.4604H138.373C141.07%2043.4604%20142.925%2045.8105%20142.925%2048.1605C142.925%2049.8393%20142.082%2051.5179%20140.565%2052.1893L143.768%2057.393H140.059L137.192%2052.8607H135V57.393H131.965V57.5607ZM135.169%2050.175H138.204C139.047%2050.175%20139.553%2049.3356%20139.553%2048.1605C139.553%2046.9856%20138.71%2046.3142%20138.035%2046.3142H135.169V50.175Z'%20fill='%235D5359'/%3e%3cpath%20d='M146.635%2057.5607V43.4604H150.007V49.8393L155.403%2043.4604H158.776L153.548%2049.6713L159.281%2057.5607H155.74L151.693%2051.5179L150.007%2053.3642V57.5607H146.635Z'%20fill='%235D5359'/%3e%3cpath%20d='M171.422%2054.7073V57.5607H161.474V43.4604H171.253V46.3142H164.677V48.9999H170.242V51.6856H164.677V54.7073H171.422Z'%20fill='%235D5359'/%3e%3cpath%20d='M185.417%2046.3142H181.202V57.5607H177.829V46.3142H173.614V43.4604H185.417V46.3142Z'%20fill='%235D5359'/%3e%3cpath%20d='M111.057%2062.5967V76.6973H107.853V70.9898H102.12V76.6973H98.9161V62.5967H102.12V68.1361H107.853V62.5967H111.057Z'%20fill='%235D5359'/%3e%3cpath%20d='M124.04%2069.815V62.5967H127.244V69.815C127.244%2073.6758%20125.389%2076.865%20121.005%2076.865C116.453%2076.865%20114.766%2073.5078%20114.766%2069.815V62.5967H117.97V69.815C117.97%2071.997%20118.813%2074.0115%20121.005%2074.0115C123.366%2074.0115%20124.04%2071.997%20124.04%2069.815Z'%20fill='%235D5359'/%3e%3cpath%20d='M138.036%2076.6973H131.122V62.5967H139.047C141.071%2062.5967%20142.251%2064.4433%20142.251%2066.2898C142.251%2067.6327%20141.576%2068.9755%20140.228%2069.4793C141.914%2069.9827%20142.926%2071.1578%20142.926%2073.1721C142.757%2075.5221%20140.733%2076.6973%20138.036%2076.6973ZM134.326%2065.4504V68.3041H137.53C138.204%2068.3041%20138.879%2067.8004%20138.879%2066.7933C138.879%2065.7861%20138.373%2065.2827%20137.698%2065.2827H134.326V65.4504ZM138.204%2070.8221H134.494V73.8435H138.204C139.047%2073.8435%20139.722%2073.1721%20139.722%2072.3327C139.553%2071.6613%20138.879%2070.8221%20138.204%2070.8221Z'%20fill='%235D5359'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M73.4753%2051.4994C78.7281%2050.5396%2082.8911%2046.4891%2083.9954%2041.3137L84.1232%2040.7134L83.9445%2040.1256C80.5804%2029.066%2071.9945%2020.2704%2061.0373%2016.5726C57.4%2015.3451%2053.5046%2014.6804%2049.458%2014.6804C45.4112%2014.6804%2041.5158%2015.3451%2037.8784%2016.5726C26.9214%2020.2704%2018.3354%2029.066%2014.9712%2040.1256L14.7924%2040.7134L14.9206%2041.3137C16.0247%2046.4891%2020.1875%2050.5396%2025.4405%2051.4994V58.8839H14.4183C14.6758%2059.9557%2014.9818%2061.0088%2015.3337%2062.0411C20.1553%2076.1811%2033.6083%2086.3619%2049.458%2086.3619C65.3074%2086.3619%2078.7606%2076.1811%2083.5822%2062.0411C83.9342%2061.0088%2084.2399%2059.9557%2084.4974%2058.8839H73.4753V51.4994ZM41.0517%2020.5973V38.5742C41.0517%2043.1931%2044.8155%2046.9371%2049.458%2046.9371C54.1005%2046.9371%2057.8641%2043.1931%2057.8641%2038.5742V20.5973C55.1919%2019.856%2052.3732%2019.4592%2049.458%2019.4592C46.5428%2019.4592%2043.7241%2019.856%2041.0517%2020.5973ZM62.6675%2022.3673V38.5742C62.6675%2043.1931%2066.431%2046.9371%2071.0735%2046.9371C74.9051%2046.9371%2078.1425%2044.3848%2079.1528%2040.8942C76.4672%2032.6902%2070.4379%2025.9824%2062.6675%2022.3673ZM60.2658%2046.1322C57.8753%2049.5094%2053.9255%2051.7159%2049.458%2051.7159C44.9902%2051.7159%2041.0408%2049.5094%2038.65%2046.1322C36.6982%2048.8894%2033.7074%2050.8662%2030.2439%2051.4994V58.8839H68.6718V51.4994C65.2083%2050.8662%2062.2175%2048.8894%2060.2658%2046.1322ZM21.1583%2063.6628C26.1349%2074.2514%2036.9382%2081.5834%2049.458%2081.5834C61.9776%2081.5834%2072.781%2074.2514%2077.7574%2063.6628H21.1583ZM36.2482%2038.5742V22.3673C28.4779%2025.9824%2022.4486%2032.6902%2019.7631%2040.8942C20.7733%2044.3848%2024.0106%2046.9371%2027.8422%2046.9371C32.4847%2046.9371%2036.2482%2043.1931%2036.2482%2038.5742Z'%20fill='%23FFC35D'/%3e%3c/svg%3e";
21
- var je = { exports: {} };
22
- (function(V, b) {
23
- (function() {
24
- var n = {};
25
- V.exports = n, n.simpleFilter = function(d, t) {
26
- return t.filter(function(o) {
27
- return n.test(d, o);
28
- });
29
- }, n.test = function(d, t) {
30
- return n.match(d, t) !== null;
31
- }, n.match = function(d, t, o) {
32
- o = o || {};
33
- var c = 0, s = [], m = t.length, f = 0, i = 0, e = o.pre || "", p = o.post || "", I = o.caseSensitive && t || t.toLowerCase(), E;
34
- d = o.caseSensitive && d || d.toLowerCase();
35
- for (var B = 0; B < m; B++)
36
- E = t[B], I[B] === d[c] ? (E = e + E + p, c += 1, i += 1 + i) : i = 0, f += i, s[s.length] = E;
37
- return c === d.length ? (f = I === d ? 1 / 0 : f, { rendered: s.join(""), score: f }) : null;
38
- }, n.filter = function(d, t, o) {
39
- return !t || t.length === 0 ? [] : typeof d != "string" ? t : (o = o || {}, t.reduce(function(c, s, m, f) {
40
- var i = s;
41
- o.extract && (i = o.extract(s));
42
- var e = n.match(d, i, o);
43
- return e != null && (c[c.length] = {
44
- string: e.rendered,
45
- score: e.score,
46
- index: m,
47
- original: s
48
- }), c;
49
- }, []).sort(function(c, s) {
50
- var m = s.score - c.score;
51
- return m || c.index - s.index;
52
- }));
53
- };
54
- })();
55
- })(je);
56
- var ft = je.exports;
57
- const Ue = /* @__PURE__ */ qe(ft);
58
- function Ie(V, b) {
59
- return Ue.filter(V, b).length > 0;
60
- }
61
- function pt(V, b) {
62
- if (!V)
63
- return {
64
- label: b,
65
- segments: [
66
- {
67
- isMatch: !1,
68
- segment: b
69
- }
70
- ],
71
- matched: !1
72
- };
73
- const [n] = Ue.filter(V.toLocaleLowerCase(), [b], {
74
- pre: "|",
75
- post: "|"
76
- });
77
- if (!n)
78
- return {
79
- label: b,
80
- segments: [{ segment: b, isMatch: !1 }],
81
- matched: !1
82
- };
83
- const d = n.string.toString().replace(/\|\|/g, "").split("|").reduce((t, o, c) => (t.push({
84
- segment: o,
85
- isMatch: c % 2 !== 0
86
- //e.g. index 1, 3, 5, ...
87
- }), t), new Array());
88
- return {
89
- label: b,
90
- segments: d,
91
- matched: !0
92
- };
93
- }
94
- function G(V) {
95
- return Object.prototype.hasOwnProperty.call(V, "children");
96
- }
97
- const vt = { class: "flex flex-col gap-12 h-[350px]" }, yt = { class: "flex items-center" }, gt = {
98
- class: "flex-1",
99
- "data-cy": "items-selected"
100
- }, At = {
101
- class: "flex-1",
102
- "data-cy": "filter-field"
103
- }, bt = ["data-cy"], ht = { class: "flex flex-col" }, xt = { class: "fm-typo-en-body-md-400" }, It = {
104
- key: 1,
105
- class: "w-full py-16 text-fm-color-typo-disabled fm-typo-en-body-md-400 text-center"
106
- }, He = /* @__PURE__ */ Q({
107
- __name: "FmNestedMultiselectDialog",
108
- props: /* @__PURE__ */ Qe({
109
- modelValue: {}
110
- }, {
111
- modelValue: {},
112
- modelModifiers: {}
113
- }),
114
- emits: ["update:modelValue"],
115
- setup(V) {
116
- const b = ke(V, "modelValue"), n = We();
117
- ce(() => {
118
- n.emitData(b.value);
119
- });
120
- const d = N(""), { t } = $();
121
- function o(r) {
122
- return Ie(
123
- d.value,
124
- r.sublabel ? [r.label, r.sublabel] : [r.label]
125
- );
126
- }
127
- function c(r) {
128
- return o(r) ? !0 : G(r) ? r.children.some(c) : !1;
129
- }
130
- function s(r, g) {
131
- if (!d.value)
132
- return !0;
133
- const [S, ...T] = r;
134
- if (typeof S != "number")
135
- return !1;
136
- const D = g[S];
137
- return Ie(
138
- d.value,
139
- D.sublabel ? [D.label, D.sublabel] : [D.label]
140
- ) ? !0 : T.length === 0 ? c(D) : G(D) ? s(T, D.children) : !1;
141
- }
142
- function m(r, g, S = 0, T = !1) {
143
- if (G(r) && r.children.length) {
144
- const { children: D, ...X } = r, R = D.flatMap(
145
- (O, j) => m(O, [...g, j], S + 1, T || r.disabled)
146
- );
147
- return [
148
- {
149
- ...X,
150
- keys: g,
151
- indent: S,
152
- collapsible: !0,
153
- disabled: T || r.disabled
154
- },
155
- ...R
156
- ];
157
- }
158
- return [
159
- {
160
- ...r,
161
- keys: g,
162
- indent: S,
163
- collapsible: !1,
164
- disabled: T || r.disabled
165
- }
166
- ];
167
- }
168
- const f = z(() => b.value.flatMap(
169
- (r, g) => m(r, [g]).filter((S) => s(S.keys, b.value))
170
- ));
171
- function i(r) {
172
- if (G(r)) {
173
- if (c(r)) {
174
- const g = o(r) ? r.children : r.children.filter(c);
175
- return g.length === 0 ? !1 : g.every(i);
176
- }
177
- return r.children.every(i);
178
- }
179
- return r.active ?? !1;
180
- }
181
- function e(r, g) {
182
- const [S, ...T] = r;
183
- if (typeof S != "number")
184
- return !1;
185
- const D = g[S];
186
- return T.length === 0 ? i(D ?? []) : G(D) ? e(T, D.children ?? []) : !1;
187
- }
188
- function p(r) {
189
- if (G(r)) {
190
- if (c(r)) {
191
- const g = o(r) ? r.children : r.children.filter(c);
192
- return g.length === 0 ? !1 : g.some(i) && !g.every(i);
193
- }
194
- return !1;
195
- }
196
- return !1;
197
- }
198
- function I(r, g) {
199
- const [S, ...T] = r;
200
- if (typeof S != "number")
201
- return !1;
202
- const D = g[S];
203
- return T.length === 0 ? p(D ?? []) : G(D) ? I(T, (D == null ? void 0 : D.children) ?? []) : !1;
204
- }
205
- function E(r, g) {
206
- if (r.disabled)
207
- return r;
208
- if (G(r)) {
209
- if (c(r)) {
210
- const S = o(r) ? r.children : r.children.filter(c);
211
- return {
212
- ...r,
213
- children: r.children.map((T) => S.find((X) => Ge(X.value, T.value)) ? E(T, g) : T)
214
- };
215
- }
216
- return {
217
- ...r,
218
- children: r.children.map((S) => E(S, g))
219
- };
220
- }
221
- return {
222
- ...r,
223
- active: g
224
- };
225
- }
226
- function B(r, g, S) {
227
- const [T, ...D] = r;
228
- return typeof T != "number" ? g : D.length === 0 ? g.map((X, R) => T !== R ? X : E(X, S)) : g.map(
229
- (X, R) => T === R && G(X) ? {
230
- ...X,
231
- children: B(D, X.children, S)
232
- } : X
233
- );
234
- }
235
- const v = N(new Array());
236
- function a(r) {
237
- const g = r.join();
238
- return v.value.find((S) => g === S);
239
- }
240
- function h(r) {
241
- const g = r.join();
242
- a(r) ? v.value = v.value.filter((S) => S !== g) : v.value = [...v.value, g];
243
- }
244
- function k(r) {
245
- const g = r.join();
246
- return v.value.find((S) => g.startsWith(S) && g !== S);
247
- }
248
- const y = z(
249
- () => f.value.filter((r) => s(r.keys, b.value) && r.active).length
250
- );
251
- function l(r, g, S) {
252
- b.value = B(r, g, S), n.emitData(b.value);
253
- }
254
- return (r, g) => {
255
- const S = F("FmSearch"), T = F("FmCheckbox"), D = F("FmButton"), X = F("FmListItem"), R = F("FmList");
256
- return x(), _("div", vt, [
257
- u("div", yt, [
258
- u("div", gt, M(w(t)("inventory.formField.itemsSelected", { count: y.value })), 1),
259
- u("div", At, [
260
- A(S, {
261
- modelValue: d.value,
262
- "onUpdate:modelValue": g[0] || (g[0] = (O) => d.value = O),
263
- placeholder: w(t)("inventory.formField.filterItems")
264
- }, null, 8, ["modelValue", "placeholder"])
265
- ])
266
- ]),
267
- f.value.length ? (x(), H(R, {
268
- key: 0,
269
- class: "flex-1 overflow-y-auto"
270
- }, {
271
- default: L(() => [
272
- (x(!0), _(Y, null, W(f.value, (O) => (x(), _("div", {
273
- key: O.keys.join(),
274
- class: K([
275
- "transition-all overflow-y-clip",
276
- k(O.keys) ? "max-h-0 opacity-0" : "max-h-[50px] opacity-100"
277
- ]),
278
- "data-cy": `nested-${O.keys.join("-")}-${O.label}`
279
- }, [
280
- A(X, {
281
- clickable: O.selectable !== !1,
282
- onClick: () => O.selectable === !1 || O.disabled || l(O.keys, b.value, !e(O.keys, b.value)),
283
- style: Ye({
284
- paddingLeft: `${16 + O.indent * 16}px`,
285
- paddingTop: "4px",
286
- paddingBottom: "4px"
287
- }),
288
- disabled: O.selectable !== !1 && O.disabled
289
- }, se({
290
- default: L(() => [
291
- u("div", ht, [
292
- u("div", xt, [
293
- (x(!0), _(Y, null, W(w(pt)(d.value, O.label).segments, (j, ue) => (x(), _("span", {
294
- key: ue,
295
- class: K({
296
- "font-bold": j.isMatch
297
- })
298
- }, M(j.segment), 3))), 128))
299
- ]),
300
- O.sublabel ? (x(), _("div", {
301
- key: 0,
302
- class: K([
303
- "fm-typo-en-body-sm-400",
304
- O.disabled ? "" : "text-fm-color-typo-secondary"
305
- ])
306
- }, M(O.sublabel), 3)) : U("", !0)
307
- ])
308
- ]),
309
- _: 2
310
- }, [
311
- O.selectable !== !1 ? {
312
- name: "prepend",
313
- fn: L(() => [
314
- A(T, {
315
- disabled: O.disabled,
316
- "model-value": e(O.keys, b.value),
317
- value: O.keys,
318
- indeterminate: I(O.keys, b.value)
319
- }, null, 8, ["disabled", "model-value", "value", "indeterminate"])
320
- ]),
321
- key: "0"
322
- } : void 0,
323
- O.collapsible ? {
324
- name: "append",
325
- fn: L(() => [
326
- A(D, {
327
- "prepend-icon": a(O.keys) ? "expand_less" : "expand_more",
328
- size: "md",
329
- variant: "tertiary",
330
- onClick: Pe(() => h(O.keys), ["stop"])
331
- }, null, 8, ["prepend-icon", "onClick"])
332
- ]),
333
- key: "1"
334
- } : void 0
335
- ]), 1032, ["clickable", "onClick", "style", "disabled"])
336
- ], 10, bt))), 128))
337
- ]),
338
- _: 1
339
- })) : (x(), _("div", It, M(w(t)("inventory.formField.noItemsFound")), 1))
340
- ]);
341
- };
342
- }
343
- }), St = { class: "flex flex-col rounded border border-fm-color-neutral-gray-100 px-5 py-5 gap-5" }, wt = { class: "flex items-center" }, kt = { class: "text-lg font-bold flex-grow" }, Ft = {
344
- key: 0,
345
- class: "table-auto w-full"
346
- }, Ct = { class: "text-left" }, Bt = { class: "min-w-64" }, Et = { class: "flex flex-col" }, Vt = { class: "fm-typo-en-body-md-400" }, _t = {
347
- key: 0,
348
- class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400"
349
- }, Lt = { class: "w-1" }, Nt = /* @__PURE__ */ Q({
350
- __name: "ApplyAddon",
351
- props: {
352
- groups: {
353
- type: Array,
354
- required: !0
355
- },
356
- modifiers: {
357
- type: Array,
358
- required: !0
359
- },
360
- items: {
361
- type: Array,
362
- required: !0
363
- },
364
- loading: {
365
- type: Boolean
366
- }
367
- },
368
- emits: ["update:modifiers"],
369
- setup(V, { emit: b }) {
370
- const n = V, d = b, t = be(), o = z(() => {
371
- const e = n.groups.flatMap((p) => p.items.map((I) => {
372
- const E = n.items.find((B) => B._id === I._id);
373
- return {
374
- ...I,
375
- groupName: p.name,
376
- name: I.name ?? (E == null ? void 0 : E.name) ?? "-"
377
- };
378
- }));
379
- return n.modifiers.map((p) => {
380
- const I = e.find((v) => v.selection === p.selection), E = (I == null ? void 0 : I.name) ?? "-", B = (I == null ? void 0 : I.groupName) ?? "";
381
- return {
382
- ...p,
383
- name: E,
384
- groupName: B
385
- };
386
- });
387
- }), c = z(() => n.groups.flatMap((e) => e.items.map((p) => ({ ...p, groupId: e._id }))));
388
- function s({ selection: e }) {
389
- d(
390
- "update:modifiers",
391
- n.modifiers.filter((p) => p.selection !== e)
392
- );
393
- }
394
- function m({ selection: e }, p) {
395
- const I = n.modifiers.find((E) => E.selection === e);
396
- I && (I.code = p);
397
- }
398
- function f() {
399
- let e = [];
400
- n.groups.forEach((I) => {
401
- let E = !1;
402
- I.items.every((B) => B._id.startsWith("item")) && (E = !0), e.push({
403
- label: I.name,
404
- sublabel: "Group",
405
- value: I._id,
406
- disabled: E,
407
- children: I.items.reduce((B, v) => {
408
- var k;
409
- const a = n.items.find((y) => y._id === v._id), h = (k = a == null ? void 0 : a.variant) == null ? void 0 : k.variantCombinations.find(
410
- (y) => y.combinationKey === (v == null ? void 0 : v.combinationKey)
411
- );
412
- return [
413
- ...B,
414
- {
415
- label: `${v.name ?? (a == null ? void 0 : a.name)} ${h ? `(${h.name})` : ""}`,
416
- value: `${v.selection}${h ? `/${h == null ? void 0 : h.combinationKey}` : ""}`,
417
- disabled: E,
418
- active: !!n.modifiers.find(({ selection: y }) => y === v.selection)
419
- }
420
- ];
421
- }, [])
422
- });
423
- });
424
- const p = {
425
- modelValue: e
426
- };
427
- t.open({
428
- title: "Select Addons",
429
- contentComponent: He,
430
- contentComponentProps: p,
431
- primaryActions: {
432
- text: "Confirm",
433
- close: !0
434
- }
435
- }).onPrimary((I) => {
436
- const E = ae(n.modifiers);
437
- let B = [];
438
- function v(a, h) {
439
- if (h(a), G(a))
440
- for (let k of a.children)
441
- v(k, h);
442
- }
443
- I.forEach((a) => {
444
- v(a, (h) => {
445
- var r;
446
- if (n.groups.find(({ _id: g }) => g === h.value)) return;
447
- const y = c.value.find(({ selection: g }) => g === h.value), l = B.find(({ selection: g }) => h.value === g);
448
- !G(h) && h.active && l === void 0 && B.push({
449
- addonGroupId: (y == null ? void 0 : y.groupId) ?? "",
450
- selection: h.value,
451
- code: ((r = E.find(({ selection: g }) => h.value === g)) == null ? void 0 : r.code) ?? ""
452
- });
453
- });
454
- }), d("update:modifiers", B);
455
- });
456
- }
457
- const { t: i } = $();
458
- return (e, p) => {
459
- const I = F("FmButton"), E = F("FmTextField");
460
- return x(), _("div", St, [
461
- u("div", wt, [
462
- u("div", kt, M(w(i)("inventory.integration.apply.addons")), 1),
463
- A(I, {
464
- type: "button",
465
- variant: "plain",
466
- size: "md",
467
- icon: "link",
468
- label: w(i)("inventory.integration.apply.applyAddon"),
469
- onClick: p[0] || (p[0] = (B) => f())
470
- }, null, 8, ["label"])
471
- ]),
472
- u("div", null, [
473
- o.value.length > 0 ? (x(), _("table", Ft, [
474
- u("tr", Ct, [
475
- u("th", Bt, M(w(i)("inventory.integration.apply.name")), 1),
476
- u("th", null, M(w(i)("inventory.integration.apply.code")), 1),
477
- p[1] || (p[1] = u("th", { class: "w-1" }, " ", -1))
478
- ]),
479
- (x(!0), _(Y, null, W(o.value, (B, v) => (x(), _(Y, { key: v }, [
480
- p[2] || (p[2] = u("tr", { class: "block h-8" }, null, -1)),
481
- u("tr", null, [
482
- u("td", null, [
483
- u("div", Et, [
484
- u("div", Vt, M(B.name), 1),
485
- B.groupName ? (x(), _("div", _t, M(B.groupName), 1)) : U("", !0)
486
- ])
487
- ]),
488
- u("td", null, [
489
- A(E, {
490
- disabled: V.loading,
491
- "model-value": B.code,
492
- "onUpdate:modelValue": [(a) => B.code = a, (a) => m(B, a)],
493
- rules: [
494
- function(h) {
495
- return !!h || "Required";
496
- }
497
- ]
498
- }, null, 8, ["disabled", "model-value", "onUpdate:modelValue", "rules"])
499
- ]),
500
- u("td", Lt, [
501
- A(I, {
502
- disabled: V.loading,
503
- type: "button",
504
- variant: "tertiary",
505
- icon: "delete",
506
- "icon-color": "#000000",
507
- size: "md",
508
- onClick: (a) => s(B)
509
- }, null, 8, ["disabled", "onClick"])
510
- ])
511
- ])
512
- ], 64))), 128))
513
- ])) : U("", !0)
514
- ])
515
- ]);
516
- };
517
- }
518
- });
519
- function Tt(V, b = []) {
520
- const n = b.map((t) => V.find((o) => o._id === t)).filter((t) => !!t);
521
- return Dt(n).reduce((t, o) => (t[o.combinationKey] = o.selectionName.join(" / "), t), {});
522
- }
523
- function Rt(V, b, n) {
524
- const d = n.reduce((o, c) => {
525
- var i, e, p;
526
- const s = c.category || "", m = Tt(b, (i = c.variant) == null ? void 0 : i.variantGroupIds), f = {
527
- ...c,
528
- codeName: [c.code, c.name].filter((I) => !!I).join(" "),
529
- variant: {
530
- variantGroupIds: ((e = c.variant) == null ? void 0 : e.variantGroupIds) || [],
531
- variantCombinations: (((p = c.variant) == null ? void 0 : p.variantCombinations) || []).map((I) => {
532
- const E = I.code, B = I.name || m[I.combinationKey || ""];
533
- return {
534
- ...I,
535
- codeName: [E, B].filter((v) => !!v).join(" ").trim() || "-"
536
- };
537
- })
538
- }
539
- };
540
- return o[s] = o[s] ? [...o[s], f] : [f], o;
541
- }, {}), t = Object.values(d)[0];
542
- return V.length === 0 && t ? t.map((o) => ({
543
- id: o._id,
544
- name: o.name ?? "",
545
- items: d[o._id || ""] || []
546
- })) || [] : V.map((o) => ({
547
- id: o._id,
548
- name: o.name ?? "",
549
- items: d[o._id || ""] || []
550
- }));
551
- }
552
- function Xe(V, b) {
553
- if (V.length == 1)
554
- return V[0];
555
- const n = V[0], d = V.slice(1, V.length), t = Xe(d, b);
556
- return n.reduce((c, s) => [...c, ...t.map((m) => b(s, m))], new Array());
557
- }
558
- function Dt(V) {
559
- if (V.length === 0) return [];
560
- const b = V.map(
561
- (d) => (d.options ?? []).map(
562
- (t) => ({
563
- combinationKey: [`${d._id}/${t._id}`],
564
- selectionName: [t.name ?? ""]
565
- })
566
- )
567
- );
568
- return Xe(b, (d, t) => ({
569
- combinationKey: [...d.combinationKey, ...t.combinationKey],
570
- selectionName: [...d.selectionName, ...t.selectionName]
571
- })).map((d) => {
572
- const t = [...d.combinationKey];
573
- return t.sort(), {
574
- combinationKey: t.join("/"),
575
- active: !0,
576
- selectionName: d.selectionName
577
- };
578
- });
579
- }
580
- const Mt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-100 px-5 py-5 gap-5 mb-3" }, Ot = { class: "flex items-center" }, zt = { class: "text-lg font-bold flex-grow" }, jt = {
581
- key: 0,
582
- class: "table-auto w-full"
583
- }, Ut = { class: "text-left" }, Ht = { class: "min-w-64" }, Xt = { class: "flex flex-col" }, Qt = { class: "fm-typo-en-body-md-400" }, Yt = {
584
- key: 0,
585
- class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400"
586
- }, Pt = { class: "w-1" }, ge = /* @__PURE__ */ Q({
587
- __name: "ApplyProduct",
588
- props: {
589
- isAddon: {
590
- type: Boolean,
591
- default: !1
592
- },
593
- bindings: {
594
- type: Array,
595
- required: !0
596
- },
597
- categories: {
598
- type: Array,
599
- required: !0
600
- },
601
- variants: {
602
- type: Object,
603
- required: !0
604
- },
605
- menus: {
606
- type: Array,
607
- required: !0
608
- }
609
- },
610
- emits: ["update:bindings"],
611
- setup(V, { emit: b }) {
612
- const n = V, d = b, t = be(), o = z(() => n.isAddon ? "Addons" : "Products"), c = z(() => n.isAddon ? [] : n.categories), s = z(
613
- () => Rt(c.value, n.variants, n.menus)
614
- ), m = z(() => {
615
- if (n.isAddon)
616
- return n.bindings.map((h) => {
617
- const k = n.menus.find((l) => l._id === h.productId), y = (k == null ? void 0 : k.name) ?? "-";
618
- return {
619
- ...h,
620
- name: y,
621
- itemCode: (k == null ? void 0 : k.code) ?? "-"
622
- };
623
- });
624
- const a = s.value.flatMap((h) => h.items);
625
- return n.bindings.map((h) => {
626
- var g;
627
- const k = a.find((S) => S._id === h.productId), y = (k == null ? void 0 : k.name) ?? "-";
628
- let l = (k == null ? void 0 : k.code) ?? "-", r;
629
- if (h.combinationKey) {
630
- const S = (((g = k == null ? void 0 : k.variant) == null ? void 0 : g.variantCombinations) || []).find(
631
- (T) => T.combinationKey === h.combinationKey
632
- );
633
- r = (S == null ? void 0 : S.name) ?? (S == null ? void 0 : S.codeName) ?? "", l = (S == null ? void 0 : S.code) ?? l;
634
- }
635
- return {
636
- ...h,
637
- name: y,
638
- itemCode: l,
639
- variantName: r
640
- };
641
- });
642
- });
643
- function f(a) {
644
- d(
645
- "update:bindings",
646
- n.bindings.filter(
647
- (h) => h.productId !== a.productId || h.combinationKey !== a.combinationKey
648
- )
649
- );
650
- }
651
- function i({ productId: a, combinationKey: h }, k) {
652
- const y = n.bindings.find(
653
- (l) => l.productId === a && l.combinationKey === h
654
- );
655
- y && (y.code = k);
656
- }
657
- function e() {
658
- return s.value.map((a) => ({
659
- label: a.name,
660
- sublabel: "Category",
661
- value: a.name,
662
- disabled: !1,
663
- children: a.items.map((h) => {
664
- var y;
665
- const k = (y = h.variant) == null ? void 0 : y.variantCombinations;
666
- return k != null && k.length ? {
667
- label: h.name ?? "",
668
- value: h._id,
669
- sublabel: "Product",
670
- children: [
671
- {
672
- label: h.codeName ?? "",
673
- value: {
674
- productId: h._id
675
- },
676
- active: !!n.bindings.find(
677
- ({ productId: l, combinationKey: r }) => h._id === l && !r
678
- )
679
- },
680
- ...k.map((l) => ({
681
- label: l.codeName ?? "",
682
- value: {
683
- productId: h._id,
684
- combinationKey: l.combinationKey
685
- },
686
- sublabel: "Variant",
687
- active: !!n.bindings.find(
688
- ({ productId: r, combinationKey: g }) => h._id === r && l.combinationKey === g
689
- )
690
- }))
691
- ]
692
- } : {
693
- label: h.codeName ?? "",
694
- value: {
695
- productId: h._id
696
- },
697
- active: !!n.bindings.find(
698
- ({ productId: l, combinationKey: r }) => h._id === l && !r
699
- )
700
- };
701
- })
702
- }));
703
- }
704
- function p() {
705
- return n.menus.map((a) => ({
706
- label: a.name,
707
- value: { productId: a._id },
708
- active: !!n.bindings.find(
709
- ({ productId: h, combinationKey: k }) => a._id === h && !k
710
- )
711
- }));
712
- }
713
- function I(a) {
714
- const h = ae(n.bindings);
715
- return a.flatMap((k) => k.children.flatMap((y) => {
716
- var r;
717
- if (G(y))
718
- return y.children.filter((g) => g.active).map((g) => {
719
- var D, X;
720
- const { productId: S, combinationKey: T } = g.value;
721
- return T ? {
722
- productId: S,
723
- combinationKey: T,
724
- code: ((D = h.find(
725
- ({ productId: R, combinationKey: O }) => S === R && T === O
726
- )) == null ? void 0 : D.code) ?? ""
727
- } : {
728
- productId: S,
729
- code: ((X = h.find(({ productId: R, combinationKey: O }) => S === R && !O)) == null ? void 0 : X.code) ?? ""
730
- };
731
- });
732
- if (!y.active)
733
- return [];
734
- const { productId: l } = y.value;
735
- return [
736
- {
737
- productId: l,
738
- code: ((r = h.find(({ productId: g, combinationKey: S }) => l === g && !S)) == null ? void 0 : r.code) ?? ""
739
- }
740
- ];
741
- }));
742
- }
743
- function E(a) {
744
- const h = ae(n.bindings);
745
- return a.filter((k) => k.active).map(
746
- (k) => {
747
- var y;
748
- return {
749
- productId: k.value.productId,
750
- code: ((y = h.find(({ productId: l }) => l === k.value.productId)) == null ? void 0 : y.code) ?? ""
751
- };
752
- }
753
- );
754
- }
755
- function B() {
756
- let a;
757
- n.isAddon ? a = p() : a = e();
758
- const h = {
759
- modelValue: a
760
- };
761
- t.open({
762
- title: `Select ${o.value}`,
763
- contentComponent: He,
764
- contentComponentProps: h,
765
- primaryActions: {
766
- text: "Confirm",
767
- close: !0
768
- }
769
- }).onPrimary((k) => {
770
- let y;
771
- n.isAddon ? y = E(k) : y = I(k), d("update:bindings", y);
772
- });
773
- }
774
- const { t: v } = $();
775
- return (a, h) => {
776
- const k = F("FmButton"), y = F("FmTextField");
777
- return x(), _("div", Mt, [
778
- u("div", Ot, [
779
- u("div", zt, M(V.isAddon ? w(v)("inventory.integration.apply.addons") : w(v)("inventory.integration.apply.products")), 1),
780
- A(k, {
781
- type: "button",
782
- variant: "plain",
783
- size: "md",
784
- icon: "link",
785
- label: V.isAddon ? w(v)("inventory.integration.apply.applyAddon") : w(v)("inventory.integration.apply.applyProduct"),
786
- onClick: h[0] || (h[0] = (l) => B())
787
- }, null, 8, ["label"])
788
- ]),
789
- u("div", null, [
790
- m.value.length > 0 ? (x(), _("table", jt, [
791
- u("thead", null, [
792
- u("tr", Ut, [
793
- u("th", Ht, M(w(v)("inventory.integration.apply.name")), 1),
794
- u("th", null, M(w(v)("inventory.integration.apply.code")), 1),
795
- h[1] || (h[1] = u("th", { class: "w-1" }, " ", -1))
796
- ])
797
- ]),
798
- u("tbody", null, [
799
- (x(!0), _(Y, null, W(m.value, (l, r) => (x(), _(Y, { key: r }, [
800
- h[2] || (h[2] = u("tr", { class: "block h-8" }, null, -1)),
801
- u("tr", null, [
802
- u("td", null, [
803
- u("div", Xt, [
804
- u("div", Qt, M(l.itemCode) + " " + M(l.name), 1),
805
- l.variantName ? (x(), _("div", Yt, M(l.variantName), 1)) : U("", !0)
806
- ])
807
- ]),
808
- u("td", null, [
809
- A(y, {
810
- "model-value": l.code,
811
- "onUpdate:modelValue": [(g) => l.code = g, (g) => i(l, g)],
812
- rules: [
813
- function(S) {
814
- return !!S || "Required";
815
- }
816
- ]
817
- }, null, 8, ["model-value", "onUpdate:modelValue", "rules"])
818
- ]),
819
- u("td", Pt, [
820
- A(k, {
821
- type: "button",
822
- variant: "tertiary",
823
- icon: "delete",
824
- "icon-color": "#000000",
825
- size: "md",
826
- onClick: (g) => f(l)
827
- }, null, 8, ["onClick"])
828
- ])
829
- ])
830
- ], 64))), 128))
831
- ])
832
- ])) : U("", !0)
833
- ])
834
- ]);
835
- };
836
- }
837
- }), Jt = { class: "flex flex-col gap-8 w-full" }, Kt = /* @__PURE__ */ Q({
838
- __name: "ApplyProductDialog",
839
- props: {
840
- categories: { default: () => [] },
841
- variants: { default: () => [] },
842
- menus: { default: () => [] },
843
- groups: { default: () => [] },
844
- setting: {},
845
- show: { type: Boolean },
846
- loading: { type: Boolean }
847
- },
848
- emits: ["update:setting", "update:show", "submit"],
849
- setup(V, { emit: b }) {
850
- const n = V, d = b, t = Fe(ae(n.setting));
851
- Ce([() => n.show], ([i]) => {
852
- if (i)
853
- for (const e of Object.keys(n.setting))
854
- t[e] = n.setting[e];
855
- });
856
- const o = N(), c = re(n, "show");
857
- function s() {
858
- var i, e;
859
- (e = (i = o.value) == null ? void 0 : i.validateInputs) == null || e.call(i);
860
- }
861
- function m() {
862
- d("update:setting", ae(t)), d("submit");
863
- }
864
- const { t: f } = $();
865
- return (i, e) => {
866
- const p = F("FmChip"), I = F("FmForm"), E = F("FmButton"), B = F("FmSideSheet");
867
- return x(), H(B, {
868
- modelValue: w(c),
869
- "onUpdate:modelValue": e[4] || (e[4] = (v) => ie(c) ? c.value = v : null),
870
- header: w(f)("inventory.integration.apply.title"),
871
- "dismiss-away": "",
872
- "close-button": "",
873
- "max-width": 500
874
- }, {
875
- default: L(() => [
876
- u("div", Jt, [
877
- u("div", null, [
878
- A(p, { label: "Menu v3" })
879
- ]),
880
- A(I, {
881
- ref_key: "formRef",
882
- ref: o,
883
- onValidationSuccess: e[2] || (e[2] = (v) => m())
884
- }, {
885
- default: L(() => [
886
- A(ge, {
887
- bindings: t.bindings,
888
- categories: i.categories,
889
- variants: i.variants,
890
- menus: i.menus,
891
- "onUpdate:bindings": e[0] || (e[0] = (v) => t.bindings = v)
892
- }, null, 8, ["bindings", "categories", "variants", "menus"]),
893
- A(Nt, {
894
- form: o.value,
895
- modifiers: t.modifiers ?? [],
896
- groups: i.groups ?? [],
897
- items: i.menus ?? [],
898
- "onUpdate:modifiers": e[1] || (e[1] = (v) => t.modifiers = v)
899
- }, null, 8, ["form", "modifiers", "groups", "items"])
900
- ]),
901
- _: 1
902
- }, 512)
903
- ])
904
- ]),
905
- "side-sheet-footer": L(() => [
906
- A(E, {
907
- loading: i.loading,
908
- type: "submit",
909
- label: w(f)("common.confirm"),
910
- onClick: e[3] || (e[3] = (v) => s())
911
- }, null, 8, ["loading", "label"])
912
- ]),
913
- _: 1
914
- }, 8, ["modelValue", "header"]);
915
- };
916
- }
917
- }), qt = { class: "flex flex-col gap-8 w-full" }, Gt = /* @__PURE__ */ Q({
918
- __name: "ApplyProductDialogV4",
919
- props: {
920
- categories: { default: () => [] },
921
- variants: { default: () => [] },
922
- menus: { default: () => [] },
923
- groups: { default: () => [] },
924
- setting: {},
925
- show: { type: Boolean },
926
- loading: { type: Boolean }
927
- },
928
- emits: ["update:setting", "update:show", "submit"],
929
- setup(V, { emit: b }) {
930
- const n = V, d = b, t = Fe(ae(n.setting));
931
- Ce([() => n.show], ([v]) => {
932
- if (v)
933
- for (const a of Object.keys(n.setting))
934
- t[a] = n.setting[a];
935
- });
936
- const o = z(() => n.menus.filter((v) => !(v != null && v.category))), c = z(() => t.bindings.filter((v) => {
937
- const a = n.menus.find((h) => h._id === v.productId);
938
- return a ? !(a != null && a.category) : !1;
939
- })), s = z(() => n.menus.filter((v) => (v == null ? void 0 : v.category) !== null)), m = z(() => t.bindings.filter((v) => {
940
- const a = n.menus.find((h) => h._id === v.productId);
941
- return a ? (a == null ? void 0 : a.category) !== null : !1;
942
- }));
943
- function f(v) {
944
- t.bindings = [...c.value, ...v];
945
- }
946
- function i(v) {
947
- t.bindings = [...m.value, ...v];
948
- }
949
- const e = N(), p = re(n, "show");
950
- function I() {
951
- var v, a;
952
- (a = (v = e.value) == null ? void 0 : v.validateInputs) == null || a.call(v);
953
- }
954
- function E() {
955
- d("update:setting", ae(t)), d("submit");
956
- }
957
- const { t: B } = $();
958
- return (v, a) => {
959
- const h = F("FmChip"), k = F("FmForm"), y = F("FmButton"), l = F("FmSideSheet");
960
- return x(), H(l, {
961
- modelValue: w(p),
962
- "onUpdate:modelValue": a[4] || (a[4] = (r) => ie(p) ? p.value = r : null),
963
- header: w(B)("inventory.integration.apply.title"),
964
- "dismiss-away": "",
965
- "close-button": "",
966
- "max-width": 500
967
- }, {
968
- default: L(() => [
969
- u("div", qt, [
970
- u("div", null, [
971
- A(h, { label: "Menu v4" })
972
- ]),
973
- A(k, {
974
- ref_key: "formRef",
975
- ref: e,
976
- onValidationSuccess: a[2] || (a[2] = (r) => E())
977
- }, {
978
- default: L(() => [
979
- A(ge, {
980
- categories: v.categories,
981
- variants: v.variants,
982
- bindings: m.value,
983
- menus: s.value,
984
- "onUpdate:bindings": a[0] || (a[0] = (r) => f(r))
985
- }, null, 8, ["categories", "variants", "bindings", "menus"]),
986
- A(ge, {
987
- "is-addon": !0,
988
- categories: [],
989
- variants: v.variants,
990
- bindings: c.value,
991
- menus: o.value,
992
- "onUpdate:bindings": a[1] || (a[1] = (r) => i(r))
993
- }, null, 8, ["variants", "bindings", "menus"])
994
- ]),
995
- _: 1
996
- }, 512)
997
- ])
998
- ]),
999
- "side-sheet-footer": L(() => [
1000
- A(y, {
1001
- loading: v.loading,
1002
- type: "submit",
1003
- label: w(B)("common.confirm"),
1004
- onClick: a[3] || (a[3] = (r) => I())
1005
- }, null, 8, ["loading", "label"])
1006
- ]),
1007
- _: 1
1008
- }, 8, ["modelValue", "header"]);
1009
- };
1010
- }
1011
- }), Zt = { key: 0 }, Wt = { class: "flex justify-center" }, $t = ["src"], en = { class: "flex flex-col items-center gap-2" }, tn = { class: "text-lg font-bold" }, nn = { class: "text-fm-color-neutral-gray-300" }, on = { key: 0 }, sn = /* @__PURE__ */ Q({
1012
- __name: "FoodMarketHub",
1013
- setup(V) {
1014
- const b = le(), n = ee(), d = ne(), t = N(!1), o = tt(), c = z(() => o.state.menu ?? []), s = z(() => o.state.group ?? []), m = z(() => o.state.variants ?? []), f = z(() => o.state.categories ?? []), i = Ze(), e = z(() => {
1015
- var k;
1016
- return (k = b.currentBusiness.value) == null ? void 0 : k.menuVersion;
1017
- });
1018
- d.watchLocation(o.init);
1019
- const p = N(!1);
1020
- async function I() {
1021
- p.value = !0;
1022
- }
1023
- const { breakpoints: E } = Ve(), B = z(() => E.value.xs || E.value.sm), v = z(() => B.value);
1024
- async function a() {
1025
- const k = o.state.setting;
1026
- if (k) {
1027
- t.value = !0;
1028
- try {
1029
- await i.updateSetting(k), n.open({
1030
- title: "Success",
1031
- message: "Your changes has been saved",
1032
- type: "success"
1033
- }), p.value = !1, await o.init();
1034
- return;
1035
- } catch (y) {
1036
- n.open({
1037
- title: "Something went wrong",
1038
- message: "Cannot update integration info. Please try again.",
1039
- type: "error"
1040
- }), console.error("Error at updating integration info", y);
1041
- } finally {
1042
- t.value = !1;
1043
- }
1044
- }
1045
- }
1046
- const { t: h } = $();
1047
- return (k, y) => {
1048
- const l = F("FmCardSection"), r = F("FmCard");
1049
- return w(o).isEnabled && !w(o).isBusinessLocation ? (x(), _("div", Zt, [
1050
- A(r, {
1051
- class: K({
1052
- "w-full": v.value,
1053
- "w-1/2": !v.value,
1054
- border: !0,
1055
- "border-fm-color-neutral-gray-100": !0,
1056
- "cursor-pointer": !0,
1057
- "hover:border-fm-color-primary": !0
1058
- }),
1059
- onClick: y[0] || (y[0] = (g) => I())
1060
- }, {
1061
- default: L(() => [
1062
- A(l, null, {
1063
- default: L(() => [
1064
- u("div", Wt, [
1065
- u("img", {
1066
- src: w(mt),
1067
- alt: "Food Market Hub"
1068
- }, null, 8, $t)
1069
- ]),
1070
- u("div", en, [
1071
- u("div", tn, M(w(h)("inventory.integration.fmh.title")), 1),
1072
- u("div", nn, M(w(h)("inventory.integration.fmh.description")), 1)
1073
- ])
1074
- ]),
1075
- _: 1
1076
- })
1077
- ]),
1078
- _: 1
1079
- }, 8, ["class"]),
1080
- w(o).state.setting ? (x(), _("div", on, [
1081
- (x(), H(fe, { to: "body" }, [
1082
- e.value === "v3" ? (x(), H(Kt, {
1083
- key: 0,
1084
- menus: c.value,
1085
- variants: m.value,
1086
- categories: f.value,
1087
- setting: w(o).state.setting,
1088
- "onUpdate:setting": y[1] || (y[1] = (g) => w(o).state.setting = g),
1089
- show: p.value,
1090
- "onUpdate:show": y[2] || (y[2] = (g) => p.value = g),
1091
- groups: s.value,
1092
- loading: t.value,
1093
- onSubmit: y[3] || (y[3] = (g) => a())
1094
- }, null, 8, ["menus", "variants", "categories", "setting", "show", "groups", "loading"])) : (x(), H(Gt, {
1095
- key: 1,
1096
- menus: c.value,
1097
- variants: m.value,
1098
- categories: f.value,
1099
- setting: w(o).state.setting,
1100
- "onUpdate:setting": y[4] || (y[4] = (g) => w(o).state.setting = g),
1101
- show: p.value,
1102
- "onUpdate:show": y[5] || (y[5] = (g) => p.value = g),
1103
- groups: s.value,
1104
- loading: t.value,
1105
- onSubmit: y[6] || (y[6] = (g) => a())
1106
- }, null, 8, ["menus", "variants", "categories", "setting", "show", "groups", "loading"]))
1107
- ]))
1108
- ])) : U("", !0)
1109
- ])) : U("", !0);
1110
- };
1111
- }
1112
- }), an = "data:image/svg+xml,%3csvg%20width='200'%20height='100'%20viewBox='0%200%20200%20100'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3crect%20width='200'%20height='100'%20fill='url(%23pattern0_1500_58879)'/%3e%3cdefs%3e%3cpattern%20id='pattern0_1500_58879'%20patternContentUnits='objectBoundingBox'%20width='1'%20height='1'%3e%3cuse%20xlink:href='%23image0_1500_58879'%20transform='matrix(0.002%200%200%200.004%200%200.046)'/%3e%3c/pattern%3e%3cimage%20id='image0_1500_58879'%20width='500'%20height='227'%20xlink:href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAADjCAYAAABzcuYdAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAB9KADAAQAAAABAAAA4wAAAABu8la3AABAAElEQVR4Ae2dCYAcVZnH61V191w5yDU5CDAkIXN0z0wC7C4uAorKpeyysugiuLqKooKIBwsCcguCFwoogqwrIHhzLIKigDeIQDLT3XMlmYSQBHKQhITM1V319v+6p/qorup+1VPd0z3zFXSm6r3vvfe9X1W9792lKHQQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIgMKIAREgApVLoKmp6aCGhoZZqrp/fzi8eU/lakqaEQEiMNkEpqNBZ8Fg00JVr13AfcpizrX5uAlLVVVlhmHwybohSF/lnA/jtwU6bIcu24eHh3du2rRpbzl0CgaDJzLGjsFPn0wObvOqqqJSyncIbmrM2DyqKNv6+/v3u42nkuRxL+ZqzHi/orD3IHNNnLFZClf243wLntBHRmOxnwwMDOyqJJ2L1QV5nYFHv1HX9QX4uwTxLMIzOBvPoFFsnK7CqXLJqIpaw7n+VCTS99fM+JcsWVI/Z86c86F7IN97gzz58Yz+NhqNPp8ZfrqeB4NKgLHlCzmvnQsGh4HPfPway3bfx8GrivX+qwmfDNcAHP6O+/ab8SAV/cdX0dp5pFwwuGCGqs87ivnUk7nCj0ZBuZz5lGWiNsMS9y95E/FSukwx47bnDSkZL4NG4ocDhfib/hkzBjtCofW4/COufxMOh9fhXBf+JTj+DS/UhSJeVxyYoagFq0GS+XedKZP/OLeAOlTL+UBHqO05QzF+gsraX/EijrmOdhIDhEKt7wKtbzGmtppqJJ6I5GPRqjLlXbUB/4WQuygS6f2tKVNNf5ubm5f4fOrxqIudzFTeoXDe5Nc0UbCnDlfPYCqUuxMDzy6edtlAe+OK8rBVuK6uTlRIboa7v5DOeL8QhTJtDfry5csb6wKBY1WNv41ztppxZTnKX1Ti0vegEEMr/4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ZGGaNjzBFfw3Dk6/C5r8SiUSEAY95p0bRMSWW0tXW1h4Ma7kcOi+AvjOydGdsN3okdijKyODu3UOvbtu2bajo1CggESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiIBHBP4fA65iItIh5WIAAAAASUVORK5CYII='/%3e%3c/defs%3e%3c/svg%3e", ln = {
1113
- key: 0,
1114
- class: "line-clamp-1 text-ellipsis"
1115
- }, rn = {
1116
- key: 1,
1117
- class: "line-clamp-1 text-ellipsis text-fm-color-typo-tertiary"
1118
- }, un = { class: "flex flex-col gap-5" }, cn = { class: "overflow-x-hidden overflow-y-auto max-h-[300px]" }, dn = /* @__PURE__ */ Q({
1119
- __name: "FmEnhancedSelect",
1120
- props: {
1121
- placeholder: {},
1122
- items: {},
1123
- label: {},
1124
- searchTarget: {},
1125
- disabled: { type: Boolean },
1126
- modelValue: {}
1127
- },
1128
- emits: ["update:modelValue"],
1129
- setup(V, { emit: b }) {
1130
- const n = V, d = b, t = N(""), o = z(
1131
- () => new at(
1132
- n.items,
1133
- (s) => [s.label ?? "", s.sublabel ?? "", ...s.value[n.searchTarget]].filter((m) => m)
1134
- )
1135
- ), c = z(() => o.value.search(t.value));
1136
- return (s, m) => {
1137
- const f = F("FmLabel"), i = F("FmField"), e = F("FmIcon"), p = F("FmTextField"), I = F("FmMenuItem"), E = F("FmMenu"), B = F("FmFormGroup");
1138
- return x(), H(B, {
1139
- "model-value": s.modelValue,
1140
- rules: [w(it)()],
1141
- "label-mark": "required"
1142
- }, se({
1143
- default: L(({ invalid: v }) => [
1144
- A(E, null, {
1145
- "menu-button": L(() => [
1146
- A(i, {
1147
- class: K([
1148
- "fm-typo-en-body-lg-400",
1149
- {
1150
- "text-fm-color-typo-primary": !s.disabled,
1151
- "text-fm-color-typo-disabled": s.disabled
1152
- }
1153
- ]),
1154
- invalid: v,
1155
- "append-icon": "expand_more"
1156
- }, {
1157
- default: L(() => [
1158
- s.modelValue[n.searchTarget] ? (x(), _("span", ln, M(s.modelValue[n.searchTarget]), 1)) : (x(), _("span", rn, M(s.placeholder || "Select an option"), 1))
1159
- ]),
1160
- _: 2
1161
- }, 1032, ["class", "invalid"])
1162
- ]),
1163
- default: L(() => [
1164
- u("div", un, [
1165
- A(p, {
1166
- modelValue: t.value,
1167
- "onUpdate:modelValue": m[1] || (m[1] = (a) => t.value = a),
1168
- placeholder: "Filter options"
1169
- }, se({
1170
- prepend: L(() => [
1171
- A(e, { name: "search" })
1172
- ]),
1173
- _: 2
1174
- }, [
1175
- t.value.length ? {
1176
- name: "append",
1177
- fn: L(() => [
1178
- A(e, {
1179
- class: "cursor-pointer",
1180
- name: "close",
1181
- onClick: m[0] || (m[0] = (a) => t.value = "")
1182
- })
1183
- ]),
1184
- key: "0"
1185
- } : void 0
1186
- ]), 1032, ["modelValue"]),
1187
- u("div", cn, [
1188
- (x(!0), _(Y, null, W(c.value, (a, h) => {
1189
- var k, y;
1190
- return x(), H(I, {
1191
- key: h,
1192
- label: a.label,
1193
- "model-value": a.value[n.searchTarget] === ((k = s.modelValue) == null ? void 0 : k[n.searchTarget]),
1194
- onClick: (l) => d("update:modelValue", a.value),
1195
- "x-should-scroll-into": `${a.value[n.searchTarget] === ((y = s.modelValue) == null ? void 0 : y[n.searchTarget])}`
1196
- }, null, 8, ["label", "model-value", "onClick", "x-should-scroll-into"]);
1197
- }), 128))
1198
- ])
1199
- ])
1200
- ]),
1201
- _: 2
1202
- }, 1024)
1203
- ]),
1204
- _: 2
1205
- }, [
1206
- s.label ? {
1207
- name: "label",
1208
- fn: L(() => [
1209
- A(f, { label: s.label }, null, 8, ["label"])
1210
- ]),
1211
- key: "0"
1212
- } : void 0
1213
- ]), 1032, ["model-value", "rules"]);
1214
- };
1215
- }
1216
- }), mn = { class: "flex-col items-center" }, fn = { class: "flex gap-2" }, pn = {
1217
- key: 0,
1218
- class: "text-xs text-red-500 mt-2"
1219
- }, vn = {
1220
- key: 1,
1221
- class: "flex items-center mt-2"
1222
- }, yn = { class: "flex flex-col" }, gn = { class: "font-medium" }, An = { class: "text-xs text-gray-400" }, bn = { class: "text-xs text-gray-400" }, hn = /* @__PURE__ */ Q({
1223
- __name: "NetSuiteLocationField",
1224
- props: {
1225
- isDuplicate: { type: Boolean, default: !1 },
1226
- nsLocationOptions: {},
1227
- fmLocation: {},
1228
- modelValue: { default: () => ({
1229
- netsuiteId: "",
1230
- name: "",
1231
- subsidiaryName: "",
1232
- subsidiaryId: ""
1233
- }) }
1234
- },
1235
- emits: ["update:modelValue"],
1236
- setup(V, { emit: b }) {
1237
- const n = V, d = z(() => n.modelValue), t = b;
1238
- return (o, c) => {
1239
- const s = F("FmButton"), m = F("FmIcon");
1240
- return x(), _("div", mn, [
1241
- u("div", fn, [
1242
- A(dn, {
1243
- placeholder: "Select NetSuite Location",
1244
- items: o.nsLocationOptions,
1245
- searchTarget: "name",
1246
- "model-value": d.value,
1247
- "onUpdate:modelValue": c[0] || (c[0] = (f) => t("update:modelValue", f))
1248
- }, null, 8, ["items", "model-value"]),
1249
- d.value.netsuiteId ? (x(), H(s, {
1250
- key: 0,
1251
- variant: "secondary",
1252
- label: "Clear",
1253
- onClick: c[1] || (c[1] = (f) => t("update:modelValue", {
1254
- netsuiteId: "",
1255
- name: "",
1256
- subsidiaryName: "",
1257
- subsidiaryId: ""
1258
- }))
1259
- })) : U("", !0)
1260
- ]),
1261
- o.isDuplicate ? (x(), _("div", pn, " NetSuite location being used by another FeedMe location. ")) : U("", !0),
1262
- d.value.netsuiteId ? (x(), _("div", vn, [
1263
- A(m, {
1264
- name: "cloud",
1265
- color: "neutral-gray-400",
1266
- size: "md",
1267
- class: "mr-2",
1268
- outline: ""
1269
- }),
1270
- u("div", yn, [
1271
- u("span", gn, M(d.value.name), 1),
1272
- u("span", An, "ID: " + M(d.value.netsuiteId), 1),
1273
- u("span", bn, "Subsidiary: " + M(d.value.subsidiaryName), 1)
1274
- ])
1275
- ])) : U("", !0)
1276
- ]);
1277
- };
1278
- }
1279
- }), xn = /* @__PURE__ */ Q({
1280
- __name: "AddLocationDialog",
1281
- props: {
1282
- showDialog: {
1283
- type: Boolean,
1284
- required: !0
1285
- },
1286
- fmLocationNotYetConfigured: {
1287
- type: Array,
1288
- required: !0
1289
- },
1290
- nsLocationsNotBeingUsed: {
1291
- type: Array,
1292
- required: !0
1293
- },
1294
- formRef: {
1295
- type: Object,
1296
- default: null
1297
- }
1298
- },
1299
- emits: ["update:loading", "update:showDialog"],
1300
- setup(V, { emit: b }) {
1301
- const n = oe(), d = ee(), t = [
1302
- {
1303
- id: "fmLocation",
1304
- header: "FeedMe Location",
1305
- cell(I) {
1306
- const E = I.row.original, B = C(q.FmIcon, {
1307
- name: E.type,
1308
- color: "neutral-gray-400",
1309
- size: "md",
1310
- class: "mr-2",
1311
- outline: !0
1312
- });
1313
- return C("div", { class: "flex items-center" }, [
1314
- B,
1315
- C("div", { class: "flex flex-col" }, [
1316
- C("span", { class: "font-medium" }, E.name),
1317
- C("span", { class: "text-xs text-gray-400" }, E.doc._id)
1318
- ])
1319
- ]);
1320
- }
1321
- },
1322
- {
1323
- id: "nsLocation",
1324
- header: "NetSuite Location",
1325
- cell(I) {
1326
- const E = I.row.original, B = s.value[E.dbName], v = Object.entries(s.value).some(
1327
- ([a, h]) => a !== E.dbName && h.netsuiteId === (B == null ? void 0 : B.netsuiteId)
1328
- );
1329
- return C(hn, {
1330
- isDuplicate: v,
1331
- nsLocationOptions: i.value,
1332
- modelValue: B,
1333
- fmLocation: E,
1334
- "onUpdate:modelValue": (a) => {
1335
- a.netsuiteId ? s.value = {
1336
- ...s.value,
1337
- [E.dbName]: {
1338
- netsuiteId: a.netsuiteId,
1339
- name: a.name,
1340
- subsidiaryName: a.subsidiaryName,
1341
- subsidiaryId: a.subsidiaryId
1342
- }
1343
- } : delete s.value[E.dbName];
1344
- }
1345
- });
1346
- }
1347
- }
1348
- ], o = V, c = b, s = N({}), m = N(), f = N(""), i = z(() => o.nsLocationsNotBeingUsed.map((I) => ({
1349
- label: I.name,
1350
- value: I
1351
- }))), e = z(() => Object.values(s.value).length === 0 || Object.values(s.value).some(
1352
- (I) => Object.values(s.value).filter((E) => E.netsuiteId === I.netsuiteId).length > 1
1353
- ));
1354
- async function p() {
1355
- try {
1356
- c("update:loading", !0), await n.updateLocationConfigs(s.value), d.open({
1357
- message: "Locations updated successfully",
1358
- type: "success"
1359
- }), c("update:showDialog", !1), s.value = {};
1360
- } catch {
1361
- d.open({
1362
- message: "Failed to update locations. Please try again.",
1363
- type: "error"
1364
- });
1365
- } finally {
1366
- c("update:loading", !1);
1367
- }
1368
- }
1369
- return (I, E) => {
1370
- const B = F("FmTable"), v = F("FmForm"), a = F("FmSpacer"), h = F("FmButton"), k = F("FmDialog");
1371
- return x(), H(k, {
1372
- modelValue: V.showDialog,
1373
- "onUpdate:modelValue": E[2] || (E[2] = (y) => I.$emit("update:showDialog", y)),
1374
- overlay: !0,
1375
- "max-width": "900px"
1376
- }, {
1377
- "dialog-header": L(() => E[3] || (E[3] = [
1378
- u("div", null, "Add locations", -1)
1379
- ])),
1380
- "dialog-footer": L(() => [
1381
- A(a, { class: "sm:hidden xs:hidden" }),
1382
- A(h, {
1383
- class: "sm:w-full xs:w-full",
1384
- label: "Submit",
1385
- size: "md",
1386
- disabled: e.value,
1387
- onClick: p
1388
- }, null, 8, ["disabled"])
1389
- ]),
1390
- default: L(() => [
1391
- A(v, {
1392
- ref: "formRef",
1393
- class: "mb-4",
1394
- "model-value": m.value,
1395
- "onUpdate:modelValue": E[1] || (E[1] = (y) => m.value = y)
1396
- }, {
1397
- default: L(() => [
1398
- A(B, {
1399
- modelValue: m.value,
1400
- "onUpdate:modelValue": E[0] || (E[0] = (y) => m.value = y),
1401
- "row-data": o.fmLocationNotYetConfigured,
1402
- "column-defs": t,
1403
- "search-value": f.value,
1404
- "shrink-at": !1
1405
- }, null, 8, ["modelValue", "row-data", "search-value"])
1406
- ]),
1407
- _: 1
1408
- }, 8, ["model-value"])
1409
- ]),
1410
- _: 1
1411
- }, 8, ["modelValue"]);
1412
- };
1413
- }
1414
- }), In = { class: "p-8 flex items-center justify-between" }, Sn = { class: "flex gap-4" }, wn = /* @__PURE__ */ Q({
1415
- __name: "LocationsTab",
1416
- setup(V) {
1417
- const b = ne(), n = oe(), d = ee(), t = N(!1), o = N(), c = N(""), s = N(null), m = N([]), f = N(null), i = [
1418
- {
1419
- key: "type",
1420
- type: "string",
1421
- entity: "item",
1422
- values: ["warehouse", "restaurant"]
1423
- }
1424
- ];
1425
- ce(async () => {
1426
- if (n.isReady && n.isEnabled)
1427
- try {
1428
- m.value = await n.getNetSuiteLocationOptions();
1429
- } catch {
1430
- d.open({ message: "Failed to fetch NetSuite locations", type: "error" });
1431
- }
1432
- });
1433
- const e = z(() => {
1434
- let v = n.state.setting.locations;
1435
- if (!s.value)
1436
- return v;
1437
- const a = Le.build(s.value);
1438
- return v.filter(
1439
- (h) => Ne(
1440
- {
1441
- type: h.type
1442
- },
1443
- a
1444
- )
1445
- );
1446
- }), p = [
1447
- {
1448
- id: "location",
1449
- header: () => "FeedMe Location",
1450
- accessorFn: (v) => {
1451
- const a = b.locations.find(
1452
- (h) => h.type === v.type && h.doc._id === v.id
1453
- );
1454
- return `${(a == null ? void 0 : a.name) || ""} ${(a == null ? void 0 : a.doc._id) || ""}`;
1455
- },
1456
- cell(v) {
1457
- const a = v.row.original, h = b.locations.find(
1458
- (y) => y.type === a.type && y.doc._id === a.id
1459
- );
1460
- if (!h)
1461
- return C("div", "Unknown Location");
1462
- const k = C(q.FmIcon, {
1463
- name: h.type,
1464
- color: "neutral-gray-400",
1465
- size: "md",
1466
- class: "mr-2",
1467
- outline: !0
1468
- });
1469
- return C("div", { class: "flex items-center" }, [
1470
- k,
1471
- C("div", { class: "flex flex-col" }, [
1472
- C("span", { class: "font-medium" }, h.name),
1473
- C("span", { class: "text-xs text-gray-400" }, h.doc._id)
1474
- ])
1475
- ]);
1476
- }
1477
- },
1478
- {
1479
- id: "netsuite",
1480
- header: () => "NetSuite Location",
1481
- accessorFn: (v) => {
1482
- var h;
1483
- const a = (h = m.value.find(
1484
- (k) => k.netsuiteId === v.netSuiteId
1485
- )) == null ? void 0 : h.subsidiaryName;
1486
- return `${v.name} ${v.netSuiteId} ${a || ""}`;
1487
- },
1488
- cell(v) {
1489
- var y;
1490
- const a = v.row.original, h = (y = m.value.find(
1491
- (l) => l.netsuiteId === a.netSuiteId
1492
- )) == null ? void 0 : y.subsidiaryName, k = C(q.FmIcon, {
1493
- name: "cloud",
1494
- color: "neutral-gray-400",
1495
- size: "md",
1496
- class: "mr-2",
1497
- outline: !0
1498
- });
1499
- return C("div", { class: "flex items-center" }, [
1500
- k,
1501
- C("div", { class: "flex flex-col" }, [
1502
- C("span", { class: "font-medium" }, a.name),
1503
- C("span", { class: "text-xs text-gray-400" }, `ID: ${a.netSuiteId}`),
1504
- C("span", { class: "text-xs text-gray-400" }, `Subsidiary: ${h}`)
1505
- ])
1506
- ]);
1507
- }
1508
- }
1509
- ], I = z(() => b.locations.filter(
1510
- (v) => !n.state.setting.locations.some(
1511
- (a) => a.id === v.doc._id && a.type === v.type
1512
- )
1513
- )), E = z(() => m.value.filter(
1514
- (v) => !n.state.setting.locations.some(
1515
- (a) => a.netSuiteId === v.netsuiteId
1516
- )
1517
- )), B = () => {
1518
- t.value = !0;
1519
- };
1520
- return (v, a) => {
1521
- const h = F("FmSearch"), k = F("FmButton"), y = F("FmTable");
1522
- return x(), _("div", null, [
1523
- u("div", In, [
1524
- u("div", Sn, [
1525
- A(h, {
1526
- placeholder: "Search by Location",
1527
- class: "w-[300px]",
1528
- modelValue: c.value,
1529
- "onUpdate:modelValue": a[0] || (a[0] = (l) => c.value = l)
1530
- }, null, 8, ["modelValue"]),
1531
- A(w(Te), {
1532
- modelValue: s.value,
1533
- "onUpdate:modelValue": a[1] || (a[1] = (l) => s.value = l),
1534
- attributes: i
1535
- }, null, 8, ["modelValue"])
1536
- ]),
1537
- A(k, {
1538
- label: "Add location",
1539
- onClick: B
1540
- })
1541
- ]),
1542
- A(y, {
1543
- modelValue: o.value,
1544
- "onUpdate:modelValue": a[2] || (a[2] = (l) => o.value = l),
1545
- "row-data": e.value,
1546
- "column-defs": p,
1547
- "shrink-at": !1,
1548
- "search-value": c.value,
1549
- autoResetPageIndex: !0
1550
- }, null, 8, ["modelValue", "row-data", "search-value"]),
1551
- A(xn, {
1552
- "show-dialog": t.value,
1553
- "onUpdate:showDialog": [
1554
- a[3] || (a[3] = (l) => t.value = l),
1555
- a[4] || (a[4] = (l) => t.value = l)
1556
- ],
1557
- formRef: f.value,
1558
- fmLocationNotYetConfigured: I.value,
1559
- nsLocationsNotBeingUsed: E.value
1560
- }, null, 8, ["show-dialog", "formRef", "fmLocationNotYetConfigured", "nsLocationsNotBeingUsed"])
1561
- ]);
1562
- };
1563
- }
1564
- }), kn = { class: "p-8" }, Fn = /* @__PURE__ */ Q({
1565
- __name: "VendorsTab",
1566
- setup(V) {
1567
- const b = ut(), n = oe(), d = ee(), t = N(""), o = N([]);
1568
- ce(async () => {
1569
- if (b.suppliers.length === 0)
1570
- try {
1571
- await b.readSuppliers();
1572
- } catch {
1573
- d.open({ message: "Failed to fetch suppliers", type: "error" });
1574
- }
1575
- if (n.isReady && n.isEnabled)
1576
- try {
1577
- o.value = await n.getNetSuiteLocationOptions();
1578
- } catch {
1579
- d.open({ message: "Failed to fetch NetSuite locations", type: "error" });
1580
- }
1581
- });
1582
- const c = z(() => n.state.setting.vendors), s = [
1583
- {
1584
- id: "vendor",
1585
- header: () => "FeedMe Supplier",
1586
- accessorFn: (m) => {
1587
- const f = b.suppliers.find((i) => i._id === m.id);
1588
- return `${(f == null ? void 0 : f.name) || ""} ${(f == null ? void 0 : f._id) || ""}`;
1589
- },
1590
- cell(m) {
1591
- const f = m.row.original, i = b.suppliers.find(
1592
- (p) => p._id === f.id
1593
- );
1594
- if (!i)
1595
- return C("div", "Unknown Supplier");
1596
- const e = C(q.FmIcon, {
1597
- name: "apartment",
1598
- color: "neutral-gray-400",
1599
- size: "md",
1600
- class: "mr-2",
1601
- outline: !0
1602
- });
1603
- return C("div", { class: "flex items-center" }, [
1604
- e,
1605
- C("div", { class: "flex flex-col" }, [
1606
- C("span", { class: "font-medium" }, i.name),
1607
- C("span", { class: "text-xs text-gray-400" }, i._id)
1608
- ])
1609
- ]);
1610
- }
1611
- },
1612
- {
1613
- id: "netsuite",
1614
- header: () => "NetSuite Vendor",
1615
- accessorFn: (m) => {
1616
- var i;
1617
- const f = (i = o.value.find(
1618
- (e) => e.subsidiaryId === m.subsidiaryId
1619
- )) == null ? void 0 : i.subsidiaryName;
1620
- return `${m.name} ${m.netSuiteId} ${f || ""}`;
1621
- },
1622
- cell(m) {
1623
- var p;
1624
- const f = m.row.original, i = (p = o.value.find(
1625
- (I) => I.subsidiaryId === f.subsidiaryId
1626
- )) == null ? void 0 : p.subsidiaryName, e = C(q.FmIcon, {
1627
- name: "cloud",
1628
- color: "neutral-gray-400",
1629
- size: "md",
1630
- class: "mr-2",
1631
- outline: !0
1632
- });
1633
- return C("div", { class: "flex items-center" }, [
1634
- e,
1635
- C("div", { class: "flex flex-col" }, [
1636
- C("span", { class: "font-medium" }, f.name),
1637
- C("span", { class: "text-xs text-gray-400" }, `ID: ${f.netSuiteId}`),
1638
- C("span", { class: "text-xs text-gray-400" }, `Subsidiary: ${i || "N/A"}`)
1639
- ])
1640
- ]);
1641
- }
1642
- }
1643
- ];
1644
- return (m, f) => {
1645
- const i = F("FmSearch"), e = F("FmTable");
1646
- return x(), _("div", null, [
1647
- u("div", kn, [
1648
- A(i, {
1649
- placeholder: "Search by Vendor",
1650
- class: "w-[300px]",
1651
- modelValue: t.value,
1652
- "onUpdate:modelValue": f[0] || (f[0] = (p) => t.value = p)
1653
- }, null, 8, ["modelValue"])
1654
- ]),
1655
- A(e, {
1656
- autoResetPageIndex: !0,
1657
- "row-data": c.value,
1658
- "column-defs": s,
1659
- "shrink-at": !1,
1660
- "search-value": t.value
1661
- }, null, 8, ["row-data", "search-value"])
1662
- ]);
1663
- };
1664
- }
1665
- }), Cn = { class: "p-8 flex gap-4" }, Bn = /* @__PURE__ */ Q({
1666
- __name: "ItemsTab",
1667
- setup(V) {
1668
- const b = de(), n = oe(), d = N(), t = N(""), o = N(null), c = [
1669
- {
1670
- key: "itemType",
1671
- type: "string",
1672
- entity: "item",
1673
- values: Object.values(ye.Values)
1674
- }
1675
- ], s = z(() => {
1676
- let f = n.state.setting.items;
1677
- if (!o.value)
1678
- return f;
1679
- const i = Le.build(o.value);
1680
- return f.filter(
1681
- (e) => Ne(
1682
- {
1683
- itemType: e.itemType || ye.Enum.InvtPart
1684
- },
1685
- i
1686
- )
1687
- );
1688
- }), m = [
1689
- {
1690
- id: "item",
1691
- header: () => "FeedMe Ingredient",
1692
- accessorFn: (f) => {
1693
- const i = b.skuById[f.id];
1694
- return `${(i == null ? void 0 : i.name) || ""} ${(i == null ? void 0 : i._id) || ""} ${(i == null ? void 0 : i.code) || ""}`;
1695
- },
1696
- cell(f) {
1697
- const i = f.row.original, e = b.skuById[i.id];
1698
- if (!e)
1699
- return C("div", "Unknown Ingredient");
1700
- const p = C(q.FmIcon, {
1701
- name: "grocery",
1702
- color: "neutral-gray-400",
1703
- size: "md",
1704
- class: "mr-2",
1705
- outline: !0
1706
- });
1707
- return C("div", { class: "flex items-center" }, [
1708
- p,
1709
- C("div", { class: "flex flex-col" }, [
1710
- C("span", { class: "font-medium" }, e.name),
1711
- C("span", { class: "text-xs text-gray-400" }, `ID: ${e._id}`),
1712
- C("span", { class: "text-xs text-gray-400" }, `Code: ${e.code}`)
1713
- ])
1714
- ]);
1715
- }
1716
- },
1717
- {
1718
- id: "netsuite",
1719
- header: () => "NetSuite Item",
1720
- accessorFn: (f) => {
1721
- const i = n.state.setting.units.find(
1722
- (e) => e.netSuiteId === f.unitTypeId
1723
- );
1724
- return `${f.name} ${f.netSuiteId} ${(i == null ? void 0 : i.netSuiteId) || ""}`;
1725
- },
1726
- cell(f) {
1727
- const i = f.row.original, e = n.state.setting.units.find(
1728
- (I) => I.netSuiteId === i.unitTypeId
1729
- ), p = C(q.FmIcon, {
1730
- name: "cloud",
1731
- color: "neutral-gray-400",
1732
- size: "md",
1733
- class: "mr-2",
1734
- outline: !0
1735
- });
1736
- return C("div", { class: "flex items-center" }, [
1737
- p,
1738
- C("div", { class: "flex flex-col" }, [
1739
- C("span", { class: "font-medium" }, i.name || "N/A"),
1740
- C("span", { class: "text-xs text-gray-400" }, `ID: ${i.netSuiteId}`),
1741
- C(
1742
- "span",
1743
- { class: "text-xs text-gray-400" },
1744
- `Unit Type: ${(e == null ? void 0 : e.netSuiteId) || "N/A"}`
1745
- ),
1746
- C(
1747
- "span",
1748
- { class: "text-xs text-gray-400" },
1749
- `Unit of Measure (Base): ${(e == null ? void 0 : e.baseUnitUnitOfMeasureId) || "N/A"}`
1750
- ),
1751
- C(
1752
- "span",
1753
- { class: "text-xs text-gray-400" },
1754
- `Type: ${i.itemType || ye.Enum.InvtPart}`
1755
- )
1756
- ])
1757
- ]);
1758
- }
1759
- }
1760
- ];
1761
- return (f, i) => {
1762
- const e = F("FmSearch"), p = F("FmTable");
1763
- return x(), _("div", null, [
1764
- u("div", Cn, [
1765
- A(e, {
1766
- placeholder: "Search by Item",
1767
- class: "w-[300px]",
1768
- modelValue: t.value,
1769
- "onUpdate:modelValue": i[0] || (i[0] = (I) => t.value = I)
1770
- }, null, 8, ["modelValue"]),
1771
- A(w(Te), {
1772
- modelValue: o.value,
1773
- "onUpdate:modelValue": i[1] || (i[1] = (I) => o.value = I),
1774
- attributes: c
1775
- }, null, 8, ["modelValue"])
1776
- ]),
1777
- A(p, {
1778
- modelValue: d.value,
1779
- "onUpdate:modelValue": i[2] || (i[2] = (I) => d.value = I),
1780
- "row-data": s.value,
1781
- "column-defs": m,
1782
- "shrink-at": !1,
1783
- "search-value": t.value,
1784
- autoResetPageIndex: !0
1785
- }, null, 8, ["modelValue", "row-data", "search-value"])
1786
- ]);
1787
- };
1788
- }
1789
- }), En = { class: "p-8" }, Vn = /* @__PURE__ */ Q({
1790
- __name: "UnitTypesTab",
1791
- setup(V) {
1792
- const b = de(), n = oe(), d = N(), t = N(""), o = z(() => n.state.setting.units), c = [
1793
- {
1794
- id: "unit",
1795
- header: () => "FeedMe Unit",
1796
- accessorFn: (s) => {
1797
- const m = b.units.find((f) => f._id === s.id);
1798
- return `${(m == null ? void 0 : m.name) || ""} ${(m == null ? void 0 : m._id) || ""} ${(m == null ? void 0 : m.abbrev) || ""}`;
1799
- },
1800
- cell(s) {
1801
- var e;
1802
- const m = s.row.original, f = b.units.find((p) => p._id === m.id);
1803
- if (!f)
1804
- return C("div", "Unknown Unit");
1805
- const i = C(q.FmIcon, {
1806
- name: "measuring_tape",
1807
- color: "neutral-gray-400",
1808
- size: "md",
1809
- class: "mr-2",
1810
- outline: !0
1811
- });
1812
- return C("div", { class: "flex items-center" }, [
1813
- i,
1814
- C("div", { class: "flex flex-col" }, [
1815
- C("span", { class: "font-medium" }, f.name),
1816
- C("span", { class: "text-xs text-gray-400" }, `ID: ${f._id}`),
1817
- C("span", { class: "text-xs text-gray-400" }, `Abbrev: ${f.abbrev}`),
1818
- C(
1819
- "span",
1820
- { class: "text-xs text-gray-400" },
1821
- `Measurements: ${((e = f.measurements) == null ? void 0 : e.length) || 0}`
1822
- )
1823
- ])
1824
- ]);
1825
- }
1826
- },
1827
- {
1828
- id: "netsuite",
1829
- header: () => "NetSuite Unit Type",
1830
- accessorFn: (s) => `${s.netSuiteId} ${s.baseUnitUnitOfMeasureId || ""}`,
1831
- cell(s) {
1832
- const m = s.row.original, f = C(q.FmIcon, {
1833
- name: "cloud",
1834
- color: "neutral-gray-400",
1835
- size: "md",
1836
- class: "mr-2",
1837
- outline: !0
1838
- });
1839
- return C("div", { class: "flex items-center" }, [
1840
- f,
1841
- C("div", { class: "flex flex-col" }, [
1842
- C("span", { class: "font-medium" }, `Unit Type ID: ${m.netSuiteId}`),
1843
- C(
1844
- "span",
1845
- { class: "text-xs text-gray-400" },
1846
- `Base Unit of Measure: ${m.baseUnitUnitOfMeasureId || "N/A"}`
1847
- ),
1848
- C(
1849
- "span",
1850
- { class: "text-xs text-gray-400" },
1851
- `Measurements: ${m.measurements.length}`
1852
- )
1853
- ])
1854
- ]);
1855
- }
1856
- }
1857
- ];
1858
- return (s, m) => {
1859
- const f = F("FmSearch"), i = F("FmTable");
1860
- return x(), _("div", null, [
1861
- u("div", En, [
1862
- A(f, {
1863
- placeholder: "Search by Unit Type",
1864
- class: "w-[300px]",
1865
- modelValue: t.value,
1866
- "onUpdate:modelValue": m[0] || (m[0] = (e) => t.value = e)
1867
- }, null, 8, ["modelValue"])
1868
- ]),
1869
- A(i, {
1870
- modelValue: d.value,
1871
- "onUpdate:modelValue": m[1] || (m[1] = (e) => d.value = e),
1872
- "row-data": o.value,
1873
- "column-defs": c,
1874
- "shrink-at": !1,
1875
- "search-value": t.value,
1876
- autoResetPageIndex: !0
1877
- }, null, 8, ["modelValue", "row-data", "search-value"])
1878
- ]);
1879
- };
1880
- }
1881
- }), _n = { key: 0 }, Ln = {
1882
- key: 1,
1883
- class: "flex flex-col gap-8 w-full"
1884
- }, Nn = { class: "flex gap-2 flex-wrap" }, Tn = { class: "flex gap-8 items-center justify-start" }, Rn = /* @__PURE__ */ Q({
1885
- __name: "BusinessNetSuiteSideSheet",
1886
- props: {
1887
- show: { type: Boolean },
1888
- loading: { type: Boolean }
1889
- },
1890
- emits: ["update:show", "update:loading"],
1891
- setup(V, { emit: b }) {
1892
- const n = le(), d = V, t = b, o = re(d, "show"), c = N(
1893
- "locations"
1894
- /* LOCATIONS */
1895
- ), s = [
1896
- { value: "locations", label: "Locations" },
1897
- { value: "vendors", label: "Vendors" },
1898
- { value: "items", label: "Items" },
1899
- { value: "unitTypes", label: "Unit Types" }
1900
- ], { t: m } = $(), f = [
1901
- "Unit Type",
1902
- "Inventory Item",
1903
- "Location",
1904
- "Vendor",
1905
- "Subsidiary",
1906
- "Purchase Order",
1907
- "Transfer Order",
1908
- "Inventory Transfer"
1909
- ];
1910
- return (i, e) => {
1911
- const p = F("FmChip"), I = F("FmTabs"), E = F("FmButton"), B = F("FmSideSheet");
1912
- return x(), H(B, {
1913
- modelValue: w(o),
1914
- "onUpdate:modelValue": e[2] || (e[2] = (v) => ie(o) ? o.value = v : null),
1915
- header: w(m)("inventory.integration.netsuite.title"),
1916
- "dismiss-away": "",
1917
- "close-button": "",
1918
- "max-width": 800
1919
- }, {
1920
- default: L(() => {
1921
- var v;
1922
- return [
1923
- (v = w(n).sessionUser.value) != null && v.role.isAdmin ? (x(), _("div", Ln, [
1924
- e[3] || (e[3] = u("div", { class: "text-sm" }, " This integration keeps your FeedMe system and NetSuite in sync for the following modules: ", -1)),
1925
- u("div", Nn, [
1926
- (x(), _(Y, null, W(f, (a) => A(p, {
1927
- key: a,
1928
- label: a,
1929
- compact: ""
1930
- }, null, 8, ["label"])), 64))
1931
- ]),
1932
- e[4] || (e[4] = u("div", { class: "text-xs mt-2" }, " Changes made in FeedMe or NetSuite will be reflected in both systems, ensuring data consistency and streamlined operations. ", -1)),
1933
- e[5] || (e[5] = u("hr", { class: "my-3" }, null, -1)),
1934
- A(I, {
1935
- "model-value": c.value,
1936
- "onUpdate:modelValue": e[0] || (e[0] = (a) => c.value = a),
1937
- items: s
1938
- }, null, 8, ["model-value"]),
1939
- c.value === "locations" ? (x(), H(wn, { key: 0 })) : U("", !0),
1940
- c.value === "vendors" ? (x(), H(Fn, { key: 1 })) : U("", !0),
1941
- c.value === "items" ? (x(), H(Bn, { key: 2 })) : U("", !0),
1942
- c.value === "unitTypes" ? (x(), H(Vn, { key: 3 })) : U("", !0)
1943
- ])) : (x(), _("div", _n, " Please contact your administrator to apply the changes. "))
1944
- ];
1945
- }),
1946
- "side-sheet-footer": L(() => [
1947
- u("div", Tn, [
1948
- A(E, {
1949
- variant: "tertiary",
1950
- label: w(m)("common.close"),
1951
- onClick: e[1] || (e[1] = (v) => t("update:show", !1))
1952
- }, null, 8, ["label"])
1953
- ])
1954
- ]),
1955
- _: 1
1956
- }, 8, ["modelValue", "header"]);
1957
- };
1958
- }
1959
- }), Dn = /* @__PURE__ */ Q({
1960
- __name: "InventoryTransferIngredientTable",
1961
- props: {
1962
- modelValue: { default: [] },
1963
- modelModifiers: {}
1964
- },
1965
- emits: ["update:modelValue"],
1966
- setup(V) {
1967
- const { t: b } = ve(), n = ke(V, "modelValue"), d = [
1968
- {
1969
- id: "Code",
1970
- header: () => b("inventory.transfer.form.items.table.Code"),
1971
- accessorKey: "code",
1972
- size: 200,
1973
- cell(t) {
1974
- const o = t.row.original;
1975
- return C(
1976
- q.FmTooltip,
1977
- {
1978
- content: o.code,
1979
- placement: "top",
1980
- variant: "plain",
1981
- zIndex: 50
1982
- },
1983
- C(
1984
- "span",
1985
- {
1986
- class: "flex-auto line-clamp-2 text-ellipsis break-all"
1987
- },
1988
- o.code
1989
- )
1990
- );
1991
- },
1992
- enableSorting: !1
1993
- },
1994
- {
1995
- id: "Name",
1996
- header: () => b("inventory.transfer.form.items.table.Name"),
1997
- minSize: 300,
1998
- cell(t) {
1999
- const o = t.row.original;
2000
- return C(
2001
- q.FmTooltip,
2002
- {
2003
- content: o.name,
2004
- placement: "top",
2005
- variant: "plain",
2006
- zIndex: 50
2007
- },
2008
- C(
2009
- "span",
2010
- {
2011
- class: "flex-auto line-clamp-2 text-ellipsis break-all"
2012
- },
2013
- o.name
2014
- )
2015
- );
2016
- },
2017
- enableSorting: !1
2018
- },
2019
- {
2020
- id: "Amount",
2021
- header: () => b("inventory.transfer.form.items.table.Amount"),
2022
- minSize: 200,
2023
- cell(t) {
2024
- const o = t.row.original, c = t.row.index;
2025
- return C(ct, {
2026
- style: {
2027
- flex: "1 1 0%"
2028
- },
2029
- modelValue: {
2030
- amount: o.quantity ?? { amount: 1, precision: 0 },
2031
- measurement: o.measurement ?? null
2032
- },
2033
- key: o.sku._id,
2034
- unit: o.sku.unit,
2035
- "onUpdate:modelValue": (s) => {
2036
- if (!s) return;
2037
- const m = {
2038
- ...o,
2039
- quantity: s.amount,
2040
- measurement: s.measurement
2041
- };
2042
- n.value = [
2043
- ...n.value.slice(0, c),
2044
- m,
2045
- ...n.value.slice(c + 1)
2046
- ];
2047
- },
2048
- rules: [dt(+rt({ amount: 1, precision: 0 }))],
2049
- applyDefaultRules: !0
2050
- });
2051
- },
2052
- enableSorting: !1
2053
- },
2054
- {
2055
- id: "Delete",
2056
- header: "",
2057
- cell(t) {
2058
- const o = t.row.original, c = t.row.index;
2059
- return C("div", { class: "flex justify-end" }, [
2060
- C(q.FmButton, {
2061
- key: o.sku._id,
2062
- class: "delete-button",
2063
- type: "button",
2064
- icon: "delete",
2065
- variant: "tertiary",
2066
- size: "md",
2067
- onClick: () => {
2068
- n.value = [...n.value.slice(0, c), ...n.value.slice(c + 1)];
2069
- }
2070
- })
2071
- ]);
2072
- },
2073
- enableSorting: !1,
2074
- size: 40,
2075
- meta: {
2076
- cellClass: "",
2077
- headerClass: ""
2078
- }
2079
- }
2080
- ];
2081
- return (t, o) => {
2082
- const c = F("FmTable");
2083
- return x(), H(c, {
2084
- "column-defs": d,
2085
- "row-data": n.value,
2086
- "row-key": (s) => s.sku._id,
2087
- "empty-text": w(b)("inventory.transfer.form.items.table.empty"),
2088
- pagination: !1,
2089
- "virtual-scroll": { enabled: !0, itemSize: 48 }
2090
- }, null, 8, ["row-data", "row-key", "empty-text"]);
2091
- };
2092
- }
2093
- }), Mn = { class: "flex items-center gap-8 mb-8" }, On = /* @__PURE__ */ Q({
2094
- __name: "InventoryTransferOutTable",
2095
- setup(V) {
2096
- const b = N([]), n = pe(), d = N(!1), t = N(!1), o = ee(), c = ne();
2097
- ce(async () => {
2098
- const i = /* @__PURE__ */ new Date(), e = /* @__PURE__ */ new Date();
2099
- e.setDate(e.getDate() - 30), d.value = !0;
2100
- try {
2101
- const p = await n.getInventoryTransferHistory(
2102
- c.currentLocationDBName,
2103
- e,
2104
- i
2105
- );
2106
- b.value = p;
2107
- } catch (p) {
2108
- console.error("Error fetching inventory transfer history:", p);
2109
- } finally {
2110
- d.value = !1;
2111
- }
2112
- });
2113
- async function s() {
2114
- try {
2115
- t.value = !0, await n.manualSyncInventoryTransfer(c.currentLocationDBName), o == null || o.open({
2116
- title: "Sync Started",
2117
- message: "Inventory transfers sync queued successfully.",
2118
- type: "success"
2119
- });
2120
- } catch (i) {
2121
- o == null || o.open({
2122
- title: "Sync Failed",
2123
- message: `Failed to queue inventory transfers sync. ${i == null ? void 0 : i.message}`,
2124
- type: "error"
2125
- });
2126
- } finally {
2127
- t.value = !1;
2128
- }
2129
- }
2130
- const m = [
2131
- // {
2132
- // id: 'type',
2133
- // header: 'Type',
2134
- // cell: (props: any) => {
2135
- // return props.row.original.type ? sentenceCase(props.row.original.type) : 'N/A'
2136
- // }
2137
- // },
2138
- {
2139
- id: "destinationLocation",
2140
- header: "Destination Location",
2141
- cell: (i) => {
2142
- const e = i.row.original.destinationLocation.netSuiteName;
2143
- return e ? C(
2144
- q.FmTooltip,
2145
- { zIndex: 51 },
2146
- {
2147
- content() {
2148
- return e;
2149
- },
2150
- default() {
2151
- return C("div", { class: "line-clamp-2 fm-typo-en-body-sm-400" }, e);
2152
- }
2153
- }
2154
- ) : "N/A";
2155
- }
2156
- },
2157
- {
2158
- id: "netsuite",
2159
- header: () => "NetSuite",
2160
- cell(i) {
2161
- return C("div", { class: "flex flex-col" }, [
2162
- C(
2163
- "span",
2164
- { class: "fm-typo-en-body-sm-400" },
2165
- `ID: ${i.row.original.netsuiteId ?? "N/A"}`
2166
- ),
2167
- C(
2168
- "span",
2169
- { class: "fm-typo-en-body-sm-400" },
2170
- `Transaction ID: ${i.row.original.netsuiteTranId ?? "N/A"}`
2171
- ),
2172
- C(
2173
- "span",
2174
- { class: "fm-typo-en-body-sm-400" },
2175
- `Transaction Date: ${i.row.original.netsuiteTranDate ?? "N/A"}`
2176
- )
2177
- ]);
2178
- }
2179
- },
2180
- {
2181
- id: "adjustment",
2182
- header: () => "Adjustment (FeedMe)",
2183
- cell(i) {
2184
- const e = i.row.original.adjustmentId;
2185
- return C("div", { class: "flex flex-col" }, [
2186
- C("span", { class: "fm-typo-en-body-sm-400" }, `ID: ${e ?? "N/A"}`),
2187
- C(
2188
- "span",
2189
- { class: "fm-typo-en-body-sm-400" },
2190
- `Date: ${e ? he(Ae(e)) : "N/A"}`
2191
- )
2192
- ]);
2193
- }
2194
- },
2195
- {
2196
- id: "items",
2197
- header: () => "Items",
2198
- cell(i) {
2199
- const e = i.row.original.items;
2200
- return C(
2201
- "div",
2202
- { class: "overflow-auto" },
2203
- C("ul", { class: "list-disc pl-5" }, [
2204
- e == null ? void 0 : e.map(
2205
- (p) => C(
2206
- "li",
2207
- { class: "fm-typo-en-body-sm-400" },
2208
- `[${p == null ? void 0 : p.itemId}] ${p == null ? void 0 : p.itemName}: ${p == null ? void 0 : p.quantity} ${(p == null ? void 0 : p.uomName) ?? "N/A"}`
2209
- )
2210
- )
2211
- ])
2212
- );
2213
- },
2214
- size: 150
2215
- }
2216
- ], f = N();
2217
- return (i, e) => {
2218
- const p = F("FmButton"), I = F("FmTable");
2219
- return x(), _(Y, null, [
2220
- u("div", Mn, [
2221
- e[1] || (e[1] = u("span", null, "Last 30 Days:", -1)),
2222
- A(p, {
2223
- "prepend-icon": "sync",
2224
- variant: "secondary",
2225
- label: "Sync",
2226
- loading: t.value,
2227
- "text-color": "primary",
2228
- "bg-color": "transparent",
2229
- "border-color": "primary",
2230
- onClick: s
2231
- }, null, 8, ["loading"])
2232
- ]),
2233
- A(I, {
2234
- modelValue: f.value,
2235
- "onUpdate:modelValue": e[0] || (e[0] = (E) => f.value = E),
2236
- "row-data": b.value,
2237
- "column-defs": m,
2238
- loading: d.value
2239
- }, null, 8, ["modelValue", "row-data", "loading"])
2240
- ], 64);
2241
- };
2242
- }
2243
- }), zn = { class: "flex flex-col gap-8" }, jn = {
2244
- key: 0,
2245
- class: "flex flex-col gap-4"
2246
- }, Un = { class: "flex gap-2" }, Hn = {
2247
- key: 1,
2248
- class: "flex items-center my-2 border rounded-lg p-2"
2249
- }, Xn = { class: "flex flex-col" }, Qn = { class: "font-medium" }, Yn = { class: "text-xs text-gray-400" }, Pn = { class: "text-xs text-gray-400" }, Jn = { class: "flex my-4" }, Kn = { class: "flex" }, qn = {
2250
- key: 1,
2251
- class: "flex flex-col"
2252
- }, Gn = {
2253
- key: 1,
2254
- class: "flex flex-col"
2255
- }, Zn = /* @__PURE__ */ Q({
2256
- __name: "InventoryTransfer",
2257
- props: {
2258
- nsLocations: {},
2259
- currentLocationSetting: {},
2260
- currentLocationSubsidiary: {}
2261
- },
2262
- setup(V) {
2263
- const b = be(), n = oe(), d = de(), t = pe(), o = ee(), { t: c } = ve(), s = N([]), m = [{ label: "Transfer Out" }, { label: "History" }], f = N(m[0]), i = N(!1), e = N(null), p = N(null), I = V, E = z(() => {
2264
- const y = n.currentLocationSetting, l = n.configuredLocations;
2265
- return I.nsLocations.map((r) => ({
2266
- label: r.name,
2267
- value: r,
2268
- disabled: l.some((g) => g.netSuiteId === r.netsuiteId) || r.subsidiaryId !== (y == null ? void 0 : y.subsidiaryId)
2269
- }));
2270
- }), B = z({
2271
- get() {
2272
- return e.value ? e.value.toISOString().slice(0, 10) : "";
2273
- },
2274
- set(y) {
2275
- if (!y) {
2276
- e.value = null;
2277
- return;
2278
- }
2279
- const l = e.value ?? /* @__PURE__ */ new Date(), r = new Date(y);
2280
- l.setFullYear(r.getFullYear(), r.getMonth(), r.getDate()), e.value = new Date(l);
2281
- }
2282
- }), v = z({
2283
- get() {
2284
- if (!e.value) return null;
2285
- const y = String(e.value.getHours()).padStart(2, "0"), l = String(e.value.getMinutes()).padStart(2, "0");
2286
- return `${y}:${l}`;
2287
- },
2288
- set(y) {
2289
- if (!y) return;
2290
- const [l, r] = y.split(":").map(Number), g = e.value ?? /* @__PURE__ */ new Date();
2291
- g.setHours(l, r), e.value = new Date(g);
2292
- }
2293
- }), a = z(() => B.value && v.value && p.value && s.value.length > 0 && !i.value);
2294
- async function h() {
2295
- if (a.value) {
2296
- if (!I.currentLocationSetting) {
2297
- o.open({
2298
- message: "Current location setting is not available",
2299
- type: "error"
2300
- });
2301
- return;
2302
- }
2303
- i.value = !0;
2304
- try {
2305
- const y = {
2306
- items: s.value,
2307
- date: e.value.toISOString(),
2308
- netsuiteLocationId: p.value.netsuiteId,
2309
- netsuiteLocationName: p.value.name
2310
- }, l = `${I.currentLocationSetting.type}_${I.currentLocationSetting.id}`;
2311
- await t.createInventoryTransfer(l, y), s.value = [], e.value = null, p.value = null, o.open({
2312
- message: "Inventort transfer created successfully",
2313
- type: "success"
2314
- });
2315
- } catch {
2316
- o.open({
2317
- message: "Failed to create inventory transfer",
2318
- type: "error"
2319
- });
2320
- } finally {
2321
- i.value = !1;
2322
- }
2323
- }
2324
- }
2325
- function k() {
2326
- const y = n.currentLocationSubsidiary(), l = n.getAvailableItems(y.id), r = d.skus.filter((T) => l.includes(T._id)).map((T) => T._id), g = d.skus.map(
2327
- (T) => ({
2328
- label: T.name,
2329
- sublabel: T.code,
2330
- value: T,
2331
- disabled: !r.includes(T._id)
2332
- })
2333
- ), S = g.filter((T) => {
2334
- var D;
2335
- return (D = s.value) == null ? void 0 : D.find((X) => X.sku._id === T.value._id);
2336
- }).map((T) => T.value);
2337
- b.open({
2338
- title: c("inventory.transfer.form.items.selectItem"),
2339
- closeButton: !0,
2340
- contentComponent: lt,
2341
- contentComponentProps: {
2342
- modelValue: S,
2343
- items: g,
2344
- virtualScroll: !0
2345
- },
2346
- primaryActions: {
2347
- text: c("common.confirm"),
2348
- close: !0
2349
- },
2350
- secondaryActions: {
2351
- text: c("common.close"),
2352
- close: !0,
2353
- variant: "tertiary"
2354
- }
2355
- }).onPrimary((T) => {
2356
- const D = s.value, X = T.map((R) => {
2357
- const O = D.find((ue) => ue.sku._id === R._id);
2358
- return O || {
2359
- sku: R,
2360
- code: R.code,
2361
- name: R.name,
2362
- quantity: {
2363
- amount: 1,
2364
- precision: 0
2365
- }
2366
- };
2367
- });
2368
- X.sort((R, O) => R.sku.code.localeCompare(O.sku.code)), s.value = X;
2369
- });
2370
- }
2371
- return (y, l) => {
2372
- const r = F("FmButtonGroup"), g = F("FmLabel"), S = F("FmField"), T = F("FmSimpleDatePicker"), D = F("FmTimePicker"), X = F("FmSelect"), R = F("FmIcon"), O = F("FmButton");
2373
- return x(), _("div", zn, [
2374
- A(r, {
2375
- modelValue: f.value,
2376
- "onUpdate:modelValue": l[0] || (l[0] = (j) => f.value = j),
2377
- items: m
2378
- }, null, 8, ["modelValue"]),
2379
- f.value.label === "Transfer Out" ? (x(), _(Y, { key: 0 }, [
2380
- w(n).inventoryTransferOutEnabled ? (x(), _("div", jn, [
2381
- A(g, { class: "fm-typo-en-body-md-600" }, {
2382
- default: L(() => l[6] || (l[6] = [
2383
- J("Type")
2384
- ])),
2385
- _: 1
2386
- }),
2387
- A(S, {
2388
- class: "my-4",
2389
- disabled: "",
2390
- "prepend-icon": "lock"
2391
- }, {
2392
- default: L(() => l[7] || (l[7] = [
2393
- J("Transfer out")
2394
- ])),
2395
- _: 1
2396
- }),
2397
- A(g, { class: "fm-typo-en-body-md-600" }, {
2398
- default: L(() => l[8] || (l[8] = [
2399
- J("Subsidiary")
2400
- ])),
2401
- _: 1
2402
- }),
2403
- A(S, {
2404
- class: "my-4",
2405
- disabled: "",
2406
- "prepend-icon": "lock"
2407
- }, {
2408
- default: L(() => [
2409
- J(M(y.currentLocationSubsidiary.fullName), 1)
2410
- ]),
2411
- _: 1
2412
- }),
2413
- A(g, { class: "fm-typo-en-body-md-600" }, {
2414
- default: L(() => l[9] || (l[9] = [
2415
- J("Transaction date")
2416
- ])),
2417
- _: 1
2418
- }),
2419
- A(T, {
2420
- modelValue: B.value,
2421
- "onUpdate:modelValue": l[1] || (l[1] = (j) => B.value = j)
2422
- }, null, 8, ["modelValue"]),
2423
- A(g, { class: "fm-typo-en-body-md-600" }, {
2424
- default: L(() => l[10] || (l[10] = [
2425
- J("Transaction time")
2426
- ])),
2427
- _: 1
2428
- }),
2429
- A(D, {
2430
- modelValue: v.value,
2431
- "onUpdate:modelValue": l[2] || (l[2] = (j) => v.value = j)
2432
- }, null, 8, ["modelValue"]),
2433
- A(g, { class: "fm-typo-en-body-md-600" }, {
2434
- default: L(() => l[11] || (l[11] = [
2435
- J("NetSuite Location")
2436
- ])),
2437
- _: 1
2438
- }),
2439
- u("div", Un, [
2440
- p.value ? U("", !0) : (x(), H(X, {
2441
- key: 0,
2442
- class: "my-4 w-full",
2443
- modelValue: p.value,
2444
- "onUpdate:modelValue": l[3] || (l[3] = (j) => p.value = j),
2445
- searchable: "",
2446
- searchTarget: "label",
2447
- items: E.value
2448
- }, null, 8, ["modelValue", "items"])),
2449
- p.value ? (x(), _("div", Hn, [
2450
- A(R, {
2451
- name: "cloud",
2452
- color: "neutral-gray-400",
2453
- size: "md",
2454
- class: "mr-2",
2455
- outline: ""
2456
- }),
2457
- u("div", Xn, [
2458
- u("span", Qn, M(p.value.name), 1),
2459
- u("span", Yn, "ID: " + M(p.value.netsuiteId), 1),
2460
- u("span", Pn, "Subsidiary: " + M(p.value.subsidiaryName), 1)
2461
- ]),
2462
- A(O, {
2463
- class: "ml-2",
2464
- variant: "secondary",
2465
- label: "Clear",
2466
- onClick: l[4] || (l[4] = (j) => p.value = null)
2467
- })
2468
- ])) : U("", !0)
2469
- ]),
2470
- u("div", Jn, [
2471
- A(O, {
2472
- class: "ml-auto",
2473
- variant: "secondary",
2474
- "prepend-icon": "add",
2475
- label: "Ingredients",
2476
- onClick: k
2477
- })
2478
- ]),
2479
- A(Dn, {
2480
- modelValue: s.value,
2481
- "onUpdate:modelValue": l[5] || (l[5] = (j) => s.value = j)
2482
- }, null, 8, ["modelValue"]),
2483
- u("div", Kn, [
2484
- A(O, {
2485
- class: "ml-auto mt-4",
2486
- variant: "primary",
2487
- "prepend-icon": "add",
2488
- label: "Create",
2489
- disabled: !a.value,
2490
- loading: i.value,
2491
- onClick: h
2492
- }, null, 8, ["disabled", "loading"])
2493
- ])
2494
- ])) : (x(), _("div", qn, [
2495
- A(g, { class: "fm-typo-en-body-md-600" }, {
2496
- default: L(() => l[12] || (l[12] = [
2497
- J(" Feature is not enabled. Please contact your administrator. ")
2498
- ])),
2499
- _: 1
2500
- })
2501
- ]))
2502
- ], 64)) : U("", !0),
2503
- f.value.label === "History" ? (x(), _("div", Gn, [
2504
- A(On)
2505
- ])) : U("", !0)
2506
- ]);
2507
- };
2508
- }
2509
- }), Wn = { class: "flex flex-col gap-8" }, $n = {
2510
- key: 0,
2511
- class: "flex flex-col gap-4"
2512
- }, eo = { class: "flex flex-col gap-2" }, to = { class: "flex flex-col gap-2 pl-6" }, no = { key: 1 }, oo = { class: "flex justify-end" }, so = { class: "flex flex-col gap-4" }, ao = { class: "ml-auto flex gap-4" }, lo = /* @__PURE__ */ Q({
2513
- __name: "TransferOrder",
2514
- props: {
2515
- currentLocationSetting: {}
2516
- },
2517
- setup(V) {
2518
- const b = le(), n = pe(), d = ee(), t = N(!1), o = V, c = N([]), s = N(/* @__PURE__ */ new Set()), m = N(!1), f = N(Z.enum[1]), i = [
2519
- { value: Z.enum[1], label: "Version 1" },
2520
- {
2521
- value: Z.enum[2],
2522
- label: "Version 2",
2523
- subLabel: "Supports duplicate skus"
2524
- }
2525
- ], e = z(() => c.value.length > 0 && s.value.size === c.value.length), p = z(() => s.value.size > 0 && s.value.size < c.value.length);
2526
- function I(y) {
2527
- y ? s.value = new Set(c.value.map((l) => l.id)) : s.value = /* @__PURE__ */ new Set();
2528
- }
2529
- function E(y, l) {
2530
- l ? s.value.add(y) : s.value.delete(y), s.value = new Set(s.value);
2531
- }
2532
- function B(y) {
2533
- return s.value.has(y);
2534
- }
2535
- async function v() {
2536
- var y;
2537
- t.value = !0;
2538
- try {
2539
- const l = ((y = o.currentLocationSetting) == null ? void 0 : y.id) || "", r = await n.getUnSyncTransferInOrders(l);
2540
- c.value = r, s.value = /* @__PURE__ */ new Set(), d.open({
2541
- message: "Check unsync transfer in order successfully",
2542
- type: "success"
2543
- });
2544
- } catch {
2545
- d.open({
2546
- message: "Failed to check unsync transfer in order",
2547
- type: "error"
2548
- });
2549
- } finally {
2550
- t.value = !1;
2551
- }
2552
- }
2553
- async function a() {
2554
- if (s.value.size === 0) {
2555
- d.open({
2556
- message: "No transfer orders selected",
2557
- type: "info"
2558
- });
2559
- return;
2560
- }
2561
- f.value = Z.enum[1], m.value = !0;
2562
- }
2563
- async function h() {
2564
- m.value = !1;
2565
- const y = f.value === Z.enum[2] ? Z.enum[2] : void 0;
2566
- await k(y);
2567
- }
2568
- async function k(y) {
2569
- t.value = !0;
2570
- try {
2571
- const l = Array.from(s.value);
2572
- await n.manualSyncMultipleTransferInOrders({ netsuiteIds: l, version: y }), await new Promise((r) => setTimeout(r, 5e3)), d.open({
2573
- message: "Sync transfer orders request sent successfully",
2574
- type: "success"
2575
- });
2576
- } catch (l) {
2577
- console.log(l), d.open({
2578
- message: "Failed to sync transfer orders",
2579
- type: "error"
2580
- });
2581
- } finally {
2582
- t.value = !1;
2583
- }
2584
- }
2585
- return (y, l) => {
2586
- var X;
2587
- const r = F("FmButton"), g = F("FmCheckbox"), S = F("FmRadio"), T = F("FmRadioGroup"), D = F("FmDialog");
2588
- return x(), _("div", Wn, [
2589
- u("span", null, "Current date and time: " + M((/* @__PURE__ */ new Date()).toLocaleString()), 1),
2590
- A(r, {
2591
- label: "Check Unsync Transfer Order (Last 2 months)",
2592
- variant: "primary",
2593
- onClick: v,
2594
- disabled: t.value,
2595
- loading: t.value
2596
- }, null, 8, ["disabled", "loading"]),
2597
- c.value.length > 0 ? (x(), _("div", $n, [
2598
- l[3] || (l[3] = u("p", null, "Transfer Order NetSuite ID not match with existing orders", -1)),
2599
- u("div", eo, [
2600
- (X = w(b).sessionUser.value) != null && X.role.isAdmin ? (x(), H(g, {
2601
- key: 0,
2602
- label: "Select All",
2603
- value: "all",
2604
- modelValue: e.value,
2605
- indeterminate: p.value,
2606
- "onUpdate:modelValue": I
2607
- }, null, 8, ["modelValue", "indeterminate"])) : U("", !0),
2608
- u("ul", to, [
2609
- (x(!0), _(Y, null, W(c.value, (R) => {
2610
- var O;
2611
- return x(), _("li", {
2612
- key: R.id,
2613
- class: "flex items-center"
2614
- }, [
2615
- (O = w(b).sessionUser.value) != null && O.role.isAdmin ? (x(), H(g, {
2616
- key: 0,
2617
- label: `${R.id} (${R.tranid})`,
2618
- value: R.id,
2619
- modelValue: B(R.id),
2620
- "onUpdate:modelValue": (j) => E(R.id, j)
2621
- }, null, 8, ["label", "value", "modelValue", "onUpdate:modelValue"])) : (x(), _("span", no, M(R.id) + " (" + M(R.tranid) + ")", 1))
2622
- ]);
2623
- }), 128))
2624
- ])
2625
- ]),
2626
- u("div", oo, [
2627
- A(_e, null, {
2628
- default: L(() => [
2629
- c.value.length > 0 ? (x(), H(r, {
2630
- key: 0,
2631
- label: `Sync Selected (${s.value.size})`,
2632
- variant: "destructive",
2633
- onClick: a,
2634
- disabled: t.value || s.value.size === 0,
2635
- loading: t.value
2636
- }, null, 8, ["label", "disabled", "loading"])) : U("", !0)
2637
- ]),
2638
- _: 1
2639
- })
2640
- ])
2641
- ])) : U("", !0),
2642
- A(D, {
2643
- modelValue: m.value,
2644
- "onUpdate:modelValue": l[2] || (l[2] = (R) => m.value = R),
2645
- overlay: !0
2646
- }, {
2647
- "dialog-header": L(() => l[4] || (l[4] = [
2648
- u("span", { class: "fm-typo-en-heading-lg-700" }, "Select Sync Version", -1)
2649
- ])),
2650
- "dialog-footer": L(() => [
2651
- u("div", ao, [
2652
- A(r, {
2653
- label: "Not now",
2654
- variant: "secondary",
2655
- onClick: l[1] || (l[1] = (R) => m.value = !1)
2656
- }),
2657
- A(r, {
2658
- label: "Confirm",
2659
- variant: "primary",
2660
- onClick: h
2661
- })
2662
- ])
2663
- ]),
2664
- default: L(() => [
2665
- u("div", so, [
2666
- u("p", null, " Choose which purchase order version to use for syncing " + M(s.value.size) + " selected transfer orders: ", 1),
2667
- A(T, {
2668
- modelValue: f.value,
2669
- "onUpdate:modelValue": l[0] || (l[0] = (R) => f.value = R)
2670
- }, {
2671
- default: L(() => [
2672
- (x(), _(Y, null, W(i, (R) => A(S, {
2673
- key: R.value,
2674
- value: R.value,
2675
- label: R.label,
2676
- sublabel: R.subLabel
2677
- }, null, 8, ["value", "label", "sublabel"])), 64))
2678
- ]),
2679
- _: 1
2680
- }, 8, ["modelValue"])
2681
- ])
2682
- ]),
2683
- _: 1
2684
- }, 8, ["modelValue"])
2685
- ]);
2686
- };
2687
- }
2688
- }), io = { class: "flex flex-col gap-8" }, ro = {
2689
- key: 0,
2690
- class: "flex flex-col gap-4"
2691
- }, uo = { class: "flex flex-col gap-2" }, co = { class: "flex flex-col gap-2 pl-6" }, mo = { key: 1 }, fo = { class: "flex justify-end" }, po = { class: "flex flex-col gap-4" }, vo = { class: "ml-auto flex gap-4" }, yo = /* @__PURE__ */ Q({
2692
- __name: "PurchaseOrder",
2693
- props: {
2694
- currentLocationSetting: {}
2695
- },
2696
- setup(V) {
2697
- const b = le(), n = pe(), d = ee(), t = N(!1), o = V, c = N([]), s = N(/* @__PURE__ */ new Set()), m = N(!1), f = N(Z.enum[1]), i = [
2698
- { value: Z.enum[1], label: "Version 1" },
2699
- {
2700
- value: Z.enum[2],
2701
- label: "Version 2",
2702
- subLabel: "Supports duplicate skus"
2703
- }
2704
- ], e = z(() => c.value.length > 0 && s.value.size === c.value.length), p = z(() => s.value.size > 0 && s.value.size < c.value.length);
2705
- function I(y) {
2706
- y ? s.value = new Set(c.value) : s.value = /* @__PURE__ */ new Set();
2707
- }
2708
- function E(y, l) {
2709
- l ? s.value.add(y) : s.value.delete(y), s.value = new Set(s.value);
2710
- }
2711
- function B(y) {
2712
- return s.value.has(y);
2713
- }
2714
- async function v() {
2715
- var y;
2716
- t.value = !0;
2717
- try {
2718
- const l = ((y = o.currentLocationSetting) == null ? void 0 : y.id) || "", r = await n.getUnSyncPurchaseOrders(l);
2719
- c.value = r, s.value = /* @__PURE__ */ new Set(), d.open({
2720
- message: "Check unsync purchase order successfully",
2721
- type: "success"
2722
- });
2723
- } catch {
2724
- d.open({
2725
- message: "Failed to check unsync purchase order",
2726
- type: "error"
2727
- });
2728
- } finally {
2729
- t.value = !1;
2730
- }
2731
- }
2732
- async function a() {
2733
- if (s.value.size === 0) {
2734
- d.open({
2735
- message: "No purchase orders selected",
2736
- type: "info"
2737
- });
2738
- return;
2739
- }
2740
- f.value = Z.enum[1], m.value = !0;
2741
- }
2742
- async function h() {
2743
- m.value = !1;
2744
- const y = f.value === Z.enum[2] ? Z.enum[2] : void 0;
2745
- await k(y);
2746
- }
2747
- async function k(y) {
2748
- t.value = !0;
2749
- try {
2750
- const l = Array.from(s.value);
2751
- await n.manualSyncMultiplePurchaseOrders({ netsuiteIds: l, version: y }), await new Promise((r) => setTimeout(r, 5e3)), d.open({
2752
- message: "Sync purchase orders request sent successfully",
2753
- type: "success"
2754
- });
2755
- } catch (l) {
2756
- console.log(l), d.open({
2757
- message: "Failed to sync purchase orders",
2758
- type: "error"
2759
- });
2760
- } finally {
2761
- t.value = !1;
2762
- }
2763
- }
2764
- return (y, l) => {
2765
- var X;
2766
- const r = F("FmButton"), g = F("FmCheckbox"), S = F("FmRadio"), T = F("FmRadioGroup"), D = F("FmDialog");
2767
- return x(), _("div", io, [
2768
- u("span", null, "Current date and time: " + M((/* @__PURE__ */ new Date()).toLocaleString()), 1),
2769
- A(r, {
2770
- label: "Check Unsync Purchase Order (Last 2 months)",
2771
- variant: "primary",
2772
- onClick: v,
2773
- disabled: t.value,
2774
- loading: t.value
2775
- }, null, 8, ["disabled", "loading"]),
2776
- c.value.length > 0 ? (x(), _("div", ro, [
2777
- l[3] || (l[3] = u("p", null, "Purchase Order NetSuite ID not match with existing orders", -1)),
2778
- u("div", uo, [
2779
- (X = w(b).sessionUser.value) != null && X.role.isAdmin ? (x(), H(g, {
2780
- key: 0,
2781
- label: "Select All",
2782
- value: "all",
2783
- modelValue: e.value,
2784
- indeterminate: p.value,
2785
- "onUpdate:modelValue": I
2786
- }, null, 8, ["modelValue", "indeterminate"])) : U("", !0),
2787
- u("ul", co, [
2788
- (x(!0), _(Y, null, W(c.value, (R) => {
2789
- var O;
2790
- return x(), _("li", {
2791
- key: R,
2792
- class: "flex items-center"
2793
- }, [
2794
- (O = w(b).sessionUser.value) != null && O.role.isAdmin ? (x(), H(g, {
2795
- key: 0,
2796
- label: R,
2797
- value: R,
2798
- modelValue: B(R),
2799
- "onUpdate:modelValue": (j) => E(R, j)
2800
- }, null, 8, ["label", "value", "modelValue", "onUpdate:modelValue"])) : (x(), _("span", mo, M(R), 1))
2801
- ]);
2802
- }), 128))
2803
- ])
2804
- ]),
2805
- u("div", fo, [
2806
- A(_e, null, {
2807
- default: L(() => [
2808
- c.value.length > 0 ? (x(), H(r, {
2809
- key: 0,
2810
- label: `Sync Selected (${s.value.size})`,
2811
- variant: "destructive",
2812
- onClick: a,
2813
- disabled: t.value || s.value.size === 0,
2814
- loading: t.value
2815
- }, null, 8, ["label", "disabled", "loading"])) : U("", !0)
2816
- ]),
2817
- _: 1
2818
- })
2819
- ])
2820
- ])) : U("", !0),
2821
- A(D, {
2822
- modelValue: m.value,
2823
- "onUpdate:modelValue": l[2] || (l[2] = (R) => m.value = R),
2824
- overlay: !0
2825
- }, {
2826
- "dialog-header": L(() => l[4] || (l[4] = [
2827
- u("span", { class: "fm-typo-en-heading-lg-700" }, "Select Sync Version", -1)
2828
- ])),
2829
- "dialog-footer": L(() => [
2830
- u("div", vo, [
2831
- A(r, {
2832
- label: "Not now",
2833
- variant: "secondary",
2834
- onClick: l[1] || (l[1] = (R) => m.value = !1)
2835
- }),
2836
- A(r, {
2837
- label: "Confirm",
2838
- variant: "primary",
2839
- onClick: h
2840
- })
2841
- ])
2842
- ]),
2843
- default: L(() => [
2844
- u("div", po, [
2845
- u("p", null, " Choose which purchase order version to use for syncing " + M(s.value.size) + " selected purchase orders: ", 1),
2846
- A(T, {
2847
- modelValue: f.value,
2848
- "onUpdate:modelValue": l[0] || (l[0] = (R) => f.value = R)
2849
- }, {
2850
- default: L(() => [
2851
- (x(), _(Y, null, W(i, (R) => A(S, {
2852
- key: R.value,
2853
- value: R.value,
2854
- label: R.label,
2855
- sublabel: R.subLabel
2856
- }, null, 8, ["value", "label", "sublabel"])), 64))
2857
- ]),
2858
- _: 1
2859
- }, 8, ["modelValue"])
2860
- ])
2861
- ]),
2862
- _: 1
2863
- }, 8, ["modelValue"])
2864
- ]);
2865
- };
2866
- }
2867
- }), go = { class: "flex flex-col gap-8 w-full" }, Ao = { class: "flex gap-4 justify-between" }, bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-[30px] px-8 py-4 bg-fm-color-neutral-gray-100 text-fm-color-neutral-gray-400" }, ho = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, xo = { key: 0 }, Io = { class: "flex gap-8 items-center justify-start" }, So = /* @__PURE__ */ Q({
2868
- __name: "NetSuiteSideSheet",
2869
- props: {
2870
- nsLocations: {},
2871
- show: { type: Boolean },
2872
- loading: { type: Boolean }
2873
- },
2874
- emits: ["update:show"],
2875
- setup(V, { emit: b }) {
2876
- var B;
2877
- const n = le(), d = oe(), t = V, o = re(t, "show"), { t: c } = $(), s = b, m = ne(), f = ((B = m._currentLocation) == null ? void 0 : B.type) || "", i = [
2878
- {
2879
- label: "Inventory Transfer (Out)",
2880
- value: "inventoryTransfer"
2881
- /* INVENTORY_TRANSFER */
2882
- },
2883
- {
2884
- label: "Transfer Order",
2885
- value: "transferOrder"
2886
- /* TRANSFER_ORDER */
2887
- },
2888
- {
2889
- label: "Purchase Order",
2890
- value: "purchaseOrder"
2891
- /* PURCHASE_ORDER */
2892
- }
2893
- ], e = N(i[0].value), p = z(() => d.currentLocationSubsidiary()), I = z(() => d.currentLocationSetting), E = z(() => t.nsLocations.filter(
2894
- (v) => v.subsidiaryId === p.value.id || v.netsuiteId === p.value.id
2895
- ));
2896
- return (v, a) => {
2897
- var r;
2898
- const h = F("FmIcon"), k = F("FmTabs"), y = F("FmButton"), l = F("FmSideSheet");
2899
- return x(), H(l, {
2900
- modelValue: w(o),
2901
- "onUpdate:modelValue": a[2] || (a[2] = (g) => ie(o) ? o.value = g : null),
2902
- header: "Data migration (Xilnex)",
2903
- "dismiss-away": "",
2904
- "close-button": "",
2905
- "max-width": 800
2906
- }, se({
2907
- default: L(() => [
2908
- w(d).isCurrentLocationBindedToNetSuite ? (x(), _(Y, { key: 1 }, [
2909
- e.value === "inventoryTransfer" ? (x(), H(Zn, {
2910
- key: 0,
2911
- currentLocationSetting: I.value,
2912
- nsLocations: E.value,
2913
- currentLocationSubsidiary: p.value
2914
- }, null, 8, ["currentLocationSetting", "nsLocations", "currentLocationSubsidiary"])) : U("", !0),
2915
- e.value === "transferOrder" ? (x(), H(lo, {
2916
- key: 1,
2917
- currentLocationSetting: I.value
2918
- }, null, 8, ["currentLocationSetting"])) : U("", !0),
2919
- e.value === "purchaseOrder" ? (x(), H(yo, {
2920
- key: 2,
2921
- currentLocationSetting: I.value
2922
- }, null, 8, ["currentLocationSetting"])) : U("", !0)
2923
- ], 64)) : (x(), _("div", xo, " Netsuite is not configured for this location. Please contact your administrator. "))
2924
- ]),
2925
- "side-sheet-footer": L(() => [
2926
- u("div", Io, [
2927
- A(y, {
2928
- variant: "tertiary",
2929
- label: w(c)("common.close"),
2930
- onClick: a[1] || (a[1] = (g) => s("update:show", !1))
2931
- }, null, 8, ["label"])
2932
- ])
2933
- ]),
2934
- _: 2
2935
- }, [
2936
- (r = w(n).sessionUser.value) != null && r.role.isAdmin ? {
2937
- name: "side-sheet-header",
2938
- fn: L(() => {
2939
- var g;
2940
- return [
2941
- u("div", go, [
2942
- u("div", Ao, [
2943
- a[3] || (a[3] = u("div", { class: "fm-typo-en-title-md-600" }, "NetSuite Integration", -1)),
2944
- u("div", bo, [
2945
- A(h, {
2946
- name: w(f),
2947
- size: "sm"
2948
- }, null, 8, ["name"]),
2949
- u("div", ho, M((g = w(m)._currentLocation) == null ? void 0 : g.name), 1)
2950
- ])
2951
- ]),
2952
- A(k, {
2953
- "model-value": e.value,
2954
- "onUpdate:modelValue": a[0] || (a[0] = (S) => e.value = S),
2955
- items: i
2956
- }, null, 8, ["model-value"])
2957
- ])
2958
- ];
2959
- }),
2960
- key: "0"
2961
- } : void 0
2962
- ]), 1032, ["modelValue"]);
2963
- };
2964
- }
2965
- }), wo = { class: "flex justify-center" }, ko = ["src"], Fo = { class: "flex flex-col items-center gap-2" }, Co = { class: "text-lg font-bold" }, Bo = { class: "text-fm-color-neutral-gray-300" }, Eo = /* @__PURE__ */ Q({
2966
- __name: "NetSuite",
2967
- setup(V) {
2968
- const b = oe(), n = ee(), d = N(!1), t = N(!1);
2969
- async function o() {
2970
- t.value = !0;
2971
- }
2972
- const c = N([]);
2973
- Je(async () => {
2974
- if (b.isReady && b.isEnabled && !b.isBusinessLocation) {
2975
- d.value = !0;
2976
- try {
2977
- const m = await b.getNetSuiteLocationOptions();
2978
- c.value = m;
2979
- } catch {
2980
- n.open({
2981
- message: "Failed to fetch NetSuite locations",
2982
- type: "error"
2983
- });
2984
- } finally {
2985
- d.value = !1;
2986
- }
2987
- }
2988
- });
2989
- const { t: s } = $();
2990
- return (m, f) => {
2991
- const i = F("FmCardSection"), e = F("FmCard");
2992
- return w(b).isEnabled ? (x(), _(Y, { key: 0 }, [
2993
- A(e, {
2994
- class: K({
2995
- "w-full": !0,
2996
- border: !0,
2997
- "border-fm-color-neutral-gray-100": !0,
2998
- "cursor-pointer": !0,
2999
- "hover:border-fm-color-primary": !0
3000
- }),
3001
- onClick: f[0] || (f[0] = (p) => o())
3002
- }, {
3003
- default: L(() => [
3004
- A(i, null, {
3005
- default: L(() => [
3006
- u("div", wo, [
3007
- u("img", {
3008
- src: w(an),
3009
- alt: "NetSuite"
3010
- }, null, 8, ko)
3011
- ]),
3012
- u("div", Fo, [
3013
- u("div", Co, M(w(s)("inventory.integration.netsuite.title")), 1),
3014
- u("div", Bo, M(w(s)("inventory.integration.netsuite.description")), 1)
3015
- ])
3016
- ]),
3017
- _: 1
3018
- })
3019
- ]),
3020
- _: 1
3021
- }),
3022
- w(b).state.setting ? (x(), H(fe, {
3023
- key: 0,
3024
- to: "body"
3025
- }, [
3026
- w(b).isBusinessLocation ? (x(), H(Rn, {
3027
- key: 0,
3028
- show: t.value,
3029
- "onUpdate:show": [
3030
- f[1] || (f[1] = (p) => t.value = p),
3031
- f[2] || (f[2] = (p) => t.value = p)
3032
- ],
3033
- loading: d.value,
3034
- "onUpdate:loading": f[3] || (f[3] = (p) => d.value = p)
3035
- }, null, 8, ["show", "loading"])) : (x(), H(So, {
3036
- key: 1,
3037
- setting: w(b).state.setting,
3038
- "onUpdate:setting": f[4] || (f[4] = (p) => w(b).state.setting = p),
3039
- nsLocations: c.value,
3040
- "onUpdate:nsLocations": f[5] || (f[5] = (p) => c.value = p),
3041
- show: t.value,
3042
- "onUpdate:show": [
3043
- f[6] || (f[6] = (p) => t.value = p),
3044
- f[7] || (f[7] = (p) => t.value = p)
3045
- ],
3046
- loading: d.value,
3047
- "onUpdate:loading": f[8] || (f[8] = (p) => d.value = p)
3048
- }, null, 8, ["setting", "nsLocations", "show", "loading"]))
3049
- ])) : U("", !0)
3050
- ], 64)) : U("", !0);
3051
- };
3052
- }
3053
- }), Se = [
3054
- "store",
3055
- "issueBy",
3056
- "verifiedBy",
3057
- "stockTakeId",
3058
- "date",
3059
- "status",
3060
- "c_field",
3061
- "itemCode",
3062
- "itemName",
3063
- "physicalQty",
3064
- "ohQty",
3065
- "customCost",
3066
- "totalPhysicalCustomCost",
3067
- "schemeFranchiseePrice",
3068
- "physicalSchemeTotalFranchiseePrice"
3069
- ];
3070
- async function Vo(V, b, n) {
3071
- var c;
3072
- const d = await _o(n), t = [], o = {};
3073
- for (const s in d) {
3074
- const m = d[s];
3075
- for (let f = 0; f < m.length; f++) {
3076
- const i = m[f], e = i.itemCode, p = i.itemName, I = i.physicalQty, E = i.customCost;
3077
- if (e === "" || e === "undefined") {
3078
- t.push({
3079
- row: i.excelRow,
3080
- itemCode: e,
3081
- itemName: p,
3082
- message: "Item code is empty or undefined"
3083
- });
3084
- continue;
3085
- }
3086
- const B = b.find((y) => y.code === e);
3087
- if (!B) {
3088
- t.push({
3089
- row: i.excelRow,
3090
- itemCode: e,
3091
- itemName: p,
3092
- qty: I,
3093
- message: "Item not found in inventory"
3094
- }), console.error(`${i.excelRow} Item not found: ${e} ${p} ${I}`);
3095
- continue;
3096
- }
3097
- let v = Number(i.totalPhysicalCustomCost);
3098
- const a = V[B._id];
3099
- a && (v = a * Number(I));
3100
- const h = te.fromNumber(Number(I)), k = {
3101
- amount: h,
3102
- cost: {
3103
- ...te.fromNumber(Number(v)),
3104
- currency: "MYR"
3105
- }
3106
- };
3107
- I != "0" && E == "0" && console.warn(`Item ${e} ${p} has 0 cost.`), o[c = B._id] ?? (o[c] = {
3108
- skuAdjustment: {
3109
- sku: B,
3110
- fromBalance: te.fromNumber(0),
3111
- amounts: [
3112
- {
3113
- _id: null,
3114
- type: Be.Enum.CLOSING,
3115
- remark: "Opening Balance",
3116
- amount: h,
3117
- measurement: null,
3118
- // always the smallest unit
3119
- cost: k.cost
3120
- }
3121
- ],
3122
- toBalance: h,
3123
- toCostBalances: [k]
3124
- },
3125
- skuBalance: {
3126
- id: B._id,
3127
- balance: h,
3128
- costs: [k]
3129
- }
3130
- });
3131
- }
3132
- }
3133
- return {
3134
- errors: t,
3135
- rows: o
3136
- };
3137
- }
3138
- async function _o(V) {
3139
- const b = await new Promise((o, c) => {
3140
- const s = new FileReader();
3141
- s.onload = (m) => o(m.target.result), s.onerror = c, s.readAsArrayBuffer(V);
3142
- }), n = Oe(b, { type: "array" }), d = n.SheetNames, t = {};
3143
- for (const o of d) {
3144
- const c = await Lo(n.Sheets[o]);
3145
- t[o] = c;
3146
- }
3147
- return t;
3148
- }
3149
- async function Lo(V) {
3150
- const b = ze.sheet_to_json(V, {
3151
- header: Se,
3152
- range: 12
3153
- }), n = [];
3154
- for (let d = 0; d < b.length; d++) {
3155
- const t = b[d], o = {};
3156
- for (const c of Se)
3157
- o[c] = String(t[c]).trim();
3158
- n.push({
3159
- ...o,
3160
- excelRow: d + 13
3161
- // Excel rows start from 1, and we skip the first 12 rows
3162
- });
3163
- }
3164
- return n;
3165
- }
3166
- const No = { class: "flex flex-col gap-4" }, To = { class: "flex flex-col" }, Ro = {
3167
- key: 0,
3168
- class: "flex flex-col gap-4 my-5"
3169
- }, Do = { class: "flex flex-col gap-8" }, Mo = { class: "flex flex-col gap-8" }, Oo = {
3170
- class: /* @__PURE__ */ K(["fm-corner-radius-md p-16 flex items-center gap-16"])
3171
- }, zo = {
3172
- class: /* @__PURE__ */ K(["fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center gap-3"])
3173
- }, jo = { class: "line-clamp-2 text-ellipsis break-all" }, Uo = { class: "flex flex-col" }, Ho = { class: "font-medium" }, Xo = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, Qo = {
3174
- key: 0,
3175
- class: "rounded border-1 border-gray-200 p-2 flex items-center"
3176
- }, Yo = { class: "flex flex-col" }, Po = { class: "font-medium" }, Jo = { class: "text-xs text-gray-400" }, Ko = { class: "text-xs text-gray-400" }, qo = { class: "flex" }, Go = { class: "flex" }, Zo = {
3177
- key: 1,
3178
- class: "flex flex-col gap-2"
3179
- }, Wo = /* @__PURE__ */ Q({
3180
- __name: "XilnexOpeningImport",
3181
- setup(V) {
3182
- const b = nt(), n = oe(), d = de(), t = Ee(), o = ee(), c = ne(), s = z(() => [
3183
- {
3184
- value: "xilnex",
3185
- label: "Xilnex",
3186
- subLabel: "Based on Xilnex's item cost from excel file"
3187
- },
3188
- ...n.isEnabled ? [
3189
- {
3190
- value: "netsuite",
3191
- label: "NetSuite",
3192
- subLabel: "Based on NetSuite's item current average cost by location. If not available, it will fallback to excel's cost",
3193
- disabled: !n.isCurrentLocationBindedToNetSuite,
3194
- disabledReason: "Current location is not binded to NetSuite"
3195
- }
3196
- ] : []
3197
- ]), m = N(s.value[0].value), { t: f } = ve(), i = N(null), e = N(), p = N(""), I = N([]), E = N([]), B = [
3198
- {
3199
- id: "ingredient",
3200
- header: () => "Ingredient",
3201
- cell(g) {
3202
- const S = g.row.original;
3203
- return C("div", { class: "flex flex-col" }, [
3204
- C("span", { class: "font-medium" }, S.skuAdjustment.sku.name),
3205
- C("span", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, [
3206
- S.skuAdjustment.sku.code
3207
- ])
3208
- ]);
3209
- }
3210
- },
3211
- {
3212
- id: "openingBalance",
3213
- header: () => "Opening Balance",
3214
- cell(g) {
3215
- const S = g.row.original;
3216
- return C("div", { class: "flex flex-col" }, [
3217
- C(
3218
- "span",
3219
- { class: "font-medium" },
3220
- te.toFormatString({
3221
- value: S.skuAdjustment.amounts[0].amount
3222
- })
3223
- )
3224
- ]);
3225
- }
3226
- },
3227
- {
3228
- id: "unit",
3229
- header: () => "Unit",
3230
- cell(g) {
3231
- const S = g.row.original, T = !S.skuAdjustment.amounts[0].measurement;
3232
- let D = S.skuAdjustment.sku.unit.name;
3233
- if (!T) {
3234
- const X = S.skuAdjustment.sku.unit.measurements.find(
3235
- (R) => R.id === S.skuAdjustment.amounts[0].measurement.id
3236
- );
3237
- D = X ? X.name : "Error: Measurement not found";
3238
- }
3239
- return C("div", { class: "flex flex-col" }, [
3240
- C("span", { class: "font-medium" }, D),
3241
- T ? null : C("span", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, [
3242
- `Base unit: ${S.skuAdjustment.sku.unit.name}`
3243
- ])
3244
- ]);
3245
- }
3246
- },
3247
- {
3248
- id: "totalCost",
3249
- header: () => "Total Cost",
3250
- cell(g) {
3251
- const S = g.row.original, { currency: T, ...D } = S.skuAdjustment.amounts[0].cost ?? {
3252
- amount: 0,
3253
- precision: 0,
3254
- currency: ""
3255
- };
3256
- return C("div", { class: "flex flex-col" }, [
3257
- C(
3258
- "span",
3259
- { class: "font-medium" },
3260
- te.toFormatString({
3261
- value: D
3262
- })
3263
- )
3264
- ]);
3265
- }
3266
- }
3267
- ], v = [
3268
- {
3269
- accessorKey: "row",
3270
- header: "Row"
3271
- },
3272
- {
3273
- accessorKey: "itemCode",
3274
- header: "Item Code"
3275
- },
3276
- {
3277
- accessorKey: "itemName",
3278
- header: "Item Name"
3279
- },
3280
- {
3281
- accessorKey: "qty",
3282
- header: "Quantity"
3283
- },
3284
- {
3285
- accessorKey: "message",
3286
- header: "Error Message"
3287
- }
3288
- ], a = N(!1);
3289
- async function h() {
3290
- if (i.value) {
3291
- a.value = !0;
3292
- try {
3293
- let g = {};
3294
- m.value === "netsuite" && (g = await n.getItemAverageCosts());
3295
- const { errors: S, rows: T } = await Vo(
3296
- g,
3297
- d.skus,
3298
- i.value
3299
- );
3300
- I.value = S, E.value = Object.values(T);
3301
- } catch {
3302
- o.open({
3303
- message: "Error verifying file",
3304
- type: "error"
3305
- });
3306
- } finally {
3307
- a.value = !1;
3308
- }
3309
- }
3310
- }
3311
- async function k() {
3312
- if (i.value) {
3313
- a.value = !0;
3314
- try {
3315
- if (!l.value) {
3316
- o.open({
3317
- message: "Please select a date for the opening balance",
3318
- type: "error"
3319
- });
3320
- return;
3321
- }
3322
- await t.setOpeningBalance({
3323
- effectiveAt: l.value,
3324
- skuAdjustments: E.value.map((g) => g.skuAdjustment),
3325
- skuBalances: E.value.map((g) => g.skuBalance)
3326
- }), o.open({
3327
- message: "Opening balance imported successfully",
3328
- type: "success"
3329
- }), await b.fetchClosingDocumentId();
3330
- } catch {
3331
- o.open({
3332
- message: "Error importing opening balance",
3333
- type: "error"
3334
- });
3335
- } finally {
3336
- a.value = !1;
3337
- }
3338
- }
3339
- }
3340
- const y = N(""), l = z({
3341
- get() {
3342
- return y.value;
3343
- },
3344
- set(g) {
3345
- y.value = `${g}T15:59:59.999Z`;
3346
- }
3347
- }), r = z(() => {
3348
- if (!y.value) return null;
3349
- const g = new Date(y.value);
3350
- return isNaN(g.getTime()) ? null : he(g);
3351
- });
3352
- return (g, S) => {
3353
- const T = F("FmLabel"), D = F("FmField"), X = F("FmSimpleDatePicker"), R = F("FmButton"), O = F("FmIcon"), j = F("FmRadio"), ue = F("FmRadioGroup"), xe = F("FmTable");
3354
- return x(), _("div", No, [
3355
- u("div", To, [
3356
- A(T, { label: "Latest closing" })
3357
- ]),
3358
- A(D, {
3359
- "prepend-icon": "lock_outline",
3360
- disabled: ""
3361
- }, {
3362
- default: L(() => [
3363
- J(M(w(b).state.closingDocumentId ? `${w(Re)(new Date(w(Ae)(w(b).state.closingDocumentId)))}` : "No closing found"), 1)
3364
- ]),
3365
- _: 1
3366
- }),
3367
- w(b).state.closingDocumentId ? (x(), _("div", Zo, [
3368
- S[6] || (S[6] = u("span", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, " Not able to import opening balance as closing document already exists. ", -1)),
3369
- w(c)._currentLocation ? (x(), _(Y, { key: 0 }, [
3370
- A(T, { label: "Location ID" }),
3371
- A(D, {
3372
- "prepend-icon": "lock_outline",
3373
- disabled: ""
3374
- }, {
3375
- default: L(() => [
3376
- J(M(w(c)._currentLocation.dbName.split("_")[1]), 1)
3377
- ]),
3378
- _: 1
3379
- })
3380
- ], 64)) : U("", !0)
3381
- ])) : (x(), _("div", Ro, [
3382
- A(X, {
3383
- modelValue: l.value,
3384
- "onUpdate:modelValue": S[0] || (S[0] = (P) => l.value = P),
3385
- label: "Last closing time"
3386
- }, {
3387
- "trigger-button": L(() => [
3388
- A(D, {
3389
- "prepend-icon": "calendar_today",
3390
- readonly: "",
3391
- label: "Last closing time"
3392
- }, {
3393
- default: L(() => [
3394
- J(M(r.value), 1)
3395
- ]),
3396
- _: 1
3397
- })
3398
- ]),
3399
- _: 1
3400
- }, 8, ["modelValue"]),
3401
- u("div", Do, [
3402
- A(T, { label: "Stock take file" })
3403
- ]),
3404
- A(Me, {
3405
- onFileUpload: S[1] || (S[1] = (P) => {
3406
- P && (i.value = P);
3407
- }),
3408
- accept: ".xlsx, .xls, .csv"
3409
- }, se({ _: 2 }, [
3410
- i.value ? {
3411
- name: "default",
3412
- fn: L(({ openFileDialog: P }) => [
3413
- u("div", Mo, [
3414
- u("div", Oo, [
3415
- u("div", zo, [
3416
- u("div", jo, M(i.value.name), 1),
3417
- A(R, {
3418
- label: w(f)("inventory.ingredient.import.replaceFile"),
3419
- variant: "secondary",
3420
- "prepend-icon": "autorenew",
3421
- onClick: P
3422
- }, null, 8, ["label", "onClick"])
3423
- ])
3424
- ])
3425
- ])
3426
- ]),
3427
- key: "0"
3428
- } : void 0
3429
- ]), 1024),
3430
- A(ue, {
3431
- modelValue: m.value,
3432
- "onUpdate:modelValue": S[2] || (S[2] = (P) => m.value = P),
3433
- label: "Retrieve cost from",
3434
- class: "my-5"
3435
- }, {
3436
- default: L(() => [
3437
- (x(!0), _(Y, null, W(s.value, (P) => (x(), H(j, {
3438
- key: P.value,
3439
- value: P.value,
3440
- label: P.label,
3441
- sublabel: P.subLabel,
3442
- disabled: P.disabled
3443
- }, {
3444
- label: L(() => [
3445
- u("div", Uo, [
3446
- u("span", Ho, M(P.label), 1),
3447
- u("span", Xo, M(P.disabled ? P.disabledReason : P.subLabel), 1)
3448
- ]),
3449
- P.value === "netsuite" && w(n).currentLocationSetting ? (x(), _("div", Qo, [
3450
- A(O, {
3451
- name: "cloud",
3452
- color: "neutral-gray-400",
3453
- size: "md",
3454
- class: "mr-2",
3455
- outline: !0
3456
- }),
3457
- u("div", Yo, [
3458
- u("span", Po, M(w(n).currentLocationSetting.name), 1),
3459
- u("span", Jo, "ID: " + M(w(n).currentLocationSetting.netSuiteId), 1),
3460
- u("span", Ko, "Subsidiary: " + M(w(n).getSubsidiaryFullName(
3461
- w(n).currentLocationSetting.subsidiaryId
3462
- ).fullName), 1)
3463
- ])
3464
- ])) : U("", !0)
3465
- ]),
3466
- _: 2
3467
- }, 1032, ["value", "label", "sublabel", "disabled"]))), 128))
3468
- ]),
3469
- _: 1
3470
- }, 8, ["modelValue"]),
3471
- u("div", qo, [
3472
- A(R, {
3473
- class: "ml-auto mt-4",
3474
- variant: "secondary",
3475
- "prepend-icon": "troubleshoot",
3476
- label: "Verify",
3477
- disabled: !i.value && !a.value,
3478
- loading: a.value,
3479
- onClick: h
3480
- }, null, 8, ["disabled", "loading"])
3481
- ]),
3482
- i.value && E.value.length > 0 ? (x(), _(Y, { key: 0 }, [
3483
- S[4] || (S[4] = u("h2", { class: "fm-typo-en-title-md-800 mt-8 mb-4" }, "Results", -1)),
3484
- A(xe, {
3485
- modelValue: e.value,
3486
- "onUpdate:modelValue": S[3] || (S[3] = (P) => e.value = P),
3487
- "row-data": E.value,
3488
- "column-defs": B,
3489
- "shrink-at": !1,
3490
- "search-value": p.value
3491
- }, null, 8, ["modelValue", "row-data", "search-value"])
3492
- ], 64)) : U("", !0),
3493
- I.value.length > 0 ? (x(), _(Y, { key: 1 }, [
3494
- S[5] || (S[5] = u("h2", { class: "fm-typo-en-title-md-800 mt-8 mb-4 text-red-600" }, "Errors", -1)),
3495
- A(xe, {
3496
- "row-data": I.value,
3497
- "column-defs": v
3498
- }, null, 8, ["row-data"])
3499
- ], 64)) : U("", !0),
3500
- u("div", Go, [
3501
- E.value.length > 0 && !w(b).state.closingDocumentId ? (x(), H(R, {
3502
- key: 0,
3503
- class: "ml-auto mt-4",
3504
- "prepend-icon": "file_upload",
3505
- variant: "primary",
3506
- label: "Import Opening Balance",
3507
- disabled: !i.value || a.value,
3508
- onClick: k
3509
- }, null, 8, ["disabled"])) : U("", !0)
3510
- ])
3511
- ]))
3512
- ]);
3513
- };
3514
- }
3515
- }), $o = { class: "flex flex-col gap-8 w-full" }, es = { class: "flex gap-4 justify-between" }, ts = { class: "inline-flex rounded-md items-center gap-4 justify-center h-[30px] px-8 py-4 bg-fm-color-neutral-gray-100 text-fm-color-neutral-gray-400" }, ns = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, os = { key: 0 }, ss = {
3516
- key: 1,
3517
- class: "flex flex-col gap-8 w-full"
3518
- }, as = { key: 1 }, ls = { class: "flex gap-8 items-center justify-start" }, is = /* @__PURE__ */ Q({
3519
- __name: "XilnexSideSheet",
3520
- props: {
3521
- show: { type: Boolean },
3522
- loading: { type: Boolean }
3523
- },
3524
- emits: ["update:show"],
3525
- setup(V, { emit: b }) {
3526
- var e;
3527
- const n = le(), t = re(V, "show"), { t: o } = $(), c = b, s = ne(), m = ((e = s._currentLocation) == null ? void 0 : e.type) || "", f = [
3528
- { label: me(
3529
- "openingBalance"
3530
- /* OPENING_BALANCE */
3531
- ) },
3532
- { label: me(
3533
- "transferNote"
3534
- /* TRANSFER_NOTE */
3535
- ) }
3536
- ], i = N(f[0]);
3537
- return (p, I) => {
3538
- var h;
3539
- const E = F("FmIcon"), B = F("FmButtonGroup"), v = F("FmButton"), a = F("FmSideSheet");
3540
- return x(), H(a, {
3541
- modelValue: w(t),
3542
- "onUpdate:modelValue": I[2] || (I[2] = (k) => ie(t) ? t.value = k : null),
3543
- header: "Data migration (Xilnex)",
3544
- "dismiss-away": "",
3545
- "close-button": "",
3546
- "max-width": 800
3547
- }, se({
3548
- default: L(() => {
3549
- var k;
3550
- return [
3551
- (k = w(n).sessionUser.value) != null && k.role.isAdmin ? (x(), _("div", ss, [
3552
- i.value.label === w(me)(
3553
- "openingBalance"
3554
- /* OPENING_BALANCE */
3555
- ) ? (x(), H(Wo, { key: 0 })) : U("", !0),
3556
- i.value.label === w(me)(
3557
- "transferNote"
3558
- /* TRANSFER_NOTE */
3559
- ) ? (x(), _("div", as, " Not available yet. ")) : U("", !0)
3560
- ])) : (x(), _("div", os, " Please contact your administrator to apply the changes. "))
3561
- ];
3562
- }),
3563
- "side-sheet-footer": L(() => [
3564
- u("div", ls, [
3565
- A(v, {
3566
- variant: "tertiary",
3567
- label: w(o)("common.close"),
3568
- onClick: I[1] || (I[1] = (k) => c("update:show", !1))
3569
- }, null, 8, ["label"])
3570
- ])
3571
- ]),
3572
- _: 2
3573
- }, [
3574
- (h = w(n).sessionUser.value) != null && h.role.isAdmin ? {
3575
- name: "side-sheet-header",
3576
- fn: L(() => {
3577
- var k;
3578
- return [
3579
- u("div", $o, [
3580
- u("div", es, [
3581
- I[3] || (I[3] = u("div", { class: "fm-typo-en-title-md-600" }, "Data migration (Xilnex)", -1)),
3582
- u("div", ts, [
3583
- A(E, {
3584
- name: w(m),
3585
- size: "sm"
3586
- }, null, 8, ["name"]),
3587
- u("div", ns, M((k = w(s)._currentLocation) == null ? void 0 : k.name), 1)
3588
- ])
3589
- ]),
3590
- A(B, {
3591
- modelValue: i.value,
3592
- "onUpdate:modelValue": I[0] || (I[0] = (y) => i.value = y),
3593
- items: f
3594
- }, null, 8, ["modelValue"])
3595
- ])
3596
- ];
3597
- }),
3598
- key: "0"
3599
- } : void 0
3600
- ]), 1032, ["modelValue"]);
3601
- };
3602
- }
3603
- }), rs = /* @__PURE__ */ Q({
3604
- __name: "XilnexView",
3605
- setup(V) {
3606
- const b = De(), n = ne(), d = N(!1);
3607
- async function t() {
3608
- d.value = !0, console.log("Opening Xilnex migration dialog");
3609
- }
3610
- return (o, c) => {
3611
- const s = F("FmCardSection"), m = F("FmCard");
3612
- return w(b).enabledXilnexOpeningMigration && !w(n).businessLevel ? (x(), _(Y, { key: 0 }, [
3613
- A(m, {
3614
- class: K({
3615
- "w-full": !0,
3616
- border: !0,
3617
- "border-fm-color-neutral-gray-100": !0,
3618
- "cursor-pointer": !0,
3619
- "hover:border-fm-color-primary": !0
3620
- }),
3621
- onClick: c[0] || (c[0] = (f) => t())
3622
- }, {
3623
- default: L(() => [
3624
- A(s, null, {
3625
- default: L(() => c[2] || (c[2] = [
3626
- u("div", { class: "flex justify-center" }, [
3627
- u("div", { class: "size-[100px] bg-gray-200 rounded-lg flex items-center justify-center" }, [
3628
- u("span", { class: "text-lg font-bold text-gray-600" }, "Xilnex")
3629
- ])
3630
- ], -1),
3631
- u("div", { class: "flex flex-col items-center gap-2" }, [
3632
- u("div", { class: "text-lg font-bold" }, "Xilnex"),
3633
- u("div", { class: "text-fm-color-neutral-gray-300" }, "Data migration from Xilnex")
3634
- ], -1)
3635
- ])),
3636
- _: 1
3637
- })
3638
- ]),
3639
- _: 1
3640
- }),
3641
- (x(), H(fe, { to: "body" }, [
3642
- A(is, {
3643
- show: d.value,
3644
- "onUpdate:show": c[1] || (c[1] = (f) => d.value = f)
3645
- }, null, 8, ["show"])
3646
- ]))
3647
- ], 64)) : U("", !0);
3648
- };
3649
- }
3650
- }), we = [
3651
- "bin",
3652
- "group",
3653
- "code",
3654
- "description",
3655
- "unitcost",
3656
- "convertUom",
3657
- "quantity",
3658
- "total"
3659
- ];
3660
- async function us(V, b, n) {
3661
- var m;
3662
- const d = await cs(n), t = [], o = {}, c = Object.keys(d)[0], s = d[c];
3663
- for (let f = 0; f < s.length; f++) {
3664
- const i = s[f], e = i.code, p = i.description, I = i.quantity, E = i.unitcost;
3665
- if (e === "" || e === "undefined") {
3666
- t.push({
3667
- row: i.excelRow,
3668
- itemCode: e,
3669
- itemName: p,
3670
- message: "Item code is empty or undefined"
3671
- });
3672
- continue;
3673
- }
3674
- const B = b.find((y) => y.code === e);
3675
- if (!B) {
3676
- t.push({
3677
- row: i.excelRow,
3678
- itemCode: e,
3679
- itemName: p,
3680
- qty: I,
3681
- message: "Item not found in inventory"
3682
- }), console.error(`${i.excelRow} Item not found: ${e} ${p} ${I}`);
3683
- continue;
3684
- }
3685
- let v = Number(i.total);
3686
- const a = V[B._id];
3687
- a && (v = a * Number(I));
3688
- const h = te.fromNumber(Number(I)), k = {
3689
- amount: h,
3690
- cost: {
3691
- ...te.fromNumber(Number(v)),
3692
- currency: "MYR"
3693
- }
3694
- };
3695
- I != "0" && E == "0" && console.warn(`Item ${e} ${p} has 0 cost.`), o[m = B._id] ?? (o[m] = {
3696
- skuAdjustment: {
3697
- sku: B,
3698
- fromBalance: te.fromNumber(0),
3699
- amounts: [
3700
- {
3701
- _id: null,
3702
- type: Be.Enum.CLOSING,
3703
- remark: "Opening Balance",
3704
- amount: h,
3705
- measurement: null,
3706
- // always the smallest unit
3707
- cost: k.cost
3708
- }
3709
- ],
3710
- toBalance: h,
3711
- toCostBalances: [k]
3712
- },
3713
- skuBalance: {
3714
- id: B._id,
3715
- balance: h,
3716
- costs: [k]
3717
- }
3718
- });
3719
- }
3720
- return {
3721
- errors: t,
3722
- rows: o
3723
- };
3724
- }
3725
- async function cs(V) {
3726
- const b = await new Promise((o, c) => {
3727
- const s = new FileReader();
3728
- s.onload = (m) => o(m.target.result), s.onerror = c, s.readAsArrayBuffer(V);
3729
- }), n = Oe(b, { type: "array" }), d = n.SheetNames, t = {};
3730
- for (const o of d) {
3731
- const c = await ds(n.Sheets[o]);
3732
- t[o] = c;
3733
- }
3734
- return t;
3735
- }
3736
- async function ds(V) {
3737
- const b = ze.sheet_to_json(V, {
3738
- header: we,
3739
- range: 1
3740
- }), n = [];
3741
- for (let d = 0; d < b.length; d++) {
3742
- const t = b[d], o = {};
3743
- for (const c of we)
3744
- o[c] = String(t[c]).trim();
3745
- n.push({
3746
- ...o,
3747
- excelRow: d + 2
3748
- // Excel rows start from 1, and we skip the first row
3749
- });
3750
- }
3751
- return n;
3752
- }
3753
- const ms = { class: "flex flex-col gap-4" }, fs = { class: "flex flex-col" }, ps = {
3754
- key: 0,
3755
- class: "flex flex-col gap-4 my-5"
3756
- }, vs = { class: "flex flex-col gap-8" }, ys = { class: "flex flex-col gap-8" }, gs = {
3757
- class: /* @__PURE__ */ K(["fm-corner-radius-md p-16 flex items-center gap-16"])
3758
- }, As = {
3759
- class: /* @__PURE__ */ K(["fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center gap-3"])
3760
- }, bs = { class: "line-clamp-2 text-ellipsis break-all" }, hs = { class: "flex flex-col" }, xs = { class: "font-medium" }, Is = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, Ss = { class: "flex" }, ws = { class: "flex" }, ks = { key: 1 }, Fs = /* @__PURE__ */ Q({
3761
- __name: "SynergyOpeningImport",
3762
- setup(V) {
3763
- const b = ot(), n = de(), d = Ee(), t = ee(), o = z(() => [
3764
- {
3765
- value: "synergy",
3766
- label: "Synergy",
3767
- subLabel: "Based on Synergy's item cost from excel file"
3768
- }
3769
- ]), c = N(o.value[0].value), { t: s } = ve(), m = N(null), f = N(), i = N(""), e = N([]), p = N([]), I = [
3770
- {
3771
- id: "ingredient",
3772
- header: () => "Ingredient",
3773
- cell(l) {
3774
- const r = l.row.original;
3775
- return C("div", { class: "flex flex-col" }, [
3776
- C("span", { class: "font-medium" }, r.skuAdjustment.sku.name),
3777
- C("span", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, [
3778
- r.skuAdjustment.sku.code
3779
- ])
3780
- ]);
3781
- }
3782
- },
3783
- {
3784
- id: "openingBalance",
3785
- header: () => "Opening Balance",
3786
- cell(l) {
3787
- const r = l.row.original;
3788
- return C("div", { class: "flex flex-col" }, [
3789
- C(
3790
- "span",
3791
- { class: "font-medium" },
3792
- te.toFormatString({
3793
- value: r.skuAdjustment.amounts[0].amount
3794
- })
3795
- )
3796
- ]);
3797
- }
3798
- },
3799
- {
3800
- id: "unit",
3801
- header: () => "Unit",
3802
- cell(l) {
3803
- const r = l.row.original, g = !r.skuAdjustment.amounts[0].measurement;
3804
- let S = r.skuAdjustment.sku.unit.name;
3805
- if (!g) {
3806
- const T = r.skuAdjustment.sku.unit.measurements.find(
3807
- (D) => D.id === r.skuAdjustment.amounts[0].measurement.id
3808
- );
3809
- S = T ? T.name : "Error: Measurement not found";
3810
- }
3811
- return C("div", { class: "flex flex-col" }, [
3812
- C("span", { class: "font-medium" }, S),
3813
- g ? null : C("span", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, [
3814
- `Base unit: ${r.skuAdjustment.sku.unit.name}`
3815
- ])
3816
- ]);
3817
- }
3818
- },
3819
- {
3820
- id: "totalCost",
3821
- header: () => "Total Cost",
3822
- cell(l) {
3823
- const r = l.row.original, { currency: g, ...S } = r.skuAdjustment.amounts[0].cost ?? {
3824
- amount: 0,
3825
- precision: 0,
3826
- currency: ""
3827
- };
3828
- return C("div", { class: "flex flex-col" }, [
3829
- C(
3830
- "span",
3831
- { class: "font-medium" },
3832
- te.toFormatString({
3833
- value: S
3834
- })
3835
- )
3836
- ]);
3837
- }
3838
- }
3839
- ], E = [
3840
- {
3841
- accessorKey: "row",
3842
- header: "Row"
3843
- },
3844
- {
3845
- accessorKey: "itemCode",
3846
- header: "Item Code"
3847
- },
3848
- {
3849
- accessorKey: "itemName",
3850
- header: "Item Name"
3851
- },
3852
- {
3853
- accessorKey: "qty",
3854
- header: "Quantity"
3855
- },
3856
- {
3857
- accessorKey: "message",
3858
- header: "Error Message"
3859
- }
3860
- ], B = N(!1);
3861
- async function v() {
3862
- if (m.value) {
3863
- B.value = !0;
3864
- try {
3865
- let l = {};
3866
- const { errors: r, rows: g } = await us(
3867
- l,
3868
- n.skus,
3869
- m.value
3870
- );
3871
- e.value = r, p.value = Object.values(g);
3872
- } catch {
3873
- t.open({
3874
- message: "Error verifying file",
3875
- type: "error"
3876
- });
3877
- } finally {
3878
- B.value = !1;
3879
- }
3880
- }
3881
- }
3882
- async function a() {
3883
- if (m.value) {
3884
- B.value = !0;
3885
- try {
3886
- if (!k.value) {
3887
- t.open({
3888
- message: "Please select a date for the opening balance",
3889
- type: "error"
3890
- });
3891
- return;
3892
- }
3893
- await d.setOpeningBalance({
3894
- effectiveAt: k.value,
3895
- skuAdjustments: p.value.map((l) => l.skuAdjustment),
3896
- skuBalances: p.value.map((l) => l.skuBalance)
3897
- }), t.open({
3898
- message: "Opening balance imported successfully",
3899
- type: "success"
3900
- }), await b.fetchClosingDocumentId();
3901
- } catch {
3902
- t.open({
3903
- message: "Error importing opening balance",
3904
- type: "error"
3905
- });
3906
- } finally {
3907
- B.value = !1;
3908
- }
3909
- }
3910
- }
3911
- const h = N(""), k = z({
3912
- get() {
3913
- return h.value;
3914
- },
3915
- set(l) {
3916
- h.value = `${l}T15:59:59.999Z`;
3917
- }
3918
- }), y = z(() => {
3919
- if (!h.value) return null;
3920
- const l = new Date(h.value);
3921
- return isNaN(l.getTime()) ? null : he(l);
3922
- });
3923
- return (l, r) => {
3924
- const g = F("FmLabel"), S = F("FmField"), T = F("FmSimpleDatePicker"), D = F("FmButton"), X = F("FmRadio"), R = F("FmRadioGroup"), O = F("FmTable");
3925
- return x(), _("div", ms, [
3926
- u("div", fs, [
3927
- A(g, { label: "Latest closing" })
3928
- ]),
3929
- A(S, {
3930
- "prepend-icon": "lock_outline",
3931
- disabled: ""
3932
- }, {
3933
- default: L(() => [
3934
- J(M(w(b).state.closingDocumentId ? `${w(Re)(new Date(w(Ae)(w(b).state.closingDocumentId)))}` : "No closing found"), 1)
3935
- ]),
3936
- _: 1
3937
- }),
3938
- w(b).state.closingDocumentId ? (x(), _("div", ks, r[6] || (r[6] = [
3939
- u("span", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, " Not able to import opening balance as closing document already exists. ", -1)
3940
- ]))) : (x(), _("div", ps, [
3941
- A(T, {
3942
- modelValue: k.value,
3943
- "onUpdate:modelValue": r[0] || (r[0] = (j) => k.value = j),
3944
- label: "Last closing time"
3945
- }, {
3946
- "trigger-button": L(() => [
3947
- A(S, {
3948
- "prepend-icon": "calendar_today",
3949
- readonly: "",
3950
- label: "Last closing time"
3951
- }, {
3952
- default: L(() => [
3953
- J(M(y.value), 1)
3954
- ]),
3955
- _: 1
3956
- })
3957
- ]),
3958
- _: 1
3959
- }, 8, ["modelValue"]),
3960
- u("div", vs, [
3961
- A(g, { label: "Stock take file" })
3962
- ]),
3963
- A(Me, {
3964
- onFileUpload: r[1] || (r[1] = (j) => {
3965
- j && (m.value = j);
3966
- }),
3967
- accept: ".xlsx, .xls, .csv"
3968
- }, se({ _: 2 }, [
3969
- m.value ? {
3970
- name: "default",
3971
- fn: L(({ openFileDialog: j }) => [
3972
- u("div", ys, [
3973
- u("div", gs, [
3974
- u("div", As, [
3975
- u("div", bs, M(m.value.name), 1),
3976
- A(D, {
3977
- label: w(s)("inventory.ingredient.import.replaceFile"),
3978
- variant: "secondary",
3979
- "prepend-icon": "autorenew",
3980
- onClick: j
3981
- }, null, 8, ["label", "onClick"])
3982
- ])
3983
- ])
3984
- ])
3985
- ]),
3986
- key: "0"
3987
- } : void 0
3988
- ]), 1024),
3989
- A(R, {
3990
- modelValue: c.value,
3991
- "onUpdate:modelValue": r[2] || (r[2] = (j) => c.value = j),
3992
- label: "Retrieve cost from",
3993
- class: "my-5"
3994
- }, {
3995
- default: L(() => [
3996
- (x(!0), _(Y, null, W(o.value, (j) => (x(), H(X, {
3997
- key: j.value,
3998
- value: j.value,
3999
- label: j.label,
4000
- sublabel: j.subLabel,
4001
- disabled: j.disabled
4002
- }, {
4003
- label: L(() => [
4004
- u("div", hs, [
4005
- u("span", xs, M(j.label), 1),
4006
- u("span", Is, M(j.disabled ? j.disabledReason : j.subLabel), 1)
4007
- ])
4008
- ]),
4009
- _: 2
4010
- }, 1032, ["value", "label", "sublabel", "disabled"]))), 128))
4011
- ]),
4012
- _: 1
4013
- }, 8, ["modelValue"]),
4014
- u("div", Ss, [
4015
- A(D, {
4016
- class: "ml-auto mt-4",
4017
- variant: "secondary",
4018
- "prepend-icon": "troubleshoot",
4019
- label: "Verify",
4020
- disabled: !m.value && !B.value,
4021
- loading: B.value,
4022
- onClick: v
4023
- }, null, 8, ["disabled", "loading"])
4024
- ]),
4025
- m.value && p.value.length > 0 ? (x(), _(Y, { key: 0 }, [
4026
- r[4] || (r[4] = u("h2", { class: "fm-typo-en-title-md-800 mt-8 mb-4" }, "Results", -1)),
4027
- A(O, {
4028
- modelValue: f.value,
4029
- "onUpdate:modelValue": r[3] || (r[3] = (j) => f.value = j),
4030
- "row-data": p.value,
4031
- "column-defs": I,
4032
- "shrink-at": !1,
4033
- "search-value": i.value
4034
- }, null, 8, ["modelValue", "row-data", "search-value"])
4035
- ], 64)) : U("", !0),
4036
- e.value.length > 0 ? (x(), _(Y, { key: 1 }, [
4037
- r[5] || (r[5] = u("h2", { class: "fm-typo-en-title-md-800 mt-8 mb-4 text-red-600" }, "Errors", -1)),
4038
- A(O, {
4039
- "row-data": e.value,
4040
- "column-defs": E
4041
- }, null, 8, ["row-data"])
4042
- ], 64)) : U("", !0),
4043
- u("div", ws, [
4044
- p.value.length > 0 && !w(b).state.closingDocumentId ? (x(), H(D, {
4045
- key: 0,
4046
- class: "ml-auto mt-4",
4047
- "prepend-icon": "file_upload",
4048
- variant: "primary",
4049
- label: "Import Opening Balance",
4050
- disabled: !m.value || B.value,
4051
- onClick: a
4052
- }, null, 8, ["disabled"])) : U("", !0)
4053
- ])
4054
- ]))
4055
- ]);
4056
- };
4057
- }
4058
- }), Cs = { class: "flex flex-col gap-8 w-full" }, Bs = { class: "flex gap-4 justify-between" }, Es = { class: "inline-flex rounded-md items-center gap-4 justify-center h-[30px] px-8 py-4 bg-fm-color-neutral-gray-100 text-fm-color-neutral-gray-400" }, Vs = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, _s = { key: 0 }, Ls = {
4059
- key: 1,
4060
- class: "flex flex-col gap-8 w-full"
4061
- }, Ns = { class: "flex gap-8 items-center justify-start" }, Ts = /* @__PURE__ */ Q({
4062
- __name: "SynergySideSheet",
4063
- props: {
4064
- show: { type: Boolean },
4065
- loading: { type: Boolean }
4066
- },
4067
- emits: ["update:show"],
4068
- setup(V, { emit: b }) {
4069
- var f;
4070
- const n = le(), t = re(V, "show"), { t: o } = $(), c = b, s = ne(), m = ((f = s._currentLocation) == null ? void 0 : f.type) || "";
4071
- return (i, e) => {
4072
- var B;
4073
- const p = F("FmIcon"), I = F("FmButton"), E = F("FmSideSheet");
4074
- return x(), H(E, {
4075
- modelValue: w(t),
4076
- "onUpdate:modelValue": e[1] || (e[1] = (v) => ie(t) ? t.value = v : null),
4077
- header: "Data migration (Synergy)",
4078
- "dismiss-away": "",
4079
- "close-button": "",
4080
- "max-width": 800
4081
- }, se({
4082
- default: L(() => {
4083
- var v;
4084
- return [
4085
- (v = w(n).sessionUser.value) != null && v.role.isAdmin ? (x(), _("div", Ls, [
4086
- A(Fs)
4087
- ])) : (x(), _("div", _s, " Please contact your administrator to apply the changes. "))
4088
- ];
4089
- }),
4090
- "side-sheet-footer": L(() => [
4091
- u("div", Ns, [
4092
- A(I, {
4093
- variant: "tertiary",
4094
- label: w(o)("common.close"),
4095
- onClick: e[0] || (e[0] = (v) => c("update:show", !1))
4096
- }, null, 8, ["label"])
4097
- ])
4098
- ]),
4099
- _: 2
4100
- }, [
4101
- (B = w(n).sessionUser.value) != null && B.role.isAdmin ? {
4102
- name: "side-sheet-header",
4103
- fn: L(() => {
4104
- var v;
4105
- return [
4106
- u("div", Cs, [
4107
- u("div", Bs, [
4108
- e[2] || (e[2] = u("div", { class: "fm-typo-en-title-md-600" }, "Data migration (Synergy)", -1)),
4109
- u("div", Es, [
4110
- A(p, {
4111
- name: w(m),
4112
- size: "sm"
4113
- }, null, 8, ["name"]),
4114
- u("div", Vs, M((v = w(s)._currentLocation) == null ? void 0 : v.name), 1)
4115
- ])
4116
- ])
4117
- ])
4118
- ];
4119
- }),
4120
- key: "0"
4121
- } : void 0
4122
- ]), 1032, ["modelValue"]);
4123
- };
4124
- }
4125
- }), Rs = /* @__PURE__ */ Q({
4126
- __name: "SynergyView",
4127
- setup(V) {
4128
- const b = De(), n = ne(), d = N(!1);
4129
- async function t() {
4130
- d.value = !0, console.log("Opening Synergy migration dialog");
4131
- }
4132
- return (o, c) => {
4133
- const s = F("FmCardSection"), m = F("FmCard");
4134
- return w(b).enabledSynergyOpeningMigration && !w(n).businessLevel ? (x(), _(Y, { key: 0 }, [
4135
- A(m, {
4136
- class: K({
4137
- "w-full": !0,
4138
- border: !0,
4139
- "border-fm-color-neutral-gray-100": !0,
4140
- "cursor-pointer": !0,
4141
- "hover:border-fm-color-primary": !0
4142
- }),
4143
- onClick: c[0] || (c[0] = (f) => t())
4144
- }, {
4145
- default: L(() => [
4146
- A(s, null, {
4147
- default: L(() => c[2] || (c[2] = [
4148
- u("div", { class: "flex justify-center" }, [
4149
- u("div", { class: "size-[100px] bg-gray-200 rounded-lg flex items-center justify-center" }, [
4150
- u("span", { class: "text-lg font-bold text-gray-600" }, "Synergy")
4151
- ])
4152
- ], -1),
4153
- u("div", { class: "flex flex-col items-center gap-2" }, [
4154
- u("div", { class: "text-lg font-bold" }, "Synergy"),
4155
- u("div", { class: "text-fm-color-neutral-gray-300" }, "Data migration from Synergy")
4156
- ], -1)
4157
- ])),
4158
- _: 1
4159
- })
4160
- ]),
4161
- _: 1
4162
- }),
4163
- (x(), H(fe, { to: "body" }, [
4164
- A(Ts, {
4165
- show: d.value,
4166
- "onUpdate:show": c[1] || (c[1] = (f) => d.value = f)
4167
- }, null, 8, ["show"])
4168
- ]))
4169
- ], 64)) : U("", !0);
4170
- };
4171
- }
4172
- }), Ds = { key: 0 }, Ms = {
4173
- key: 1,
4174
- class: "flex flex-col items-center my-10 gap-5"
4175
- }, Os = ["src"], zs = {
4176
- class: "text-xs text-neutral-400 text-center",
4177
- style: { "max-width": "25rem" }
4178
- }, js = {
4179
- key: 2,
4180
- class: "grid grid-cols-2 gap-5"
4181
- }, la = /* @__PURE__ */ Q({
4182
- __name: "IntegrationView",
4183
- setup(V) {
4184
- const b = ne(), n = N(!1), d = st(), { breakpoints: t } = Ve(), o = z(() => t.value.xs || t.value.sm), { t: c } = $();
4185
- return ce(async () => {
4186
- if (b._currentLocation) {
4187
- n.value = !0;
4188
- try {
4189
- await d.fetchFoodMarketHubSetting(), await d.fetchNetSuiteSetting();
4190
- } finally {
4191
- n.value = !1;
4192
- }
4193
- }
4194
- }), (s, m) => {
4195
- const f = F("FmCircularProgress");
4196
- return x(), H($e, {
4197
- title: w(c)("inventory.integration.title")
4198
- }, {
4199
- default: L(() => [
4200
- u("div", {
4201
- class: K([
4202
- "flex flex-col gap-8 max-h-full",
4203
- {
4204
- "p-0": o.value,
4205
- "px-24 ": !o.value
4206
- }
4207
- ])
4208
- }, [
4209
- A(et, {
4210
- "change-location": "",
4211
- showBusiness: ""
4212
- }),
4213
- !w(b)._currentLocation || n.value ? (x(), _("div", Ds, [
4214
- A(f, { size: "lg" })
4215
- ])) : w(d).enabledIntegrations == 0 ? (x(), _("div", Ms, [
4216
- u("div", null, [
4217
- u("img", {
4218
- src: w(Ke),
4219
- alt: "List is empty"
4220
- }, null, 8, Os)
4221
- ]),
4222
- m[0] || (m[0] = u("div", { class: "font-bold text-lg" }, "Integration", -1)),
4223
- u("div", zs, M(w(c)("inventory.integration.description")), 1)
4224
- ])) : (x(), _("div", js, [
4225
- A(Eo),
4226
- A(sn),
4227
- A(rs),
4228
- A(Rs)
4229
- ]))
4230
- ], 2)
4231
- ]),
4232
- _: 1
4233
- }, 8, ["title"]);
4234
- };
4235
- }
4236
- });
4237
- export {
4238
- la as default
4239
- };