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