@feedmepos/mf-inventory-portal 1.2.36 → 1.2.37-dev.2
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.
- package/dist/{App-CoRV0uPu.js → App-BNC_VGLY.js} +3 -3
- package/dist/{ApprovalView-D1RJwuTs.js → ApprovalView-C3-qwfBy.js} +5 -5
- package/dist/{BindingsDialog-DIjYRaBX.js → BindingsDialog-DJYcwvLj.js} +2 -2
- package/dist/{BindingsPicker-DWzm6wUk.js → BindingsPicker-BfjaThga.js} +2 -2
- package/dist/{BindingsTable-Cgt_1URn.js → BindingsTable-CxsJ7J29.js} +3 -3
- package/dist/{ClosingDraftView-BtmTem1i.js → ClosingDraftView-lWH-HNt8.js} +8 -8
- package/dist/ClosingHistoryView-tDq0ShBo.js +391 -0
- package/dist/{ClosingTemplateView-DldPeva3.js → ClosingTemplateView-VDIoPSGE.js} +14 -14
- package/dist/{DeliveryOrderPrintPreview-CN1ISr0X.js → DeliveryOrderPrintPreview-BB57thjw.js} +9 -9
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-ClqAKJw7.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BFJquom_.js} +17 -17
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-C4h5BXYx.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-D6nFHej1.js} +2 -2
- package/dist/{FmMultiselectDialog-C7l2zdfp.js → FmMultiselectDialog-ByhflquX.js} +2 -2
- package/dist/{FmMultiselectDialog-Dm6KX3jk.js → FmMultiselectDialog-pbQjC6ox.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-C7SxuBsK.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BVkl9ATd.js} +3 -3
- package/dist/{ImportView-DoeGZffY.js → ImportView-BESMNYR1.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CiK769eN.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-6nCLOWwx.js} +1 -1
- package/dist/{IngredientGroupView-CAGoKjAQ.js → IngredientGroupView-JdgXfEsA.js} +5 -5
- package/dist/{IngredientsView-CqiVcl6C.js → IngredientsView-Btcmhy3H.js} +14 -14
- package/dist/IntegrationView-CxHNZ7E3.js +4488 -0
- package/dist/{InventoryBindingForm-ABaQrODH.js → InventoryBindingForm-CpLif5mq.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CCkqGDgP.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-B2AQxOn1.js} +4 -4
- package/dist/{InventoryBindingSummary-NKnKZi6q.js → InventoryBindingSummary-DGBAel1C.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CgYH09wF.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-oQlPxFAX.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CB1g11Ll.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DuWFQ6Q0.js} +2 -2
- package/dist/{PublishView-DksyQG3l.js → PublishView-C-UiGWym.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-03pZKACn.js → PurchaseOrderPrintPreview-mO_oxnft.js} +10 -10
- package/dist/{ReceiveRequestView-BeQfTd9r.js → ReceiveRequestView-Cr6Xrv4Q.js} +19 -19
- package/dist/{RecipeView-ifhPuBGA.js → RecipeView-Bk9O5UiN.js} +8 -8
- package/dist/{StockView-DedXRTWx.js → StockView-C2op154q.js} +15 -15
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-ChlgF_bk.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CntpgdYL.js} +1 -1
- package/dist/{SupplierView-CrfsfuOf.js → SupplierView-2qjnAlnU.js} +11 -11
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-Csi6RdZv.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-DqdgsUES.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BAkZOh6P.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CbSWd397.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-Drtj7Kd3.js → TransferDetails.vue_vue_type_script_setup_true_lang-U5KJ5_b2.js} +14 -14
- package/dist/{TransferTemplateView-BhdAu8px.js → TransferTemplateView-Dw4Ukcce.js} +15 -15
- package/dist/{UnitView-BiSvzbL6.js → UnitView-H4Sgdzg5.js} +6 -6
- package/dist/{WarehouseView-Dhi2uxnP.js → WarehouseView-DzR1A-Cr.js} +5 -5
- package/dist/{WastageTemplateView-DkvpRveY.js → WastageTemplateView-Sb2KtrF3.js} +14 -14
- package/dist/api/closing.d.ts +1 -0
- package/dist/api/netsuite.d.ts +96 -3
- package/dist/{app-Bwm5cx2b.js → app-Cnok7m8q.js} +3735 -3731
- package/dist/app.js +1 -1
- package/dist/{closing-template-kl2L1-wG.js → closing-template-u2ACSj7R.js} +1 -1
- package/dist/{date2-BkJijdu3.js → date2-DtnfdJTF.js} +1 -1
- package/dist/{dayjs.min-CHim5Kj5.js → dayjs.min-DcraCntx.js} +1 -1
- package/dist/{decimal-D6edjUO7.js → decimal-CIJMix9a.js} +2 -2
- package/dist/{defineDeepModel-Be2-pkT1.js → defineDeepModel-LcFLGZe5.js} +1 -1
- package/dist/{duplicate-template-DmG9P6zh.js → duplicate-template-Btr1_Yzf.js} +1 -1
- package/dist/{feature-BVjxI6j1.js → feature-DSy7PE3I.js} +2 -2
- package/dist/{format-time-from-id-F6jt6fTo.js → format-time-from-id-Dh_SXggJ.js} +1 -1
- package/dist/{format-unit-display-BPfoIQ5l.js → format-unit-display-BZ9AAp4V.js} +10 -10
- package/dist/{import-export.helper-CH-D34oH.js → import-export.helper-C3aWPNyJ.js} +5 -5
- package/dist/{index-DRQQwiwn.js → index-BTM5svgh.js} +1 -1
- package/dist/{index-Bgc84muo.js → index-DbWKRddg.js} +3 -3
- package/dist/{index-eJWoHNdw.js → index-eN7NxI-_.js} +1 -1
- package/dist/{lodash-C24hnHyT.js → lodash-DUlA5LSE.js} +1 -1
- package/dist/{netsuite-BhH6M8jR.js → netsuite-ekrD_FS6.js} +961 -928
- package/dist/{purchase-order-template-1sBeg568.js → purchase-order-template-C4S6XRoE.js} +1 -1
- package/dist/{rules-CCd7mYLv.js → rules-Buw1aczb.js} +3 -3
- package/dist/{stock-BWS0ZS6g.js → stock-CLvc2DUC.js} +3 -3
- package/dist/{stock-rD5kj1QP.js → stock-DqZP0ldB.js} +1 -1
- package/dist/stores/integration/netsuite.d.ts +13 -0
- package/dist/{supplier-BbyOdDkm.js → supplier-BA4riI7a.js} +2 -2
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-B5qh-1pZ.js → use-ingredient-select-dialog-BFI0Mdnw.js} +2 -2
- package/dist/{use-inventory-binding-dialog-Dvhw3xKV.js → use-inventory-binding-dialog-BIqgx607.js} +2 -2
- package/dist/{use-template-enabled-locations-2-CXYSdKKV.js → use-template-enabled-locations-2-CyBo9a3I.js} +2 -2
- package/dist/views/integration/components/netsuite/business/AddVendorDialog.vue.d.ts +743 -0
- package/dist/views/integration/components/netsuite/business/NetSuiteVendorField.vue.d.ts +73 -0
- package/dist/{vue-i18n-CKCDKj-z.js → vue-i18n-C62Txccp.js} +341 -341
- package/dist/{xlsx-CHsCI3Ao.js → xlsx-Cmu71X0Z.js} +1 -1
- package/dist/{xlsx.util-BgpaGhEM.js → xlsx.util-DI9MSTQE.js} +1 -1
- package/package.json +3 -3
- package/dist/ClosingHistoryView-Ao3Hm8IY.js +0 -367
- package/dist/IntegrationView-DBoAg8xQ.js +0 -4069
|
@@ -1,4069 +0,0 @@
|
|
|
1
|
-
import { defineComponent as P, mergeModels as Xe, useModel as we, onMounted as ue, ref as N, computed as O, resolveComponent as F, openBlock as x, createElementBlock as _, createElementVNode as r, toDisplayString as D, unref as k, createVNode as b, createBlock as U, withCtx as L, Fragment as Q, renderList as ee, normalizeClass as K, normalizeStyle as Pe, createSlots as oe, createCommentVNode as z, withModifiers as Qe, reactive as ke, watch as Be, isRef as le, Teleport as fe, h as w, createTextVNode as J, watchEffect as Ye } from "vue";
|
|
2
|
-
import { E as Je } from "./empty-placeholder-wf6-BWE8.js";
|
|
3
|
-
import { w as Ke, x as qe, c as se, u as te, y as Ze, a as ce, N as ye, z as Ae, s as $, A as Fe, B as Ce, t as me } from "./app-Bwm5cx2b.js";
|
|
4
|
-
import { useDialogChild as Ge, useDialog as de, useProxiedModel as ie, useSnackbar as W, useBreakpoints as Ee, components as q } from "@feedmepos/ui-library";
|
|
5
|
-
import { F as Ve, _ as We } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
|
|
6
|
-
import { useI18n as G, useCoreStore as ae } from "@feedmepos/mf-common";
|
|
7
|
-
import { _ as $e } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-C4h5BXYx.js";
|
|
8
|
-
import { u as et, a as tt, b as nt, c as ot } from "./index-Bgc84muo.js";
|
|
9
|
-
import { u as ne, a as pe } from "./netsuite-BhH6M8jR.js";
|
|
10
|
-
import { b as st, a as at } from "./FmMultiselectDialog-C7l2zdfp.js";
|
|
11
|
-
import { R as lt, a as it } from "./rules-CCd7mYLv.js";
|
|
12
|
-
import { N as _e, H as Le, b as Ne } from "./app-uBuHtW8m.js";
|
|
13
|
-
import { u as rt } from "./supplier-BbyOdDkm.js";
|
|
14
|
-
import { u as ve } from "./vue-i18n-CKCDKj-z.js";
|
|
15
|
-
import { _ as ut, a as ct } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-C7SxuBsK.js";
|
|
16
|
-
import { a as be, f as Te } from "./date2-BkJijdu3.js";
|
|
17
|
-
import { u as Me } from "./feature-BVjxI6j1.js";
|
|
18
|
-
import { F as De } from "./FmDroppableField-J0xUsOTV.js";
|
|
19
|
-
import { r as Re, u as Oe } from "./xlsx-CHsCI3Ao.js";
|
|
20
|
-
const dt = "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, y) {
|
|
23
|
-
(function() {
|
|
24
|
-
var n = {};
|
|
25
|
-
V.exports = n, n.simpleFilter = function(u, t) {
|
|
26
|
-
return t.filter(function(o) {
|
|
27
|
-
return n.test(u, o);
|
|
28
|
-
});
|
|
29
|
-
}, n.test = function(u, t) {
|
|
30
|
-
return n.match(u, t) !== null;
|
|
31
|
-
}, n.match = function(u, t, o) {
|
|
32
|
-
o = o || {};
|
|
33
|
-
var l = 0, f = [], m = t.length, i = 0, s = 0, e = o.pre || "", c = o.post || "", h = o.caseSensitive && t || t.toLowerCase(), E;
|
|
34
|
-
u = o.caseSensitive && u || u.toLowerCase();
|
|
35
|
-
for (var C = 0; C < m; C++)
|
|
36
|
-
E = t[C], h[C] === u[l] ? (E = e + E + c, l += 1, s += 1 + s) : s = 0, i += s, f[f.length] = E;
|
|
37
|
-
return l === u.length ? (i = h === u ? 1 / 0 : i, { rendered: f.join(""), score: i }) : null;
|
|
38
|
-
}, n.filter = function(u, t, o) {
|
|
39
|
-
return !t || t.length === 0 ? [] : typeof u != "string" ? t : (o = o || {}, t.reduce(function(l, f, m, i) {
|
|
40
|
-
var s = f;
|
|
41
|
-
o.extract && (s = o.extract(f));
|
|
42
|
-
var e = n.match(u, s, o);
|
|
43
|
-
return e != null && (l[l.length] = {
|
|
44
|
-
string: e.rendered,
|
|
45
|
-
score: e.score,
|
|
46
|
-
index: m,
|
|
47
|
-
original: f
|
|
48
|
-
}), l;
|
|
49
|
-
}, []).sort(function(l, f) {
|
|
50
|
-
var m = f.score - l.score;
|
|
51
|
-
return m || l.index - f.index;
|
|
52
|
-
}));
|
|
53
|
-
};
|
|
54
|
-
})();
|
|
55
|
-
})(je);
|
|
56
|
-
var mt = je.exports;
|
|
57
|
-
const ze = /* @__PURE__ */ Ke(mt);
|
|
58
|
-
function xe(V, y) {
|
|
59
|
-
return ze.filter(V, y).length > 0;
|
|
60
|
-
}
|
|
61
|
-
function ft(V, y) {
|
|
62
|
-
if (!V)
|
|
63
|
-
return {
|
|
64
|
-
label: y,
|
|
65
|
-
segments: [
|
|
66
|
-
{
|
|
67
|
-
isMatch: !1,
|
|
68
|
-
segment: y
|
|
69
|
-
}
|
|
70
|
-
],
|
|
71
|
-
matched: !1
|
|
72
|
-
};
|
|
73
|
-
const [n] = ze.filter(V.toLocaleLowerCase(), [y], {
|
|
74
|
-
pre: "|",
|
|
75
|
-
post: "|"
|
|
76
|
-
});
|
|
77
|
-
if (!n)
|
|
78
|
-
return {
|
|
79
|
-
label: y,
|
|
80
|
-
segments: [{ segment: y, isMatch: !1 }],
|
|
81
|
-
matched: !1
|
|
82
|
-
};
|
|
83
|
-
const u = n.string.toString().replace(/\|\|/g, "").split("|").reduce((t, o, l) => (t.push({
|
|
84
|
-
segment: o,
|
|
85
|
-
isMatch: l % 2 !== 0
|
|
86
|
-
//e.g. index 1, 3, 5, ...
|
|
87
|
-
}), t), new Array());
|
|
88
|
-
return {
|
|
89
|
-
label: y,
|
|
90
|
-
segments: u,
|
|
91
|
-
matched: !0
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
function Z(V) {
|
|
95
|
-
return Object.prototype.hasOwnProperty.call(V, "children");
|
|
96
|
-
}
|
|
97
|
-
const pt = { class: "flex flex-col gap-12 h-[350px]" }, vt = { class: "flex items-center" }, yt = {
|
|
98
|
-
class: "flex-1",
|
|
99
|
-
"data-cy": "items-selected"
|
|
100
|
-
}, gt = {
|
|
101
|
-
class: "flex-1",
|
|
102
|
-
"data-cy": "filter-field"
|
|
103
|
-
}, At = ["data-cy"], bt = { class: "flex flex-col" }, ht = { class: "fm-typo-en-body-md-400" }, xt = {
|
|
104
|
-
key: 1,
|
|
105
|
-
class: "w-full py-16 text-fm-color-typo-disabled fm-typo-en-body-md-400 text-center"
|
|
106
|
-
}, Ue = /* @__PURE__ */ P({
|
|
107
|
-
__name: "FmNestedMultiselectDialog",
|
|
108
|
-
props: /* @__PURE__ */ Xe({
|
|
109
|
-
modelValue: {}
|
|
110
|
-
}, {
|
|
111
|
-
modelValue: {},
|
|
112
|
-
modelModifiers: {}
|
|
113
|
-
}),
|
|
114
|
-
emits: ["update:modelValue"],
|
|
115
|
-
setup(V) {
|
|
116
|
-
const y = we(V, "modelValue"), n = Ge();
|
|
117
|
-
ue(() => {
|
|
118
|
-
n.emitData(y.value);
|
|
119
|
-
});
|
|
120
|
-
const u = N(""), { t } = G();
|
|
121
|
-
function o(d) {
|
|
122
|
-
return xe(
|
|
123
|
-
u.value,
|
|
124
|
-
d.sublabel ? [d.label, d.sublabel] : [d.label]
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
function l(d) {
|
|
128
|
-
return o(d) ? !0 : Z(d) ? d.children.some(l) : !1;
|
|
129
|
-
}
|
|
130
|
-
function f(d, v) {
|
|
131
|
-
if (!u.value)
|
|
132
|
-
return !0;
|
|
133
|
-
const [S, ...T] = d;
|
|
134
|
-
if (typeof S != "number")
|
|
135
|
-
return !1;
|
|
136
|
-
const M = v[S];
|
|
137
|
-
return xe(
|
|
138
|
-
u.value,
|
|
139
|
-
M.sublabel ? [M.label, M.sublabel] : [M.label]
|
|
140
|
-
) ? !0 : T.length === 0 ? l(M) : Z(M) ? f(T, M.children) : !1;
|
|
141
|
-
}
|
|
142
|
-
function m(d, v, S = 0, T = !1) {
|
|
143
|
-
if (Z(d) && d.children.length) {
|
|
144
|
-
const { children: M, ...H } = d, X = M.flatMap(
|
|
145
|
-
(R, j) => m(R, [...v, j], S + 1, T || d.disabled)
|
|
146
|
-
);
|
|
147
|
-
return [
|
|
148
|
-
{
|
|
149
|
-
...H,
|
|
150
|
-
keys: v,
|
|
151
|
-
indent: S,
|
|
152
|
-
collapsible: !0,
|
|
153
|
-
disabled: T || d.disabled
|
|
154
|
-
},
|
|
155
|
-
...X
|
|
156
|
-
];
|
|
157
|
-
}
|
|
158
|
-
return [
|
|
159
|
-
{
|
|
160
|
-
...d,
|
|
161
|
-
keys: v,
|
|
162
|
-
indent: S,
|
|
163
|
-
collapsible: !1,
|
|
164
|
-
disabled: T || d.disabled
|
|
165
|
-
}
|
|
166
|
-
];
|
|
167
|
-
}
|
|
168
|
-
const i = O(() => y.value.flatMap(
|
|
169
|
-
(d, v) => m(d, [v]).filter((S) => f(S.keys, y.value))
|
|
170
|
-
));
|
|
171
|
-
function s(d) {
|
|
172
|
-
if (Z(d)) {
|
|
173
|
-
if (l(d)) {
|
|
174
|
-
const v = o(d) ? d.children : d.children.filter(l);
|
|
175
|
-
return v.length === 0 ? !1 : v.every(s);
|
|
176
|
-
}
|
|
177
|
-
return d.children.every(s);
|
|
178
|
-
}
|
|
179
|
-
return d.active ?? !1;
|
|
180
|
-
}
|
|
181
|
-
function e(d, v) {
|
|
182
|
-
const [S, ...T] = d;
|
|
183
|
-
if (typeof S != "number")
|
|
184
|
-
return !1;
|
|
185
|
-
const M = v[S];
|
|
186
|
-
return T.length === 0 ? s(M ?? []) : Z(M) ? e(T, M.children ?? []) : !1;
|
|
187
|
-
}
|
|
188
|
-
function c(d) {
|
|
189
|
-
if (Z(d)) {
|
|
190
|
-
if (l(d)) {
|
|
191
|
-
const v = o(d) ? d.children : d.children.filter(l);
|
|
192
|
-
return v.length === 0 ? !1 : v.some(s) && !v.every(s);
|
|
193
|
-
}
|
|
194
|
-
return !1;
|
|
195
|
-
}
|
|
196
|
-
return !1;
|
|
197
|
-
}
|
|
198
|
-
function h(d, v) {
|
|
199
|
-
const [S, ...T] = d;
|
|
200
|
-
if (typeof S != "number")
|
|
201
|
-
return !1;
|
|
202
|
-
const M = v[S];
|
|
203
|
-
return T.length === 0 ? c(M ?? []) : Z(M) ? h(T, (M == null ? void 0 : M.children) ?? []) : !1;
|
|
204
|
-
}
|
|
205
|
-
function E(d, v) {
|
|
206
|
-
if (d.disabled)
|
|
207
|
-
return d;
|
|
208
|
-
if (Z(d)) {
|
|
209
|
-
if (l(d)) {
|
|
210
|
-
const S = o(d) ? d.children : d.children.filter(l);
|
|
211
|
-
return {
|
|
212
|
-
...d,
|
|
213
|
-
children: d.children.map((T) => S.find((H) => qe(H.value, T.value)) ? E(T, v) : T)
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
return {
|
|
217
|
-
...d,
|
|
218
|
-
children: d.children.map((S) => E(S, v))
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
return {
|
|
222
|
-
...d,
|
|
223
|
-
active: v
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
function C(d, v, S) {
|
|
227
|
-
const [T, ...M] = d;
|
|
228
|
-
return typeof T != "number" ? v : M.length === 0 ? v.map((H, X) => T !== X ? H : E(H, S)) : v.map(
|
|
229
|
-
(H, X) => T === X && Z(H) ? {
|
|
230
|
-
...H,
|
|
231
|
-
children: C(M, H.children, S)
|
|
232
|
-
} : H
|
|
233
|
-
);
|
|
234
|
-
}
|
|
235
|
-
const p = N(new Array());
|
|
236
|
-
function a(d) {
|
|
237
|
-
const v = d.join();
|
|
238
|
-
return p.value.find((S) => v === S);
|
|
239
|
-
}
|
|
240
|
-
function g(d) {
|
|
241
|
-
const v = d.join();
|
|
242
|
-
a(d) ? p.value = p.value.filter((S) => S !== v) : p.value = [...p.value, v];
|
|
243
|
-
}
|
|
244
|
-
function B(d) {
|
|
245
|
-
const v = d.join();
|
|
246
|
-
return p.value.find((S) => v.startsWith(S) && v !== S);
|
|
247
|
-
}
|
|
248
|
-
const I = O(
|
|
249
|
-
() => i.value.filter((d) => f(d.keys, y.value) && d.active).length
|
|
250
|
-
);
|
|
251
|
-
function A(d, v, S) {
|
|
252
|
-
y.value = C(d, v, S), n.emitData(y.value);
|
|
253
|
-
}
|
|
254
|
-
return (d, v) => {
|
|
255
|
-
const S = F("FmSearch"), T = F("FmCheckbox"), M = F("FmButton"), H = F("FmListItem"), X = F("FmList");
|
|
256
|
-
return x(), _("div", pt, [
|
|
257
|
-
r("div", vt, [
|
|
258
|
-
r("div", yt, D(k(t)("inventory.formField.itemsSelected", { count: I.value })), 1),
|
|
259
|
-
r("div", gt, [
|
|
260
|
-
b(S, {
|
|
261
|
-
modelValue: u.value,
|
|
262
|
-
"onUpdate:modelValue": v[0] || (v[0] = (R) => u.value = R),
|
|
263
|
-
placeholder: k(t)("inventory.formField.filterItems")
|
|
264
|
-
}, null, 8, ["modelValue", "placeholder"])
|
|
265
|
-
])
|
|
266
|
-
]),
|
|
267
|
-
i.value.length ? (x(), U(X, {
|
|
268
|
-
key: 0,
|
|
269
|
-
class: "flex-1 overflow-y-auto"
|
|
270
|
-
}, {
|
|
271
|
-
default: L(() => [
|
|
272
|
-
(x(!0), _(Q, null, ee(i.value, (R) => (x(), _("div", {
|
|
273
|
-
key: R.keys.join(),
|
|
274
|
-
class: K([
|
|
275
|
-
"transition-all overflow-y-clip",
|
|
276
|
-
B(R.keys) ? "max-h-0 opacity-0" : "max-h-[50px] opacity-100"
|
|
277
|
-
]),
|
|
278
|
-
"data-cy": `nested-${R.keys.join("-")}-${R.label}`
|
|
279
|
-
}, [
|
|
280
|
-
b(H, {
|
|
281
|
-
clickable: R.selectable !== !1,
|
|
282
|
-
onClick: () => R.selectable === !1 || R.disabled || A(R.keys, y.value, !e(R.keys, y.value)),
|
|
283
|
-
style: Pe({
|
|
284
|
-
paddingLeft: `${16 + R.indent * 16}px`,
|
|
285
|
-
paddingTop: "4px",
|
|
286
|
-
paddingBottom: "4px"
|
|
287
|
-
}),
|
|
288
|
-
disabled: R.selectable !== !1 && R.disabled
|
|
289
|
-
}, oe({
|
|
290
|
-
default: L(() => [
|
|
291
|
-
r("div", bt, [
|
|
292
|
-
r("div", ht, [
|
|
293
|
-
(x(!0), _(Q, null, ee(k(ft)(u.value, R.label).segments, (j, re) => (x(), _("span", {
|
|
294
|
-
key: re,
|
|
295
|
-
class: K({
|
|
296
|
-
"font-bold": j.isMatch
|
|
297
|
-
})
|
|
298
|
-
}, D(j.segment), 3))), 128))
|
|
299
|
-
]),
|
|
300
|
-
R.sublabel ? (x(), _("div", {
|
|
301
|
-
key: 0,
|
|
302
|
-
class: K([
|
|
303
|
-
"fm-typo-en-body-sm-400",
|
|
304
|
-
R.disabled ? "" : "text-fm-color-typo-secondary"
|
|
305
|
-
])
|
|
306
|
-
}, D(R.sublabel), 3)) : z("", !0)
|
|
307
|
-
])
|
|
308
|
-
]),
|
|
309
|
-
_: 2
|
|
310
|
-
}, [
|
|
311
|
-
R.selectable !== !1 ? {
|
|
312
|
-
name: "prepend",
|
|
313
|
-
fn: L(() => [
|
|
314
|
-
b(T, {
|
|
315
|
-
disabled: R.disabled,
|
|
316
|
-
"model-value": e(R.keys, y.value),
|
|
317
|
-
value: R.keys,
|
|
318
|
-
indeterminate: h(R.keys, y.value)
|
|
319
|
-
}, null, 8, ["disabled", "model-value", "value", "indeterminate"])
|
|
320
|
-
]),
|
|
321
|
-
key: "0"
|
|
322
|
-
} : void 0,
|
|
323
|
-
R.collapsible ? {
|
|
324
|
-
name: "append",
|
|
325
|
-
fn: L(() => [
|
|
326
|
-
b(M, {
|
|
327
|
-
"prepend-icon": a(R.keys) ? "expand_less" : "expand_more",
|
|
328
|
-
size: "md",
|
|
329
|
-
variant: "tertiary",
|
|
330
|
-
onClick: Qe(() => g(R.keys), ["stop"])
|
|
331
|
-
}, null, 8, ["prepend-icon", "onClick"])
|
|
332
|
-
]),
|
|
333
|
-
key: "1"
|
|
334
|
-
} : void 0
|
|
335
|
-
]), 1032, ["clickable", "onClick", "style", "disabled"])
|
|
336
|
-
], 10, At))), 128))
|
|
337
|
-
]),
|
|
338
|
-
_: 1
|
|
339
|
-
})) : (x(), _("div", xt, D(k(t)("inventory.formField.noItemsFound")), 1))
|
|
340
|
-
]);
|
|
341
|
-
};
|
|
342
|
-
}
|
|
343
|
-
}), It = { class: "flex flex-col rounded border border-fm-color-neutral-gray-100 px-5 py-5 gap-5" }, St = { class: "flex items-center" }, wt = { class: "text-lg font-bold flex-grow" }, kt = {
|
|
344
|
-
key: 0,
|
|
345
|
-
class: "table-auto w-full"
|
|
346
|
-
}, Bt = { class: "text-left" }, Ft = { class: "min-w-64" }, Ct = { class: "flex flex-col" }, Et = { class: "fm-typo-en-body-md-400" }, Vt = {
|
|
347
|
-
key: 0,
|
|
348
|
-
class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400"
|
|
349
|
-
}, _t = { class: "w-1" }, Lt = /* @__PURE__ */ P({
|
|
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: y }) {
|
|
370
|
-
const n = V, u = y, t = de(), o = O(() => {
|
|
371
|
-
const e = n.groups.flatMap((c) => c.items.map((h) => {
|
|
372
|
-
const E = n.items.find((C) => C._id === h._id);
|
|
373
|
-
return {
|
|
374
|
-
...h,
|
|
375
|
-
groupName: c.name,
|
|
376
|
-
name: h.name ?? (E == null ? void 0 : E.name) ?? "-"
|
|
377
|
-
};
|
|
378
|
-
}));
|
|
379
|
-
return n.modifiers.map((c) => {
|
|
380
|
-
const h = e.find((p) => p.selection === c.selection), E = (h == null ? void 0 : h.name) ?? "-", C = (h == null ? void 0 : h.groupName) ?? "";
|
|
381
|
-
return {
|
|
382
|
-
...c,
|
|
383
|
-
name: E,
|
|
384
|
-
groupName: C
|
|
385
|
-
};
|
|
386
|
-
});
|
|
387
|
-
}), l = O(() => n.groups.flatMap((e) => e.items.map((c) => ({ ...c, groupId: e._id }))));
|
|
388
|
-
function f({ selection: e }) {
|
|
389
|
-
u(
|
|
390
|
-
"update:modifiers",
|
|
391
|
-
n.modifiers.filter((c) => c.selection !== e)
|
|
392
|
-
);
|
|
393
|
-
}
|
|
394
|
-
function m({ selection: e }, c) {
|
|
395
|
-
const h = n.modifiers.find((E) => E.selection === e);
|
|
396
|
-
h && (h.code = c);
|
|
397
|
-
}
|
|
398
|
-
function i() {
|
|
399
|
-
let e = [];
|
|
400
|
-
n.groups.forEach((h) => {
|
|
401
|
-
let E = !1;
|
|
402
|
-
h.items.every((C) => C._id.startsWith("item")) && (E = !0), e.push({
|
|
403
|
-
label: h.name,
|
|
404
|
-
sublabel: "Group",
|
|
405
|
-
value: h._id,
|
|
406
|
-
disabled: E,
|
|
407
|
-
children: h.items.reduce((C, p) => {
|
|
408
|
-
var B;
|
|
409
|
-
const a = n.items.find((I) => I._id === p._id), g = (B = a == null ? void 0 : a.variant) == null ? void 0 : B.variantCombinations.find(
|
|
410
|
-
(I) => I.combinationKey === (p == null ? void 0 : p.combinationKey)
|
|
411
|
-
);
|
|
412
|
-
return [
|
|
413
|
-
...C,
|
|
414
|
-
{
|
|
415
|
-
label: `${p.name ?? (a == null ? void 0 : a.name)} ${g ? `(${g.name})` : ""}`,
|
|
416
|
-
value: `${p.selection}${g ? `/${g == null ? void 0 : g.combinationKey}` : ""}`,
|
|
417
|
-
disabled: E,
|
|
418
|
-
active: !!n.modifiers.find(({ selection: I }) => I === p.selection)
|
|
419
|
-
}
|
|
420
|
-
];
|
|
421
|
-
}, [])
|
|
422
|
-
});
|
|
423
|
-
});
|
|
424
|
-
const c = {
|
|
425
|
-
modelValue: e
|
|
426
|
-
};
|
|
427
|
-
t.open({
|
|
428
|
-
title: "Select Addons",
|
|
429
|
-
contentComponent: Ue,
|
|
430
|
-
contentComponentProps: c,
|
|
431
|
-
primaryActions: {
|
|
432
|
-
text: "Confirm",
|
|
433
|
-
close: !0
|
|
434
|
-
}
|
|
435
|
-
}).onPrimary((h) => {
|
|
436
|
-
const E = se(n.modifiers);
|
|
437
|
-
let C = [];
|
|
438
|
-
function p(a, g) {
|
|
439
|
-
if (g(a), Z(a))
|
|
440
|
-
for (let B of a.children)
|
|
441
|
-
p(B, g);
|
|
442
|
-
}
|
|
443
|
-
h.forEach((a) => {
|
|
444
|
-
p(a, (g) => {
|
|
445
|
-
var d;
|
|
446
|
-
if (n.groups.find(({ _id: v }) => v === g.value)) return;
|
|
447
|
-
const I = l.value.find(({ selection: v }) => v === g.value), A = C.find(({ selection: v }) => g.value === v);
|
|
448
|
-
!Z(g) && g.active && A === void 0 && C.push({
|
|
449
|
-
addonGroupId: (I == null ? void 0 : I.groupId) ?? "",
|
|
450
|
-
selection: g.value,
|
|
451
|
-
code: ((d = E.find(({ selection: v }) => g.value === v)) == null ? void 0 : d.code) ?? ""
|
|
452
|
-
});
|
|
453
|
-
});
|
|
454
|
-
}), u("update:modifiers", C);
|
|
455
|
-
});
|
|
456
|
-
}
|
|
457
|
-
const { t: s } = G();
|
|
458
|
-
return (e, c) => {
|
|
459
|
-
const h = F("FmButton"), E = F("FmTextField");
|
|
460
|
-
return x(), _("div", It, [
|
|
461
|
-
r("div", St, [
|
|
462
|
-
r("div", wt, D(k(s)("inventory.integration.apply.addons")), 1),
|
|
463
|
-
b(h, {
|
|
464
|
-
type: "button",
|
|
465
|
-
variant: "plain",
|
|
466
|
-
size: "md",
|
|
467
|
-
icon: "link",
|
|
468
|
-
label: k(s)("inventory.integration.apply.applyAddon"),
|
|
469
|
-
onClick: c[0] || (c[0] = (C) => i())
|
|
470
|
-
}, null, 8, ["label"])
|
|
471
|
-
]),
|
|
472
|
-
r("div", null, [
|
|
473
|
-
o.value.length > 0 ? (x(), _("table", kt, [
|
|
474
|
-
r("tr", Bt, [
|
|
475
|
-
r("th", Ft, D(k(s)("inventory.integration.apply.name")), 1),
|
|
476
|
-
r("th", null, D(k(s)("inventory.integration.apply.code")), 1),
|
|
477
|
-
c[1] || (c[1] = r("th", { class: "w-1" }, " ", -1))
|
|
478
|
-
]),
|
|
479
|
-
(x(!0), _(Q, null, ee(o.value, (C, p) => (x(), _(Q, { key: p }, [
|
|
480
|
-
c[2] || (c[2] = r("tr", { class: "block h-8" }, null, -1)),
|
|
481
|
-
r("tr", null, [
|
|
482
|
-
r("td", null, [
|
|
483
|
-
r("div", Ct, [
|
|
484
|
-
r("div", Et, D(C.name), 1),
|
|
485
|
-
C.groupName ? (x(), _("div", Vt, D(C.groupName), 1)) : z("", !0)
|
|
486
|
-
])
|
|
487
|
-
]),
|
|
488
|
-
r("td", null, [
|
|
489
|
-
b(E, {
|
|
490
|
-
disabled: V.loading,
|
|
491
|
-
"model-value": C.code,
|
|
492
|
-
"onUpdate:modelValue": [(a) => C.code = a, (a) => m(C, a)],
|
|
493
|
-
rules: [
|
|
494
|
-
function(g) {
|
|
495
|
-
return !!g || "Required";
|
|
496
|
-
}
|
|
497
|
-
]
|
|
498
|
-
}, null, 8, ["disabled", "model-value", "onUpdate:modelValue", "rules"])
|
|
499
|
-
]),
|
|
500
|
-
r("td", _t, [
|
|
501
|
-
b(h, {
|
|
502
|
-
disabled: V.loading,
|
|
503
|
-
type: "button",
|
|
504
|
-
variant: "tertiary",
|
|
505
|
-
icon: "delete",
|
|
506
|
-
"icon-color": "#000000",
|
|
507
|
-
size: "md",
|
|
508
|
-
onClick: (a) => f(C)
|
|
509
|
-
}, null, 8, ["disabled", "onClick"])
|
|
510
|
-
])
|
|
511
|
-
])
|
|
512
|
-
], 64))), 128))
|
|
513
|
-
])) : z("", !0)
|
|
514
|
-
])
|
|
515
|
-
]);
|
|
516
|
-
};
|
|
517
|
-
}
|
|
518
|
-
});
|
|
519
|
-
function Nt(V, y = []) {
|
|
520
|
-
const n = y.map((t) => V.find((o) => o._id === t)).filter((t) => !!t);
|
|
521
|
-
return Mt(n).reduce((t, o) => (t[o.combinationKey] = o.selectionName.join(" / "), t), {});
|
|
522
|
-
}
|
|
523
|
-
function Tt(V, y, n) {
|
|
524
|
-
const u = n.reduce((o, l) => {
|
|
525
|
-
var s, e, c;
|
|
526
|
-
const f = l.category || "", m = Nt(y, (s = l.variant) == null ? void 0 : s.variantGroupIds), i = {
|
|
527
|
-
...l,
|
|
528
|
-
codeName: [l.code, l.name].filter((h) => !!h).join(" "),
|
|
529
|
-
variant: {
|
|
530
|
-
variantGroupIds: ((e = l.variant) == null ? void 0 : e.variantGroupIds) || [],
|
|
531
|
-
variantCombinations: (((c = l.variant) == null ? void 0 : c.variantCombinations) || []).map((h) => {
|
|
532
|
-
const E = h.code, C = h.name || m[h.combinationKey || ""];
|
|
533
|
-
return {
|
|
534
|
-
...h,
|
|
535
|
-
codeName: [E, C].filter((p) => !!p).join(" ").trim() || "-"
|
|
536
|
-
};
|
|
537
|
-
})
|
|
538
|
-
}
|
|
539
|
-
};
|
|
540
|
-
return o[f] = o[f] ? [...o[f], i] : [i], o;
|
|
541
|
-
}, {}), t = Object.values(u)[0];
|
|
542
|
-
return V.length === 0 && t ? t.map((o) => ({
|
|
543
|
-
id: o._id,
|
|
544
|
-
name: o.name ?? "",
|
|
545
|
-
items: u[o._id || ""] || []
|
|
546
|
-
})) || [] : V.map((o) => ({
|
|
547
|
-
id: o._id,
|
|
548
|
-
name: o.name ?? "",
|
|
549
|
-
items: u[o._id || ""] || []
|
|
550
|
-
}));
|
|
551
|
-
}
|
|
552
|
-
function He(V, y) {
|
|
553
|
-
if (V.length == 1)
|
|
554
|
-
return V[0];
|
|
555
|
-
const n = V[0], u = V.slice(1, V.length), t = He(u, y);
|
|
556
|
-
return n.reduce((l, f) => [...l, ...t.map((m) => y(f, m))], new Array());
|
|
557
|
-
}
|
|
558
|
-
function Mt(V) {
|
|
559
|
-
if (V.length === 0) return [];
|
|
560
|
-
const y = V.map(
|
|
561
|
-
(u) => (u.options ?? []).map(
|
|
562
|
-
(t) => ({
|
|
563
|
-
combinationKey: [`${u._id}/${t._id}`],
|
|
564
|
-
selectionName: [t.name ?? ""]
|
|
565
|
-
})
|
|
566
|
-
)
|
|
567
|
-
);
|
|
568
|
-
return He(y, (u, t) => ({
|
|
569
|
-
combinationKey: [...u.combinationKey, ...t.combinationKey],
|
|
570
|
-
selectionName: [...u.selectionName, ...t.selectionName]
|
|
571
|
-
})).map((u) => {
|
|
572
|
-
const t = [...u.combinationKey];
|
|
573
|
-
return t.sort(), {
|
|
574
|
-
combinationKey: t.join("/"),
|
|
575
|
-
active: !0,
|
|
576
|
-
selectionName: u.selectionName
|
|
577
|
-
};
|
|
578
|
-
});
|
|
579
|
-
}
|
|
580
|
-
const Dt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-100 px-5 py-5 gap-5 mb-3" }, Rt = { class: "flex items-center" }, Ot = { class: "text-lg font-bold flex-grow" }, jt = {
|
|
581
|
-
key: 0,
|
|
582
|
-
class: "table-auto w-full"
|
|
583
|
-
}, zt = { class: "text-left" }, Ut = { class: "min-w-64" }, Ht = { class: "flex flex-col" }, Xt = { class: "fm-typo-en-body-md-400" }, Pt = {
|
|
584
|
-
key: 0,
|
|
585
|
-
class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400"
|
|
586
|
-
}, Qt = { class: "w-1" }, ge = /* @__PURE__ */ P({
|
|
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: y }) {
|
|
612
|
-
const n = V, u = y, t = de(), o = O(() => n.isAddon ? "Addons" : "Products"), l = O(() => n.isAddon ? [] : n.categories), f = O(
|
|
613
|
-
() => Tt(l.value, n.variants, n.menus)
|
|
614
|
-
), m = O(() => {
|
|
615
|
-
if (n.isAddon)
|
|
616
|
-
return n.bindings.map((g) => {
|
|
617
|
-
const B = n.menus.find((A) => A._id === g.productId), I = (B == null ? void 0 : B.name) ?? "-";
|
|
618
|
-
return {
|
|
619
|
-
...g,
|
|
620
|
-
name: I,
|
|
621
|
-
itemCode: (B == null ? void 0 : B.code) ?? "-"
|
|
622
|
-
};
|
|
623
|
-
});
|
|
624
|
-
const a = f.value.flatMap((g) => g.items);
|
|
625
|
-
return n.bindings.map((g) => {
|
|
626
|
-
var v;
|
|
627
|
-
const B = a.find((S) => S._id === g.productId), I = (B == null ? void 0 : B.name) ?? "-";
|
|
628
|
-
let A = (B == null ? void 0 : B.code) ?? "-", d;
|
|
629
|
-
if (g.combinationKey) {
|
|
630
|
-
const S = (((v = B == null ? void 0 : B.variant) == null ? void 0 : v.variantCombinations) || []).find(
|
|
631
|
-
(T) => T.combinationKey === g.combinationKey
|
|
632
|
-
);
|
|
633
|
-
d = (S == null ? void 0 : S.name) ?? (S == null ? void 0 : S.codeName) ?? "", A = (S == null ? void 0 : S.code) ?? A;
|
|
634
|
-
}
|
|
635
|
-
return {
|
|
636
|
-
...g,
|
|
637
|
-
name: I,
|
|
638
|
-
itemCode: A,
|
|
639
|
-
variantName: d
|
|
640
|
-
};
|
|
641
|
-
});
|
|
642
|
-
});
|
|
643
|
-
function i(a) {
|
|
644
|
-
u(
|
|
645
|
-
"update:bindings",
|
|
646
|
-
n.bindings.filter(
|
|
647
|
-
(g) => g.productId !== a.productId || g.combinationKey !== a.combinationKey
|
|
648
|
-
)
|
|
649
|
-
);
|
|
650
|
-
}
|
|
651
|
-
function s({ productId: a, combinationKey: g }, B) {
|
|
652
|
-
const I = n.bindings.find(
|
|
653
|
-
(A) => A.productId === a && A.combinationKey === g
|
|
654
|
-
);
|
|
655
|
-
I && (I.code = B);
|
|
656
|
-
}
|
|
657
|
-
function e() {
|
|
658
|
-
return f.value.map((a) => ({
|
|
659
|
-
label: a.name,
|
|
660
|
-
sublabel: "Category",
|
|
661
|
-
value: a.name,
|
|
662
|
-
disabled: !1,
|
|
663
|
-
children: a.items.map((g) => {
|
|
664
|
-
var I;
|
|
665
|
-
const B = (I = g.variant) == null ? void 0 : I.variantCombinations;
|
|
666
|
-
return B != null && B.length ? {
|
|
667
|
-
label: g.name ?? "",
|
|
668
|
-
value: g._id,
|
|
669
|
-
sublabel: "Product",
|
|
670
|
-
children: [
|
|
671
|
-
{
|
|
672
|
-
label: g.codeName ?? "",
|
|
673
|
-
value: {
|
|
674
|
-
productId: g._id
|
|
675
|
-
},
|
|
676
|
-
active: !!n.bindings.find(
|
|
677
|
-
({ productId: A, combinationKey: d }) => g._id === A && !d
|
|
678
|
-
)
|
|
679
|
-
},
|
|
680
|
-
...B.map((A) => ({
|
|
681
|
-
label: A.codeName ?? "",
|
|
682
|
-
value: {
|
|
683
|
-
productId: g._id,
|
|
684
|
-
combinationKey: A.combinationKey
|
|
685
|
-
},
|
|
686
|
-
sublabel: "Variant",
|
|
687
|
-
active: !!n.bindings.find(
|
|
688
|
-
({ productId: d, combinationKey: v }) => g._id === d && A.combinationKey === v
|
|
689
|
-
)
|
|
690
|
-
}))
|
|
691
|
-
]
|
|
692
|
-
} : {
|
|
693
|
-
label: g.codeName ?? "",
|
|
694
|
-
value: {
|
|
695
|
-
productId: g._id
|
|
696
|
-
},
|
|
697
|
-
active: !!n.bindings.find(
|
|
698
|
-
({ productId: A, combinationKey: d }) => g._id === A && !d
|
|
699
|
-
)
|
|
700
|
-
};
|
|
701
|
-
})
|
|
702
|
-
}));
|
|
703
|
-
}
|
|
704
|
-
function c() {
|
|
705
|
-
return n.menus.map((a) => ({
|
|
706
|
-
label: a.name,
|
|
707
|
-
value: { productId: a._id },
|
|
708
|
-
active: !!n.bindings.find(
|
|
709
|
-
({ productId: g, combinationKey: B }) => a._id === g && !B
|
|
710
|
-
)
|
|
711
|
-
}));
|
|
712
|
-
}
|
|
713
|
-
function h(a) {
|
|
714
|
-
const g = se(n.bindings);
|
|
715
|
-
return a.flatMap((B) => B.children.flatMap((I) => {
|
|
716
|
-
var d;
|
|
717
|
-
if (Z(I))
|
|
718
|
-
return I.children.filter((v) => v.active).map((v) => {
|
|
719
|
-
var M, H;
|
|
720
|
-
const { productId: S, combinationKey: T } = v.value;
|
|
721
|
-
return T ? {
|
|
722
|
-
productId: S,
|
|
723
|
-
combinationKey: T,
|
|
724
|
-
code: ((M = g.find(
|
|
725
|
-
({ productId: X, combinationKey: R }) => S === X && T === R
|
|
726
|
-
)) == null ? void 0 : M.code) ?? ""
|
|
727
|
-
} : {
|
|
728
|
-
productId: S,
|
|
729
|
-
code: ((H = g.find(({ productId: X, combinationKey: R }) => S === X && !R)) == null ? void 0 : H.code) ?? ""
|
|
730
|
-
};
|
|
731
|
-
});
|
|
732
|
-
if (!I.active)
|
|
733
|
-
return [];
|
|
734
|
-
const { productId: A } = I.value;
|
|
735
|
-
return [
|
|
736
|
-
{
|
|
737
|
-
productId: A,
|
|
738
|
-
code: ((d = g.find(({ productId: v, combinationKey: S }) => A === v && !S)) == null ? void 0 : d.code) ?? ""
|
|
739
|
-
}
|
|
740
|
-
];
|
|
741
|
-
}));
|
|
742
|
-
}
|
|
743
|
-
function E(a) {
|
|
744
|
-
const g = se(n.bindings);
|
|
745
|
-
return a.filter((B) => B.active).map(
|
|
746
|
-
(B) => {
|
|
747
|
-
var I;
|
|
748
|
-
return {
|
|
749
|
-
productId: B.value.productId,
|
|
750
|
-
code: ((I = g.find(({ productId: A }) => A === B.value.productId)) == null ? void 0 : I.code) ?? ""
|
|
751
|
-
};
|
|
752
|
-
}
|
|
753
|
-
);
|
|
754
|
-
}
|
|
755
|
-
function C() {
|
|
756
|
-
let a;
|
|
757
|
-
n.isAddon ? a = c() : a = e();
|
|
758
|
-
const g = {
|
|
759
|
-
modelValue: a
|
|
760
|
-
};
|
|
761
|
-
t.open({
|
|
762
|
-
title: `Select ${o.value}`,
|
|
763
|
-
contentComponent: Ue,
|
|
764
|
-
contentComponentProps: g,
|
|
765
|
-
primaryActions: {
|
|
766
|
-
text: "Confirm",
|
|
767
|
-
close: !0
|
|
768
|
-
}
|
|
769
|
-
}).onPrimary((B) => {
|
|
770
|
-
let I;
|
|
771
|
-
n.isAddon ? I = E(B) : I = h(B), u("update:bindings", I);
|
|
772
|
-
});
|
|
773
|
-
}
|
|
774
|
-
const { t: p } = G();
|
|
775
|
-
return (a, g) => {
|
|
776
|
-
const B = F("FmButton"), I = F("FmTextField");
|
|
777
|
-
return x(), _("div", Dt, [
|
|
778
|
-
r("div", Rt, [
|
|
779
|
-
r("div", Ot, D(V.isAddon ? k(p)("inventory.integration.apply.addons") : k(p)("inventory.integration.apply.products")), 1),
|
|
780
|
-
b(B, {
|
|
781
|
-
type: "button",
|
|
782
|
-
variant: "plain",
|
|
783
|
-
size: "md",
|
|
784
|
-
icon: "link",
|
|
785
|
-
label: V.isAddon ? k(p)("inventory.integration.apply.applyAddon") : k(p)("inventory.integration.apply.applyProduct"),
|
|
786
|
-
onClick: g[0] || (g[0] = (A) => C())
|
|
787
|
-
}, null, 8, ["label"])
|
|
788
|
-
]),
|
|
789
|
-
r("div", null, [
|
|
790
|
-
m.value.length > 0 ? (x(), _("table", jt, [
|
|
791
|
-
r("thead", null, [
|
|
792
|
-
r("tr", zt, [
|
|
793
|
-
r("th", Ut, D(k(p)("inventory.integration.apply.name")), 1),
|
|
794
|
-
r("th", null, D(k(p)("inventory.integration.apply.code")), 1),
|
|
795
|
-
g[1] || (g[1] = r("th", { class: "w-1" }, " ", -1))
|
|
796
|
-
])
|
|
797
|
-
]),
|
|
798
|
-
r("tbody", null, [
|
|
799
|
-
(x(!0), _(Q, null, ee(m.value, (A, d) => (x(), _(Q, { key: d }, [
|
|
800
|
-
g[2] || (g[2] = r("tr", { class: "block h-8" }, null, -1)),
|
|
801
|
-
r("tr", null, [
|
|
802
|
-
r("td", null, [
|
|
803
|
-
r("div", Ht, [
|
|
804
|
-
r("div", Xt, D(A.itemCode) + " " + D(A.name), 1),
|
|
805
|
-
A.variantName ? (x(), _("div", Pt, D(A.variantName), 1)) : z("", !0)
|
|
806
|
-
])
|
|
807
|
-
]),
|
|
808
|
-
r("td", null, [
|
|
809
|
-
b(I, {
|
|
810
|
-
"model-value": A.code,
|
|
811
|
-
"onUpdate:modelValue": [(v) => A.code = v, (v) => s(A, v)],
|
|
812
|
-
rules: [
|
|
813
|
-
function(S) {
|
|
814
|
-
return !!S || "Required";
|
|
815
|
-
}
|
|
816
|
-
]
|
|
817
|
-
}, null, 8, ["model-value", "onUpdate:modelValue", "rules"])
|
|
818
|
-
]),
|
|
819
|
-
r("td", Qt, [
|
|
820
|
-
b(B, {
|
|
821
|
-
type: "button",
|
|
822
|
-
variant: "tertiary",
|
|
823
|
-
icon: "delete",
|
|
824
|
-
"icon-color": "#000000",
|
|
825
|
-
size: "md",
|
|
826
|
-
onClick: (v) => i(A)
|
|
827
|
-
}, null, 8, ["onClick"])
|
|
828
|
-
])
|
|
829
|
-
])
|
|
830
|
-
], 64))), 128))
|
|
831
|
-
])
|
|
832
|
-
])) : z("", !0)
|
|
833
|
-
])
|
|
834
|
-
]);
|
|
835
|
-
};
|
|
836
|
-
}
|
|
837
|
-
}), Yt = { class: "flex flex-col gap-8 w-full" }, Jt = /* @__PURE__ */ P({
|
|
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: y }) {
|
|
850
|
-
const n = V, u = y, t = ke(se(n.setting));
|
|
851
|
-
Be([() => n.show], ([s]) => {
|
|
852
|
-
if (s)
|
|
853
|
-
for (const e of Object.keys(n.setting))
|
|
854
|
-
t[e] = n.setting[e];
|
|
855
|
-
});
|
|
856
|
-
const o = N(), l = ie(n, "show");
|
|
857
|
-
function f() {
|
|
858
|
-
var s, e;
|
|
859
|
-
(e = (s = o.value) == null ? void 0 : s.validateInputs) == null || e.call(s);
|
|
860
|
-
}
|
|
861
|
-
function m() {
|
|
862
|
-
u("update:setting", se(t)), u("submit");
|
|
863
|
-
}
|
|
864
|
-
const { t: i } = G();
|
|
865
|
-
return (s, e) => {
|
|
866
|
-
const c = F("FmChip"), h = F("FmForm"), E = F("FmButton"), C = F("FmSideSheet");
|
|
867
|
-
return x(), U(C, {
|
|
868
|
-
modelValue: k(l),
|
|
869
|
-
"onUpdate:modelValue": e[4] || (e[4] = (p) => le(l) ? l.value = p : null),
|
|
870
|
-
header: k(i)("inventory.integration.apply.title"),
|
|
871
|
-
"dismiss-away": "",
|
|
872
|
-
"close-button": "",
|
|
873
|
-
"max-width": 500
|
|
874
|
-
}, {
|
|
875
|
-
default: L(() => [
|
|
876
|
-
r("div", Yt, [
|
|
877
|
-
r("div", null, [
|
|
878
|
-
b(c, { label: "Menu v3" })
|
|
879
|
-
]),
|
|
880
|
-
b(h, {
|
|
881
|
-
ref_key: "formRef",
|
|
882
|
-
ref: o,
|
|
883
|
-
onValidationSuccess: e[2] || (e[2] = (p) => m())
|
|
884
|
-
}, {
|
|
885
|
-
default: L(() => [
|
|
886
|
-
b(ge, {
|
|
887
|
-
bindings: t.bindings,
|
|
888
|
-
categories: s.categories,
|
|
889
|
-
variants: s.variants,
|
|
890
|
-
menus: s.menus,
|
|
891
|
-
"onUpdate:bindings": e[0] || (e[0] = (p) => t.bindings = p)
|
|
892
|
-
}, null, 8, ["bindings", "categories", "variants", "menus"]),
|
|
893
|
-
b(Lt, {
|
|
894
|
-
form: o.value,
|
|
895
|
-
modifiers: t.modifiers ?? [],
|
|
896
|
-
groups: s.groups ?? [],
|
|
897
|
-
items: s.menus ?? [],
|
|
898
|
-
"onUpdate:modifiers": e[1] || (e[1] = (p) => t.modifiers = p)
|
|
899
|
-
}, null, 8, ["form", "modifiers", "groups", "items"])
|
|
900
|
-
]),
|
|
901
|
-
_: 1
|
|
902
|
-
}, 512)
|
|
903
|
-
])
|
|
904
|
-
]),
|
|
905
|
-
"side-sheet-footer": L(() => [
|
|
906
|
-
b(E, {
|
|
907
|
-
loading: s.loading,
|
|
908
|
-
type: "submit",
|
|
909
|
-
label: k(i)("common.confirm"),
|
|
910
|
-
onClick: e[3] || (e[3] = (p) => f())
|
|
911
|
-
}, null, 8, ["loading", "label"])
|
|
912
|
-
]),
|
|
913
|
-
_: 1
|
|
914
|
-
}, 8, ["modelValue", "header"]);
|
|
915
|
-
};
|
|
916
|
-
}
|
|
917
|
-
}), Kt = { class: "flex flex-col gap-8 w-full" }, qt = /* @__PURE__ */ P({
|
|
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: y }) {
|
|
930
|
-
const n = V, u = y, t = ke(se(n.setting));
|
|
931
|
-
Be([() => n.show], ([p]) => {
|
|
932
|
-
if (p)
|
|
933
|
-
for (const a of Object.keys(n.setting))
|
|
934
|
-
t[a] = n.setting[a];
|
|
935
|
-
});
|
|
936
|
-
const o = O(() => n.menus.filter((p) => !(p != null && p.category))), l = O(() => t.bindings.filter((p) => {
|
|
937
|
-
const a = n.menus.find((g) => g._id === p.productId);
|
|
938
|
-
return a ? !(a != null && a.category) : !1;
|
|
939
|
-
})), f = O(() => n.menus.filter((p) => (p == null ? void 0 : p.category) !== null)), m = O(() => t.bindings.filter((p) => {
|
|
940
|
-
const a = n.menus.find((g) => g._id === p.productId);
|
|
941
|
-
return a ? (a == null ? void 0 : a.category) !== null : !1;
|
|
942
|
-
}));
|
|
943
|
-
function i(p) {
|
|
944
|
-
t.bindings = [...l.value, ...p];
|
|
945
|
-
}
|
|
946
|
-
function s(p) {
|
|
947
|
-
t.bindings = [...m.value, ...p];
|
|
948
|
-
}
|
|
949
|
-
const e = N(), c = ie(n, "show");
|
|
950
|
-
function h() {
|
|
951
|
-
var p, a;
|
|
952
|
-
(a = (p = e.value) == null ? void 0 : p.validateInputs) == null || a.call(p);
|
|
953
|
-
}
|
|
954
|
-
function E() {
|
|
955
|
-
u("update:setting", se(t)), u("submit");
|
|
956
|
-
}
|
|
957
|
-
const { t: C } = G();
|
|
958
|
-
return (p, a) => {
|
|
959
|
-
const g = F("FmChip"), B = F("FmForm"), I = F("FmButton"), A = F("FmSideSheet");
|
|
960
|
-
return x(), U(A, {
|
|
961
|
-
modelValue: k(c),
|
|
962
|
-
"onUpdate:modelValue": a[4] || (a[4] = (d) => le(c) ? c.value = d : null),
|
|
963
|
-
header: k(C)("inventory.integration.apply.title"),
|
|
964
|
-
"dismiss-away": "",
|
|
965
|
-
"close-button": "",
|
|
966
|
-
"max-width": 500
|
|
967
|
-
}, {
|
|
968
|
-
default: L(() => [
|
|
969
|
-
r("div", Kt, [
|
|
970
|
-
r("div", null, [
|
|
971
|
-
b(g, { label: "Menu v4" })
|
|
972
|
-
]),
|
|
973
|
-
b(B, {
|
|
974
|
-
ref_key: "formRef",
|
|
975
|
-
ref: e,
|
|
976
|
-
onValidationSuccess: a[2] || (a[2] = (d) => E())
|
|
977
|
-
}, {
|
|
978
|
-
default: L(() => [
|
|
979
|
-
b(ge, {
|
|
980
|
-
categories: p.categories,
|
|
981
|
-
variants: p.variants,
|
|
982
|
-
bindings: m.value,
|
|
983
|
-
menus: f.value,
|
|
984
|
-
"onUpdate:bindings": a[0] || (a[0] = (d) => i(d))
|
|
985
|
-
}, null, 8, ["categories", "variants", "bindings", "menus"]),
|
|
986
|
-
b(ge, {
|
|
987
|
-
"is-addon": !0,
|
|
988
|
-
categories: [],
|
|
989
|
-
variants: p.variants,
|
|
990
|
-
bindings: l.value,
|
|
991
|
-
menus: o.value,
|
|
992
|
-
"onUpdate:bindings": a[1] || (a[1] = (d) => s(d))
|
|
993
|
-
}, null, 8, ["variants", "bindings", "menus"])
|
|
994
|
-
]),
|
|
995
|
-
_: 1
|
|
996
|
-
}, 512)
|
|
997
|
-
])
|
|
998
|
-
]),
|
|
999
|
-
"side-sheet-footer": L(() => [
|
|
1000
|
-
b(I, {
|
|
1001
|
-
loading: p.loading,
|
|
1002
|
-
type: "submit",
|
|
1003
|
-
label: k(C)("common.confirm"),
|
|
1004
|
-
onClick: a[3] || (a[3] = (d) => h())
|
|
1005
|
-
}, null, 8, ["loading", "label"])
|
|
1006
|
-
]),
|
|
1007
|
-
_: 1
|
|
1008
|
-
}, 8, ["modelValue", "header"]);
|
|
1009
|
-
};
|
|
1010
|
-
}
|
|
1011
|
-
}), Zt = { key: 0 }, Gt = { class: "flex justify-center" }, Wt = ["src"], $t = { class: "flex flex-col items-center gap-2" }, en = { class: "text-lg font-bold" }, tn = { class: "text-fm-color-neutral-gray-300" }, nn = { key: 0 }, on = /* @__PURE__ */ P({
|
|
1012
|
-
__name: "FoodMarketHub",
|
|
1013
|
-
setup(V) {
|
|
1014
|
-
const y = ae(), n = W(), u = te(), t = N(!1), o = et(), l = O(() => o.state.menu ?? []), f = O(() => o.state.group ?? []), m = O(() => o.state.variants ?? []), i = O(() => o.state.categories ?? []), s = Ze(), e = O(() => {
|
|
1015
|
-
var B;
|
|
1016
|
-
return (B = y.currentBusiness.value) == null ? void 0 : B.menuVersion;
|
|
1017
|
-
});
|
|
1018
|
-
u.watchLocation(o.init);
|
|
1019
|
-
const c = N(!1);
|
|
1020
|
-
async function h() {
|
|
1021
|
-
c.value = !0;
|
|
1022
|
-
}
|
|
1023
|
-
const { breakpoints: E } = Ee(), C = O(() => E.value.xs || E.value.sm), p = O(() => C.value);
|
|
1024
|
-
async function a() {
|
|
1025
|
-
const B = o.state.setting;
|
|
1026
|
-
if (B) {
|
|
1027
|
-
t.value = !0;
|
|
1028
|
-
try {
|
|
1029
|
-
await s.updateSetting(B), n.open({
|
|
1030
|
-
title: "Success",
|
|
1031
|
-
message: "Your changes has been saved",
|
|
1032
|
-
type: "success"
|
|
1033
|
-
}), c.value = !1, await o.init();
|
|
1034
|
-
return;
|
|
1035
|
-
} catch (I) {
|
|
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", I);
|
|
1041
|
-
} finally {
|
|
1042
|
-
t.value = !1;
|
|
1043
|
-
}
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
const { t: g } = G();
|
|
1047
|
-
return (B, I) => {
|
|
1048
|
-
const A = F("FmCardSection"), d = F("FmCard");
|
|
1049
|
-
return k(o).isEnabled && !k(o).isBusinessLocation ? (x(), _("div", Zt, [
|
|
1050
|
-
b(d, {
|
|
1051
|
-
class: K({
|
|
1052
|
-
"w-full": p.value,
|
|
1053
|
-
"w-1/2": !p.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: I[0] || (I[0] = (v) => h())
|
|
1060
|
-
}, {
|
|
1061
|
-
default: L(() => [
|
|
1062
|
-
b(A, null, {
|
|
1063
|
-
default: L(() => [
|
|
1064
|
-
r("div", Gt, [
|
|
1065
|
-
r("img", {
|
|
1066
|
-
src: k(dt),
|
|
1067
|
-
alt: "Food Market Hub"
|
|
1068
|
-
}, null, 8, Wt)
|
|
1069
|
-
]),
|
|
1070
|
-
r("div", $t, [
|
|
1071
|
-
r("div", en, D(k(g)("inventory.integration.fmh.title")), 1),
|
|
1072
|
-
r("div", tn, D(k(g)("inventory.integration.fmh.description")), 1)
|
|
1073
|
-
])
|
|
1074
|
-
]),
|
|
1075
|
-
_: 1
|
|
1076
|
-
})
|
|
1077
|
-
]),
|
|
1078
|
-
_: 1
|
|
1079
|
-
}, 8, ["class"]),
|
|
1080
|
-
k(o).state.setting ? (x(), _("div", nn, [
|
|
1081
|
-
(x(), U(fe, { to: "body" }, [
|
|
1082
|
-
e.value === "v3" ? (x(), U(Jt, {
|
|
1083
|
-
key: 0,
|
|
1084
|
-
menus: l.value,
|
|
1085
|
-
variants: m.value,
|
|
1086
|
-
categories: i.value,
|
|
1087
|
-
setting: k(o).state.setting,
|
|
1088
|
-
"onUpdate:setting": I[1] || (I[1] = (v) => k(o).state.setting = v),
|
|
1089
|
-
show: c.value,
|
|
1090
|
-
"onUpdate:show": I[2] || (I[2] = (v) => c.value = v),
|
|
1091
|
-
groups: f.value,
|
|
1092
|
-
loading: t.value,
|
|
1093
|
-
onSubmit: I[3] || (I[3] = (v) => a())
|
|
1094
|
-
}, null, 8, ["menus", "variants", "categories", "setting", "show", "groups", "loading"])) : (x(), U(qt, {
|
|
1095
|
-
key: 1,
|
|
1096
|
-
menus: l.value,
|
|
1097
|
-
variants: m.value,
|
|
1098
|
-
categories: i.value,
|
|
1099
|
-
setting: k(o).state.setting,
|
|
1100
|
-
"onUpdate:setting": I[4] || (I[4] = (v) => k(o).state.setting = v),
|
|
1101
|
-
show: c.value,
|
|
1102
|
-
"onUpdate:show": I[5] || (I[5] = (v) => c.value = v),
|
|
1103
|
-
groups: f.value,
|
|
1104
|
-
loading: t.value,
|
|
1105
|
-
onSubmit: I[6] || (I[6] = (v) => a())
|
|
1106
|
-
}, null, 8, ["menus", "variants", "categories", "setting", "show", "groups", "loading"]))
|
|
1107
|
-
]))
|
|
1108
|
-
])) : z("", !0)
|
|
1109
|
-
])) : z("", !0);
|
|
1110
|
-
};
|
|
1111
|
-
}
|
|
1112
|
-
}), sn = "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+NhqNPp8ZfrqeB4NKgLHlCzmvn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aiPxGJ9P1SIm5bkdDhhy/019fPQ0F6BN6QQ/EWzMFfvJ8y76JtlK4crc95IjBnPsNQngj39DziKjKUIVjueCyeoxPAEPv55uYhVT92GXGpxK35F8823vQtMOZfQZrS75Rb/VpaWuZhB7ZGZvibUCk/DK3ieRhzX2LHLDNur/ll55/58Rw+73VFJlN/OicCRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARyCTAMi/onAgQgWwCra2th6mqulBTlEWKYjRyVZ2nKspcnHPO1bjCjW0IsVvhbKvO2OvDw8NbBwcH38iOha6IABEgAqUnULUGvb390DlcmXEbMrCQK8wwUWncPEv9DegKvycS6bk/5eLRSbC99VKmqKcgujEzSpv0GVd4zFD0qyOR/hdMOae/HStWLGW1tfcoijUjukMQmBoXB5TJOrjNE8AZV3Ujfnk0OvD3LGFctLW1BX2qcgtTmB+Xltis0t5f5+pvkwEFDwRjXwyHwy+61SAYDAY0wzhS0dT3KIwfh3wuRxww5ooM6L1AspVz5WXG2J+4zp8Z1fWe/v7+/UXocaimql9HuIMY56nnG9cBQH+4OxL5lts43cqvWLGipq6u5ivg0AEV4iK8eL7xzPjwT7/Oey+ORtPPvlP8TU1NtbNmNIh42g2FJeIRsoxxHzdYH3h9NhqNpt4hazzt7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+6fisodI+5lli0peibheMTTcv/uq6/ibn2tehQcCJl0gHHYQqKmsHhnVdGJiSHD09PVFELH7fFB854YHAUYpqYMtTFZ8MVY6AcTwUf8XYo5js5vSe6DpnMVVhw3gOEBfrRr6ewdT4p2FwdyNcyY+uaN9vkMhvVgdXdoLtyaiciHH/ozFwehD+Cv2d+pRjOlOgKkfXPXuOM/57roz+LhLZ8ArCeHro8+fHVEO5D8vi/oqnNz25EApDvZc3bdqUcvM04fHIsIlPRGG+xETWzOcOzyEGS5h4Bkp7cP59PNQHZ06sNBNE5Sn1zppusn+Tb3Kh95n5cX+flo2T5KqbgFn+V3cuSHsi4B0BtnTp0trZODTDWMJ9yiKU+qL1PhstvUTpid3ZGGaNjzBFfw3Dk6/C5r8SiUSEAY95p0bRMSWW0tXW1h4Ma7kcOi+AvjOydGdsN3okdijKyODu3UOvbtu2bajo1CggESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiIBHBP4fA65iItIh5WIAAAAASUVORK5CYII='/%3e%3c/defs%3e%3c/svg%3e", an = {
|
|
1113
|
-
key: 0,
|
|
1114
|
-
class: "line-clamp-1 text-ellipsis"
|
|
1115
|
-
}, ln = {
|
|
1116
|
-
key: 1,
|
|
1117
|
-
class: "line-clamp-1 text-ellipsis text-fm-color-typo-tertiary"
|
|
1118
|
-
}, rn = { class: "flex flex-col gap-5" }, un = { class: "overflow-x-hidden overflow-y-auto max-h-[300px]" }, cn = /* @__PURE__ */ P({
|
|
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: y }) {
|
|
1130
|
-
const n = V, u = y, t = N(""), o = O(
|
|
1131
|
-
() => new st(
|
|
1132
|
-
n.items,
|
|
1133
|
-
(f) => [f.label ?? "", f.sublabel ?? "", ...f.value[n.searchTarget]].filter((m) => m)
|
|
1134
|
-
)
|
|
1135
|
-
), l = O(() => o.value.search(t.value));
|
|
1136
|
-
return (f, m) => {
|
|
1137
|
-
const i = F("FmLabel"), s = F("FmField"), e = F("FmIcon"), c = F("FmTextField"), h = F("FmMenuItem"), E = F("FmMenu"), C = F("FmFormGroup");
|
|
1138
|
-
return x(), U(C, {
|
|
1139
|
-
"model-value": f.modelValue,
|
|
1140
|
-
rules: [k(lt)()],
|
|
1141
|
-
"label-mark": "required"
|
|
1142
|
-
}, oe({
|
|
1143
|
-
default: L(({ invalid: p }) => [
|
|
1144
|
-
b(E, null, {
|
|
1145
|
-
"menu-button": L(() => [
|
|
1146
|
-
b(s, {
|
|
1147
|
-
class: K([
|
|
1148
|
-
"fm-typo-en-body-lg-400",
|
|
1149
|
-
{
|
|
1150
|
-
"text-fm-color-typo-primary": !f.disabled,
|
|
1151
|
-
"text-fm-color-typo-disabled": f.disabled
|
|
1152
|
-
}
|
|
1153
|
-
]),
|
|
1154
|
-
invalid: p,
|
|
1155
|
-
"append-icon": "expand_more"
|
|
1156
|
-
}, {
|
|
1157
|
-
default: L(() => [
|
|
1158
|
-
f.modelValue[n.searchTarget] ? (x(), _("span", an, D(f.modelValue[n.searchTarget]), 1)) : (x(), _("span", ln, D(f.placeholder || "Select an option"), 1))
|
|
1159
|
-
]),
|
|
1160
|
-
_: 2
|
|
1161
|
-
}, 1032, ["class", "invalid"])
|
|
1162
|
-
]),
|
|
1163
|
-
default: L(() => [
|
|
1164
|
-
r("div", rn, [
|
|
1165
|
-
b(c, {
|
|
1166
|
-
modelValue: t.value,
|
|
1167
|
-
"onUpdate:modelValue": m[1] || (m[1] = (a) => t.value = a),
|
|
1168
|
-
placeholder: "Filter options"
|
|
1169
|
-
}, oe({
|
|
1170
|
-
prepend: L(() => [
|
|
1171
|
-
b(e, { name: "search" })
|
|
1172
|
-
]),
|
|
1173
|
-
_: 2
|
|
1174
|
-
}, [
|
|
1175
|
-
t.value.length ? {
|
|
1176
|
-
name: "append",
|
|
1177
|
-
fn: L(() => [
|
|
1178
|
-
b(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
|
-
r("div", un, [
|
|
1188
|
-
(x(!0), _(Q, null, ee(l.value, (a, g) => {
|
|
1189
|
-
var B, I;
|
|
1190
|
-
return x(), U(h, {
|
|
1191
|
-
key: g,
|
|
1192
|
-
label: a.label,
|
|
1193
|
-
"model-value": a.value[n.searchTarget] === ((B = f.modelValue) == null ? void 0 : B[n.searchTarget]),
|
|
1194
|
-
onClick: (A) => u("update:modelValue", a.value),
|
|
1195
|
-
"x-should-scroll-into": `${a.value[n.searchTarget] === ((I = f.modelValue) == null ? void 0 : I[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
|
-
f.label ? {
|
|
1207
|
-
name: "label",
|
|
1208
|
-
fn: L(() => [
|
|
1209
|
-
b(i, { label: f.label }, null, 8, ["label"])
|
|
1210
|
-
]),
|
|
1211
|
-
key: "0"
|
|
1212
|
-
} : void 0
|
|
1213
|
-
]), 1032, ["model-value", "rules"]);
|
|
1214
|
-
};
|
|
1215
|
-
}
|
|
1216
|
-
}), dn = { class: "flex-col items-center" }, mn = { class: "flex gap-2" }, fn = {
|
|
1217
|
-
key: 0,
|
|
1218
|
-
class: "text-xs text-red-500 mt-2"
|
|
1219
|
-
}, pn = {
|
|
1220
|
-
key: 1,
|
|
1221
|
-
class: "flex items-center mt-2"
|
|
1222
|
-
}, vn = { class: "flex flex-col" }, yn = { class: "font-medium" }, gn = { class: "text-xs text-gray-400" }, An = { class: "text-xs text-gray-400" }, bn = /* @__PURE__ */ P({
|
|
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: y }) {
|
|
1237
|
-
const n = V, u = O(() => n.modelValue), t = y;
|
|
1238
|
-
return (o, l) => {
|
|
1239
|
-
const f = F("FmButton"), m = F("FmIcon");
|
|
1240
|
-
return x(), _("div", dn, [
|
|
1241
|
-
r("div", mn, [
|
|
1242
|
-
b(cn, {
|
|
1243
|
-
placeholder: "Select NetSuite Location",
|
|
1244
|
-
items: o.nsLocationOptions,
|
|
1245
|
-
searchTarget: "name",
|
|
1246
|
-
"model-value": u.value,
|
|
1247
|
-
"onUpdate:modelValue": l[0] || (l[0] = (i) => t("update:modelValue", i))
|
|
1248
|
-
}, null, 8, ["items", "model-value"]),
|
|
1249
|
-
u.value.netsuiteId ? (x(), U(f, {
|
|
1250
|
-
key: 0,
|
|
1251
|
-
variant: "secondary",
|
|
1252
|
-
label: "Clear",
|
|
1253
|
-
onClick: l[1] || (l[1] = (i) => t("update:modelValue", {
|
|
1254
|
-
netsuiteId: "",
|
|
1255
|
-
name: "",
|
|
1256
|
-
subsidiaryName: "",
|
|
1257
|
-
subsidiaryId: ""
|
|
1258
|
-
}))
|
|
1259
|
-
})) : z("", !0)
|
|
1260
|
-
]),
|
|
1261
|
-
o.isDuplicate ? (x(), _("div", fn, " NetSuite location being used by another FeedMe location. ")) : z("", !0),
|
|
1262
|
-
u.value.netsuiteId ? (x(), _("div", pn, [
|
|
1263
|
-
b(m, {
|
|
1264
|
-
name: "cloud",
|
|
1265
|
-
color: "neutral-gray-400",
|
|
1266
|
-
size: "md",
|
|
1267
|
-
class: "mr-2",
|
|
1268
|
-
outline: ""
|
|
1269
|
-
}),
|
|
1270
|
-
r("div", vn, [
|
|
1271
|
-
r("span", yn, D(u.value.name), 1),
|
|
1272
|
-
r("span", gn, "ID: " + D(u.value.netsuiteId), 1),
|
|
1273
|
-
r("span", An, "Subsidiary: " + D(u.value.subsidiaryName), 1)
|
|
1274
|
-
])
|
|
1275
|
-
])) : z("", !0)
|
|
1276
|
-
]);
|
|
1277
|
-
};
|
|
1278
|
-
}
|
|
1279
|
-
}), hn = /* @__PURE__ */ P({
|
|
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: y }) {
|
|
1301
|
-
const n = ne(), u = W(), t = [
|
|
1302
|
-
{
|
|
1303
|
-
id: "fmLocation",
|
|
1304
|
-
header: "FeedMe Location",
|
|
1305
|
-
cell(h) {
|
|
1306
|
-
const E = h.row.original, C = w(q.FmIcon, {
|
|
1307
|
-
name: E.type,
|
|
1308
|
-
color: "neutral-gray-400",
|
|
1309
|
-
size: "md",
|
|
1310
|
-
class: "mr-2",
|
|
1311
|
-
outline: !0
|
|
1312
|
-
});
|
|
1313
|
-
return w("div", { class: "flex items-center" }, [
|
|
1314
|
-
C,
|
|
1315
|
-
w("div", { class: "flex flex-col" }, [
|
|
1316
|
-
w("span", { class: "font-medium" }, E.name),
|
|
1317
|
-
w("span", { class: "text-xs text-gray-400" }, E.doc._id)
|
|
1318
|
-
])
|
|
1319
|
-
]);
|
|
1320
|
-
}
|
|
1321
|
-
},
|
|
1322
|
-
{
|
|
1323
|
-
id: "nsLocation",
|
|
1324
|
-
header: "NetSuite Location",
|
|
1325
|
-
cell(h) {
|
|
1326
|
-
const E = h.row.original, C = f.value[E.dbName], p = Object.entries(f.value).some(
|
|
1327
|
-
([a, g]) => a !== E.dbName && g.netsuiteId === (C == null ? void 0 : C.netsuiteId)
|
|
1328
|
-
);
|
|
1329
|
-
return w(bn, {
|
|
1330
|
-
isDuplicate: p,
|
|
1331
|
-
nsLocationOptions: s.value,
|
|
1332
|
-
modelValue: C,
|
|
1333
|
-
fmLocation: E,
|
|
1334
|
-
"onUpdate:modelValue": (a) => {
|
|
1335
|
-
a.netsuiteId ? f.value = {
|
|
1336
|
-
...f.value,
|
|
1337
|
-
[E.dbName]: {
|
|
1338
|
-
netsuiteId: a.netsuiteId,
|
|
1339
|
-
name: a.name,
|
|
1340
|
-
subsidiaryName: a.subsidiaryName,
|
|
1341
|
-
subsidiaryId: a.subsidiaryId
|
|
1342
|
-
}
|
|
1343
|
-
} : delete f.value[E.dbName];
|
|
1344
|
-
}
|
|
1345
|
-
});
|
|
1346
|
-
}
|
|
1347
|
-
}
|
|
1348
|
-
], o = V, l = y, f = N({}), m = N(), i = N(""), s = O(() => o.nsLocationsNotBeingUsed.map((h) => ({
|
|
1349
|
-
label: h.name,
|
|
1350
|
-
value: h
|
|
1351
|
-
}))), e = O(() => Object.values(f.value).length === 0 || Object.values(f.value).some(
|
|
1352
|
-
(h) => Object.values(f.value).filter((E) => E.netsuiteId === h.netsuiteId).length > 1
|
|
1353
|
-
));
|
|
1354
|
-
async function c() {
|
|
1355
|
-
try {
|
|
1356
|
-
l("update:loading", !0), await n.updateLocationConfigs(f.value), u.open({
|
|
1357
|
-
message: "Locations updated successfully",
|
|
1358
|
-
type: "success"
|
|
1359
|
-
}), l("update:showDialog", !1), f.value = {};
|
|
1360
|
-
} catch {
|
|
1361
|
-
u.open({
|
|
1362
|
-
message: "Failed to update locations. Please try again.",
|
|
1363
|
-
type: "error"
|
|
1364
|
-
});
|
|
1365
|
-
} finally {
|
|
1366
|
-
l("update:loading", !1);
|
|
1367
|
-
}
|
|
1368
|
-
}
|
|
1369
|
-
return (h, E) => {
|
|
1370
|
-
const C = F("FmTable"), p = F("FmForm"), a = F("FmSpacer"), g = F("FmButton"), B = F("FmDialog");
|
|
1371
|
-
return x(), U(B, {
|
|
1372
|
-
modelValue: V.showDialog,
|
|
1373
|
-
"onUpdate:modelValue": E[2] || (E[2] = (I) => h.$emit("update:showDialog", I)),
|
|
1374
|
-
overlay: !0,
|
|
1375
|
-
"max-width": "900px"
|
|
1376
|
-
}, {
|
|
1377
|
-
"dialog-header": L(() => E[3] || (E[3] = [
|
|
1378
|
-
r("div", null, "Add locations", -1)
|
|
1379
|
-
])),
|
|
1380
|
-
"dialog-footer": L(() => [
|
|
1381
|
-
b(a, { class: "sm:hidden xs:hidden" }),
|
|
1382
|
-
b(g, {
|
|
1383
|
-
class: "sm:w-full xs:w-full",
|
|
1384
|
-
label: "Submit",
|
|
1385
|
-
size: "md",
|
|
1386
|
-
disabled: e.value,
|
|
1387
|
-
onClick: c
|
|
1388
|
-
}, null, 8, ["disabled"])
|
|
1389
|
-
]),
|
|
1390
|
-
default: L(() => [
|
|
1391
|
-
b(p, {
|
|
1392
|
-
ref: "formRef",
|
|
1393
|
-
class: "mb-4",
|
|
1394
|
-
"model-value": m.value,
|
|
1395
|
-
"onUpdate:modelValue": E[1] || (E[1] = (I) => m.value = I)
|
|
1396
|
-
}, {
|
|
1397
|
-
default: L(() => [
|
|
1398
|
-
b(C, {
|
|
1399
|
-
modelValue: m.value,
|
|
1400
|
-
"onUpdate:modelValue": E[0] || (E[0] = (I) => m.value = I),
|
|
1401
|
-
"row-data": o.fmLocationNotYetConfigured,
|
|
1402
|
-
"column-defs": t,
|
|
1403
|
-
"search-value": i.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
|
-
}), xn = { class: "p-8 flex items-center justify-between" }, In = { class: "flex gap-4" }, Sn = /* @__PURE__ */ P({
|
|
1415
|
-
__name: "LocationsTab",
|
|
1416
|
-
setup(V) {
|
|
1417
|
-
const y = te(), n = ne(), u = W(), t = N(!1), o = N(), l = N(""), f = N(null), m = N([]), i = N(null), s = [
|
|
1418
|
-
{
|
|
1419
|
-
key: "type",
|
|
1420
|
-
type: "string",
|
|
1421
|
-
entity: "item",
|
|
1422
|
-
values: ["warehouse", "restaurant"]
|
|
1423
|
-
}
|
|
1424
|
-
];
|
|
1425
|
-
ue(async () => {
|
|
1426
|
-
if (n.isReady && n.isEnabled)
|
|
1427
|
-
try {
|
|
1428
|
-
m.value = await n.getNetSuiteLocationOptions();
|
|
1429
|
-
} catch {
|
|
1430
|
-
u.open({ message: "Failed to fetch NetSuite locations", type: "error" });
|
|
1431
|
-
}
|
|
1432
|
-
});
|
|
1433
|
-
const e = O(() => {
|
|
1434
|
-
let p = n.state.setting.locations;
|
|
1435
|
-
if (!f.value)
|
|
1436
|
-
return p;
|
|
1437
|
-
const a = _e.build(f.value);
|
|
1438
|
-
return p.filter(
|
|
1439
|
-
(g) => Le(
|
|
1440
|
-
{
|
|
1441
|
-
type: g.type
|
|
1442
|
-
},
|
|
1443
|
-
a
|
|
1444
|
-
)
|
|
1445
|
-
);
|
|
1446
|
-
}), c = [
|
|
1447
|
-
{
|
|
1448
|
-
id: "location",
|
|
1449
|
-
header: () => "FeedMe Location",
|
|
1450
|
-
accessorFn: (p) => {
|
|
1451
|
-
const a = y.locations.find(
|
|
1452
|
-
(g) => g.type === p.type && g.doc._id === p.id
|
|
1453
|
-
);
|
|
1454
|
-
return `${(a == null ? void 0 : a.name) || ""} ${(a == null ? void 0 : a.doc._id) || ""}`;
|
|
1455
|
-
},
|
|
1456
|
-
cell(p) {
|
|
1457
|
-
const a = p.row.original, g = y.locations.find(
|
|
1458
|
-
(I) => I.type === a.type && I.doc._id === a.id
|
|
1459
|
-
);
|
|
1460
|
-
if (!g)
|
|
1461
|
-
return w("div", "Unknown Location");
|
|
1462
|
-
const B = w(q.FmIcon, {
|
|
1463
|
-
name: g.type,
|
|
1464
|
-
color: "neutral-gray-400",
|
|
1465
|
-
size: "md",
|
|
1466
|
-
class: "mr-2",
|
|
1467
|
-
outline: !0
|
|
1468
|
-
});
|
|
1469
|
-
return w("div", { class: "flex items-center" }, [
|
|
1470
|
-
B,
|
|
1471
|
-
w("div", { class: "flex flex-col" }, [
|
|
1472
|
-
w("span", { class: "font-medium" }, g.name),
|
|
1473
|
-
w("span", { class: "text-xs text-gray-400" }, g.doc._id)
|
|
1474
|
-
])
|
|
1475
|
-
]);
|
|
1476
|
-
}
|
|
1477
|
-
},
|
|
1478
|
-
{
|
|
1479
|
-
id: "netsuite",
|
|
1480
|
-
header: () => "NetSuite Location",
|
|
1481
|
-
accessorFn: (p) => {
|
|
1482
|
-
var g;
|
|
1483
|
-
const a = (g = m.value.find(
|
|
1484
|
-
(B) => B.netsuiteId === p.netSuiteId
|
|
1485
|
-
)) == null ? void 0 : g.subsidiaryName;
|
|
1486
|
-
return `${p.name} ${p.netSuiteId} ${a || ""}`;
|
|
1487
|
-
},
|
|
1488
|
-
cell(p) {
|
|
1489
|
-
var I;
|
|
1490
|
-
const a = p.row.original, g = (I = m.value.find(
|
|
1491
|
-
(A) => A.netsuiteId === a.netSuiteId
|
|
1492
|
-
)) == null ? void 0 : I.subsidiaryName, B = w(q.FmIcon, {
|
|
1493
|
-
name: "cloud",
|
|
1494
|
-
color: "neutral-gray-400",
|
|
1495
|
-
size: "md",
|
|
1496
|
-
class: "mr-2",
|
|
1497
|
-
outline: !0
|
|
1498
|
-
});
|
|
1499
|
-
return w("div", { class: "flex items-center" }, [
|
|
1500
|
-
B,
|
|
1501
|
-
w("div", { class: "flex flex-col" }, [
|
|
1502
|
-
w("span", { class: "font-medium" }, a.name),
|
|
1503
|
-
w("span", { class: "text-xs text-gray-400" }, `ID: ${a.netSuiteId}`),
|
|
1504
|
-
w("span", { class: "text-xs text-gray-400" }, `Subsidiary: ${g}`)
|
|
1505
|
-
])
|
|
1506
|
-
]);
|
|
1507
|
-
}
|
|
1508
|
-
}
|
|
1509
|
-
], h = O(() => y.locations.filter(
|
|
1510
|
-
(p) => !n.state.setting.locations.some(
|
|
1511
|
-
(a) => a.id === p.doc._id && a.type === p.type
|
|
1512
|
-
)
|
|
1513
|
-
)), E = O(() => m.value.filter(
|
|
1514
|
-
(p) => !n.state.setting.locations.some(
|
|
1515
|
-
(a) => a.netSuiteId === p.netsuiteId
|
|
1516
|
-
)
|
|
1517
|
-
)), C = () => {
|
|
1518
|
-
t.value = !0;
|
|
1519
|
-
};
|
|
1520
|
-
return (p, a) => {
|
|
1521
|
-
const g = F("FmSearch"), B = F("FmButton"), I = F("FmTable");
|
|
1522
|
-
return x(), _("div", null, [
|
|
1523
|
-
r("div", xn, [
|
|
1524
|
-
r("div", In, [
|
|
1525
|
-
b(g, {
|
|
1526
|
-
placeholder: "Search by Location",
|
|
1527
|
-
class: "w-[300px]",
|
|
1528
|
-
modelValue: l.value,
|
|
1529
|
-
"onUpdate:modelValue": a[0] || (a[0] = (A) => l.value = A)
|
|
1530
|
-
}, null, 8, ["modelValue"]),
|
|
1531
|
-
b(k(Ne), {
|
|
1532
|
-
modelValue: f.value,
|
|
1533
|
-
"onUpdate:modelValue": a[1] || (a[1] = (A) => f.value = A),
|
|
1534
|
-
attributes: s
|
|
1535
|
-
}, null, 8, ["modelValue"])
|
|
1536
|
-
]),
|
|
1537
|
-
b(B, {
|
|
1538
|
-
label: "Add location",
|
|
1539
|
-
onClick: C
|
|
1540
|
-
})
|
|
1541
|
-
]),
|
|
1542
|
-
b(I, {
|
|
1543
|
-
modelValue: o.value,
|
|
1544
|
-
"onUpdate:modelValue": a[2] || (a[2] = (A) => o.value = A),
|
|
1545
|
-
"row-data": e.value,
|
|
1546
|
-
"column-defs": c,
|
|
1547
|
-
"shrink-at": !1,
|
|
1548
|
-
"search-value": l.value,
|
|
1549
|
-
autoResetPageIndex: !0
|
|
1550
|
-
}, null, 8, ["modelValue", "row-data", "search-value"]),
|
|
1551
|
-
b(hn, {
|
|
1552
|
-
"show-dialog": t.value,
|
|
1553
|
-
"onUpdate:showDialog": [
|
|
1554
|
-
a[3] || (a[3] = (A) => t.value = A),
|
|
1555
|
-
a[4] || (a[4] = (A) => t.value = A)
|
|
1556
|
-
],
|
|
1557
|
-
formRef: i.value,
|
|
1558
|
-
fmLocationNotYetConfigured: h.value,
|
|
1559
|
-
nsLocationsNotBeingUsed: E.value
|
|
1560
|
-
}, null, 8, ["show-dialog", "formRef", "fmLocationNotYetConfigured", "nsLocationsNotBeingUsed"])
|
|
1561
|
-
]);
|
|
1562
|
-
};
|
|
1563
|
-
}
|
|
1564
|
-
}), wn = { class: "p-8" }, kn = /* @__PURE__ */ P({
|
|
1565
|
-
__name: "VendorsTab",
|
|
1566
|
-
setup(V) {
|
|
1567
|
-
const y = rt(), n = ne(), u = W(), t = N(""), o = N([]);
|
|
1568
|
-
ue(async () => {
|
|
1569
|
-
if (y.suppliers.length === 0)
|
|
1570
|
-
try {
|
|
1571
|
-
await y.readSuppliers();
|
|
1572
|
-
} catch {
|
|
1573
|
-
u.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
|
-
u.open({ message: "Failed to fetch NetSuite locations", type: "error" });
|
|
1580
|
-
}
|
|
1581
|
-
});
|
|
1582
|
-
const l = O(() => n.state.setting.vendors), f = [
|
|
1583
|
-
{
|
|
1584
|
-
id: "vendor",
|
|
1585
|
-
header: () => "FeedMe Supplier",
|
|
1586
|
-
accessorFn: (m) => {
|
|
1587
|
-
const i = y.suppliers.find((s) => s._id === m.id);
|
|
1588
|
-
return `${(i == null ? void 0 : i.name) || ""} ${(i == null ? void 0 : i._id) || ""}`;
|
|
1589
|
-
},
|
|
1590
|
-
cell(m) {
|
|
1591
|
-
const i = m.row.original, s = y.suppliers.find(
|
|
1592
|
-
(c) => c._id === i.id
|
|
1593
|
-
);
|
|
1594
|
-
if (!s)
|
|
1595
|
-
return w("div", "Unknown Supplier");
|
|
1596
|
-
const e = w(q.FmIcon, {
|
|
1597
|
-
name: "apartment",
|
|
1598
|
-
color: "neutral-gray-400",
|
|
1599
|
-
size: "md",
|
|
1600
|
-
class: "mr-2",
|
|
1601
|
-
outline: !0
|
|
1602
|
-
});
|
|
1603
|
-
return w("div", { class: "flex items-center" }, [
|
|
1604
|
-
e,
|
|
1605
|
-
w("div", { class: "flex flex-col" }, [
|
|
1606
|
-
w("span", { class: "font-medium" }, s.name),
|
|
1607
|
-
w("span", { class: "text-xs text-gray-400" }, s._id)
|
|
1608
|
-
])
|
|
1609
|
-
]);
|
|
1610
|
-
}
|
|
1611
|
-
},
|
|
1612
|
-
{
|
|
1613
|
-
id: "netsuite",
|
|
1614
|
-
header: () => "NetSuite Vendor",
|
|
1615
|
-
accessorFn: (m) => {
|
|
1616
|
-
var s;
|
|
1617
|
-
const i = (s = o.value.find(
|
|
1618
|
-
(e) => e.subsidiaryId === m.subsidiaryId
|
|
1619
|
-
)) == null ? void 0 : s.subsidiaryName;
|
|
1620
|
-
return `${m.name} ${m.netSuiteId} ${i || ""}`;
|
|
1621
|
-
},
|
|
1622
|
-
cell(m) {
|
|
1623
|
-
var c;
|
|
1624
|
-
const i = m.row.original, s = (c = o.value.find(
|
|
1625
|
-
(h) => h.subsidiaryId === i.subsidiaryId
|
|
1626
|
-
)) == null ? void 0 : c.subsidiaryName, e = w(q.FmIcon, {
|
|
1627
|
-
name: "cloud",
|
|
1628
|
-
color: "neutral-gray-400",
|
|
1629
|
-
size: "md",
|
|
1630
|
-
class: "mr-2",
|
|
1631
|
-
outline: !0
|
|
1632
|
-
});
|
|
1633
|
-
return w("div", { class: "flex items-center" }, [
|
|
1634
|
-
e,
|
|
1635
|
-
w("div", { class: "flex flex-col" }, [
|
|
1636
|
-
w("span", { class: "font-medium" }, i.name),
|
|
1637
|
-
w("span", { class: "text-xs text-gray-400" }, `ID: ${i.netSuiteId}`),
|
|
1638
|
-
w("span", { class: "text-xs text-gray-400" }, `Subsidiary: ${s || "N/A"}`)
|
|
1639
|
-
])
|
|
1640
|
-
]);
|
|
1641
|
-
}
|
|
1642
|
-
}
|
|
1643
|
-
];
|
|
1644
|
-
return (m, i) => {
|
|
1645
|
-
const s = F("FmSearch"), e = F("FmTable");
|
|
1646
|
-
return x(), _("div", null, [
|
|
1647
|
-
r("div", wn, [
|
|
1648
|
-
b(s, {
|
|
1649
|
-
placeholder: "Search by Vendor",
|
|
1650
|
-
class: "w-[300px]",
|
|
1651
|
-
modelValue: t.value,
|
|
1652
|
-
"onUpdate:modelValue": i[0] || (i[0] = (c) => t.value = c)
|
|
1653
|
-
}, null, 8, ["modelValue"])
|
|
1654
|
-
]),
|
|
1655
|
-
b(e, {
|
|
1656
|
-
autoResetPageIndex: !0,
|
|
1657
|
-
"row-data": l.value,
|
|
1658
|
-
"column-defs": f,
|
|
1659
|
-
"shrink-at": !1,
|
|
1660
|
-
"search-value": t.value
|
|
1661
|
-
}, null, 8, ["row-data", "search-value"])
|
|
1662
|
-
]);
|
|
1663
|
-
};
|
|
1664
|
-
}
|
|
1665
|
-
}), Bn = { class: "p-8 flex gap-4" }, Fn = /* @__PURE__ */ P({
|
|
1666
|
-
__name: "ItemsTab",
|
|
1667
|
-
setup(V) {
|
|
1668
|
-
const y = ce(), n = ne(), u = N(), t = N(""), o = N(null), l = [
|
|
1669
|
-
{
|
|
1670
|
-
key: "itemType",
|
|
1671
|
-
type: "string",
|
|
1672
|
-
entity: "item",
|
|
1673
|
-
values: Object.values(ye.Values)
|
|
1674
|
-
}
|
|
1675
|
-
], f = O(() => {
|
|
1676
|
-
let i = n.state.setting.items;
|
|
1677
|
-
if (!o.value)
|
|
1678
|
-
return i;
|
|
1679
|
-
const s = _e.build(o.value);
|
|
1680
|
-
return i.filter(
|
|
1681
|
-
(e) => Le(
|
|
1682
|
-
{
|
|
1683
|
-
itemType: e.itemType || ye.Enum.InvtPart
|
|
1684
|
-
},
|
|
1685
|
-
s
|
|
1686
|
-
)
|
|
1687
|
-
);
|
|
1688
|
-
}), m = [
|
|
1689
|
-
{
|
|
1690
|
-
id: "item",
|
|
1691
|
-
header: () => "FeedMe Ingredient",
|
|
1692
|
-
accessorFn: (i) => {
|
|
1693
|
-
const s = y.skuById[i.id];
|
|
1694
|
-
return `${(s == null ? void 0 : s.name) || ""} ${(s == null ? void 0 : s._id) || ""} ${(s == null ? void 0 : s.code) || ""}`;
|
|
1695
|
-
},
|
|
1696
|
-
cell(i) {
|
|
1697
|
-
const s = i.row.original, e = y.skuById[s.id];
|
|
1698
|
-
if (!e)
|
|
1699
|
-
return w("div", "Unknown Ingredient");
|
|
1700
|
-
const c = w(q.FmIcon, {
|
|
1701
|
-
name: "grocery",
|
|
1702
|
-
color: "neutral-gray-400",
|
|
1703
|
-
size: "md",
|
|
1704
|
-
class: "mr-2",
|
|
1705
|
-
outline: !0
|
|
1706
|
-
});
|
|
1707
|
-
return w("div", { class: "flex items-center" }, [
|
|
1708
|
-
c,
|
|
1709
|
-
w("div", { class: "flex flex-col" }, [
|
|
1710
|
-
w("span", { class: "font-medium" }, e.name),
|
|
1711
|
-
w("span", { class: "text-xs text-gray-400" }, `ID: ${e._id}`),
|
|
1712
|
-
w("span", { class: "text-xs text-gray-400" }, `Code: ${e.code}`)
|
|
1713
|
-
])
|
|
1714
|
-
]);
|
|
1715
|
-
}
|
|
1716
|
-
},
|
|
1717
|
-
{
|
|
1718
|
-
id: "netsuite",
|
|
1719
|
-
header: () => "NetSuite Item",
|
|
1720
|
-
accessorFn: (i) => {
|
|
1721
|
-
const s = n.state.setting.units.find(
|
|
1722
|
-
(e) => e.netSuiteId === i.unitTypeId
|
|
1723
|
-
);
|
|
1724
|
-
return `${i.name} ${i.netSuiteId} ${(s == null ? void 0 : s.netSuiteId) || ""}`;
|
|
1725
|
-
},
|
|
1726
|
-
cell(i) {
|
|
1727
|
-
const s = i.row.original, e = n.state.setting.units.find(
|
|
1728
|
-
(h) => h.netSuiteId === s.unitTypeId
|
|
1729
|
-
), c = w(q.FmIcon, {
|
|
1730
|
-
name: "cloud",
|
|
1731
|
-
color: "neutral-gray-400",
|
|
1732
|
-
size: "md",
|
|
1733
|
-
class: "mr-2",
|
|
1734
|
-
outline: !0
|
|
1735
|
-
});
|
|
1736
|
-
return w("div", { class: "flex items-center" }, [
|
|
1737
|
-
c,
|
|
1738
|
-
w("div", { class: "flex flex-col" }, [
|
|
1739
|
-
w("span", { class: "font-medium" }, s.name || "N/A"),
|
|
1740
|
-
w("span", { class: "text-xs text-gray-400" }, `ID: ${s.netSuiteId}`),
|
|
1741
|
-
w(
|
|
1742
|
-
"span",
|
|
1743
|
-
{ class: "text-xs text-gray-400" },
|
|
1744
|
-
`Unit Type: ${(e == null ? void 0 : e.netSuiteId) || "N/A"}`
|
|
1745
|
-
),
|
|
1746
|
-
w(
|
|
1747
|
-
"span",
|
|
1748
|
-
{ class: "text-xs text-gray-400" },
|
|
1749
|
-
`Unit of Measure (Base): ${(e == null ? void 0 : e.baseUnitUnitOfMeasureId) || "N/A"}`
|
|
1750
|
-
),
|
|
1751
|
-
w(
|
|
1752
|
-
"span",
|
|
1753
|
-
{ class: "text-xs text-gray-400" },
|
|
1754
|
-
`Type: ${s.itemType || ye.Enum.InvtPart}`
|
|
1755
|
-
)
|
|
1756
|
-
])
|
|
1757
|
-
]);
|
|
1758
|
-
}
|
|
1759
|
-
}
|
|
1760
|
-
];
|
|
1761
|
-
return (i, s) => {
|
|
1762
|
-
const e = F("FmSearch"), c = F("FmTable");
|
|
1763
|
-
return x(), _("div", null, [
|
|
1764
|
-
r("div", Bn, [
|
|
1765
|
-
b(e, {
|
|
1766
|
-
placeholder: "Search by Item",
|
|
1767
|
-
class: "w-[300px]",
|
|
1768
|
-
modelValue: t.value,
|
|
1769
|
-
"onUpdate:modelValue": s[0] || (s[0] = (h) => t.value = h)
|
|
1770
|
-
}, null, 8, ["modelValue"]),
|
|
1771
|
-
b(k(Ne), {
|
|
1772
|
-
modelValue: o.value,
|
|
1773
|
-
"onUpdate:modelValue": s[1] || (s[1] = (h) => o.value = h),
|
|
1774
|
-
attributes: l
|
|
1775
|
-
}, null, 8, ["modelValue"])
|
|
1776
|
-
]),
|
|
1777
|
-
b(c, {
|
|
1778
|
-
modelValue: u.value,
|
|
1779
|
-
"onUpdate:modelValue": s[2] || (s[2] = (h) => u.value = h),
|
|
1780
|
-
"row-data": f.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
|
-
}), Cn = { class: "p-8" }, En = /* @__PURE__ */ P({
|
|
1790
|
-
__name: "UnitTypesTab",
|
|
1791
|
-
setup(V) {
|
|
1792
|
-
const y = ce(), n = ne(), u = N(), t = N(""), o = O(() => n.state.setting.units), l = [
|
|
1793
|
-
{
|
|
1794
|
-
id: "unit",
|
|
1795
|
-
header: () => "FeedMe Unit",
|
|
1796
|
-
accessorFn: (f) => {
|
|
1797
|
-
const m = y.units.find((i) => i._id === f.id);
|
|
1798
|
-
return `${(m == null ? void 0 : m.name) || ""} ${(m == null ? void 0 : m._id) || ""} ${(m == null ? void 0 : m.abbrev) || ""}`;
|
|
1799
|
-
},
|
|
1800
|
-
cell(f) {
|
|
1801
|
-
var e;
|
|
1802
|
-
const m = f.row.original, i = y.units.find((c) => c._id === m.id);
|
|
1803
|
-
if (!i)
|
|
1804
|
-
return w("div", "Unknown Unit");
|
|
1805
|
-
const s = w(q.FmIcon, {
|
|
1806
|
-
name: "measuring_tape",
|
|
1807
|
-
color: "neutral-gray-400",
|
|
1808
|
-
size: "md",
|
|
1809
|
-
class: "mr-2",
|
|
1810
|
-
outline: !0
|
|
1811
|
-
});
|
|
1812
|
-
return w("div", { class: "flex items-center" }, [
|
|
1813
|
-
s,
|
|
1814
|
-
w("div", { class: "flex flex-col" }, [
|
|
1815
|
-
w("span", { class: "font-medium" }, i.name),
|
|
1816
|
-
w("span", { class: "text-xs text-gray-400" }, `ID: ${i._id}`),
|
|
1817
|
-
w("span", { class: "text-xs text-gray-400" }, `Abbrev: ${i.abbrev}`),
|
|
1818
|
-
w(
|
|
1819
|
-
"span",
|
|
1820
|
-
{ class: "text-xs text-gray-400" },
|
|
1821
|
-
`Measurements: ${((e = i.measurements) == null ? void 0 : e.length) || 0}`
|
|
1822
|
-
)
|
|
1823
|
-
])
|
|
1824
|
-
]);
|
|
1825
|
-
}
|
|
1826
|
-
},
|
|
1827
|
-
{
|
|
1828
|
-
id: "netsuite",
|
|
1829
|
-
header: () => "NetSuite Unit Type",
|
|
1830
|
-
accessorFn: (f) => `${f.netSuiteId} ${f.baseUnitUnitOfMeasureId || ""}`,
|
|
1831
|
-
cell(f) {
|
|
1832
|
-
const m = f.row.original, i = w(q.FmIcon, {
|
|
1833
|
-
name: "cloud",
|
|
1834
|
-
color: "neutral-gray-400",
|
|
1835
|
-
size: "md",
|
|
1836
|
-
class: "mr-2",
|
|
1837
|
-
outline: !0
|
|
1838
|
-
});
|
|
1839
|
-
return w("div", { class: "flex items-center" }, [
|
|
1840
|
-
i,
|
|
1841
|
-
w("div", { class: "flex flex-col" }, [
|
|
1842
|
-
w("span", { class: "font-medium" }, `Unit Type ID: ${m.netSuiteId}`),
|
|
1843
|
-
w(
|
|
1844
|
-
"span",
|
|
1845
|
-
{ class: "text-xs text-gray-400" },
|
|
1846
|
-
`Base Unit of Measure: ${m.baseUnitUnitOfMeasureId || "N/A"}`
|
|
1847
|
-
),
|
|
1848
|
-
w(
|
|
1849
|
-
"span",
|
|
1850
|
-
{ class: "text-xs text-gray-400" },
|
|
1851
|
-
`Measurements: ${m.measurements.length}`
|
|
1852
|
-
)
|
|
1853
|
-
])
|
|
1854
|
-
]);
|
|
1855
|
-
}
|
|
1856
|
-
}
|
|
1857
|
-
];
|
|
1858
|
-
return (f, m) => {
|
|
1859
|
-
const i = F("FmSearch"), s = F("FmTable");
|
|
1860
|
-
return x(), _("div", null, [
|
|
1861
|
-
r("div", Cn, [
|
|
1862
|
-
b(i, {
|
|
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
|
-
b(s, {
|
|
1870
|
-
modelValue: u.value,
|
|
1871
|
-
"onUpdate:modelValue": m[1] || (m[1] = (e) => u.value = e),
|
|
1872
|
-
"row-data": o.value,
|
|
1873
|
-
"column-defs": l,
|
|
1874
|
-
"shrink-at": !1,
|
|
1875
|
-
"search-value": t.value,
|
|
1876
|
-
autoResetPageIndex: !0
|
|
1877
|
-
}, null, 8, ["modelValue", "row-data", "search-value"])
|
|
1878
|
-
]);
|
|
1879
|
-
};
|
|
1880
|
-
}
|
|
1881
|
-
}), Vn = { key: 0 }, _n = {
|
|
1882
|
-
key: 1,
|
|
1883
|
-
class: "flex flex-col gap-8 w-full"
|
|
1884
|
-
}, Ln = { class: "flex gap-2 flex-wrap" }, Nn = { class: "flex gap-8 items-center justify-start" }, Tn = /* @__PURE__ */ P({
|
|
1885
|
-
__name: "BusinessNetSuiteSideSheet",
|
|
1886
|
-
props: {
|
|
1887
|
-
show: { type: Boolean },
|
|
1888
|
-
loading: { type: Boolean }
|
|
1889
|
-
},
|
|
1890
|
-
emits: ["update:show", "update:loading"],
|
|
1891
|
-
setup(V, { emit: y }) {
|
|
1892
|
-
const n = ae(), u = V, t = y, o = ie(u, "show"), l = N(
|
|
1893
|
-
"locations"
|
|
1894
|
-
/* LOCATIONS */
|
|
1895
|
-
), f = [
|
|
1896
|
-
{ value: "locations", label: "Locations" },
|
|
1897
|
-
{ value: "vendors", label: "Vendors" },
|
|
1898
|
-
{ value: "items", label: "Items" },
|
|
1899
|
-
{ value: "unitTypes", label: "Unit Types" }
|
|
1900
|
-
], { t: m } = G(), i = [
|
|
1901
|
-
"Unit Type",
|
|
1902
|
-
"Inventory Item",
|
|
1903
|
-
"Location",
|
|
1904
|
-
"Vendor",
|
|
1905
|
-
"Subsidiary",
|
|
1906
|
-
"Purchase Order",
|
|
1907
|
-
"Transfer Order",
|
|
1908
|
-
"Inventory Transfer"
|
|
1909
|
-
];
|
|
1910
|
-
return (s, e) => {
|
|
1911
|
-
const c = F("FmChip"), h = F("FmTabs"), E = F("FmButton"), C = F("FmSideSheet");
|
|
1912
|
-
return x(), U(C, {
|
|
1913
|
-
modelValue: k(o),
|
|
1914
|
-
"onUpdate:modelValue": e[2] || (e[2] = (p) => le(o) ? o.value = p : null),
|
|
1915
|
-
header: k(m)("inventory.integration.netsuite.title"),
|
|
1916
|
-
"dismiss-away": "",
|
|
1917
|
-
"close-button": "",
|
|
1918
|
-
"max-width": 800
|
|
1919
|
-
}, {
|
|
1920
|
-
default: L(() => {
|
|
1921
|
-
var p;
|
|
1922
|
-
return [
|
|
1923
|
-
(p = k(n).sessionUser.value) != null && p.role.isAdmin ? (x(), _("div", _n, [
|
|
1924
|
-
e[3] || (e[3] = r("div", { class: "text-sm" }, " This integration keeps your FeedMe system and NetSuite in sync for the following modules: ", -1)),
|
|
1925
|
-
r("div", Ln, [
|
|
1926
|
-
(x(), _(Q, null, ee(i, (a) => b(c, {
|
|
1927
|
-
key: a,
|
|
1928
|
-
label: a,
|
|
1929
|
-
compact: ""
|
|
1930
|
-
}, null, 8, ["label"])), 64))
|
|
1931
|
-
]),
|
|
1932
|
-
e[4] || (e[4] = r("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] = r("hr", { class: "my-3" }, null, -1)),
|
|
1934
|
-
b(h, {
|
|
1935
|
-
"model-value": l.value,
|
|
1936
|
-
"onUpdate:modelValue": e[0] || (e[0] = (a) => l.value = a),
|
|
1937
|
-
items: f
|
|
1938
|
-
}, null, 8, ["model-value"]),
|
|
1939
|
-
l.value === "locations" ? (x(), U(Sn, { key: 0 })) : z("", !0),
|
|
1940
|
-
l.value === "vendors" ? (x(), U(kn, { key: 1 })) : z("", !0),
|
|
1941
|
-
l.value === "items" ? (x(), U(Fn, { key: 2 })) : z("", !0),
|
|
1942
|
-
l.value === "unitTypes" ? (x(), U(En, { key: 3 })) : z("", !0)
|
|
1943
|
-
])) : (x(), _("div", Vn, " Please contact your administrator to apply the changes. "))
|
|
1944
|
-
];
|
|
1945
|
-
}),
|
|
1946
|
-
"side-sheet-footer": L(() => [
|
|
1947
|
-
r("div", Nn, [
|
|
1948
|
-
b(E, {
|
|
1949
|
-
variant: "tertiary",
|
|
1950
|
-
label: k(m)("common.close"),
|
|
1951
|
-
onClick: e[1] || (e[1] = (p) => t("update:show", !1))
|
|
1952
|
-
}, null, 8, ["label"])
|
|
1953
|
-
])
|
|
1954
|
-
]),
|
|
1955
|
-
_: 1
|
|
1956
|
-
}, 8, ["modelValue", "header"]);
|
|
1957
|
-
};
|
|
1958
|
-
}
|
|
1959
|
-
}), Mn = /* @__PURE__ */ P({
|
|
1960
|
-
__name: "InventoryTransferIngredientTable",
|
|
1961
|
-
props: {
|
|
1962
|
-
modelValue: { default: [] },
|
|
1963
|
-
modelModifiers: {}
|
|
1964
|
-
},
|
|
1965
|
-
emits: ["update:modelValue"],
|
|
1966
|
-
setup(V) {
|
|
1967
|
-
const { t: y } = ve(), n = we(V, "modelValue"), u = [
|
|
1968
|
-
{
|
|
1969
|
-
id: "Code",
|
|
1970
|
-
header: () => y("inventory.transfer.form.items.table.Code"),
|
|
1971
|
-
accessorKey: "code",
|
|
1972
|
-
size: 200,
|
|
1973
|
-
cell(t) {
|
|
1974
|
-
const o = t.row.original;
|
|
1975
|
-
return w(
|
|
1976
|
-
q.FmTooltip,
|
|
1977
|
-
{
|
|
1978
|
-
content: o.code,
|
|
1979
|
-
placement: "top",
|
|
1980
|
-
variant: "plain",
|
|
1981
|
-
zIndex: 50
|
|
1982
|
-
},
|
|
1983
|
-
w(
|
|
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: () => y("inventory.transfer.form.items.table.Name"),
|
|
1997
|
-
minSize: 300,
|
|
1998
|
-
cell(t) {
|
|
1999
|
-
const o = t.row.original;
|
|
2000
|
-
return w(
|
|
2001
|
-
q.FmTooltip,
|
|
2002
|
-
{
|
|
2003
|
-
content: o.name,
|
|
2004
|
-
placement: "top",
|
|
2005
|
-
variant: "plain",
|
|
2006
|
-
zIndex: 50
|
|
2007
|
-
},
|
|
2008
|
-
w(
|
|
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: () => y("inventory.transfer.form.items.table.Amount"),
|
|
2022
|
-
minSize: 200,
|
|
2023
|
-
cell(t) {
|
|
2024
|
-
const o = t.row.original, l = t.row.index;
|
|
2025
|
-
return w(ut, {
|
|
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": (f) => {
|
|
2036
|
-
if (!f) return;
|
|
2037
|
-
const m = {
|
|
2038
|
-
...o,
|
|
2039
|
-
quantity: f.amount,
|
|
2040
|
-
measurement: f.measurement
|
|
2041
|
-
};
|
|
2042
|
-
n.value = [
|
|
2043
|
-
...n.value.slice(0, l),
|
|
2044
|
-
m,
|
|
2045
|
-
...n.value.slice(l + 1)
|
|
2046
|
-
];
|
|
2047
|
-
},
|
|
2048
|
-
rules: [ct(+it({ 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, l = t.row.index;
|
|
2059
|
-
return w("div", { class: "flex justify-end" }, [
|
|
2060
|
-
w(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, l), ...n.value.slice(l + 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 l = F("FmTable");
|
|
2083
|
-
return x(), U(l, {
|
|
2084
|
-
"column-defs": u,
|
|
2085
|
-
"row-data": n.value,
|
|
2086
|
-
"row-key": (f) => f.sku._id,
|
|
2087
|
-
"empty-text": k(y)("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
|
-
}), Dn = { class: "flex items-center gap-8 mb-8" }, Rn = /* @__PURE__ */ P({
|
|
2094
|
-
__name: "InventoryTransferOutTable",
|
|
2095
|
-
setup(V) {
|
|
2096
|
-
const y = N([]), n = pe(), u = N(!1), t = N(!1), o = W(), l = te();
|
|
2097
|
-
ue(async () => {
|
|
2098
|
-
const s = /* @__PURE__ */ new Date(), e = /* @__PURE__ */ new Date();
|
|
2099
|
-
e.setDate(e.getDate() - 30), u.value = !0;
|
|
2100
|
-
try {
|
|
2101
|
-
const c = await n.getInventoryTransferHistory(
|
|
2102
|
-
l.currentLocationDBName,
|
|
2103
|
-
e,
|
|
2104
|
-
s
|
|
2105
|
-
);
|
|
2106
|
-
y.value = c;
|
|
2107
|
-
} catch (c) {
|
|
2108
|
-
console.error("Error fetching inventory transfer history:", c);
|
|
2109
|
-
} finally {
|
|
2110
|
-
u.value = !1;
|
|
2111
|
-
}
|
|
2112
|
-
});
|
|
2113
|
-
async function f() {
|
|
2114
|
-
try {
|
|
2115
|
-
t.value = !0, await n.manualSyncInventoryTransfer(l.currentLocationDBName), o == null || o.open({
|
|
2116
|
-
title: "Sync Started",
|
|
2117
|
-
message: "Inventory transfers sync queued successfully.",
|
|
2118
|
-
type: "success"
|
|
2119
|
-
});
|
|
2120
|
-
} catch (s) {
|
|
2121
|
-
o == null || o.open({
|
|
2122
|
-
title: "Sync Failed",
|
|
2123
|
-
message: `Failed to queue inventory transfers sync. ${s == null ? void 0 : s.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: (s) => {
|
|
2142
|
-
const e = s.row.original.destinationLocation.netSuiteName;
|
|
2143
|
-
return e ? w(
|
|
2144
|
-
q.FmTooltip,
|
|
2145
|
-
{ zIndex: 51 },
|
|
2146
|
-
{
|
|
2147
|
-
content() {
|
|
2148
|
-
return e;
|
|
2149
|
-
},
|
|
2150
|
-
default() {
|
|
2151
|
-
return w("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(s) {
|
|
2161
|
-
return w("div", { class: "flex flex-col" }, [
|
|
2162
|
-
w(
|
|
2163
|
-
"span",
|
|
2164
|
-
{ class: "fm-typo-en-body-sm-400" },
|
|
2165
|
-
`ID: ${s.row.original.netsuiteId ?? "N/A"}`
|
|
2166
|
-
),
|
|
2167
|
-
w(
|
|
2168
|
-
"span",
|
|
2169
|
-
{ class: "fm-typo-en-body-sm-400" },
|
|
2170
|
-
`Transaction ID: ${s.row.original.netsuiteTranId ?? "N/A"}`
|
|
2171
|
-
),
|
|
2172
|
-
w(
|
|
2173
|
-
"span",
|
|
2174
|
-
{ class: "fm-typo-en-body-sm-400" },
|
|
2175
|
-
`Transaction Date: ${s.row.original.netsuiteTranDate ?? "N/A"}`
|
|
2176
|
-
)
|
|
2177
|
-
]);
|
|
2178
|
-
}
|
|
2179
|
-
},
|
|
2180
|
-
{
|
|
2181
|
-
id: "adjustment",
|
|
2182
|
-
header: () => "Adjustment (FeedMe)",
|
|
2183
|
-
cell(s) {
|
|
2184
|
-
const e = s.row.original.adjustmentId;
|
|
2185
|
-
return w("div", { class: "flex flex-col" }, [
|
|
2186
|
-
w("span", { class: "fm-typo-en-body-sm-400" }, `ID: ${e ?? "N/A"}`),
|
|
2187
|
-
w(
|
|
2188
|
-
"span",
|
|
2189
|
-
{ class: "fm-typo-en-body-sm-400" },
|
|
2190
|
-
`Date: ${e ? be(Ae(e)) : "N/A"}`
|
|
2191
|
-
)
|
|
2192
|
-
]);
|
|
2193
|
-
}
|
|
2194
|
-
},
|
|
2195
|
-
{
|
|
2196
|
-
id: "items",
|
|
2197
|
-
header: () => "Items",
|
|
2198
|
-
cell(s) {
|
|
2199
|
-
const e = s.row.original.items;
|
|
2200
|
-
return w(
|
|
2201
|
-
"div",
|
|
2202
|
-
{ class: "overflow-auto" },
|
|
2203
|
-
w("ul", { class: "list-disc pl-5" }, [
|
|
2204
|
-
e == null ? void 0 : e.map(
|
|
2205
|
-
(c) => w(
|
|
2206
|
-
"li",
|
|
2207
|
-
{ class: "fm-typo-en-body-sm-400" },
|
|
2208
|
-
`[${c == null ? void 0 : c.itemId}] ${c == null ? void 0 : c.itemName}: ${c == null ? void 0 : c.quantity} ${(c == null ? void 0 : c.uomName) ?? "N/A"}`
|
|
2209
|
-
)
|
|
2210
|
-
)
|
|
2211
|
-
])
|
|
2212
|
-
);
|
|
2213
|
-
},
|
|
2214
|
-
size: 150
|
|
2215
|
-
}
|
|
2216
|
-
], i = N();
|
|
2217
|
-
return (s, e) => {
|
|
2218
|
-
const c = F("FmButton"), h = F("FmTable");
|
|
2219
|
-
return x(), _(Q, null, [
|
|
2220
|
-
r("div", Dn, [
|
|
2221
|
-
e[1] || (e[1] = r("span", null, "Last 30 Days:", -1)),
|
|
2222
|
-
b(c, {
|
|
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: f
|
|
2231
|
-
}, null, 8, ["loading"])
|
|
2232
|
-
]),
|
|
2233
|
-
b(h, {
|
|
2234
|
-
modelValue: i.value,
|
|
2235
|
-
"onUpdate:modelValue": e[0] || (e[0] = (E) => i.value = E),
|
|
2236
|
-
"row-data": y.value,
|
|
2237
|
-
"column-defs": m,
|
|
2238
|
-
loading: u.value
|
|
2239
|
-
}, null, 8, ["modelValue", "row-data", "loading"])
|
|
2240
|
-
], 64);
|
|
2241
|
-
};
|
|
2242
|
-
}
|
|
2243
|
-
}), On = { class: "flex flex-col gap-8" }, jn = {
|
|
2244
|
-
key: 0,
|
|
2245
|
-
class: "flex flex-col gap-4"
|
|
2246
|
-
}, zn = { class: "flex gap-2" }, Un = {
|
|
2247
|
-
key: 1,
|
|
2248
|
-
class: "flex items-center my-2 border rounded-lg p-2"
|
|
2249
|
-
}, Hn = { class: "flex flex-col" }, Xn = { class: "font-medium" }, Pn = { class: "text-xs text-gray-400" }, Qn = { class: "text-xs text-gray-400" }, Yn = { class: "flex my-4" }, Jn = { class: "flex" }, Kn = {
|
|
2250
|
-
key: 1,
|
|
2251
|
-
class: "flex flex-col"
|
|
2252
|
-
}, qn = {
|
|
2253
|
-
key: 1,
|
|
2254
|
-
class: "flex flex-col"
|
|
2255
|
-
}, Zn = /* @__PURE__ */ P({
|
|
2256
|
-
__name: "InventoryTransfer",
|
|
2257
|
-
props: {
|
|
2258
|
-
nsLocations: {},
|
|
2259
|
-
currentLocationSetting: {},
|
|
2260
|
-
currentLocationSubsidiary: {}
|
|
2261
|
-
},
|
|
2262
|
-
setup(V) {
|
|
2263
|
-
const y = de(), n = ne(), u = ce(), t = pe(), o = W(), { t: l } = ve(), f = N([]), m = [{ label: "Transfer Out" }, { label: "History" }], i = N(m[0]), s = N(!1), e = N(null), c = N(null), h = V, E = O(() => {
|
|
2264
|
-
const I = n.currentLocationSetting, A = n.configuredLocations;
|
|
2265
|
-
return h.nsLocations.map((d) => ({
|
|
2266
|
-
label: d.name,
|
|
2267
|
-
value: d,
|
|
2268
|
-
disabled: A.some((v) => v.netSuiteId === d.netsuiteId) || d.subsidiaryId !== (I == null ? void 0 : I.subsidiaryId)
|
|
2269
|
-
}));
|
|
2270
|
-
}), C = O({
|
|
2271
|
-
get() {
|
|
2272
|
-
return e.value ? e.value.toISOString().slice(0, 10) : "";
|
|
2273
|
-
},
|
|
2274
|
-
set(I) {
|
|
2275
|
-
if (!I) {
|
|
2276
|
-
e.value = null;
|
|
2277
|
-
return;
|
|
2278
|
-
}
|
|
2279
|
-
const A = e.value ?? /* @__PURE__ */ new Date(), d = new Date(I);
|
|
2280
|
-
A.setFullYear(d.getFullYear(), d.getMonth(), d.getDate()), e.value = new Date(A);
|
|
2281
|
-
}
|
|
2282
|
-
}), p = O({
|
|
2283
|
-
get() {
|
|
2284
|
-
if (!e.value) return null;
|
|
2285
|
-
const I = String(e.value.getHours()).padStart(2, "0"), A = String(e.value.getMinutes()).padStart(2, "0");
|
|
2286
|
-
return `${I}:${A}`;
|
|
2287
|
-
},
|
|
2288
|
-
set(I) {
|
|
2289
|
-
if (!I) return;
|
|
2290
|
-
const [A, d] = I.split(":").map(Number), v = e.value ?? /* @__PURE__ */ new Date();
|
|
2291
|
-
v.setHours(A, d), e.value = new Date(v);
|
|
2292
|
-
}
|
|
2293
|
-
}), a = O(() => C.value && p.value && c.value && f.value.length > 0 && !s.value);
|
|
2294
|
-
async function g() {
|
|
2295
|
-
if (a.value) {
|
|
2296
|
-
if (!h.currentLocationSetting) {
|
|
2297
|
-
o.open({
|
|
2298
|
-
message: "Current location setting is not available",
|
|
2299
|
-
type: "error"
|
|
2300
|
-
});
|
|
2301
|
-
return;
|
|
2302
|
-
}
|
|
2303
|
-
s.value = !0;
|
|
2304
|
-
try {
|
|
2305
|
-
const I = {
|
|
2306
|
-
items: f.value,
|
|
2307
|
-
date: e.value.toISOString(),
|
|
2308
|
-
netsuiteLocationId: c.value.netsuiteId,
|
|
2309
|
-
netsuiteLocationName: c.value.name
|
|
2310
|
-
}, A = `${h.currentLocationSetting.type}_${h.currentLocationSetting.id}`;
|
|
2311
|
-
await t.createInventoryTransfer(A, I), f.value = [], e.value = null, c.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
|
-
s.value = !1;
|
|
2322
|
-
}
|
|
2323
|
-
}
|
|
2324
|
-
}
|
|
2325
|
-
function B() {
|
|
2326
|
-
const I = n.currentLocationSubsidiary(), A = n.getAvailableItems(I.id), d = u.skus.filter((T) => A.includes(T._id)).map((T) => T._id), v = u.skus.map(
|
|
2327
|
-
(T) => ({
|
|
2328
|
-
label: T.name,
|
|
2329
|
-
sublabel: T.code,
|
|
2330
|
-
value: T,
|
|
2331
|
-
disabled: !d.includes(T._id)
|
|
2332
|
-
})
|
|
2333
|
-
), S = v.filter((T) => {
|
|
2334
|
-
var M;
|
|
2335
|
-
return (M = f.value) == null ? void 0 : M.find((H) => H.sku._id === T.value._id);
|
|
2336
|
-
}).map((T) => T.value);
|
|
2337
|
-
y.open({
|
|
2338
|
-
title: l("inventory.transfer.form.items.selectItem"),
|
|
2339
|
-
closeButton: !0,
|
|
2340
|
-
contentComponent: at,
|
|
2341
|
-
contentComponentProps: {
|
|
2342
|
-
modelValue: S,
|
|
2343
|
-
items: v,
|
|
2344
|
-
virtualScroll: !0
|
|
2345
|
-
},
|
|
2346
|
-
primaryActions: {
|
|
2347
|
-
text: l("common.confirm"),
|
|
2348
|
-
close: !0
|
|
2349
|
-
},
|
|
2350
|
-
secondaryActions: {
|
|
2351
|
-
text: l("common.close"),
|
|
2352
|
-
close: !0,
|
|
2353
|
-
variant: "tertiary"
|
|
2354
|
-
}
|
|
2355
|
-
}).onPrimary((T) => {
|
|
2356
|
-
const M = f.value, H = T.map((X) => {
|
|
2357
|
-
const R = M.find((re) => re.sku._id === X._id);
|
|
2358
|
-
return R || {
|
|
2359
|
-
sku: X,
|
|
2360
|
-
code: X.code,
|
|
2361
|
-
name: X.name,
|
|
2362
|
-
quantity: {
|
|
2363
|
-
amount: 1,
|
|
2364
|
-
precision: 0
|
|
2365
|
-
}
|
|
2366
|
-
};
|
|
2367
|
-
});
|
|
2368
|
-
H.sort((X, R) => X.sku.code.localeCompare(R.sku.code)), f.value = H;
|
|
2369
|
-
});
|
|
2370
|
-
}
|
|
2371
|
-
return (I, A) => {
|
|
2372
|
-
const d = F("FmButtonGroup"), v = F("FmLabel"), S = F("FmField"), T = F("FmSimpleDatePicker"), M = F("FmTimePicker"), H = F("FmSelect"), X = F("FmIcon"), R = F("FmButton");
|
|
2373
|
-
return x(), _("div", On, [
|
|
2374
|
-
b(d, {
|
|
2375
|
-
modelValue: i.value,
|
|
2376
|
-
"onUpdate:modelValue": A[0] || (A[0] = (j) => i.value = j),
|
|
2377
|
-
items: m
|
|
2378
|
-
}, null, 8, ["modelValue"]),
|
|
2379
|
-
i.value.label === "Transfer Out" ? (x(), _(Q, { key: 0 }, [
|
|
2380
|
-
k(n).inventoryTransferOutEnabled ? (x(), _("div", jn, [
|
|
2381
|
-
b(v, { class: "fm-typo-en-body-md-600" }, {
|
|
2382
|
-
default: L(() => A[6] || (A[6] = [
|
|
2383
|
-
J("Type")
|
|
2384
|
-
])),
|
|
2385
|
-
_: 1
|
|
2386
|
-
}),
|
|
2387
|
-
b(S, {
|
|
2388
|
-
class: "my-4",
|
|
2389
|
-
disabled: "",
|
|
2390
|
-
"prepend-icon": "lock"
|
|
2391
|
-
}, {
|
|
2392
|
-
default: L(() => A[7] || (A[7] = [
|
|
2393
|
-
J("Transfer out")
|
|
2394
|
-
])),
|
|
2395
|
-
_: 1
|
|
2396
|
-
}),
|
|
2397
|
-
b(v, { class: "fm-typo-en-body-md-600" }, {
|
|
2398
|
-
default: L(() => A[8] || (A[8] = [
|
|
2399
|
-
J("Subsidiary")
|
|
2400
|
-
])),
|
|
2401
|
-
_: 1
|
|
2402
|
-
}),
|
|
2403
|
-
b(S, {
|
|
2404
|
-
class: "my-4",
|
|
2405
|
-
disabled: "",
|
|
2406
|
-
"prepend-icon": "lock"
|
|
2407
|
-
}, {
|
|
2408
|
-
default: L(() => [
|
|
2409
|
-
J(D(I.currentLocationSubsidiary.fullName), 1)
|
|
2410
|
-
]),
|
|
2411
|
-
_: 1
|
|
2412
|
-
}),
|
|
2413
|
-
b(v, { class: "fm-typo-en-body-md-600" }, {
|
|
2414
|
-
default: L(() => A[9] || (A[9] = [
|
|
2415
|
-
J("Transaction date")
|
|
2416
|
-
])),
|
|
2417
|
-
_: 1
|
|
2418
|
-
}),
|
|
2419
|
-
b(T, {
|
|
2420
|
-
modelValue: C.value,
|
|
2421
|
-
"onUpdate:modelValue": A[1] || (A[1] = (j) => C.value = j)
|
|
2422
|
-
}, null, 8, ["modelValue"]),
|
|
2423
|
-
b(v, { class: "fm-typo-en-body-md-600" }, {
|
|
2424
|
-
default: L(() => A[10] || (A[10] = [
|
|
2425
|
-
J("Transaction time")
|
|
2426
|
-
])),
|
|
2427
|
-
_: 1
|
|
2428
|
-
}),
|
|
2429
|
-
b(M, {
|
|
2430
|
-
modelValue: p.value,
|
|
2431
|
-
"onUpdate:modelValue": A[2] || (A[2] = (j) => p.value = j)
|
|
2432
|
-
}, null, 8, ["modelValue"]),
|
|
2433
|
-
b(v, { class: "fm-typo-en-body-md-600" }, {
|
|
2434
|
-
default: L(() => A[11] || (A[11] = [
|
|
2435
|
-
J("NetSuite Location")
|
|
2436
|
-
])),
|
|
2437
|
-
_: 1
|
|
2438
|
-
}),
|
|
2439
|
-
r("div", zn, [
|
|
2440
|
-
c.value ? z("", !0) : (x(), U(H, {
|
|
2441
|
-
key: 0,
|
|
2442
|
-
class: "my-4 w-full",
|
|
2443
|
-
modelValue: c.value,
|
|
2444
|
-
"onUpdate:modelValue": A[3] || (A[3] = (j) => c.value = j),
|
|
2445
|
-
searchable: "",
|
|
2446
|
-
searchTarget: "label",
|
|
2447
|
-
items: E.value
|
|
2448
|
-
}, null, 8, ["modelValue", "items"])),
|
|
2449
|
-
c.value ? (x(), _("div", Un, [
|
|
2450
|
-
b(X, {
|
|
2451
|
-
name: "cloud",
|
|
2452
|
-
color: "neutral-gray-400",
|
|
2453
|
-
size: "md",
|
|
2454
|
-
class: "mr-2",
|
|
2455
|
-
outline: ""
|
|
2456
|
-
}),
|
|
2457
|
-
r("div", Hn, [
|
|
2458
|
-
r("span", Xn, D(c.value.name), 1),
|
|
2459
|
-
r("span", Pn, "ID: " + D(c.value.netsuiteId), 1),
|
|
2460
|
-
r("span", Qn, "Subsidiary: " + D(c.value.subsidiaryName), 1)
|
|
2461
|
-
]),
|
|
2462
|
-
b(R, {
|
|
2463
|
-
class: "ml-2",
|
|
2464
|
-
variant: "secondary",
|
|
2465
|
-
label: "Clear",
|
|
2466
|
-
onClick: A[4] || (A[4] = (j) => c.value = null)
|
|
2467
|
-
})
|
|
2468
|
-
])) : z("", !0)
|
|
2469
|
-
]),
|
|
2470
|
-
r("div", Yn, [
|
|
2471
|
-
b(R, {
|
|
2472
|
-
class: "ml-auto",
|
|
2473
|
-
variant: "secondary",
|
|
2474
|
-
"prepend-icon": "add",
|
|
2475
|
-
label: "Ingredients",
|
|
2476
|
-
onClick: B
|
|
2477
|
-
})
|
|
2478
|
-
]),
|
|
2479
|
-
b(Mn, {
|
|
2480
|
-
modelValue: f.value,
|
|
2481
|
-
"onUpdate:modelValue": A[5] || (A[5] = (j) => f.value = j)
|
|
2482
|
-
}, null, 8, ["modelValue"]),
|
|
2483
|
-
r("div", Jn, [
|
|
2484
|
-
b(R, {
|
|
2485
|
-
class: "ml-auto mt-4",
|
|
2486
|
-
variant: "primary",
|
|
2487
|
-
"prepend-icon": "add",
|
|
2488
|
-
label: "Create",
|
|
2489
|
-
disabled: !a.value,
|
|
2490
|
-
loading: s.value,
|
|
2491
|
-
onClick: g
|
|
2492
|
-
}, null, 8, ["disabled", "loading"])
|
|
2493
|
-
])
|
|
2494
|
-
])) : (x(), _("div", Kn, [
|
|
2495
|
-
b(v, { class: "fm-typo-en-body-md-600" }, {
|
|
2496
|
-
default: L(() => A[12] || (A[12] = [
|
|
2497
|
-
J(" Feature is not enabled. Please contact your administrator. ")
|
|
2498
|
-
])),
|
|
2499
|
-
_: 1
|
|
2500
|
-
})
|
|
2501
|
-
]))
|
|
2502
|
-
], 64)) : z("", !0),
|
|
2503
|
-
i.value.label === "History" ? (x(), _("div", qn, [
|
|
2504
|
-
b(Rn)
|
|
2505
|
-
])) : z("", !0)
|
|
2506
|
-
]);
|
|
2507
|
-
};
|
|
2508
|
-
}
|
|
2509
|
-
}), Gn = { class: "flex flex-col gap-8" }, Wn = {
|
|
2510
|
-
key: 0,
|
|
2511
|
-
class: "flex flex-col gap-4"
|
|
2512
|
-
}, $n = { style: { "list-style-type": "initial", "padding-left": "1rem" } }, eo = /* @__PURE__ */ P({
|
|
2513
|
-
__name: "TransferOrder",
|
|
2514
|
-
props: {
|
|
2515
|
-
currentLocationSetting: {}
|
|
2516
|
-
},
|
|
2517
|
-
setup(V) {
|
|
2518
|
-
const y = de();
|
|
2519
|
-
ae();
|
|
2520
|
-
const n = pe(), u = W(), t = N(!1), o = V, l = N([]);
|
|
2521
|
-
async function f() {
|
|
2522
|
-
var i;
|
|
2523
|
-
t.value = !0;
|
|
2524
|
-
try {
|
|
2525
|
-
const s = ((i = o.currentLocationSetting) == null ? void 0 : i.id) || "", e = await n.getUnSyncTransferInOrders(s);
|
|
2526
|
-
l.value = e, u.open({
|
|
2527
|
-
message: "Check unsync transfer in order successfully",
|
|
2528
|
-
type: "success"
|
|
2529
|
-
});
|
|
2530
|
-
} catch {
|
|
2531
|
-
u.open({
|
|
2532
|
-
message: "Failed to check unsync transfer in order",
|
|
2533
|
-
type: "error"
|
|
2534
|
-
});
|
|
2535
|
-
} finally {
|
|
2536
|
-
t.value = !1;
|
|
2537
|
-
}
|
|
2538
|
-
}
|
|
2539
|
-
async function m() {
|
|
2540
|
-
if (l.value.length === 0) {
|
|
2541
|
-
u.open({
|
|
2542
|
-
message: "No unsynced transfer orders to sync",
|
|
2543
|
-
type: "info"
|
|
2544
|
-
});
|
|
2545
|
-
return;
|
|
2546
|
-
}
|
|
2547
|
-
y.open({
|
|
2548
|
-
title: "Sync Transfer Order",
|
|
2549
|
-
message: "Are you sure you want to sync these transfer orders?",
|
|
2550
|
-
primaryActions: { text: "Proceed", close: !0 }
|
|
2551
|
-
}).onPrimary(async () => {
|
|
2552
|
-
t.value = !0;
|
|
2553
|
-
try {
|
|
2554
|
-
await n.manualSyncMultipleTransferInOrders(l.value), await new Promise((i) => setTimeout(i, 5e3)), u.open({
|
|
2555
|
-
message: "Sync transfer orders request sent successfully",
|
|
2556
|
-
type: "success"
|
|
2557
|
-
});
|
|
2558
|
-
} catch (i) {
|
|
2559
|
-
console.log(i), u.open({
|
|
2560
|
-
message: "Failed to sync transfer orders",
|
|
2561
|
-
type: "error"
|
|
2562
|
-
});
|
|
2563
|
-
} finally {
|
|
2564
|
-
t.value = !1;
|
|
2565
|
-
}
|
|
2566
|
-
});
|
|
2567
|
-
}
|
|
2568
|
-
return (i, s) => {
|
|
2569
|
-
const e = F("FmButton");
|
|
2570
|
-
return x(), _("div", Gn, [
|
|
2571
|
-
r("span", null, "Current date and time: " + D((/* @__PURE__ */ new Date()).toLocaleString()), 1),
|
|
2572
|
-
b(e, {
|
|
2573
|
-
label: "Check Unsync Transfer Order (Last 2 months)",
|
|
2574
|
-
variant: "primary",
|
|
2575
|
-
onClick: f,
|
|
2576
|
-
disabled: t.value,
|
|
2577
|
-
loading: t.value
|
|
2578
|
-
}, null, 8, ["disabled", "loading"]),
|
|
2579
|
-
l.value.length > 0 ? (x(), _("div", Wn, [
|
|
2580
|
-
s[0] || (s[0] = r("p", null, "Transfer Order NetSuite ID not match with existing orders", -1)),
|
|
2581
|
-
r("ul", $n, [
|
|
2582
|
-
(x(!0), _(Q, null, ee(l.value, (c) => (x(), _("li", { key: c }, D(c), 1))), 128))
|
|
2583
|
-
]),
|
|
2584
|
-
r("div", null, [
|
|
2585
|
-
b(Ve, null, {
|
|
2586
|
-
default: L(() => [
|
|
2587
|
-
l.value.length > 0 ? (x(), U(e, {
|
|
2588
|
-
key: 0,
|
|
2589
|
-
label: "Sync now",
|
|
2590
|
-
variant: "destructive",
|
|
2591
|
-
onClick: m,
|
|
2592
|
-
disabled: t.value,
|
|
2593
|
-
loading: t.value
|
|
2594
|
-
}, null, 8, ["disabled", "loading"])) : z("", !0)
|
|
2595
|
-
]),
|
|
2596
|
-
_: 1
|
|
2597
|
-
})
|
|
2598
|
-
])
|
|
2599
|
-
])) : z("", !0)
|
|
2600
|
-
]);
|
|
2601
|
-
};
|
|
2602
|
-
}
|
|
2603
|
-
}), to = { class: "flex flex-col gap-8" }, no = {
|
|
2604
|
-
key: 0,
|
|
2605
|
-
class: "flex flex-col gap-4"
|
|
2606
|
-
}, oo = { style: { "list-style-type": "initial", "padding-left": "1rem" } }, so = /* @__PURE__ */ P({
|
|
2607
|
-
__name: "PurchaseOrder",
|
|
2608
|
-
props: {
|
|
2609
|
-
currentLocationSetting: {}
|
|
2610
|
-
},
|
|
2611
|
-
setup(V) {
|
|
2612
|
-
const y = de();
|
|
2613
|
-
ae();
|
|
2614
|
-
const n = pe(), u = W(), t = N(!1), o = V, l = N([]);
|
|
2615
|
-
async function f() {
|
|
2616
|
-
var i;
|
|
2617
|
-
t.value = !0;
|
|
2618
|
-
try {
|
|
2619
|
-
const s = ((i = o.currentLocationSetting) == null ? void 0 : i.id) || "", e = await n.getUnSyncPurchaseOrders(s);
|
|
2620
|
-
l.value = e, u.open({
|
|
2621
|
-
message: "Check unsync purchase order successfully",
|
|
2622
|
-
type: "success"
|
|
2623
|
-
});
|
|
2624
|
-
} catch {
|
|
2625
|
-
u.open({
|
|
2626
|
-
message: "Failed to check unsync purchase order",
|
|
2627
|
-
type: "error"
|
|
2628
|
-
});
|
|
2629
|
-
} finally {
|
|
2630
|
-
t.value = !1;
|
|
2631
|
-
}
|
|
2632
|
-
}
|
|
2633
|
-
async function m() {
|
|
2634
|
-
if (l.value.length === 0) {
|
|
2635
|
-
u.open({
|
|
2636
|
-
message: "No unsynced purchase orders to sync",
|
|
2637
|
-
type: "info"
|
|
2638
|
-
});
|
|
2639
|
-
return;
|
|
2640
|
-
}
|
|
2641
|
-
y.open({
|
|
2642
|
-
title: "Sync Purchase Order",
|
|
2643
|
-
message: "Are you sure you want to sync these purchase orders?",
|
|
2644
|
-
primaryActions: { text: "Proceed", close: !0 }
|
|
2645
|
-
}).onPrimary(async () => {
|
|
2646
|
-
t.value = !0;
|
|
2647
|
-
try {
|
|
2648
|
-
await n.manualSyncMultiplePurchaseOrders(l.value), await new Promise((i) => setTimeout(i, 5e3)), u.open({
|
|
2649
|
-
message: "Sync purchase orders request sent successfully",
|
|
2650
|
-
type: "success"
|
|
2651
|
-
});
|
|
2652
|
-
} catch (i) {
|
|
2653
|
-
console.log(i), u.open({
|
|
2654
|
-
message: "Failed to sync purchase orders",
|
|
2655
|
-
type: "error"
|
|
2656
|
-
});
|
|
2657
|
-
} finally {
|
|
2658
|
-
t.value = !1;
|
|
2659
|
-
}
|
|
2660
|
-
});
|
|
2661
|
-
}
|
|
2662
|
-
return (i, s) => {
|
|
2663
|
-
const e = F("FmButton");
|
|
2664
|
-
return x(), _("div", to, [
|
|
2665
|
-
r("span", null, "Current date and time: " + D((/* @__PURE__ */ new Date()).toLocaleString()), 1),
|
|
2666
|
-
b(e, {
|
|
2667
|
-
label: "Check Unsync Purchase Order (Last 2 months)",
|
|
2668
|
-
variant: "primary",
|
|
2669
|
-
onClick: f,
|
|
2670
|
-
disabled: t.value,
|
|
2671
|
-
loading: t.value
|
|
2672
|
-
}, null, 8, ["disabled", "loading"]),
|
|
2673
|
-
l.value.length > 0 ? (x(), _("div", no, [
|
|
2674
|
-
s[0] || (s[0] = r("p", null, "Purchase Order NetSuite ID not match with existing orders", -1)),
|
|
2675
|
-
r("ul", oo, [
|
|
2676
|
-
(x(!0), _(Q, null, ee(l.value, (c) => (x(), _("li", { key: c }, D(c), 1))), 128))
|
|
2677
|
-
]),
|
|
2678
|
-
r("div", null, [
|
|
2679
|
-
b(Ve, null, {
|
|
2680
|
-
default: L(() => [
|
|
2681
|
-
l.value.length > 0 ? (x(), U(e, {
|
|
2682
|
-
key: 0,
|
|
2683
|
-
label: "Sync now",
|
|
2684
|
-
variant: "destructive",
|
|
2685
|
-
onClick: m,
|
|
2686
|
-
disabled: t.value,
|
|
2687
|
-
loading: t.value
|
|
2688
|
-
}, null, 8, ["disabled", "loading"])) : z("", !0)
|
|
2689
|
-
]),
|
|
2690
|
-
_: 1
|
|
2691
|
-
})
|
|
2692
|
-
])
|
|
2693
|
-
])) : z("", !0)
|
|
2694
|
-
]);
|
|
2695
|
-
};
|
|
2696
|
-
}
|
|
2697
|
-
}), ao = { class: "flex flex-col gap-8 w-full" }, lo = { class: "flex gap-4 justify-between" }, io = { 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" }, ro = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, uo = { key: 0 }, co = { class: "flex gap-8 items-center justify-start" }, mo = /* @__PURE__ */ P({
|
|
2698
|
-
__name: "NetSuiteSideSheet",
|
|
2699
|
-
props: {
|
|
2700
|
-
nsLocations: {},
|
|
2701
|
-
show: { type: Boolean },
|
|
2702
|
-
loading: { type: Boolean }
|
|
2703
|
-
},
|
|
2704
|
-
emits: ["update:show"],
|
|
2705
|
-
setup(V, { emit: y }) {
|
|
2706
|
-
var C;
|
|
2707
|
-
const n = ae(), u = ne(), t = V, o = ie(t, "show"), { t: l } = G(), f = y, m = te(), i = ((C = m._currentLocation) == null ? void 0 : C.type) || "", s = [
|
|
2708
|
-
{
|
|
2709
|
-
label: "Inventory Transfer (Out)",
|
|
2710
|
-
value: "inventoryTransfer"
|
|
2711
|
-
/* INVENTORY_TRANSFER */
|
|
2712
|
-
},
|
|
2713
|
-
{
|
|
2714
|
-
label: "Transfer Order",
|
|
2715
|
-
value: "transferOrder"
|
|
2716
|
-
/* TRANSFER_ORDER */
|
|
2717
|
-
},
|
|
2718
|
-
{
|
|
2719
|
-
label: "Purchase Order",
|
|
2720
|
-
value: "purchaseOrder"
|
|
2721
|
-
/* PURCHASE_ORDER */
|
|
2722
|
-
}
|
|
2723
|
-
], e = N(s[0].value), c = O(() => u.currentLocationSubsidiary()), h = O(() => u.currentLocationSetting), E = O(() => t.nsLocations.filter(
|
|
2724
|
-
(p) => p.subsidiaryId === c.value.id || p.netsuiteId === c.value.id
|
|
2725
|
-
));
|
|
2726
|
-
return (p, a) => {
|
|
2727
|
-
var d;
|
|
2728
|
-
const g = F("FmIcon"), B = F("FmTabs"), I = F("FmButton"), A = F("FmSideSheet");
|
|
2729
|
-
return x(), U(A, {
|
|
2730
|
-
modelValue: k(o),
|
|
2731
|
-
"onUpdate:modelValue": a[2] || (a[2] = (v) => le(o) ? o.value = v : null),
|
|
2732
|
-
header: "Data migration (Xilnex)",
|
|
2733
|
-
"dismiss-away": "",
|
|
2734
|
-
"close-button": "",
|
|
2735
|
-
"max-width": 800
|
|
2736
|
-
}, oe({
|
|
2737
|
-
default: L(() => [
|
|
2738
|
-
k(u).isCurrentLocationBindedToNetSuite ? (x(), _(Q, { key: 1 }, [
|
|
2739
|
-
e.value === "inventoryTransfer" ? (x(), U(Zn, {
|
|
2740
|
-
key: 0,
|
|
2741
|
-
currentLocationSetting: h.value,
|
|
2742
|
-
nsLocations: E.value,
|
|
2743
|
-
currentLocationSubsidiary: c.value
|
|
2744
|
-
}, null, 8, ["currentLocationSetting", "nsLocations", "currentLocationSubsidiary"])) : z("", !0),
|
|
2745
|
-
e.value === "transferOrder" ? (x(), U(eo, {
|
|
2746
|
-
key: 1,
|
|
2747
|
-
currentLocationSetting: h.value
|
|
2748
|
-
}, null, 8, ["currentLocationSetting"])) : z("", !0),
|
|
2749
|
-
e.value === "purchaseOrder" ? (x(), U(so, {
|
|
2750
|
-
key: 2,
|
|
2751
|
-
currentLocationSetting: h.value
|
|
2752
|
-
}, null, 8, ["currentLocationSetting"])) : z("", !0)
|
|
2753
|
-
], 64)) : (x(), _("div", uo, " Netsuite is not configured for this location. Please contact your administrator. "))
|
|
2754
|
-
]),
|
|
2755
|
-
"side-sheet-footer": L(() => [
|
|
2756
|
-
r("div", co, [
|
|
2757
|
-
b(I, {
|
|
2758
|
-
variant: "tertiary",
|
|
2759
|
-
label: k(l)("common.close"),
|
|
2760
|
-
onClick: a[1] || (a[1] = (v) => f("update:show", !1))
|
|
2761
|
-
}, null, 8, ["label"])
|
|
2762
|
-
])
|
|
2763
|
-
]),
|
|
2764
|
-
_: 2
|
|
2765
|
-
}, [
|
|
2766
|
-
(d = k(n).sessionUser.value) != null && d.role.isAdmin ? {
|
|
2767
|
-
name: "side-sheet-header",
|
|
2768
|
-
fn: L(() => {
|
|
2769
|
-
var v;
|
|
2770
|
-
return [
|
|
2771
|
-
r("div", ao, [
|
|
2772
|
-
r("div", lo, [
|
|
2773
|
-
a[3] || (a[3] = r("div", { class: "fm-typo-en-title-md-600" }, "NetSuite Integration", -1)),
|
|
2774
|
-
r("div", io, [
|
|
2775
|
-
b(g, {
|
|
2776
|
-
name: k(i),
|
|
2777
|
-
size: "sm"
|
|
2778
|
-
}, null, 8, ["name"]),
|
|
2779
|
-
r("div", ro, D((v = k(m)._currentLocation) == null ? void 0 : v.name), 1)
|
|
2780
|
-
])
|
|
2781
|
-
]),
|
|
2782
|
-
b(B, {
|
|
2783
|
-
"model-value": e.value,
|
|
2784
|
-
"onUpdate:modelValue": a[0] || (a[0] = (S) => e.value = S),
|
|
2785
|
-
items: s
|
|
2786
|
-
}, null, 8, ["model-value"])
|
|
2787
|
-
])
|
|
2788
|
-
];
|
|
2789
|
-
}),
|
|
2790
|
-
key: "0"
|
|
2791
|
-
} : void 0
|
|
2792
|
-
]), 1032, ["modelValue"]);
|
|
2793
|
-
};
|
|
2794
|
-
}
|
|
2795
|
-
}), fo = { class: "flex justify-center" }, po = ["src"], vo = { class: "flex flex-col items-center gap-2" }, yo = { class: "text-lg font-bold" }, go = { class: "text-fm-color-neutral-gray-300" }, Ao = /* @__PURE__ */ P({
|
|
2796
|
-
__name: "NetSuite",
|
|
2797
|
-
setup(V) {
|
|
2798
|
-
const y = ne(), n = W(), u = N(!1), t = N(!1);
|
|
2799
|
-
async function o() {
|
|
2800
|
-
t.value = !0;
|
|
2801
|
-
}
|
|
2802
|
-
const l = N([]);
|
|
2803
|
-
Ye(async () => {
|
|
2804
|
-
if (y.isReady && y.isEnabled && !y.isBusinessLocation) {
|
|
2805
|
-
u.value = !0;
|
|
2806
|
-
try {
|
|
2807
|
-
const m = await y.getNetSuiteLocationOptions();
|
|
2808
|
-
l.value = m;
|
|
2809
|
-
} catch {
|
|
2810
|
-
n.open({
|
|
2811
|
-
message: "Failed to fetch NetSuite locations",
|
|
2812
|
-
type: "error"
|
|
2813
|
-
});
|
|
2814
|
-
} finally {
|
|
2815
|
-
u.value = !1;
|
|
2816
|
-
}
|
|
2817
|
-
}
|
|
2818
|
-
});
|
|
2819
|
-
const { t: f } = G();
|
|
2820
|
-
return (m, i) => {
|
|
2821
|
-
const s = F("FmCardSection"), e = F("FmCard");
|
|
2822
|
-
return k(y).isEnabled ? (x(), _(Q, { key: 0 }, [
|
|
2823
|
-
b(e, {
|
|
2824
|
-
class: K({
|
|
2825
|
-
"w-full": !0,
|
|
2826
|
-
border: !0,
|
|
2827
|
-
"border-fm-color-neutral-gray-100": !0,
|
|
2828
|
-
"cursor-pointer": !0,
|
|
2829
|
-
"hover:border-fm-color-primary": !0
|
|
2830
|
-
}),
|
|
2831
|
-
onClick: i[0] || (i[0] = (c) => o())
|
|
2832
|
-
}, {
|
|
2833
|
-
default: L(() => [
|
|
2834
|
-
b(s, null, {
|
|
2835
|
-
default: L(() => [
|
|
2836
|
-
r("div", fo, [
|
|
2837
|
-
r("img", {
|
|
2838
|
-
src: k(sn),
|
|
2839
|
-
alt: "NetSuite"
|
|
2840
|
-
}, null, 8, po)
|
|
2841
|
-
]),
|
|
2842
|
-
r("div", vo, [
|
|
2843
|
-
r("div", yo, D(k(f)("inventory.integration.netsuite.title")), 1),
|
|
2844
|
-
r("div", go, D(k(f)("inventory.integration.netsuite.description")), 1)
|
|
2845
|
-
])
|
|
2846
|
-
]),
|
|
2847
|
-
_: 1
|
|
2848
|
-
})
|
|
2849
|
-
]),
|
|
2850
|
-
_: 1
|
|
2851
|
-
}),
|
|
2852
|
-
k(y).state.setting ? (x(), U(fe, {
|
|
2853
|
-
key: 0,
|
|
2854
|
-
to: "body"
|
|
2855
|
-
}, [
|
|
2856
|
-
k(y).isBusinessLocation ? (x(), U(Tn, {
|
|
2857
|
-
key: 0,
|
|
2858
|
-
show: t.value,
|
|
2859
|
-
"onUpdate:show": [
|
|
2860
|
-
i[1] || (i[1] = (c) => t.value = c),
|
|
2861
|
-
i[2] || (i[2] = (c) => t.value = c)
|
|
2862
|
-
],
|
|
2863
|
-
loading: u.value,
|
|
2864
|
-
"onUpdate:loading": i[3] || (i[3] = (c) => u.value = c)
|
|
2865
|
-
}, null, 8, ["show", "loading"])) : (x(), U(mo, {
|
|
2866
|
-
key: 1,
|
|
2867
|
-
setting: k(y).state.setting,
|
|
2868
|
-
"onUpdate:setting": i[4] || (i[4] = (c) => k(y).state.setting = c),
|
|
2869
|
-
nsLocations: l.value,
|
|
2870
|
-
"onUpdate:nsLocations": i[5] || (i[5] = (c) => l.value = c),
|
|
2871
|
-
show: t.value,
|
|
2872
|
-
"onUpdate:show": [
|
|
2873
|
-
i[6] || (i[6] = (c) => t.value = c),
|
|
2874
|
-
i[7] || (i[7] = (c) => t.value = c)
|
|
2875
|
-
],
|
|
2876
|
-
loading: u.value,
|
|
2877
|
-
"onUpdate:loading": i[8] || (i[8] = (c) => u.value = c)
|
|
2878
|
-
}, null, 8, ["setting", "nsLocations", "show", "loading"]))
|
|
2879
|
-
])) : z("", !0)
|
|
2880
|
-
], 64)) : z("", !0);
|
|
2881
|
-
};
|
|
2882
|
-
}
|
|
2883
|
-
}), Ie = [
|
|
2884
|
-
"store",
|
|
2885
|
-
"issueBy",
|
|
2886
|
-
"verifiedBy",
|
|
2887
|
-
"stockTakeId",
|
|
2888
|
-
"date",
|
|
2889
|
-
"status",
|
|
2890
|
-
"c_field",
|
|
2891
|
-
"itemCode",
|
|
2892
|
-
"itemName",
|
|
2893
|
-
"physicalQty",
|
|
2894
|
-
"ohQty",
|
|
2895
|
-
"customCost",
|
|
2896
|
-
"totalPhysicalCustomCost",
|
|
2897
|
-
"schemeFranchiseePrice",
|
|
2898
|
-
"physicalSchemeTotalFranchiseePrice"
|
|
2899
|
-
];
|
|
2900
|
-
async function bo(V, y, n) {
|
|
2901
|
-
var l;
|
|
2902
|
-
const u = await ho(n), t = [], o = {};
|
|
2903
|
-
for (const f in u) {
|
|
2904
|
-
const m = u[f];
|
|
2905
|
-
for (let i = 0; i < m.length; i++) {
|
|
2906
|
-
const s = m[i], e = s.itemCode, c = s.itemName, h = s.physicalQty, E = s.customCost;
|
|
2907
|
-
if (e === "" || e === "undefined") {
|
|
2908
|
-
t.push({
|
|
2909
|
-
row: s.excelRow,
|
|
2910
|
-
itemCode: e,
|
|
2911
|
-
itemName: c,
|
|
2912
|
-
message: "Item code is empty or undefined"
|
|
2913
|
-
});
|
|
2914
|
-
continue;
|
|
2915
|
-
}
|
|
2916
|
-
const C = y.find((I) => I.code === e);
|
|
2917
|
-
if (!C) {
|
|
2918
|
-
t.push({
|
|
2919
|
-
row: s.excelRow,
|
|
2920
|
-
itemCode: e,
|
|
2921
|
-
itemName: c,
|
|
2922
|
-
qty: h,
|
|
2923
|
-
message: "Item not found in inventory"
|
|
2924
|
-
}), console.error(`${s.excelRow} Item not found: ${e} ${c} ${h}`);
|
|
2925
|
-
continue;
|
|
2926
|
-
}
|
|
2927
|
-
let p = Number(s.totalPhysicalCustomCost);
|
|
2928
|
-
const a = V[C._id];
|
|
2929
|
-
a && (p = a * Number(h));
|
|
2930
|
-
const g = $.fromNumber(Number(h)), B = {
|
|
2931
|
-
amount: g,
|
|
2932
|
-
cost: {
|
|
2933
|
-
...$.fromNumber(Number(p)),
|
|
2934
|
-
currency: "MYR"
|
|
2935
|
-
}
|
|
2936
|
-
};
|
|
2937
|
-
h != "0" && E == "0" && console.warn(`Item ${e} ${c} has 0 cost.`), o[l = C._id] ?? (o[l] = {
|
|
2938
|
-
skuAdjustment: {
|
|
2939
|
-
sku: C,
|
|
2940
|
-
fromBalance: $.fromNumber(0),
|
|
2941
|
-
amounts: [
|
|
2942
|
-
{
|
|
2943
|
-
_id: null,
|
|
2944
|
-
type: Fe.Enum.CLOSING,
|
|
2945
|
-
remark: "Opening Balance",
|
|
2946
|
-
amount: g,
|
|
2947
|
-
measurement: null,
|
|
2948
|
-
// always the smallest unit
|
|
2949
|
-
cost: B.cost
|
|
2950
|
-
}
|
|
2951
|
-
],
|
|
2952
|
-
toBalance: g,
|
|
2953
|
-
toCostBalances: [B]
|
|
2954
|
-
},
|
|
2955
|
-
skuBalance: {
|
|
2956
|
-
id: C._id,
|
|
2957
|
-
balance: g,
|
|
2958
|
-
costs: [B]
|
|
2959
|
-
}
|
|
2960
|
-
});
|
|
2961
|
-
}
|
|
2962
|
-
}
|
|
2963
|
-
return {
|
|
2964
|
-
errors: t,
|
|
2965
|
-
rows: o
|
|
2966
|
-
};
|
|
2967
|
-
}
|
|
2968
|
-
async function ho(V) {
|
|
2969
|
-
const y = await new Promise((o, l) => {
|
|
2970
|
-
const f = new FileReader();
|
|
2971
|
-
f.onload = (m) => o(m.target.result), f.onerror = l, f.readAsArrayBuffer(V);
|
|
2972
|
-
}), n = Re(y, { type: "array" }), u = n.SheetNames, t = {};
|
|
2973
|
-
for (const o of u) {
|
|
2974
|
-
const l = await xo(n.Sheets[o]);
|
|
2975
|
-
t[o] = l;
|
|
2976
|
-
}
|
|
2977
|
-
return t;
|
|
2978
|
-
}
|
|
2979
|
-
async function xo(V) {
|
|
2980
|
-
const y = Oe.sheet_to_json(V, {
|
|
2981
|
-
header: Ie,
|
|
2982
|
-
range: 12
|
|
2983
|
-
}), n = [];
|
|
2984
|
-
for (let u = 0; u < y.length; u++) {
|
|
2985
|
-
const t = y[u], o = {};
|
|
2986
|
-
for (const l of Ie)
|
|
2987
|
-
o[l] = String(t[l]).trim();
|
|
2988
|
-
n.push({
|
|
2989
|
-
...o,
|
|
2990
|
-
excelRow: u + 13
|
|
2991
|
-
// Excel rows start from 1, and we skip the first 12 rows
|
|
2992
|
-
});
|
|
2993
|
-
}
|
|
2994
|
-
return n;
|
|
2995
|
-
}
|
|
2996
|
-
const Io = { class: "flex flex-col gap-4" }, So = { class: "flex flex-col" }, wo = {
|
|
2997
|
-
key: 0,
|
|
2998
|
-
class: "flex flex-col gap-4 my-5"
|
|
2999
|
-
}, ko = { class: "flex flex-col gap-8" }, Bo = { class: "flex flex-col gap-8" }, Fo = {
|
|
3000
|
-
class: /* @__PURE__ */ K(["fm-corner-radius-md p-16 flex items-center gap-16"])
|
|
3001
|
-
}, Co = {
|
|
3002
|
-
class: /* @__PURE__ */ K(["fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center gap-3"])
|
|
3003
|
-
}, Eo = { class: "line-clamp-2 text-ellipsis break-all" }, Vo = { class: "flex flex-col" }, _o = { class: "font-medium" }, Lo = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, No = {
|
|
3004
|
-
key: 0,
|
|
3005
|
-
class: "rounded border-1 border-gray-200 p-2 flex items-center"
|
|
3006
|
-
}, To = { class: "flex flex-col" }, Mo = { class: "font-medium" }, Do = { class: "text-xs text-gray-400" }, Ro = { class: "text-xs text-gray-400" }, Oo = { class: "flex" }, jo = { class: "flex" }, zo = {
|
|
3007
|
-
key: 1,
|
|
3008
|
-
class: "flex flex-col gap-2"
|
|
3009
|
-
}, Uo = /* @__PURE__ */ P({
|
|
3010
|
-
__name: "XilnexOpeningImport",
|
|
3011
|
-
setup(V) {
|
|
3012
|
-
const y = tt(), n = ne(), u = ce(), t = Ce(), o = W(), l = te(), f = O(() => [
|
|
3013
|
-
{
|
|
3014
|
-
value: "xilnex",
|
|
3015
|
-
label: "Xilnex",
|
|
3016
|
-
subLabel: "Based on Xilnex's item cost from excel file"
|
|
3017
|
-
},
|
|
3018
|
-
...n.isEnabled ? [
|
|
3019
|
-
{
|
|
3020
|
-
value: "netsuite",
|
|
3021
|
-
label: "NetSuite",
|
|
3022
|
-
subLabel: "Based on NetSuite's item current average cost by location. If not available, it will fallback to excel's cost",
|
|
3023
|
-
disabled: !n.isCurrentLocationBindedToNetSuite,
|
|
3024
|
-
disabledReason: "Current location is not binded to NetSuite"
|
|
3025
|
-
}
|
|
3026
|
-
] : []
|
|
3027
|
-
]), m = N(f.value[0].value), { t: i } = ve(), s = N(null), e = N(), c = N(""), h = N([]), E = N([]), C = [
|
|
3028
|
-
{
|
|
3029
|
-
id: "ingredient",
|
|
3030
|
-
header: () => "Ingredient",
|
|
3031
|
-
cell(v) {
|
|
3032
|
-
const S = v.row.original;
|
|
3033
|
-
return w("div", { class: "flex flex-col" }, [
|
|
3034
|
-
w("span", { class: "font-medium" }, S.skuAdjustment.sku.name),
|
|
3035
|
-
w("span", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, [
|
|
3036
|
-
S.skuAdjustment.sku.code
|
|
3037
|
-
])
|
|
3038
|
-
]);
|
|
3039
|
-
}
|
|
3040
|
-
},
|
|
3041
|
-
{
|
|
3042
|
-
id: "openingBalance",
|
|
3043
|
-
header: () => "Opening Balance",
|
|
3044
|
-
cell(v) {
|
|
3045
|
-
const S = v.row.original;
|
|
3046
|
-
return w("div", { class: "flex flex-col" }, [
|
|
3047
|
-
w(
|
|
3048
|
-
"span",
|
|
3049
|
-
{ class: "font-medium" },
|
|
3050
|
-
$.toFormatString({
|
|
3051
|
-
value: S.skuAdjustment.amounts[0].amount
|
|
3052
|
-
})
|
|
3053
|
-
)
|
|
3054
|
-
]);
|
|
3055
|
-
}
|
|
3056
|
-
},
|
|
3057
|
-
{
|
|
3058
|
-
id: "unit",
|
|
3059
|
-
header: () => "Unit",
|
|
3060
|
-
cell(v) {
|
|
3061
|
-
const S = v.row.original, T = !S.skuAdjustment.amounts[0].measurement;
|
|
3062
|
-
let M = S.skuAdjustment.sku.unit.name;
|
|
3063
|
-
if (!T) {
|
|
3064
|
-
const H = S.skuAdjustment.sku.unit.measurements.find(
|
|
3065
|
-
(X) => X.id === S.skuAdjustment.amounts[0].measurement.id
|
|
3066
|
-
);
|
|
3067
|
-
M = H ? H.name : "Error: Measurement not found";
|
|
3068
|
-
}
|
|
3069
|
-
return w("div", { class: "flex flex-col" }, [
|
|
3070
|
-
w("span", { class: "font-medium" }, M),
|
|
3071
|
-
T ? null : w("span", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, [
|
|
3072
|
-
`Base unit: ${S.skuAdjustment.sku.unit.name}`
|
|
3073
|
-
])
|
|
3074
|
-
]);
|
|
3075
|
-
}
|
|
3076
|
-
},
|
|
3077
|
-
{
|
|
3078
|
-
id: "totalCost",
|
|
3079
|
-
header: () => "Total Cost",
|
|
3080
|
-
cell(v) {
|
|
3081
|
-
const S = v.row.original, { currency: T, ...M } = S.skuAdjustment.amounts[0].cost ?? {
|
|
3082
|
-
amount: 0,
|
|
3083
|
-
precision: 0,
|
|
3084
|
-
currency: ""
|
|
3085
|
-
};
|
|
3086
|
-
return w("div", { class: "flex flex-col" }, [
|
|
3087
|
-
w(
|
|
3088
|
-
"span",
|
|
3089
|
-
{ class: "font-medium" },
|
|
3090
|
-
$.toFormatString({
|
|
3091
|
-
value: M
|
|
3092
|
-
})
|
|
3093
|
-
)
|
|
3094
|
-
]);
|
|
3095
|
-
}
|
|
3096
|
-
}
|
|
3097
|
-
], p = [
|
|
3098
|
-
{
|
|
3099
|
-
accessorKey: "row",
|
|
3100
|
-
header: "Row"
|
|
3101
|
-
},
|
|
3102
|
-
{
|
|
3103
|
-
accessorKey: "itemCode",
|
|
3104
|
-
header: "Item Code"
|
|
3105
|
-
},
|
|
3106
|
-
{
|
|
3107
|
-
accessorKey: "itemName",
|
|
3108
|
-
header: "Item Name"
|
|
3109
|
-
},
|
|
3110
|
-
{
|
|
3111
|
-
accessorKey: "qty",
|
|
3112
|
-
header: "Quantity"
|
|
3113
|
-
},
|
|
3114
|
-
{
|
|
3115
|
-
accessorKey: "message",
|
|
3116
|
-
header: "Error Message"
|
|
3117
|
-
}
|
|
3118
|
-
], a = N(!1);
|
|
3119
|
-
async function g() {
|
|
3120
|
-
if (s.value) {
|
|
3121
|
-
a.value = !0;
|
|
3122
|
-
try {
|
|
3123
|
-
let v = {};
|
|
3124
|
-
m.value === "netsuite" && (v = await n.getItemAverageCosts());
|
|
3125
|
-
const { errors: S, rows: T } = await bo(
|
|
3126
|
-
v,
|
|
3127
|
-
u.skus,
|
|
3128
|
-
s.value
|
|
3129
|
-
);
|
|
3130
|
-
h.value = S, E.value = Object.values(T);
|
|
3131
|
-
} catch {
|
|
3132
|
-
o.open({
|
|
3133
|
-
message: "Error verifying file",
|
|
3134
|
-
type: "error"
|
|
3135
|
-
});
|
|
3136
|
-
} finally {
|
|
3137
|
-
a.value = !1;
|
|
3138
|
-
}
|
|
3139
|
-
}
|
|
3140
|
-
}
|
|
3141
|
-
async function B() {
|
|
3142
|
-
if (s.value) {
|
|
3143
|
-
a.value = !0;
|
|
3144
|
-
try {
|
|
3145
|
-
if (!A.value) {
|
|
3146
|
-
o.open({
|
|
3147
|
-
message: "Please select a date for the opening balance",
|
|
3148
|
-
type: "error"
|
|
3149
|
-
});
|
|
3150
|
-
return;
|
|
3151
|
-
}
|
|
3152
|
-
await t.setOpeningBalance({
|
|
3153
|
-
effectiveAt: A.value,
|
|
3154
|
-
skuAdjustments: E.value.map((v) => v.skuAdjustment),
|
|
3155
|
-
skuBalances: E.value.map((v) => v.skuBalance)
|
|
3156
|
-
}), o.open({
|
|
3157
|
-
message: "Opening balance imported successfully",
|
|
3158
|
-
type: "success"
|
|
3159
|
-
}), await y.fetchClosingDocumentId();
|
|
3160
|
-
} catch {
|
|
3161
|
-
o.open({
|
|
3162
|
-
message: "Error importing opening balance",
|
|
3163
|
-
type: "error"
|
|
3164
|
-
});
|
|
3165
|
-
} finally {
|
|
3166
|
-
a.value = !1;
|
|
3167
|
-
}
|
|
3168
|
-
}
|
|
3169
|
-
}
|
|
3170
|
-
const I = N(""), A = O({
|
|
3171
|
-
get() {
|
|
3172
|
-
return I.value;
|
|
3173
|
-
},
|
|
3174
|
-
set(v) {
|
|
3175
|
-
I.value = `${v}T15:59:59.999Z`;
|
|
3176
|
-
}
|
|
3177
|
-
}), d = O(() => {
|
|
3178
|
-
if (!I.value) return null;
|
|
3179
|
-
const v = new Date(I.value);
|
|
3180
|
-
return isNaN(v.getTime()) ? null : be(v);
|
|
3181
|
-
});
|
|
3182
|
-
return (v, S) => {
|
|
3183
|
-
const T = F("FmLabel"), M = F("FmField"), H = F("FmSimpleDatePicker"), X = F("FmButton"), R = F("FmIcon"), j = F("FmRadio"), re = F("FmRadioGroup"), he = F("FmTable");
|
|
3184
|
-
return x(), _("div", Io, [
|
|
3185
|
-
r("div", So, [
|
|
3186
|
-
b(T, { label: "Latest closing" })
|
|
3187
|
-
]),
|
|
3188
|
-
b(M, {
|
|
3189
|
-
"prepend-icon": "lock_outline",
|
|
3190
|
-
disabled: ""
|
|
3191
|
-
}, {
|
|
3192
|
-
default: L(() => [
|
|
3193
|
-
J(D(k(y).state.closingDocumentId ? `${k(Te)(new Date(k(Ae)(k(y).state.closingDocumentId)))}` : "No closing found"), 1)
|
|
3194
|
-
]),
|
|
3195
|
-
_: 1
|
|
3196
|
-
}),
|
|
3197
|
-
k(y).state.closingDocumentId ? (x(), _("div", zo, [
|
|
3198
|
-
S[6] || (S[6] = r("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)),
|
|
3199
|
-
k(l)._currentLocation ? (x(), _(Q, { key: 0 }, [
|
|
3200
|
-
b(T, { label: "Location ID" }),
|
|
3201
|
-
b(M, {
|
|
3202
|
-
"prepend-icon": "lock_outline",
|
|
3203
|
-
disabled: ""
|
|
3204
|
-
}, {
|
|
3205
|
-
default: L(() => [
|
|
3206
|
-
J(D(k(l)._currentLocation.dbName.split("_")[1]), 1)
|
|
3207
|
-
]),
|
|
3208
|
-
_: 1
|
|
3209
|
-
})
|
|
3210
|
-
], 64)) : z("", !0)
|
|
3211
|
-
])) : (x(), _("div", wo, [
|
|
3212
|
-
b(H, {
|
|
3213
|
-
modelValue: A.value,
|
|
3214
|
-
"onUpdate:modelValue": S[0] || (S[0] = (Y) => A.value = Y),
|
|
3215
|
-
label: "Last closing time"
|
|
3216
|
-
}, {
|
|
3217
|
-
"trigger-button": L(() => [
|
|
3218
|
-
b(M, {
|
|
3219
|
-
"prepend-icon": "calendar_today",
|
|
3220
|
-
readonly: "",
|
|
3221
|
-
label: "Last closing time"
|
|
3222
|
-
}, {
|
|
3223
|
-
default: L(() => [
|
|
3224
|
-
J(D(d.value), 1)
|
|
3225
|
-
]),
|
|
3226
|
-
_: 1
|
|
3227
|
-
})
|
|
3228
|
-
]),
|
|
3229
|
-
_: 1
|
|
3230
|
-
}, 8, ["modelValue"]),
|
|
3231
|
-
r("div", ko, [
|
|
3232
|
-
b(T, { label: "Stock take file" })
|
|
3233
|
-
]),
|
|
3234
|
-
b(De, {
|
|
3235
|
-
onFileUpload: S[1] || (S[1] = (Y) => {
|
|
3236
|
-
Y && (s.value = Y);
|
|
3237
|
-
}),
|
|
3238
|
-
accept: ".xlsx, .xls, .csv"
|
|
3239
|
-
}, oe({ _: 2 }, [
|
|
3240
|
-
s.value ? {
|
|
3241
|
-
name: "default",
|
|
3242
|
-
fn: L(({ openFileDialog: Y }) => [
|
|
3243
|
-
r("div", Bo, [
|
|
3244
|
-
r("div", Fo, [
|
|
3245
|
-
r("div", Co, [
|
|
3246
|
-
r("div", Eo, D(s.value.name), 1),
|
|
3247
|
-
b(X, {
|
|
3248
|
-
label: k(i)("inventory.ingredient.import.replaceFile"),
|
|
3249
|
-
variant: "secondary",
|
|
3250
|
-
"prepend-icon": "autorenew",
|
|
3251
|
-
onClick: Y
|
|
3252
|
-
}, null, 8, ["label", "onClick"])
|
|
3253
|
-
])
|
|
3254
|
-
])
|
|
3255
|
-
])
|
|
3256
|
-
]),
|
|
3257
|
-
key: "0"
|
|
3258
|
-
} : void 0
|
|
3259
|
-
]), 1024),
|
|
3260
|
-
b(re, {
|
|
3261
|
-
modelValue: m.value,
|
|
3262
|
-
"onUpdate:modelValue": S[2] || (S[2] = (Y) => m.value = Y),
|
|
3263
|
-
label: "Retrieve cost from",
|
|
3264
|
-
class: "my-5"
|
|
3265
|
-
}, {
|
|
3266
|
-
default: L(() => [
|
|
3267
|
-
(x(!0), _(Q, null, ee(f.value, (Y) => (x(), U(j, {
|
|
3268
|
-
key: Y.value,
|
|
3269
|
-
value: Y.value,
|
|
3270
|
-
label: Y.label,
|
|
3271
|
-
sublabel: Y.subLabel,
|
|
3272
|
-
disabled: Y.disabled
|
|
3273
|
-
}, {
|
|
3274
|
-
label: L(() => [
|
|
3275
|
-
r("div", Vo, [
|
|
3276
|
-
r("span", _o, D(Y.label), 1),
|
|
3277
|
-
r("span", Lo, D(Y.disabled ? Y.disabledReason : Y.subLabel), 1)
|
|
3278
|
-
]),
|
|
3279
|
-
Y.value === "netsuite" && k(n).currentLocationSetting ? (x(), _("div", No, [
|
|
3280
|
-
b(R, {
|
|
3281
|
-
name: "cloud",
|
|
3282
|
-
color: "neutral-gray-400",
|
|
3283
|
-
size: "md",
|
|
3284
|
-
class: "mr-2",
|
|
3285
|
-
outline: !0
|
|
3286
|
-
}),
|
|
3287
|
-
r("div", To, [
|
|
3288
|
-
r("span", Mo, D(k(n).currentLocationSetting.name), 1),
|
|
3289
|
-
r("span", Do, "ID: " + D(k(n).currentLocationSetting.netSuiteId), 1),
|
|
3290
|
-
r("span", Ro, "Subsidiary: " + D(k(n).getSubsidiaryFullName(
|
|
3291
|
-
k(n).currentLocationSetting.subsidiaryId
|
|
3292
|
-
).fullName), 1)
|
|
3293
|
-
])
|
|
3294
|
-
])) : z("", !0)
|
|
3295
|
-
]),
|
|
3296
|
-
_: 2
|
|
3297
|
-
}, 1032, ["value", "label", "sublabel", "disabled"]))), 128))
|
|
3298
|
-
]),
|
|
3299
|
-
_: 1
|
|
3300
|
-
}, 8, ["modelValue"]),
|
|
3301
|
-
r("div", Oo, [
|
|
3302
|
-
b(X, {
|
|
3303
|
-
class: "ml-auto mt-4",
|
|
3304
|
-
variant: "secondary",
|
|
3305
|
-
"prepend-icon": "troubleshoot",
|
|
3306
|
-
label: "Verify",
|
|
3307
|
-
disabled: !s.value && !a.value,
|
|
3308
|
-
loading: a.value,
|
|
3309
|
-
onClick: g
|
|
3310
|
-
}, null, 8, ["disabled", "loading"])
|
|
3311
|
-
]),
|
|
3312
|
-
s.value && E.value.length > 0 ? (x(), _(Q, { key: 0 }, [
|
|
3313
|
-
S[4] || (S[4] = r("h2", { class: "fm-typo-en-title-md-800 mt-8 mb-4" }, "Results", -1)),
|
|
3314
|
-
b(he, {
|
|
3315
|
-
modelValue: e.value,
|
|
3316
|
-
"onUpdate:modelValue": S[3] || (S[3] = (Y) => e.value = Y),
|
|
3317
|
-
"row-data": E.value,
|
|
3318
|
-
"column-defs": C,
|
|
3319
|
-
"shrink-at": !1,
|
|
3320
|
-
"search-value": c.value
|
|
3321
|
-
}, null, 8, ["modelValue", "row-data", "search-value"])
|
|
3322
|
-
], 64)) : z("", !0),
|
|
3323
|
-
h.value.length > 0 ? (x(), _(Q, { key: 1 }, [
|
|
3324
|
-
S[5] || (S[5] = r("h2", { class: "fm-typo-en-title-md-800 mt-8 mb-4 text-red-600" }, "Errors", -1)),
|
|
3325
|
-
b(he, {
|
|
3326
|
-
"row-data": h.value,
|
|
3327
|
-
"column-defs": p
|
|
3328
|
-
}, null, 8, ["row-data"])
|
|
3329
|
-
], 64)) : z("", !0),
|
|
3330
|
-
r("div", jo, [
|
|
3331
|
-
E.value.length > 0 && !k(y).state.closingDocumentId ? (x(), U(X, {
|
|
3332
|
-
key: 0,
|
|
3333
|
-
class: "ml-auto mt-4",
|
|
3334
|
-
"prepend-icon": "file_upload",
|
|
3335
|
-
variant: "primary",
|
|
3336
|
-
label: "Import Opening Balance",
|
|
3337
|
-
disabled: !s.value || a.value,
|
|
3338
|
-
onClick: B
|
|
3339
|
-
}, null, 8, ["disabled"])) : z("", !0)
|
|
3340
|
-
])
|
|
3341
|
-
]))
|
|
3342
|
-
]);
|
|
3343
|
-
};
|
|
3344
|
-
}
|
|
3345
|
-
}), Ho = { class: "flex flex-col gap-8 w-full" }, Xo = { class: "flex gap-4 justify-between" }, Po = { 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" }, Qo = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, Yo = { key: 0 }, Jo = {
|
|
3346
|
-
key: 1,
|
|
3347
|
-
class: "flex flex-col gap-8 w-full"
|
|
3348
|
-
}, Ko = { key: 1 }, qo = { class: "flex gap-8 items-center justify-start" }, Zo = /* @__PURE__ */ P({
|
|
3349
|
-
__name: "XilnexSideSheet",
|
|
3350
|
-
props: {
|
|
3351
|
-
show: { type: Boolean },
|
|
3352
|
-
loading: { type: Boolean }
|
|
3353
|
-
},
|
|
3354
|
-
emits: ["update:show"],
|
|
3355
|
-
setup(V, { emit: y }) {
|
|
3356
|
-
var e;
|
|
3357
|
-
const n = ae(), t = ie(V, "show"), { t: o } = G(), l = y, f = te(), m = ((e = f._currentLocation) == null ? void 0 : e.type) || "", i = [
|
|
3358
|
-
{ label: me(
|
|
3359
|
-
"openingBalance"
|
|
3360
|
-
/* OPENING_BALANCE */
|
|
3361
|
-
) },
|
|
3362
|
-
{ label: me(
|
|
3363
|
-
"transferNote"
|
|
3364
|
-
/* TRANSFER_NOTE */
|
|
3365
|
-
) }
|
|
3366
|
-
], s = N(i[0]);
|
|
3367
|
-
return (c, h) => {
|
|
3368
|
-
var g;
|
|
3369
|
-
const E = F("FmIcon"), C = F("FmButtonGroup"), p = F("FmButton"), a = F("FmSideSheet");
|
|
3370
|
-
return x(), U(a, {
|
|
3371
|
-
modelValue: k(t),
|
|
3372
|
-
"onUpdate:modelValue": h[2] || (h[2] = (B) => le(t) ? t.value = B : null),
|
|
3373
|
-
header: "Data migration (Xilnex)",
|
|
3374
|
-
"dismiss-away": "",
|
|
3375
|
-
"close-button": "",
|
|
3376
|
-
"max-width": 800
|
|
3377
|
-
}, oe({
|
|
3378
|
-
default: L(() => {
|
|
3379
|
-
var B;
|
|
3380
|
-
return [
|
|
3381
|
-
(B = k(n).sessionUser.value) != null && B.role.isAdmin ? (x(), _("div", Jo, [
|
|
3382
|
-
s.value.label === k(me)(
|
|
3383
|
-
"openingBalance"
|
|
3384
|
-
/* OPENING_BALANCE */
|
|
3385
|
-
) ? (x(), U(Uo, { key: 0 })) : z("", !0),
|
|
3386
|
-
s.value.label === k(me)(
|
|
3387
|
-
"transferNote"
|
|
3388
|
-
/* TRANSFER_NOTE */
|
|
3389
|
-
) ? (x(), _("div", Ko, " Not available yet. ")) : z("", !0)
|
|
3390
|
-
])) : (x(), _("div", Yo, " Please contact your administrator to apply the changes. "))
|
|
3391
|
-
];
|
|
3392
|
-
}),
|
|
3393
|
-
"side-sheet-footer": L(() => [
|
|
3394
|
-
r("div", qo, [
|
|
3395
|
-
b(p, {
|
|
3396
|
-
variant: "tertiary",
|
|
3397
|
-
label: k(o)("common.close"),
|
|
3398
|
-
onClick: h[1] || (h[1] = (B) => l("update:show", !1))
|
|
3399
|
-
}, null, 8, ["label"])
|
|
3400
|
-
])
|
|
3401
|
-
]),
|
|
3402
|
-
_: 2
|
|
3403
|
-
}, [
|
|
3404
|
-
(g = k(n).sessionUser.value) != null && g.role.isAdmin ? {
|
|
3405
|
-
name: "side-sheet-header",
|
|
3406
|
-
fn: L(() => {
|
|
3407
|
-
var B;
|
|
3408
|
-
return [
|
|
3409
|
-
r("div", Ho, [
|
|
3410
|
-
r("div", Xo, [
|
|
3411
|
-
h[3] || (h[3] = r("div", { class: "fm-typo-en-title-md-600" }, "Data migration (Xilnex)", -1)),
|
|
3412
|
-
r("div", Po, [
|
|
3413
|
-
b(E, {
|
|
3414
|
-
name: k(m),
|
|
3415
|
-
size: "sm"
|
|
3416
|
-
}, null, 8, ["name"]),
|
|
3417
|
-
r("div", Qo, D((B = k(f)._currentLocation) == null ? void 0 : B.name), 1)
|
|
3418
|
-
])
|
|
3419
|
-
]),
|
|
3420
|
-
b(C, {
|
|
3421
|
-
modelValue: s.value,
|
|
3422
|
-
"onUpdate:modelValue": h[0] || (h[0] = (I) => s.value = I),
|
|
3423
|
-
items: i
|
|
3424
|
-
}, null, 8, ["modelValue"])
|
|
3425
|
-
])
|
|
3426
|
-
];
|
|
3427
|
-
}),
|
|
3428
|
-
key: "0"
|
|
3429
|
-
} : void 0
|
|
3430
|
-
]), 1032, ["modelValue"]);
|
|
3431
|
-
};
|
|
3432
|
-
}
|
|
3433
|
-
}), Go = /* @__PURE__ */ P({
|
|
3434
|
-
__name: "XilnexView",
|
|
3435
|
-
setup(V) {
|
|
3436
|
-
const y = Me(), n = te(), u = N(!1);
|
|
3437
|
-
async function t() {
|
|
3438
|
-
u.value = !0, console.log("Opening Xilnex migration dialog");
|
|
3439
|
-
}
|
|
3440
|
-
return (o, l) => {
|
|
3441
|
-
const f = F("FmCardSection"), m = F("FmCard");
|
|
3442
|
-
return k(y).enabledXilnexOpeningMigration && !k(n).businessLevel ? (x(), _(Q, { key: 0 }, [
|
|
3443
|
-
b(m, {
|
|
3444
|
-
class: K({
|
|
3445
|
-
"w-full": !0,
|
|
3446
|
-
border: !0,
|
|
3447
|
-
"border-fm-color-neutral-gray-100": !0,
|
|
3448
|
-
"cursor-pointer": !0,
|
|
3449
|
-
"hover:border-fm-color-primary": !0
|
|
3450
|
-
}),
|
|
3451
|
-
onClick: l[0] || (l[0] = (i) => t())
|
|
3452
|
-
}, {
|
|
3453
|
-
default: L(() => [
|
|
3454
|
-
b(f, null, {
|
|
3455
|
-
default: L(() => l[2] || (l[2] = [
|
|
3456
|
-
r("div", { class: "flex justify-center" }, [
|
|
3457
|
-
r("div", { class: "size-[100px] bg-gray-200 rounded-lg flex items-center justify-center" }, [
|
|
3458
|
-
r("span", { class: "text-lg font-bold text-gray-600" }, "Xilnex")
|
|
3459
|
-
])
|
|
3460
|
-
], -1),
|
|
3461
|
-
r("div", { class: "flex flex-col items-center gap-2" }, [
|
|
3462
|
-
r("div", { class: "text-lg font-bold" }, "Xilnex"),
|
|
3463
|
-
r("div", { class: "text-fm-color-neutral-gray-300" }, "Data migration from Xilnex")
|
|
3464
|
-
], -1)
|
|
3465
|
-
])),
|
|
3466
|
-
_: 1
|
|
3467
|
-
})
|
|
3468
|
-
]),
|
|
3469
|
-
_: 1
|
|
3470
|
-
}),
|
|
3471
|
-
(x(), U(fe, { to: "body" }, [
|
|
3472
|
-
b(Zo, {
|
|
3473
|
-
show: u.value,
|
|
3474
|
-
"onUpdate:show": l[1] || (l[1] = (i) => u.value = i)
|
|
3475
|
-
}, null, 8, ["show"])
|
|
3476
|
-
]))
|
|
3477
|
-
], 64)) : z("", !0);
|
|
3478
|
-
};
|
|
3479
|
-
}
|
|
3480
|
-
}), Se = [
|
|
3481
|
-
"bin",
|
|
3482
|
-
"group",
|
|
3483
|
-
"code",
|
|
3484
|
-
"description",
|
|
3485
|
-
"unitcost",
|
|
3486
|
-
"convertUom",
|
|
3487
|
-
"quantity",
|
|
3488
|
-
"total"
|
|
3489
|
-
];
|
|
3490
|
-
async function Wo(V, y, n) {
|
|
3491
|
-
var m;
|
|
3492
|
-
const u = await $o(n), t = [], o = {}, l = Object.keys(u)[0], f = u[l];
|
|
3493
|
-
for (let i = 0; i < f.length; i++) {
|
|
3494
|
-
const s = f[i], e = s.code, c = s.description, h = s.quantity, E = s.unitcost;
|
|
3495
|
-
if (e === "" || e === "undefined") {
|
|
3496
|
-
t.push({
|
|
3497
|
-
row: s.excelRow,
|
|
3498
|
-
itemCode: e,
|
|
3499
|
-
itemName: c,
|
|
3500
|
-
message: "Item code is empty or undefined"
|
|
3501
|
-
});
|
|
3502
|
-
continue;
|
|
3503
|
-
}
|
|
3504
|
-
const C = y.find((I) => I.code === e);
|
|
3505
|
-
if (!C) {
|
|
3506
|
-
t.push({
|
|
3507
|
-
row: s.excelRow,
|
|
3508
|
-
itemCode: e,
|
|
3509
|
-
itemName: c,
|
|
3510
|
-
qty: h,
|
|
3511
|
-
message: "Item not found in inventory"
|
|
3512
|
-
}), console.error(`${s.excelRow} Item not found: ${e} ${c} ${h}`);
|
|
3513
|
-
continue;
|
|
3514
|
-
}
|
|
3515
|
-
let p = Number(s.total);
|
|
3516
|
-
const a = V[C._id];
|
|
3517
|
-
a && (p = a * Number(h));
|
|
3518
|
-
const g = $.fromNumber(Number(h)), B = {
|
|
3519
|
-
amount: g,
|
|
3520
|
-
cost: {
|
|
3521
|
-
...$.fromNumber(Number(p)),
|
|
3522
|
-
currency: "MYR"
|
|
3523
|
-
}
|
|
3524
|
-
};
|
|
3525
|
-
h != "0" && E == "0" && console.warn(`Item ${e} ${c} has 0 cost.`), o[m = C._id] ?? (o[m] = {
|
|
3526
|
-
skuAdjustment: {
|
|
3527
|
-
sku: C,
|
|
3528
|
-
fromBalance: $.fromNumber(0),
|
|
3529
|
-
amounts: [
|
|
3530
|
-
{
|
|
3531
|
-
_id: null,
|
|
3532
|
-
type: Fe.Enum.CLOSING,
|
|
3533
|
-
remark: "Opening Balance",
|
|
3534
|
-
amount: g,
|
|
3535
|
-
measurement: null,
|
|
3536
|
-
// always the smallest unit
|
|
3537
|
-
cost: B.cost
|
|
3538
|
-
}
|
|
3539
|
-
],
|
|
3540
|
-
toBalance: g,
|
|
3541
|
-
toCostBalances: [B]
|
|
3542
|
-
},
|
|
3543
|
-
skuBalance: {
|
|
3544
|
-
id: C._id,
|
|
3545
|
-
balance: g,
|
|
3546
|
-
costs: [B]
|
|
3547
|
-
}
|
|
3548
|
-
});
|
|
3549
|
-
}
|
|
3550
|
-
return {
|
|
3551
|
-
errors: t,
|
|
3552
|
-
rows: o
|
|
3553
|
-
};
|
|
3554
|
-
}
|
|
3555
|
-
async function $o(V) {
|
|
3556
|
-
const y = await new Promise((o, l) => {
|
|
3557
|
-
const f = new FileReader();
|
|
3558
|
-
f.onload = (m) => o(m.target.result), f.onerror = l, f.readAsArrayBuffer(V);
|
|
3559
|
-
}), n = Re(y, { type: "array" }), u = n.SheetNames, t = {};
|
|
3560
|
-
for (const o of u) {
|
|
3561
|
-
const l = await es(n.Sheets[o]);
|
|
3562
|
-
t[o] = l;
|
|
3563
|
-
}
|
|
3564
|
-
return t;
|
|
3565
|
-
}
|
|
3566
|
-
async function es(V) {
|
|
3567
|
-
const y = Oe.sheet_to_json(V, {
|
|
3568
|
-
header: Se,
|
|
3569
|
-
range: 1
|
|
3570
|
-
}), n = [];
|
|
3571
|
-
for (let u = 0; u < y.length; u++) {
|
|
3572
|
-
const t = y[u], o = {};
|
|
3573
|
-
for (const l of Se)
|
|
3574
|
-
o[l] = String(t[l]).trim();
|
|
3575
|
-
n.push({
|
|
3576
|
-
...o,
|
|
3577
|
-
excelRow: u + 2
|
|
3578
|
-
// Excel rows start from 1, and we skip the first row
|
|
3579
|
-
});
|
|
3580
|
-
}
|
|
3581
|
-
return n;
|
|
3582
|
-
}
|
|
3583
|
-
const ts = { class: "flex flex-col gap-4" }, ns = { class: "flex flex-col" }, os = {
|
|
3584
|
-
key: 0,
|
|
3585
|
-
class: "flex flex-col gap-4 my-5"
|
|
3586
|
-
}, ss = { class: "flex flex-col gap-8" }, as = { class: "flex flex-col gap-8" }, ls = {
|
|
3587
|
-
class: /* @__PURE__ */ K(["fm-corner-radius-md p-16 flex items-center gap-16"])
|
|
3588
|
-
}, is = {
|
|
3589
|
-
class: /* @__PURE__ */ K(["fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center gap-3"])
|
|
3590
|
-
}, rs = { class: "line-clamp-2 text-ellipsis break-all" }, us = { class: "flex flex-col" }, cs = { class: "font-medium" }, ds = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, ms = { class: "flex" }, fs = { class: "flex" }, ps = { key: 1 }, vs = /* @__PURE__ */ P({
|
|
3591
|
-
__name: "SynergyOpeningImport",
|
|
3592
|
-
setup(V) {
|
|
3593
|
-
const y = nt(), n = ce(), u = Ce(), t = W(), o = O(() => [
|
|
3594
|
-
{
|
|
3595
|
-
value: "synergy",
|
|
3596
|
-
label: "Synergy",
|
|
3597
|
-
subLabel: "Based on Synergy's item cost from excel file"
|
|
3598
|
-
}
|
|
3599
|
-
]), l = N(o.value[0].value), { t: f } = ve(), m = N(null), i = N(), s = N(""), e = N([]), c = N([]), h = [
|
|
3600
|
-
{
|
|
3601
|
-
id: "ingredient",
|
|
3602
|
-
header: () => "Ingredient",
|
|
3603
|
-
cell(A) {
|
|
3604
|
-
const d = A.row.original;
|
|
3605
|
-
return w("div", { class: "flex flex-col" }, [
|
|
3606
|
-
w("span", { class: "font-medium" }, d.skuAdjustment.sku.name),
|
|
3607
|
-
w("span", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, [
|
|
3608
|
-
d.skuAdjustment.sku.code
|
|
3609
|
-
])
|
|
3610
|
-
]);
|
|
3611
|
-
}
|
|
3612
|
-
},
|
|
3613
|
-
{
|
|
3614
|
-
id: "openingBalance",
|
|
3615
|
-
header: () => "Opening Balance",
|
|
3616
|
-
cell(A) {
|
|
3617
|
-
const d = A.row.original;
|
|
3618
|
-
return w("div", { class: "flex flex-col" }, [
|
|
3619
|
-
w(
|
|
3620
|
-
"span",
|
|
3621
|
-
{ class: "font-medium" },
|
|
3622
|
-
$.toFormatString({
|
|
3623
|
-
value: d.skuAdjustment.amounts[0].amount
|
|
3624
|
-
})
|
|
3625
|
-
)
|
|
3626
|
-
]);
|
|
3627
|
-
}
|
|
3628
|
-
},
|
|
3629
|
-
{
|
|
3630
|
-
id: "unit",
|
|
3631
|
-
header: () => "Unit",
|
|
3632
|
-
cell(A) {
|
|
3633
|
-
const d = A.row.original, v = !d.skuAdjustment.amounts[0].measurement;
|
|
3634
|
-
let S = d.skuAdjustment.sku.unit.name;
|
|
3635
|
-
if (!v) {
|
|
3636
|
-
const T = d.skuAdjustment.sku.unit.measurements.find(
|
|
3637
|
-
(M) => M.id === d.skuAdjustment.amounts[0].measurement.id
|
|
3638
|
-
);
|
|
3639
|
-
S = T ? T.name : "Error: Measurement not found";
|
|
3640
|
-
}
|
|
3641
|
-
return w("div", { class: "flex flex-col" }, [
|
|
3642
|
-
w("span", { class: "font-medium" }, S),
|
|
3643
|
-
v ? null : w("span", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, [
|
|
3644
|
-
`Base unit: ${d.skuAdjustment.sku.unit.name}`
|
|
3645
|
-
])
|
|
3646
|
-
]);
|
|
3647
|
-
}
|
|
3648
|
-
},
|
|
3649
|
-
{
|
|
3650
|
-
id: "totalCost",
|
|
3651
|
-
header: () => "Total Cost",
|
|
3652
|
-
cell(A) {
|
|
3653
|
-
const d = A.row.original, { currency: v, ...S } = d.skuAdjustment.amounts[0].cost ?? {
|
|
3654
|
-
amount: 0,
|
|
3655
|
-
precision: 0,
|
|
3656
|
-
currency: ""
|
|
3657
|
-
};
|
|
3658
|
-
return w("div", { class: "flex flex-col" }, [
|
|
3659
|
-
w(
|
|
3660
|
-
"span",
|
|
3661
|
-
{ class: "font-medium" },
|
|
3662
|
-
$.toFormatString({
|
|
3663
|
-
value: S
|
|
3664
|
-
})
|
|
3665
|
-
)
|
|
3666
|
-
]);
|
|
3667
|
-
}
|
|
3668
|
-
}
|
|
3669
|
-
], E = [
|
|
3670
|
-
{
|
|
3671
|
-
accessorKey: "row",
|
|
3672
|
-
header: "Row"
|
|
3673
|
-
},
|
|
3674
|
-
{
|
|
3675
|
-
accessorKey: "itemCode",
|
|
3676
|
-
header: "Item Code"
|
|
3677
|
-
},
|
|
3678
|
-
{
|
|
3679
|
-
accessorKey: "itemName",
|
|
3680
|
-
header: "Item Name"
|
|
3681
|
-
},
|
|
3682
|
-
{
|
|
3683
|
-
accessorKey: "qty",
|
|
3684
|
-
header: "Quantity"
|
|
3685
|
-
},
|
|
3686
|
-
{
|
|
3687
|
-
accessorKey: "message",
|
|
3688
|
-
header: "Error Message"
|
|
3689
|
-
}
|
|
3690
|
-
], C = N(!1);
|
|
3691
|
-
async function p() {
|
|
3692
|
-
if (m.value) {
|
|
3693
|
-
C.value = !0;
|
|
3694
|
-
try {
|
|
3695
|
-
let A = {};
|
|
3696
|
-
const { errors: d, rows: v } = await Wo(
|
|
3697
|
-
A,
|
|
3698
|
-
n.skus,
|
|
3699
|
-
m.value
|
|
3700
|
-
);
|
|
3701
|
-
e.value = d, c.value = Object.values(v);
|
|
3702
|
-
} catch {
|
|
3703
|
-
t.open({
|
|
3704
|
-
message: "Error verifying file",
|
|
3705
|
-
type: "error"
|
|
3706
|
-
});
|
|
3707
|
-
} finally {
|
|
3708
|
-
C.value = !1;
|
|
3709
|
-
}
|
|
3710
|
-
}
|
|
3711
|
-
}
|
|
3712
|
-
async function a() {
|
|
3713
|
-
if (m.value) {
|
|
3714
|
-
C.value = !0;
|
|
3715
|
-
try {
|
|
3716
|
-
if (!B.value) {
|
|
3717
|
-
t.open({
|
|
3718
|
-
message: "Please select a date for the opening balance",
|
|
3719
|
-
type: "error"
|
|
3720
|
-
});
|
|
3721
|
-
return;
|
|
3722
|
-
}
|
|
3723
|
-
await u.setOpeningBalance({
|
|
3724
|
-
effectiveAt: B.value,
|
|
3725
|
-
skuAdjustments: c.value.map((A) => A.skuAdjustment),
|
|
3726
|
-
skuBalances: c.value.map((A) => A.skuBalance)
|
|
3727
|
-
}), t.open({
|
|
3728
|
-
message: "Opening balance imported successfully",
|
|
3729
|
-
type: "success"
|
|
3730
|
-
}), await y.fetchClosingDocumentId();
|
|
3731
|
-
} catch {
|
|
3732
|
-
t.open({
|
|
3733
|
-
message: "Error importing opening balance",
|
|
3734
|
-
type: "error"
|
|
3735
|
-
});
|
|
3736
|
-
} finally {
|
|
3737
|
-
C.value = !1;
|
|
3738
|
-
}
|
|
3739
|
-
}
|
|
3740
|
-
}
|
|
3741
|
-
const g = N(""), B = O({
|
|
3742
|
-
get() {
|
|
3743
|
-
return g.value;
|
|
3744
|
-
},
|
|
3745
|
-
set(A) {
|
|
3746
|
-
g.value = `${A}T15:59:59.999Z`;
|
|
3747
|
-
}
|
|
3748
|
-
}), I = O(() => {
|
|
3749
|
-
if (!g.value) return null;
|
|
3750
|
-
const A = new Date(g.value);
|
|
3751
|
-
return isNaN(A.getTime()) ? null : be(A);
|
|
3752
|
-
});
|
|
3753
|
-
return (A, d) => {
|
|
3754
|
-
const v = F("FmLabel"), S = F("FmField"), T = F("FmSimpleDatePicker"), M = F("FmButton"), H = F("FmRadio"), X = F("FmRadioGroup"), R = F("FmTable");
|
|
3755
|
-
return x(), _("div", ts, [
|
|
3756
|
-
r("div", ns, [
|
|
3757
|
-
b(v, { label: "Latest closing" })
|
|
3758
|
-
]),
|
|
3759
|
-
b(S, {
|
|
3760
|
-
"prepend-icon": "lock_outline",
|
|
3761
|
-
disabled: ""
|
|
3762
|
-
}, {
|
|
3763
|
-
default: L(() => [
|
|
3764
|
-
J(D(k(y).state.closingDocumentId ? `${k(Te)(new Date(k(Ae)(k(y).state.closingDocumentId)))}` : "No closing found"), 1)
|
|
3765
|
-
]),
|
|
3766
|
-
_: 1
|
|
3767
|
-
}),
|
|
3768
|
-
k(y).state.closingDocumentId ? (x(), _("div", ps, d[6] || (d[6] = [
|
|
3769
|
-
r("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)
|
|
3770
|
-
]))) : (x(), _("div", os, [
|
|
3771
|
-
b(T, {
|
|
3772
|
-
modelValue: B.value,
|
|
3773
|
-
"onUpdate:modelValue": d[0] || (d[0] = (j) => B.value = j),
|
|
3774
|
-
label: "Last closing time"
|
|
3775
|
-
}, {
|
|
3776
|
-
"trigger-button": L(() => [
|
|
3777
|
-
b(S, {
|
|
3778
|
-
"prepend-icon": "calendar_today",
|
|
3779
|
-
readonly: "",
|
|
3780
|
-
label: "Last closing time"
|
|
3781
|
-
}, {
|
|
3782
|
-
default: L(() => [
|
|
3783
|
-
J(D(I.value), 1)
|
|
3784
|
-
]),
|
|
3785
|
-
_: 1
|
|
3786
|
-
})
|
|
3787
|
-
]),
|
|
3788
|
-
_: 1
|
|
3789
|
-
}, 8, ["modelValue"]),
|
|
3790
|
-
r("div", ss, [
|
|
3791
|
-
b(v, { label: "Stock take file" })
|
|
3792
|
-
]),
|
|
3793
|
-
b(De, {
|
|
3794
|
-
onFileUpload: d[1] || (d[1] = (j) => {
|
|
3795
|
-
j && (m.value = j);
|
|
3796
|
-
}),
|
|
3797
|
-
accept: ".xlsx, .xls, .csv"
|
|
3798
|
-
}, oe({ _: 2 }, [
|
|
3799
|
-
m.value ? {
|
|
3800
|
-
name: "default",
|
|
3801
|
-
fn: L(({ openFileDialog: j }) => [
|
|
3802
|
-
r("div", as, [
|
|
3803
|
-
r("div", ls, [
|
|
3804
|
-
r("div", is, [
|
|
3805
|
-
r("div", rs, D(m.value.name), 1),
|
|
3806
|
-
b(M, {
|
|
3807
|
-
label: k(f)("inventory.ingredient.import.replaceFile"),
|
|
3808
|
-
variant: "secondary",
|
|
3809
|
-
"prepend-icon": "autorenew",
|
|
3810
|
-
onClick: j
|
|
3811
|
-
}, null, 8, ["label", "onClick"])
|
|
3812
|
-
])
|
|
3813
|
-
])
|
|
3814
|
-
])
|
|
3815
|
-
]),
|
|
3816
|
-
key: "0"
|
|
3817
|
-
} : void 0
|
|
3818
|
-
]), 1024),
|
|
3819
|
-
b(X, {
|
|
3820
|
-
modelValue: l.value,
|
|
3821
|
-
"onUpdate:modelValue": d[2] || (d[2] = (j) => l.value = j),
|
|
3822
|
-
label: "Retrieve cost from",
|
|
3823
|
-
class: "my-5"
|
|
3824
|
-
}, {
|
|
3825
|
-
default: L(() => [
|
|
3826
|
-
(x(!0), _(Q, null, ee(o.value, (j) => (x(), U(H, {
|
|
3827
|
-
key: j.value,
|
|
3828
|
-
value: j.value,
|
|
3829
|
-
label: j.label,
|
|
3830
|
-
sublabel: j.subLabel,
|
|
3831
|
-
disabled: j.disabled
|
|
3832
|
-
}, {
|
|
3833
|
-
label: L(() => [
|
|
3834
|
-
r("div", us, [
|
|
3835
|
-
r("span", cs, D(j.label), 1),
|
|
3836
|
-
r("span", ds, D(j.disabled ? j.disabledReason : j.subLabel), 1)
|
|
3837
|
-
])
|
|
3838
|
-
]),
|
|
3839
|
-
_: 2
|
|
3840
|
-
}, 1032, ["value", "label", "sublabel", "disabled"]))), 128))
|
|
3841
|
-
]),
|
|
3842
|
-
_: 1
|
|
3843
|
-
}, 8, ["modelValue"]),
|
|
3844
|
-
r("div", ms, [
|
|
3845
|
-
b(M, {
|
|
3846
|
-
class: "ml-auto mt-4",
|
|
3847
|
-
variant: "secondary",
|
|
3848
|
-
"prepend-icon": "troubleshoot",
|
|
3849
|
-
label: "Verify",
|
|
3850
|
-
disabled: !m.value && !C.value,
|
|
3851
|
-
loading: C.value,
|
|
3852
|
-
onClick: p
|
|
3853
|
-
}, null, 8, ["disabled", "loading"])
|
|
3854
|
-
]),
|
|
3855
|
-
m.value && c.value.length > 0 ? (x(), _(Q, { key: 0 }, [
|
|
3856
|
-
d[4] || (d[4] = r("h2", { class: "fm-typo-en-title-md-800 mt-8 mb-4" }, "Results", -1)),
|
|
3857
|
-
b(R, {
|
|
3858
|
-
modelValue: i.value,
|
|
3859
|
-
"onUpdate:modelValue": d[3] || (d[3] = (j) => i.value = j),
|
|
3860
|
-
"row-data": c.value,
|
|
3861
|
-
"column-defs": h,
|
|
3862
|
-
"shrink-at": !1,
|
|
3863
|
-
"search-value": s.value
|
|
3864
|
-
}, null, 8, ["modelValue", "row-data", "search-value"])
|
|
3865
|
-
], 64)) : z("", !0),
|
|
3866
|
-
e.value.length > 0 ? (x(), _(Q, { key: 1 }, [
|
|
3867
|
-
d[5] || (d[5] = r("h2", { class: "fm-typo-en-title-md-800 mt-8 mb-4 text-red-600" }, "Errors", -1)),
|
|
3868
|
-
b(R, {
|
|
3869
|
-
"row-data": e.value,
|
|
3870
|
-
"column-defs": E
|
|
3871
|
-
}, null, 8, ["row-data"])
|
|
3872
|
-
], 64)) : z("", !0),
|
|
3873
|
-
r("div", fs, [
|
|
3874
|
-
c.value.length > 0 && !k(y).state.closingDocumentId ? (x(), U(M, {
|
|
3875
|
-
key: 0,
|
|
3876
|
-
class: "ml-auto mt-4",
|
|
3877
|
-
"prepend-icon": "file_upload",
|
|
3878
|
-
variant: "primary",
|
|
3879
|
-
label: "Import Opening Balance",
|
|
3880
|
-
disabled: !m.value || C.value,
|
|
3881
|
-
onClick: a
|
|
3882
|
-
}, null, 8, ["disabled"])) : z("", !0)
|
|
3883
|
-
])
|
|
3884
|
-
]))
|
|
3885
|
-
]);
|
|
3886
|
-
};
|
|
3887
|
-
}
|
|
3888
|
-
}), ys = { class: "flex flex-col gap-8 w-full" }, gs = { class: "flex gap-4 justify-between" }, As = { 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" }, bs = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, hs = { key: 0 }, xs = {
|
|
3889
|
-
key: 1,
|
|
3890
|
-
class: "flex flex-col gap-8 w-full"
|
|
3891
|
-
}, Is = { class: "flex gap-8 items-center justify-start" }, Ss = /* @__PURE__ */ P({
|
|
3892
|
-
__name: "SynergySideSheet",
|
|
3893
|
-
props: {
|
|
3894
|
-
show: { type: Boolean },
|
|
3895
|
-
loading: { type: Boolean }
|
|
3896
|
-
},
|
|
3897
|
-
emits: ["update:show"],
|
|
3898
|
-
setup(V, { emit: y }) {
|
|
3899
|
-
var i;
|
|
3900
|
-
const n = ae(), t = ie(V, "show"), { t: o } = G(), l = y, f = te(), m = ((i = f._currentLocation) == null ? void 0 : i.type) || "";
|
|
3901
|
-
return (s, e) => {
|
|
3902
|
-
var C;
|
|
3903
|
-
const c = F("FmIcon"), h = F("FmButton"), E = F("FmSideSheet");
|
|
3904
|
-
return x(), U(E, {
|
|
3905
|
-
modelValue: k(t),
|
|
3906
|
-
"onUpdate:modelValue": e[1] || (e[1] = (p) => le(t) ? t.value = p : null),
|
|
3907
|
-
header: "Data migration (Synergy)",
|
|
3908
|
-
"dismiss-away": "",
|
|
3909
|
-
"close-button": "",
|
|
3910
|
-
"max-width": 800
|
|
3911
|
-
}, oe({
|
|
3912
|
-
default: L(() => {
|
|
3913
|
-
var p;
|
|
3914
|
-
return [
|
|
3915
|
-
(p = k(n).sessionUser.value) != null && p.role.isAdmin ? (x(), _("div", xs, [
|
|
3916
|
-
b(vs)
|
|
3917
|
-
])) : (x(), _("div", hs, " Please contact your administrator to apply the changes. "))
|
|
3918
|
-
];
|
|
3919
|
-
}),
|
|
3920
|
-
"side-sheet-footer": L(() => [
|
|
3921
|
-
r("div", Is, [
|
|
3922
|
-
b(h, {
|
|
3923
|
-
variant: "tertiary",
|
|
3924
|
-
label: k(o)("common.close"),
|
|
3925
|
-
onClick: e[0] || (e[0] = (p) => l("update:show", !1))
|
|
3926
|
-
}, null, 8, ["label"])
|
|
3927
|
-
])
|
|
3928
|
-
]),
|
|
3929
|
-
_: 2
|
|
3930
|
-
}, [
|
|
3931
|
-
(C = k(n).sessionUser.value) != null && C.role.isAdmin ? {
|
|
3932
|
-
name: "side-sheet-header",
|
|
3933
|
-
fn: L(() => {
|
|
3934
|
-
var p;
|
|
3935
|
-
return [
|
|
3936
|
-
r("div", ys, [
|
|
3937
|
-
r("div", gs, [
|
|
3938
|
-
e[2] || (e[2] = r("div", { class: "fm-typo-en-title-md-600" }, "Data migration (Synergy)", -1)),
|
|
3939
|
-
r("div", As, [
|
|
3940
|
-
b(c, {
|
|
3941
|
-
name: k(m),
|
|
3942
|
-
size: "sm"
|
|
3943
|
-
}, null, 8, ["name"]),
|
|
3944
|
-
r("div", bs, D((p = k(f)._currentLocation) == null ? void 0 : p.name), 1)
|
|
3945
|
-
])
|
|
3946
|
-
])
|
|
3947
|
-
])
|
|
3948
|
-
];
|
|
3949
|
-
}),
|
|
3950
|
-
key: "0"
|
|
3951
|
-
} : void 0
|
|
3952
|
-
]), 1032, ["modelValue"]);
|
|
3953
|
-
};
|
|
3954
|
-
}
|
|
3955
|
-
}), ws = /* @__PURE__ */ P({
|
|
3956
|
-
__name: "SynergyView",
|
|
3957
|
-
setup(V) {
|
|
3958
|
-
const y = Me(), n = te(), u = N(!1);
|
|
3959
|
-
async function t() {
|
|
3960
|
-
u.value = !0, console.log("Opening Synergy migration dialog");
|
|
3961
|
-
}
|
|
3962
|
-
return (o, l) => {
|
|
3963
|
-
const f = F("FmCardSection"), m = F("FmCard");
|
|
3964
|
-
return k(y).enabledSynergyOpeningMigration && !k(n).businessLevel ? (x(), _(Q, { key: 0 }, [
|
|
3965
|
-
b(m, {
|
|
3966
|
-
class: K({
|
|
3967
|
-
"w-full": !0,
|
|
3968
|
-
border: !0,
|
|
3969
|
-
"border-fm-color-neutral-gray-100": !0,
|
|
3970
|
-
"cursor-pointer": !0,
|
|
3971
|
-
"hover:border-fm-color-primary": !0
|
|
3972
|
-
}),
|
|
3973
|
-
onClick: l[0] || (l[0] = (i) => t())
|
|
3974
|
-
}, {
|
|
3975
|
-
default: L(() => [
|
|
3976
|
-
b(f, null, {
|
|
3977
|
-
default: L(() => l[2] || (l[2] = [
|
|
3978
|
-
r("div", { class: "flex justify-center" }, [
|
|
3979
|
-
r("div", { class: "size-[100px] bg-gray-200 rounded-lg flex items-center justify-center" }, [
|
|
3980
|
-
r("span", { class: "text-lg font-bold text-gray-600" }, "Synergy")
|
|
3981
|
-
])
|
|
3982
|
-
], -1),
|
|
3983
|
-
r("div", { class: "flex flex-col items-center gap-2" }, [
|
|
3984
|
-
r("div", { class: "text-lg font-bold" }, "Synergy"),
|
|
3985
|
-
r("div", { class: "text-fm-color-neutral-gray-300" }, "Data migration from Synergy")
|
|
3986
|
-
], -1)
|
|
3987
|
-
])),
|
|
3988
|
-
_: 1
|
|
3989
|
-
})
|
|
3990
|
-
]),
|
|
3991
|
-
_: 1
|
|
3992
|
-
}),
|
|
3993
|
-
(x(), U(fe, { to: "body" }, [
|
|
3994
|
-
b(Ss, {
|
|
3995
|
-
show: u.value,
|
|
3996
|
-
"onUpdate:show": l[1] || (l[1] = (i) => u.value = i)
|
|
3997
|
-
}, null, 8, ["show"])
|
|
3998
|
-
]))
|
|
3999
|
-
], 64)) : z("", !0);
|
|
4000
|
-
};
|
|
4001
|
-
}
|
|
4002
|
-
}), ks = { key: 0 }, Bs = {
|
|
4003
|
-
key: 1,
|
|
4004
|
-
class: "flex flex-col items-center my-10 gap-5"
|
|
4005
|
-
}, Fs = ["src"], Cs = {
|
|
4006
|
-
class: "text-xs text-neutral-400 text-center",
|
|
4007
|
-
style: { "max-width": "25rem" }
|
|
4008
|
-
}, Es = {
|
|
4009
|
-
key: 2,
|
|
4010
|
-
class: "grid grid-cols-2 gap-5"
|
|
4011
|
-
}, qs = /* @__PURE__ */ P({
|
|
4012
|
-
__name: "IntegrationView",
|
|
4013
|
-
setup(V) {
|
|
4014
|
-
const y = te(), n = N(!1), u = ot(), { breakpoints: t } = Ee(), o = O(() => t.value.xs || t.value.sm), { t: l } = G();
|
|
4015
|
-
return ue(async () => {
|
|
4016
|
-
if (y._currentLocation) {
|
|
4017
|
-
n.value = !0;
|
|
4018
|
-
try {
|
|
4019
|
-
await u.fetchFoodMarketHubSetting(), await u.fetchNetSuiteSetting();
|
|
4020
|
-
} finally {
|
|
4021
|
-
n.value = !1;
|
|
4022
|
-
}
|
|
4023
|
-
}
|
|
4024
|
-
}), (f, m) => {
|
|
4025
|
-
const i = F("FmCircularProgress");
|
|
4026
|
-
return x(), U(We, {
|
|
4027
|
-
title: k(l)("inventory.integration.title")
|
|
4028
|
-
}, {
|
|
4029
|
-
default: L(() => [
|
|
4030
|
-
r("div", {
|
|
4031
|
-
class: K([
|
|
4032
|
-
"flex flex-col gap-8 max-h-full",
|
|
4033
|
-
{
|
|
4034
|
-
"p-0": o.value,
|
|
4035
|
-
"px-24 ": !o.value
|
|
4036
|
-
}
|
|
4037
|
-
])
|
|
4038
|
-
}, [
|
|
4039
|
-
b($e, {
|
|
4040
|
-
"change-location": "",
|
|
4041
|
-
showBusiness: ""
|
|
4042
|
-
}),
|
|
4043
|
-
!k(y)._currentLocation || n.value ? (x(), _("div", ks, [
|
|
4044
|
-
b(i, { size: "lg" })
|
|
4045
|
-
])) : k(u).enabledIntegrations == 0 ? (x(), _("div", Bs, [
|
|
4046
|
-
r("div", null, [
|
|
4047
|
-
r("img", {
|
|
4048
|
-
src: k(Je),
|
|
4049
|
-
alt: "List is empty"
|
|
4050
|
-
}, null, 8, Fs)
|
|
4051
|
-
]),
|
|
4052
|
-
m[0] || (m[0] = r("div", { class: "font-bold text-lg" }, "Integration", -1)),
|
|
4053
|
-
r("div", Cs, D(k(l)("inventory.integration.description")), 1)
|
|
4054
|
-
])) : (x(), _("div", Es, [
|
|
4055
|
-
b(Ao),
|
|
4056
|
-
b(on),
|
|
4057
|
-
b(Go),
|
|
4058
|
-
b(ws)
|
|
4059
|
-
]))
|
|
4060
|
-
], 2)
|
|
4061
|
-
]),
|
|
4062
|
-
_: 1
|
|
4063
|
-
}, 8, ["title"]);
|
|
4064
|
-
};
|
|
4065
|
-
}
|
|
4066
|
-
});
|
|
4067
|
-
export {
|
|
4068
|
-
qs as default
|
|
4069
|
-
};
|