@feedmepos/mf-inventory-portal 1.7.7-dev.4 → 1.7.7
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-Ct-clbwd.js +311 -0
- package/dist/{ApprovalView-C3wOLlHv.js → ApprovalView-GQ3y8yRP.js} +9 -9
- package/dist/{BindingsDialog-JlcH1aTw.js → BindingsDialog-B_x8LMvt.js} +2 -2
- package/dist/{BindingsPicker-DkrqlfPN.js → BindingsPicker-C4rmlhNo.js} +2 -2
- package/dist/{BindingsTable-jpp6SPws.js → BindingsTable-SYw-DYjb.js} +3 -3
- package/dist/{BulkReceiveRequestView-BirdnUIo.js → BulkReceiveRequestView-CMyD6XsB.js} +896 -913
- package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-DNR7YGEF.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-BnWxOouO.js} +1 -1
- package/dist/{ClosingDraftView-DIQch6xD.js → ClosingDraftView-BaSaIRL0.js} +19 -19
- package/dist/{ClosingHistoryView-CZJoa31l.js → ClosingHistoryView-DSmrywZa.js} +5 -5
- package/dist/{ClosingTemplateView-ZkzqXyT8.js → ClosingTemplateView-B37qyruZ.js} +16 -16
- package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-CxtMXhQB.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-xiwiyiaY.js} +1 -1
- package/dist/{DefaultView-DWTZ6C3R.js → DefaultView-HHRPuCzZ.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-DzaNa2kK.js → DeliveryOrderPrintPreview-vxKT_EyZ.js} +2 -2
- package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-DUTCUt3m.js → EmailDialog.vue_vue_type_script_setup_true_lang-CKThUy1e.js} +2301 -2308
- package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-Ct1GCzAa.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-w76hrhQw.js} +6 -6
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Lh-Vr5z8.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-SVrNjS4I.js} +2 -2
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CtQGcvea.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DZdqasAP.js} +2 -2
- package/dist/{FmMultiselectDialog-DbnFLr4o.js → FmMultiselectDialog-CJXq4uI3.js} +1 -1
- package/dist/{FmMultiselectDialog-DcoxFEB2.js → FmMultiselectDialog-CmmTQGla.js} +2 -2
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DKcmu7bM.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CZD1CVvQ.js} +5 -5
- package/dist/{ImportView-DMPur1x5.js → ImportView-BJVRrKvB.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-Iq3mSUfb.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-ujJY99aa.js} +1 -1
- package/dist/{IngredientGroupView-BvVTo1Ke.js → IngredientGroupView-B1JXaOhq.js} +5 -5
- package/dist/{IngredientsView-CU69Hilq.js → IngredientsView-D6NKO-Gh.js} +16 -16
- package/dist/{IntegrationExplorerView-DB9Jbj1t.js → IntegrationExplorerView-BvdOXNvG.js} +4 -4
- package/dist/{IntegrationView-B_qDF6wh.js → IntegrationView-2ZYIuc_C.js} +376 -376
- package/dist/{InventoryBindingForm-BKVf7QV7.js → InventoryBindingForm-CcF_BDm-.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DUjlsaXv.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CNV_bnBT.js} +5 -5
- package/dist/{InventoryBindingSummary-DMdzvxMo.js → InventoryBindingSummary-DiN6rNkt.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DUiwhqTz.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Bo12cqUh.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DC1TZ8zc.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CimBirfu.js} +1 -1
- package/dist/{ProductionView-AUaZW4HQ.js → ProductionView-P-LqTvzE.js} +7 -7
- package/dist/{PublishView-vslQlSGy.js → PublishView-ZeEaZqqy.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-BxzRJu3z.js → PurchaseOrderPrintPreview-CExHtihT.js} +2 -2
- package/dist/{ReceiveRequestView-B9vQ0two.js → ReceiveRequestView-DL1Ss34y.js} +14 -14
- package/dist/{RecipeView-0DnB9vpf.js → RecipeView-HOLyv97y.js} +90 -90
- package/dist/{SettingsView-BZ2li6OG.js → SettingsView-CRdleCee.js} +4 -4
- package/dist/{StockView-0PLcziHH.js → StockView-DBxrmHEr.js} +21 -21
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-xR_iYH46.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-D4JR_U_Z.js} +1 -1
- package/dist/{SupplierView-MQpBEso3.js → SupplierView-BqijOCyT.js} +12 -12
- package/dist/{SurchargeView-CRmL4yf7.js → SurchargeView-Xj3KUxjo.js} +6 -6
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-OAfKYJHc.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-BSPdcQZp.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DLmu0Z09.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Dk7G0e7l.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-DI7ugC2e.js → TransferDetails.vue_vue_type_script_setup_true_lang-xT6NiHzk.js} +20 -20
- package/dist/{TransferTemplateView-CUIMBNiD.js → TransferTemplateView-J92-tUO_.js} +20 -20
- package/dist/{UnitCostHistoryView-Dzmio_VF.js → UnitCostHistoryView-g57cYtw5.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-rxm53Kpe.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-BdcVihLf.js} +4 -4
- package/dist/{UnitView-BF8oW55F.js → UnitView-BRTPJUUL.js} +8 -8
- package/dist/{WarehouseView-DMa16xHP.js → WarehouseView-1QwCjF29.js} +5 -5
- package/dist/{WastageTemplateView-Bf7cHP8P.js → WastageTemplateView-DZKoMLRy.js} +14 -14
- package/dist/api/codemax.d.ts +2 -3
- package/dist/{app-6IztYHx0.js → app-CegeEo5h.js} +18885 -19639
- package/dist/app.d.ts +9 -866
- package/dist/app.js +1 -1
- package/dist/{closing-template-MIqLe_gz.js → closing-template-D5UxukOI.js} +1 -1
- package/dist/{date2-DbL4HabJ.js → date2-C-GDWzCe.js} +5 -5
- package/dist/{dayjs.min-ePcZnrnS.js → dayjs.min-Byig1yQ9.js} +1 -1
- package/dist/{decimal-D-LnqjKq.js → decimal-eroTbDqK.js} +2 -2
- package/dist/{defineDeepModel-Bty3whQM.js → defineDeepModel-QJOziCR5.js} +1 -1
- package/dist/{duplicate-template-H_NPyDBN.js → duplicate-template-DrZN_ru3.js} +1 -1
- package/dist/{feature-CPc36p5Q.js → feature-D6GXXPff.js} +2 -2
- package/dist/{format-time-from-id-BkSJPBPj.js → format-time-from-id-Cj_s-cFT.js} +1 -1
- package/dist/{format-unit-display-BOclhjP_.js → format-unit-display-DN98qBJs.js} +27 -27
- package/dist/{import-export.helper-DamKVb5B.js → import-export.helper-NknO9288.js} +6 -6
- package/dist/{index-DYv_DAVd.js → index-D2MIrxVZ.js} +37 -31
- package/dist/{index-Ya7If-Ie.js → index-DPbEVw86.js} +1 -1
- package/dist/{index-BJdt1ytp.js → index-DYKM4puu.js} +1 -1
- package/dist/{inventory-core-dart.default-iDYPRIr1.js → inventory-core-dart.default-YlbNYG1d.js} +1 -1
- package/dist/{lz-string--yaiymH2.js → lz-string-K_57q5YR.js} +1 -1
- package/dist/{netsuite-DMU7KBLH.js → netsuite-9yeyNqUg.js} +2 -2
- package/dist/{number-CnoNE3dq.js → number-CV-_xcmY.js} +3 -3
- package/dist/{predefined-templates-j-OmxHRV.js → predefined-templates-DuoWmhYv.js} +1 -1
- package/dist/{purchase-order-template-qrm11ZSb.js → purchase-order-template-BHlAdzEG.js} +1 -1
- package/dist/{recalculationUtils-DdROokZS.js → recalculationUtils-DVkOvHEE.js} +1 -1
- package/dist/{rules-C9KpfT_c.js → rules-CTKq3x64.js} +2 -2
- package/dist/{stock-k1HJnDb5.js → stock-B22_nRFF.js} +3 -3
- package/dist/{stock-DFl6hM8p.js → stock-BSaEC2u4.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{supplier-1RVDAJgt.js → supplier-DR_5qF95.js} +2 -2
- package/dist/{surcharge-BGpOQVQk.js → surcharge-DSqDRLyV.js} +8 -8
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-u_8oQL8X.js → uom-rules-DeDTqzIO.js} +1 -1
- package/dist/{use-ingredient-select-dialog-CWD-rBKb.js → use-ingredient-select-dialog-r4uUF4br.js} +2 -2
- package/dist/{use-inventory-binding-dialog-MAXDJLSD.js → use-inventory-binding-dialog-COAfAZoQ.js} +2 -2
- package/dist/{use-template-enabled-locations-BKKnG3h9.js → use-template-enabled-locations-CsjbDWWR.js} +2 -2
- package/dist/{use-transfer-locations-Do66oqYE.js → use-transfer-locations-CE5jC9rF.js} +2 -2
- package/dist/{useHrmPermission-Kwlb-xbn.js → useHrmPermission-B1laswqe.js} +1 -1
- package/dist/{useNavigationMenu-Or_fkxv1.js → useNavigationMenu-Dk50LuHw.js} +2 -2
- package/dist/{useSseClient-ClQjN-eX.js → useSseClient-DD0mCXGT.js} +1 -1
- package/dist/{vue-i18n-B8mT1TfS.js → vue-i18n-D8emVl6r.js} +178 -178
- package/dist/{xlsx.util-D6RuisON.js → xlsx.util-BFraXVxh.js} +2 -2
- package/package.json +5 -5
- package/dist/App-e4ZmCNvN.js +0 -978
- package/dist/api/changelog.d.ts +0 -46
- package/dist/views/changelog/components/ChangelogDialog.vue.d.ts +0 -19
- package/dist/views/changelog/components/ChangelogFloatingButton.vue.d.ts +0 -2
- package/dist/views/changelog/components/ChangelogPanel.vue.d.ts +0 -18
- package/dist/views/changelog/composables/change-path.d.ts +0 -10
- package/dist/views/changelog/composables/commit-message.d.ts +0 -9
- package/dist/views/changelog/composables/commit-message.spec.d.ts +0 -1
- package/dist/views/changelog/composables/use-changelog.d.ts +0 -36
|
@@ -1,86 +1,85 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { u as
|
|
3
|
-
import { u as it, a as
|
|
4
|
-
import { i as ft, _ as
|
|
5
|
-
import { a as
|
|
6
|
-
import { b as
|
|
7
|
-
import { i as
|
|
8
|
-
import { d as He } from "./dayjs.min-
|
|
9
|
-
import { e as
|
|
10
|
-
import { u as
|
|
11
|
-
import { u as
|
|
12
|
-
import { components as
|
|
13
|
-
import { c as
|
|
14
|
-
import { useI18n as
|
|
15
|
-
import { u as
|
|
16
|
-
import { u as
|
|
17
|
-
import { u as
|
|
18
|
-
import { b as
|
|
19
|
-
import { P as
|
|
20
|
-
import { _ as
|
|
21
|
-
import { u as
|
|
22
|
-
import { P as
|
|
23
|
-
import {
|
|
24
|
-
import { F as
|
|
25
|
-
import { p as
|
|
26
|
-
import { defineStore as
|
|
27
|
-
import { u as
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
|
|
31
|
-
const An = {
|
|
1
|
+
import { defineComponent as tt, ref as k, computed as L, watch as Ve, createElementBlock as y, openBlock as m, Fragment as ye, createBlock as le, createVNode as E, Teleport as lt, Transition as Dt, withCtx as Pe, createCommentVNode as D, createElementVNode as e, toDisplayString as p, unref as t, normalizeClass as J, renderList as Qe, createTextVNode as ot, withModifiers as Et, mergeModels as qt, useModel as Nt, resolveComponent as Ce, h as xe, onMounted as At, onUnmounted as $t, normalizeStyle as mt, watchEffect as Ot, isRef as bt, normalizeProps as ht, mergeProps as ct, guardReactiveProps as Bt } from "vue";
|
|
2
|
+
import { u as Tt, l as It } from "./netsuite-9yeyNqUg.js";
|
|
3
|
+
import { u as it, a as Lt, G as zt, T as gt, s as Mt, U as Ye, q as Ut, c as Vt, D as st, x as Jt } from "./app-CegeEo5h.js";
|
|
4
|
+
import { i as ft, _ as jt } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-w76hrhQw.js";
|
|
5
|
+
import { a as xt, d as Wt } from "./number-CV-_xcmY.js";
|
|
6
|
+
import { b as Yt, d as Ht, c as Qt, e as Kt, f as Gt, P as kt, h as Xt, a as Zt, _ as en, g as tn } from "./TransferDetails.vue_vue_type_script_setup_true_lang-xT6NiHzk.js";
|
|
7
|
+
import { i as nn } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-CimBirfu.js";
|
|
8
|
+
import { d as He } from "./dayjs.min-Byig1yQ9.js";
|
|
9
|
+
import { e as on } from "./UnitDisplayControl.vue_vue_type_script_setup_true_lang-BdcVihLf.js";
|
|
10
|
+
import { u as sn } from "./useTabStorage-BkIVScW_.js";
|
|
11
|
+
import { u as an, _ as rn } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DwrLsWX_.js";
|
|
12
|
+
import { components as ln, useSnackbar as ut, useDialog as un, useBreakpoints as cn } from "@feedmepos/ui-library";
|
|
13
|
+
import { c as dn, u as mn, _ as fn, a as pn, b as vn } from "./EmailDialog.vue_vue_type_script_setup_true_lang-CKThUy1e.js";
|
|
14
|
+
import { useI18n as nt, useCoreStore as Ct } from "@feedmepos/mf-common";
|
|
15
|
+
import { u as Ft, a as yn } from "./supplier-DR_5qF95.js";
|
|
16
|
+
import { u as bn } from "./stock-BSaEC2u4.js";
|
|
17
|
+
import { u as Ke } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-BSPdcQZp.js";
|
|
18
|
+
import { b as St, a as hn } from "./format-unit-display-DN98qBJs.js";
|
|
19
|
+
import { P as gn } from "./inventory-core-dart.default-YlbNYG1d.js";
|
|
20
|
+
import { _ as xn, F as Ze } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js";
|
|
21
|
+
import { u as Rt } from "./feature-D6GXXPff.js";
|
|
22
|
+
import { P as _n, J as wn, D as kn } from "./app-C39bYJmq.js";
|
|
23
|
+
import { d as Cn, t as Fn } from "./date2-C-GDWzCe.js";
|
|
24
|
+
import { F as _t } from "./form-mode.enum-BKiNVH6A.js";
|
|
25
|
+
import { p as Sn } from "./format-time-from-id-Cj_s-cFT.js";
|
|
26
|
+
import { defineStore as Rn } from "pinia";
|
|
27
|
+
import { u as Pn } from "./use-row-action-Cvq6VO38.js";
|
|
28
|
+
import { R as at, D as Dn } from "./row-action.enum-ncgDYAjP.js";
|
|
29
|
+
import { u as En } from "./vue-i18n-D8emVl6r.js";
|
|
30
|
+
const qn = {
|
|
32
31
|
key: 0,
|
|
33
32
|
class: "fixed inset-0 z-[200] bg-white flex flex-col overflow-hidden",
|
|
34
33
|
style: { "font-family": "Inter, sans-serif" }
|
|
35
|
-
},
|
|
34
|
+
}, Nn = {
|
|
36
35
|
key: 0,
|
|
37
36
|
class: "flex items-center justify-between px-24 h-[64px] border-b border-[#F0F0F0] shrink-0 bg-white"
|
|
38
|
-
},
|
|
37
|
+
}, An = { class: "fm-typo-en-title-md-800 text-[#1C1C1E]" }, $n = { class: "flex items-center gap-8" }, On = {
|
|
39
38
|
key: 1,
|
|
40
39
|
class: "flex items-center justify-center px-32 py-16 border-b border-[#F0F0F0] shrink-0 bg-white"
|
|
41
|
-
},
|
|
40
|
+
}, Bn = { class: "flex items-center max-w-[600px] w-full" }, Tn = ["disabled"], In = { key: 1 }, Ln = ["disabled"], zn = { key: 1 }, Mn = {
|
|
42
41
|
class: "flex flex-col items-center gap-4 min-w-0",
|
|
43
42
|
disabled: !0
|
|
44
|
-
},
|
|
43
|
+
}, Un = { class: "flex flex-1 overflow-hidden" }, Vn = { class: "flex-1 min-w-0 overflow-y-auto" }, Jn = {
|
|
45
44
|
key: 0,
|
|
46
45
|
class: "px-32 py-24"
|
|
47
|
-
},
|
|
46
|
+
}, jn = { class: "flex flex-col gap-4 mb-10" }, Wn = { class: "fm-typo-en-title-sm-700 text-[#1C1C1E]" }, Yn = { class: "fm-typo-en-body-md-400 text-[#4B4B4B]" }, Hn = { class: "mb-12" }, Qn = { class: "border border-[#E0E0E0] rounded-sm overflow-hidden bg-white" }, Kn = ["onClick"], Gn = { class: "w-32 h-32 rounded-full bg-[#F0F0F0] flex items-center justify-center shrink-0" }, Xn = { class: "fm-typo-en-body-xs text-[#6B6C70]" }, Zn = { class: "flex-1 min-w-0" }, eo = { class: "fm-typo-en-body-md-600 text-[#1C1C1E]" }, to = { class: "fm-typo-en-body-sm-400 text-[#6B6C70] truncate" }, no = { class: "text-[10px] leading-[12px] font-semibold text-[#6B6C70] bg-[#F6F7F8] px-4 py-1 rounded-[4px] uppercase tracking-[0.08em] shrink-0" }, oo = {
|
|
48
47
|
key: 0,
|
|
49
48
|
class: "w-[8px] h-[8px] rounded-full bg-[#FF7823]"
|
|
50
|
-
},
|
|
49
|
+
}, so = {
|
|
51
50
|
key: 0,
|
|
52
51
|
class: "py-40 text-center text-[#B2B3B6] fm-typo-en-body-md-400"
|
|
53
|
-
},
|
|
52
|
+
}, ao = {
|
|
54
53
|
key: 1,
|
|
55
54
|
class: "px-32 py-24"
|
|
56
|
-
},
|
|
55
|
+
}, ro = { class: "flex flex-col gap-4 mb-12" }, lo = { class: "fm-typo-en-title-sm-700 text-[#1C1C1E]" }, io = { class: "fm-typo-en-body-md-400 text-[#4B4B4B]" }, uo = { class: "grid grid-cols-2 gap-12 mb-12" }, co = { class: "flex items-start justify-between mb-12" }, mo = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-4" }, fo = { class: "fm-typo-en-body-sm-400 text-[#6B6C70]" }, po = { class: "flex items-start justify-between mb-12" }, vo = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-4" }, yo = { class: "fm-typo-en-body-sm-400 text-[#6B6C70]" }, bo = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-12" }, ho = { class: "mb-12" }, go = { class: "border border-[#E0E0E0] rounded-xl overflow-hidden bg-white" }, xo = ["onClick"], _o = { class: "w-32 h-32 rounded-full bg-[#F0F0F0] flex items-center justify-center shrink-0" }, wo = { class: "fm-typo-en-body-xs-600 text-[#6B6C70]" }, ko = { class: "flex-1 min-w-0" }, Co = { class: "fm-typo-en-body-md-600 text-[#1C1C1E]" }, Fo = { class: "fm-typo-en-body-sm-400 text-[#6B6C70] truncate" }, So = { class: "text-[10px] leading-[12px] font-semibold text-[#6B6C70] bg-[#F6F7F8] px-4 py-1 rounded-[4px] uppercase tracking-[0.08em] shrink-0" }, Ro = {
|
|
57
56
|
key: 0,
|
|
58
57
|
class: "w-[8px] h-[8px] rounded-full bg-[#FF7823]"
|
|
59
|
-
},
|
|
58
|
+
}, Po = {
|
|
60
59
|
key: 0,
|
|
61
60
|
class: "py-32 text-center text-[#B2B3B6] fm-typo-en-body-md-400"
|
|
62
|
-
},
|
|
61
|
+
}, Do = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-12" }, Eo = { class: "mb-12" }, qo = {
|
|
63
62
|
key: 0,
|
|
64
63
|
class: "py-32 flex justify-center"
|
|
65
|
-
},
|
|
64
|
+
}, No = {
|
|
66
65
|
key: 1,
|
|
67
66
|
class: "py-32 text-center text-[#B2B3B6] fm-typo-en-body-md-400"
|
|
68
|
-
},
|
|
67
|
+
}, Ao = {
|
|
69
68
|
key: 2,
|
|
70
69
|
class: "flex flex-col gap-8"
|
|
71
|
-
},
|
|
70
|
+
}, $o = ["onClick"], Oo = { class: "flex-1 min-w-0" }, Bo = { class: "fm-typo-en-body-md-600 text-[#1C1C1E] mb-2" }, To = { class: "fm-typo-en-body-sm-400 text-[#6B6C70]" }, Io = {
|
|
72
71
|
key: 0,
|
|
73
72
|
class: "w-[8px] h-[8px] rounded-full bg-[#FF7823]"
|
|
74
|
-
},
|
|
73
|
+
}, Lo = {
|
|
75
74
|
key: 2,
|
|
76
75
|
class: "px-32 py-24"
|
|
77
|
-
},
|
|
76
|
+
}, zo = { class: "flex flex-col gap-4 mb-12" }, Mo = { class: "fm-typo-en-title-sm-700 text-[#1C1C1E]" }, Uo = { class: "w-[332px] shrink-0 border-l border-[#F0F0F0] overflow-y-auto bg-white" }, Vo = { class: "p-4" }, Jo = { class: "flex flex-col gap-0 border border-[#E9EAEC] rounded-2xl bg-white overflow-hidden" }, jo = { class: "px-10 py-5 border-b border-[#F0F0F0]" }, Wo = { class: "fm-typo-en-body-md-700 text-[#1C1C1E]" }, Yo = { class: "flex flex-col gap-0.5 px-10 py-4 border-b border-[#F0F0F0]" }, Ho = { class: "text-[11px] leading-[14px] font-medium text-[#6B6C70]" }, Qo = {
|
|
78
77
|
key: 0,
|
|
79
78
|
class: "text-[11px] leading-[14px] text-[#6B6C70]"
|
|
80
|
-
},
|
|
79
|
+
}, Ko = { class: "flex flex-col gap-0.5 px-10 py-4 border-b border-[#F0F0F0]" }, Go = { class: "text-[11px] leading-[14px] font-medium text-[#6B6C70]" }, Xo = { class: "flex flex-col gap-0.5 px-10 py-4 border-b border-[#F0F0F0]" }, Zo = { class: "text-[11px] leading-[14px] font-medium text-[#6B6C70]" }, es = {
|
|
81
80
|
key: 0,
|
|
82
81
|
class: "text-[11px] leading-[14px] text-[#6B6C70]"
|
|
83
|
-
},
|
|
82
|
+
}, ts = { class: "flex items-center justify-between gap-8 px-10 py-4" }, ns = { class: "text-[15px] leading-[20px] font-semibold text-[#1C1C1E]" }, os = { class: "fm-typo-en-title-md-600" }, ss = { class: "flex flex-col gap-16" }, as = { class: "fm-typo-en-body-md-400" }, rs = { class: "max-h-[300px] overflow-y-auto" }, ls = { class: "list-disc pl-16" }, is = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, us = { class: "flex w-full gap-8 justify-end" }, cs = /* @__PURE__ */ tt({
|
|
84
83
|
__name: "CreateTransferWizard",
|
|
85
84
|
props: {
|
|
86
85
|
show: { type: Boolean },
|
|
@@ -88,15 +87,15 @@ const An = {
|
|
|
88
87
|
selectedOutletIds: {}
|
|
89
88
|
},
|
|
90
89
|
emits: ["update:show", "submitted"],
|
|
91
|
-
setup(
|
|
92
|
-
const { FmButton:
|
|
93
|
-
() => Fe.value &&
|
|
94
|
-
), Oe = L(() => i.value === 0 ? ge.value : i.value === 1 ?
|
|
90
|
+
setup(_, { emit: h }) {
|
|
91
|
+
const { FmButton: w, FmDialog: O, FmIcon: S, FmTextField: z } = ln, Y = _, $ = h, { t: c } = nt(), l = ut(), g = it(), V = Ft(), de = Lt(), v = bn(), f = Ke(), d = St(), i = k(0), C = k(!1), o = k(null), H = k(""), R = k(null), N = k(null), M = k(null), be = k(""), he = k(""), ue = k(!1), ne = k(!1), ve = k(!1), De = k(!1), _e = k(!1), Ae = k(/* @__PURE__ */ new Map()), Ee = k(), me = k([]), ge = L(() => !!o.value), $e = L(() => R.value === "transfer" ? !!N.value : R.value === "template" ? !!M.value : !1), Fe = L(() => (me.value.length ? me.value : A.value.items ?? []).some((a) => a.quantity.amount > 0)), Ge = L(() => ue.value), qe = L(
|
|
92
|
+
() => Fe.value && ne.value && ve.value && !ue.value
|
|
93
|
+
), Oe = L(() => i.value === 0 ? ge.value : i.value === 1 ? $e.value : i.value === 2 ? qe.value : !1), Se = L(
|
|
95
94
|
() => i.value === 2 ? c("inventory.transfer.receiveRequest.bulk.wizard.createTransferBtn") : c("inventory.transfer.receiveRequest.bulk.wizard.continueBtn")
|
|
96
95
|
), P = L(
|
|
97
|
-
() =>
|
|
96
|
+
() => ee.value === "Purchase" ? "Purchase method" : "Transfer method"
|
|
98
97
|
), F = L(
|
|
99
|
-
() =>
|
|
98
|
+
() => ee.value === "Purchase" ? "Purchase details" : "Transfer details"
|
|
100
99
|
), B = L(() => {
|
|
101
100
|
const n = H.value.trim().toLowerCase();
|
|
102
101
|
let a = g.locations;
|
|
@@ -104,72 +103,72 @@ const An = {
|
|
|
104
103
|
(s) => s.name.toLowerCase().includes(n) || (s.doc.profile.code ?? "").toLowerCase().includes(n)
|
|
105
104
|
) : a;
|
|
106
105
|
}), K = L(() => {
|
|
107
|
-
var
|
|
108
|
-
const n = (
|
|
109
|
-
doc:
|
|
110
|
-
name:
|
|
106
|
+
var fe;
|
|
107
|
+
const n = (fe = o.value) == null ? void 0 : fe.doc._id, a = V.suppliers.map((se) => ({
|
|
108
|
+
doc: se,
|
|
109
|
+
name: se.name,
|
|
111
110
|
dbName: "",
|
|
112
111
|
type: "supplier",
|
|
113
112
|
acceptRequest: !0
|
|
114
|
-
})),
|
|
113
|
+
})), X = [
|
|
115
114
|
...g.allLocations ?? g.locations,
|
|
116
115
|
...a
|
|
117
|
-
].filter((
|
|
118
|
-
return
|
|
119
|
-
var
|
|
120
|
-
const Ue =
|
|
121
|
-
return
|
|
122
|
-
}) :
|
|
123
|
-
}),
|
|
124
|
-
const n =
|
|
116
|
+
].filter((se) => se.doc._id !== n), te = be.value.trim().toLowerCase();
|
|
117
|
+
return te ? X.filter((se) => {
|
|
118
|
+
var Xe;
|
|
119
|
+
const Ue = se.type === "supplier" ? "" : ((Xe = se.doc.profile) == null ? void 0 : Xe.code) ?? "";
|
|
120
|
+
return se.name.toLowerCase().includes(te) || Ue.toLowerCase().includes(te);
|
|
121
|
+
}) : X;
|
|
122
|
+
}), G = L(() => {
|
|
123
|
+
const n = he.value.trim().toLowerCase(), a = d.templates;
|
|
125
124
|
return n ? a.filter((s) => s.name.toLowerCase().includes(n)) : a;
|
|
126
|
-
}),
|
|
125
|
+
}), ee = L(() => {
|
|
127
126
|
var n;
|
|
128
|
-
if (
|
|
129
|
-
return typeof
|
|
130
|
-
if (R.value === "transfer" &&
|
|
131
|
-
return
|
|
132
|
-
if (R.value === "template" &&
|
|
127
|
+
if (A.value.supplier)
|
|
128
|
+
return typeof A.value.supplier.internal == "string" ? "Transfer" : "Purchase";
|
|
129
|
+
if (R.value === "transfer" && N.value)
|
|
130
|
+
return N.value.type === "supplier" ? "Purchase" : "Transfer";
|
|
131
|
+
if (R.value === "template" && M.value) {
|
|
133
132
|
const a = d.templates.find(
|
|
134
|
-
(s) => s._id ===
|
|
133
|
+
(s) => s._id === M.value
|
|
135
134
|
);
|
|
136
135
|
if ((n = a == null ? void 0 : a.purchaseOrder) != null && n.supplier)
|
|
137
136
|
return typeof a.purchaseOrder.supplier.internal == "string" ? "Transfer" : "Purchase";
|
|
138
137
|
}
|
|
139
138
|
return "Transfer";
|
|
140
|
-
}), Re = L(() => o.value ? o.value.name : c("inventory.transfer.receiveRequest.bulk.wizard.notSelected")), we = L(() => R.value === "transfer" ?
|
|
139
|
+
}), Re = L(() => o.value ? o.value.name : c("inventory.transfer.receiveRequest.bulk.wizard.notSelected")), we = L(() => R.value === "transfer" ? ee.value === "Purchase" ? "Purchase from Supplier" : c("inventory.transfer.receiveRequest.bulk.wizard.outletToOutletMethod") : R.value === "template" ? c("inventory.transfer.receiveRequest.bulk.wizard.fromTemplateMethod") : c("inventory.transfer.receiveRequest.bulk.wizard.notChosen")), j = L(() => {
|
|
141
140
|
var n;
|
|
142
|
-
if (R.value === "transfer" &&
|
|
143
|
-
return
|
|
144
|
-
if (R.value === "template" &&
|
|
145
|
-
const a = d.templates.find((s) => s._id ===
|
|
146
|
-
return (n = a == null ? void 0 : a.purchaseOrder) != null && n.supplier ? a.purchaseOrder.supplier.name ||
|
|
141
|
+
if (R.value === "transfer" && N.value)
|
|
142
|
+
return N.value.name;
|
|
143
|
+
if (R.value === "template" && M.value) {
|
|
144
|
+
const a = d.templates.find((s) => s._id === M.value);
|
|
145
|
+
return (n = a == null ? void 0 : a.purchaseOrder) != null && n.supplier ? a.purchaseOrder.supplier.name || M.value : (a == null ? void 0 : a.name) ?? M.value;
|
|
147
146
|
}
|
|
148
147
|
return c("inventory.transfer.receiveRequest.bulk.wizard.noneYet");
|
|
149
148
|
});
|
|
150
|
-
function
|
|
151
|
-
var
|
|
152
|
-
const a = (
|
|
149
|
+
function ae(n) {
|
|
150
|
+
var X, te, fe, se, Ue;
|
|
151
|
+
const a = (X = n.doc.profile) != null && X.code ? `#${n.doc.profile.code}` : "", s = [(fe = (te = n.doc.profile) == null ? void 0 : te.address) == null ? void 0 : fe.line1, (Ue = (se = n.doc.profile) == null ? void 0 : se.address) == null ? void 0 : Ue.city].filter(Boolean).join(" · ");
|
|
153
152
|
return [a, s].filter(Boolean).join(" · ");
|
|
154
153
|
}
|
|
155
154
|
function Be(n) {
|
|
156
|
-
var s,
|
|
157
|
-
return [(s = n.doc.address) == null ? void 0 : s.line1, (
|
|
155
|
+
var s, X;
|
|
156
|
+
return [(s = n.doc.address) == null ? void 0 : s.line1, (X = n.doc.address) == null ? void 0 : X.city].filter(Boolean).join(" · ");
|
|
158
157
|
}
|
|
159
158
|
function Te(n) {
|
|
160
159
|
var a;
|
|
161
160
|
return n.type === "supplier" ? "" : ((a = n.doc.profile) == null ? void 0 : a.code) ?? "";
|
|
162
161
|
}
|
|
163
162
|
function r(n) {
|
|
164
|
-
var a, s,
|
|
165
|
-
return n.type === "supplier" ? [(a = n.doc.address) == null ? void 0 : a.line1, (s = n.doc.address) == null ? void 0 : s.city].filter(Boolean).join(" · ") : [(
|
|
163
|
+
var a, s, X, te, fe, se;
|
|
164
|
+
return n.type === "supplier" ? [(a = n.doc.address) == null ? void 0 : a.line1, (s = n.doc.address) == null ? void 0 : s.city].filter(Boolean).join(" · ") : [(te = (X = n.doc.profile) == null ? void 0 : X.address) == null ? void 0 : te.line1, (se = (fe = n.doc.profile) == null ? void 0 : fe.address) == null ? void 0 : se.city].filter(Boolean).join(" · ");
|
|
166
165
|
}
|
|
167
166
|
const u = L(
|
|
168
|
-
() => o.value ?
|
|
167
|
+
() => o.value ? ae(o.value) : ""
|
|
169
168
|
), b = L(
|
|
170
|
-
() => R.value === "transfer" &&
|
|
169
|
+
() => R.value === "transfer" && N.value ? N.value.type === "supplier" ? Be(N.value) : ae(N.value) : ""
|
|
171
170
|
), T = L(() => {
|
|
172
|
-
const a = (
|
|
171
|
+
const a = (me.value.length ? me.value : A.value.items ?? []).filter((s) => s.quantity.amount > 0).length;
|
|
173
172
|
return a === 0 ? c("inventory.transfer.receiveRequest.bulk.wizard.noneYet") : `${a} ${a === 1 ? "item" : "items"}`;
|
|
174
173
|
});
|
|
175
174
|
function I(n) {
|
|
@@ -177,7 +176,7 @@ const An = {
|
|
|
177
176
|
const a = (s = n.purchaseOrder) == null ? void 0 : s.supplier;
|
|
178
177
|
return a ? a.internal === "warehouse" ? `Transfer from ${a.name}` : a.internal === "restaurant" ? `Transfer from ${a.name}` : `Purchase from ${a.name}` : "";
|
|
179
178
|
}
|
|
180
|
-
function
|
|
179
|
+
function q(n) {
|
|
181
180
|
return {
|
|
182
181
|
_id: n.doc._id,
|
|
183
182
|
internal: n.type,
|
|
@@ -217,8 +216,8 @@ const An = {
|
|
|
217
216
|
};
|
|
218
217
|
}
|
|
219
218
|
function Q() {
|
|
220
|
-
var
|
|
221
|
-
const n =
|
|
219
|
+
var X;
|
|
220
|
+
const n = M.value ? d.templates.find((te) => te._id === M.value) : void 0, a = {
|
|
222
221
|
_rev: void 0,
|
|
223
222
|
email: void 0,
|
|
224
223
|
internal: void 0,
|
|
@@ -229,32 +228,32 @@ const An = {
|
|
|
229
228
|
_id: "",
|
|
230
229
|
name: "",
|
|
231
230
|
address: { line2: void 0, line1: "", state: "", city: "", postcode: "", country: "" }
|
|
232
|
-
}, s = R.value === "transfer" &&
|
|
231
|
+
}, s = R.value === "transfer" && N.value ? N.value.type === "supplier" ? W(N.value.doc) : q(N.value) : R.value === "template" && (n != null && n.purchaseOrder.supplier) ? n.purchaseOrder.supplier : a;
|
|
233
232
|
return {
|
|
234
233
|
remark: void 0,
|
|
235
234
|
ref: void 0,
|
|
236
235
|
stockSnapshotId: void 0,
|
|
237
236
|
effectiveAt: void 0,
|
|
238
|
-
items: R.value === "template" && ((
|
|
237
|
+
items: R.value === "template" && ((X = n == null ? void 0 : n.purchaseOrder) != null && X.items) ? n.purchaseOrder.items : [],
|
|
239
238
|
supplier: s,
|
|
240
239
|
status: "DRAFT",
|
|
241
240
|
_id: "",
|
|
242
241
|
seqNumber: 0,
|
|
243
242
|
deliveryOrder: [],
|
|
244
|
-
template:
|
|
243
|
+
template: M.value ?? void 0,
|
|
245
244
|
templateDoc: n
|
|
246
245
|
};
|
|
247
246
|
}
|
|
248
|
-
const
|
|
247
|
+
const A = k(Q()), Z = k(`${Math.random()}`), U = L(
|
|
249
248
|
() => {
|
|
250
249
|
var n;
|
|
251
|
-
return ((n =
|
|
250
|
+
return ((n = A.value.items) == null ? void 0 : n.filter((a) => a.quantity.amount === 0)) ?? [];
|
|
252
251
|
}
|
|
253
252
|
);
|
|
254
253
|
Ve(
|
|
255
254
|
() => Y.show,
|
|
256
255
|
(n) => {
|
|
257
|
-
if (n && (i.value = 0,
|
|
256
|
+
if (n && (i.value = 0, C.value = !1, o.value = null, R.value = null, N.value = null, M.value = null, H.value = "", be.value = "", he.value = "", ne.value = !1, ve.value = !1, me.value = [], A.value = Q(), Z.value = `${Math.random()}`, d.fetchTemplates(), Y.selectedOutletIds && Y.selectedOutletIds.length === 1)) {
|
|
258
257
|
const a = g.locations.find(
|
|
259
258
|
(s) => s.doc._id === Y.selectedOutletIds[0]
|
|
260
259
|
);
|
|
@@ -262,13 +261,13 @@ const An = {
|
|
|
262
261
|
}
|
|
263
262
|
}
|
|
264
263
|
);
|
|
265
|
-
function
|
|
264
|
+
function re() {
|
|
266
265
|
if (i.value === 0) {
|
|
267
266
|
if (!o.value) return;
|
|
268
267
|
g._currentLocation = o.value, ze(), Me(), i.value = 1;
|
|
269
268
|
} else if (i.value === 1) {
|
|
270
|
-
if (
|
|
271
|
-
|
|
269
|
+
if (!$e.value) return;
|
|
270
|
+
A.value = Q(), Z.value = `${Math.random()}`, me.value = [], i.value = 2;
|
|
272
271
|
} else i.value === 2 && We();
|
|
273
272
|
}
|
|
274
273
|
function Je() {
|
|
@@ -278,26 +277,26 @@ const An = {
|
|
|
278
277
|
n < i.value && (i.value = n);
|
|
279
278
|
}
|
|
280
279
|
function Le() {
|
|
281
|
-
|
|
280
|
+
$("update:show", !1);
|
|
282
281
|
}
|
|
283
282
|
function Ne(n) {
|
|
284
|
-
R.value !== n && (R.value = n,
|
|
285
|
-
|
|
283
|
+
R.value !== n && (R.value = n, N.value = null, M.value = null, me.value = [], A.value = {
|
|
284
|
+
...A.value,
|
|
286
285
|
items: [],
|
|
287
286
|
template: void 0,
|
|
288
287
|
templateDoc: void 0
|
|
289
288
|
});
|
|
290
289
|
}
|
|
291
290
|
function ke(n) {
|
|
292
|
-
|
|
291
|
+
me.value = n ?? [];
|
|
293
292
|
}
|
|
294
|
-
Ve(
|
|
295
|
-
R.value === "template" && n && (
|
|
293
|
+
Ve(M, (n) => {
|
|
294
|
+
R.value === "template" && n && (A.value = Q(), Z.value = `${Math.random()}`);
|
|
296
295
|
});
|
|
297
296
|
async function ze() {
|
|
298
|
-
|
|
297
|
+
ne.value = !1;
|
|
299
298
|
try {
|
|
300
|
-
await
|
|
299
|
+
await V.readSuppliers(), ne.value = !0;
|
|
301
300
|
} catch {
|
|
302
301
|
l.open({
|
|
303
302
|
title: c("inventory.transfer.form.unableToFetchListOfSuppliers.title"),
|
|
@@ -307,57 +306,57 @@ const An = {
|
|
|
307
306
|
}
|
|
308
307
|
}
|
|
309
308
|
async function Me() {
|
|
310
|
-
|
|
309
|
+
_e.value = !0, Ae.value = /* @__PURE__ */ new Map();
|
|
311
310
|
try {
|
|
312
|
-
const n = await
|
|
311
|
+
const n = await v.readStockBalance(), a = /* @__PURE__ */ new Map();
|
|
313
312
|
for (const s of n.skus ?? [])
|
|
314
313
|
a.set(s.id, s);
|
|
315
|
-
|
|
314
|
+
Ae.value = a;
|
|
316
315
|
} catch {
|
|
317
316
|
} finally {
|
|
318
|
-
|
|
317
|
+
_e.value = !1;
|
|
319
318
|
}
|
|
320
319
|
}
|
|
321
320
|
function je() {
|
|
322
321
|
var n;
|
|
323
|
-
(n = Ee.value) != null && n.getFormData && (
|
|
322
|
+
(n = Ee.value) != null && n.getFormData && (A.value = { ...A.value, ...Ee.value.getFormData() });
|
|
324
323
|
}
|
|
325
324
|
function We() {
|
|
326
|
-
if (je(),
|
|
325
|
+
if (je(), U.value.length > 0) {
|
|
327
326
|
De.value = !0;
|
|
328
327
|
return;
|
|
329
328
|
}
|
|
330
|
-
|
|
329
|
+
oe();
|
|
331
330
|
}
|
|
332
|
-
function
|
|
331
|
+
function x() {
|
|
333
332
|
var n;
|
|
334
|
-
|
|
333
|
+
A.value.items = ((n = A.value.items) == null ? void 0 : n.filter((a) => a.quantity.amount > 0)) ?? [], De.value = !1, oe();
|
|
335
334
|
}
|
|
336
|
-
function
|
|
337
|
-
var s,
|
|
338
|
-
const n =
|
|
339
|
-
skusById:
|
|
340
|
-
items:
|
|
335
|
+
function oe() {
|
|
336
|
+
var s, X;
|
|
337
|
+
const n = gn.validatePurchaseOrderItems({
|
|
338
|
+
skusById: de.skuById ?? {},
|
|
339
|
+
items: A.value.items ?? []
|
|
341
340
|
}), a = Object.values(n).flat();
|
|
342
341
|
if (a.length > 0) {
|
|
343
|
-
const
|
|
342
|
+
const te = a[0];
|
|
344
343
|
l.open({
|
|
345
|
-
title: `[Row ${
|
|
346
|
-
message: `${
|
|
344
|
+
title: `[Row ${te.index + 1}] "${te.poItem.sku.name}"`,
|
|
345
|
+
message: `${te.message}`,
|
|
347
346
|
type: "error"
|
|
348
347
|
});
|
|
349
348
|
return;
|
|
350
349
|
}
|
|
351
|
-
(
|
|
350
|
+
(X = (s = Ee.value) == null ? void 0 : s.validateInputs) == null || X.call(s);
|
|
352
351
|
}
|
|
353
|
-
async function
|
|
354
|
-
const n =
|
|
355
|
-
if (
|
|
352
|
+
async function ie() {
|
|
353
|
+
const n = A.value;
|
|
354
|
+
if (ue.value = !0, n.items = n.items.filter((a) => a.quantity.amount > 0), !n.items.length) {
|
|
356
355
|
l.open({
|
|
357
356
|
title: "Cannot create order",
|
|
358
357
|
message: "There are no items with non-zero amount in your request.",
|
|
359
358
|
type: "error"
|
|
360
|
-
}),
|
|
359
|
+
}), ue.value = !1;
|
|
361
360
|
return;
|
|
362
361
|
}
|
|
363
362
|
(n.supplier.internal === "warehouse" || n.supplier.internal === "restaurant") && (n.items = n.items.map(({ totalCost: a, ...s }) => s));
|
|
@@ -366,7 +365,7 @@ const An = {
|
|
|
366
365
|
title: c("inventory.transfer.receiveRequest.create.success"),
|
|
367
366
|
message: c("inventory.transfer.receiveRequest.create.successMessage"),
|
|
368
367
|
type: "success"
|
|
369
|
-
}),
|
|
368
|
+
}), $("submitted"), $("update:show", !1), ce();
|
|
370
369
|
} catch (a) {
|
|
371
370
|
l.open({
|
|
372
371
|
title: c("inventory.transfer.receiveRequest.create.error.title"),
|
|
@@ -374,15 +373,15 @@ const An = {
|
|
|
374
373
|
type: "error"
|
|
375
374
|
}), console.error("Error creating purchase order", a);
|
|
376
375
|
} finally {
|
|
377
|
-
|
|
376
|
+
ue.value = !1;
|
|
378
377
|
}
|
|
379
378
|
}
|
|
380
|
-
function
|
|
381
|
-
i.value = 0,
|
|
379
|
+
function ce() {
|
|
380
|
+
i.value = 0, C.value = !1, o.value = null, R.value = null, N.value = null, M.value = null, H.value = "", be.value = "", he.value = "", ne.value = !1, ve.value = !1, me.value = [], A.value = Q(), Z.value = `${Math.random()}`;
|
|
382
381
|
}
|
|
383
|
-
return (n, a) => (m(), y(
|
|
384
|
-
(m(),
|
|
385
|
-
E(
|
|
382
|
+
return (n, a) => (m(), y(ye, null, [
|
|
383
|
+
(m(), le(lt, { to: "body" }, [
|
|
384
|
+
E(Dt, {
|
|
386
385
|
"enter-active-class": "transition-opacity duration-150 ease-out",
|
|
387
386
|
"enter-from-class": "opacity-0",
|
|
388
387
|
"enter-to-class": "opacity-100",
|
|
@@ -391,17 +390,17 @@ const An = {
|
|
|
391
390
|
"leave-to-class": "opacity-0"
|
|
392
391
|
}, {
|
|
393
392
|
default: Pe(() => [
|
|
394
|
-
n.show ? (m(), y("div",
|
|
395
|
-
|
|
396
|
-
e("span",
|
|
397
|
-
e("div",
|
|
398
|
-
E(t(
|
|
393
|
+
n.show ? (m(), y("div", qn, [
|
|
394
|
+
C.value ? D("", !0) : (m(), y("div", Nn, [
|
|
395
|
+
e("span", An, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.title")), 1),
|
|
396
|
+
e("div", $n, [
|
|
397
|
+
E(t(w), {
|
|
399
398
|
variant: "tertiary",
|
|
400
399
|
size: "md",
|
|
401
400
|
label: t(c)("inventory.transfer.receiveRequest.bulk.wizard.cancelBtn"),
|
|
402
401
|
onClick: Le
|
|
403
402
|
}, null, 8, ["label"]),
|
|
404
|
-
i.value > 0 ? (m(),
|
|
403
|
+
i.value > 0 ? (m(), le(t(w), {
|
|
405
404
|
key: 0,
|
|
406
405
|
variant: "secondary",
|
|
407
406
|
size: "md",
|
|
@@ -409,17 +408,17 @@ const An = {
|
|
|
409
408
|
label: t(c)("inventory.transfer.receiveRequest.bulk.wizard.backBtn"),
|
|
410
409
|
onClick: Je
|
|
411
410
|
}, null, 8, ["label"])) : D("", !0),
|
|
412
|
-
E(t(
|
|
411
|
+
E(t(w), {
|
|
413
412
|
size: "md",
|
|
414
413
|
disabled: !Oe.value,
|
|
415
|
-
loading:
|
|
414
|
+
loading: ue.value,
|
|
416
415
|
label: Se.value,
|
|
417
|
-
onClick:
|
|
416
|
+
onClick: re
|
|
418
417
|
}, null, 8, ["disabled", "loading", "label"])
|
|
419
418
|
])
|
|
420
419
|
])),
|
|
421
|
-
|
|
422
|
-
e("div",
|
|
420
|
+
C.value ? D("", !0) : (m(), y("div", On, [
|
|
421
|
+
e("div", Bn, [
|
|
423
422
|
e("button", {
|
|
424
423
|
class: "flex flex-col items-center gap-4 min-w-0 group",
|
|
425
424
|
disabled: i.value <= 0,
|
|
@@ -431,16 +430,16 @@ const An = {
|
|
|
431
430
|
i.value > 0 || i.value === 0 ? "bg-[#FF7823] text-white" : "bg-[#F0F0F0] text-[#6B6C70]"
|
|
432
431
|
])
|
|
433
432
|
}, [
|
|
434
|
-
i.value > 0 ? (m(),
|
|
433
|
+
i.value > 0 ? (m(), le(t(S), {
|
|
435
434
|
key: 0,
|
|
436
435
|
name: "check",
|
|
437
436
|
size: "sm"
|
|
438
|
-
})) : (m(), y("span",
|
|
437
|
+
})) : (m(), y("span", In, "1"))
|
|
439
438
|
], 2),
|
|
440
439
|
e("span", {
|
|
441
440
|
class: J(["fm-typo-en-body-xs-500 whitespace-nowrap transition-colors duration-150", i.value >= 0 ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
|
|
442
441
|
}, " Select destination ", 2)
|
|
443
|
-
], 8,
|
|
442
|
+
], 8, Tn),
|
|
444
443
|
e("div", {
|
|
445
444
|
class: J(["flex-1 h-1 mx-8 transition-colors duration-200", i.value > 0 ? "bg-[#FF7823]" : "bg-[#E0E0E0]"])
|
|
446
445
|
}, null, 2),
|
|
@@ -455,20 +454,20 @@ const An = {
|
|
|
455
454
|
i.value > 1 || i.value === 1 ? "bg-[#FF7823] text-white" : "bg-[#F0F0F0] text-[#6B6C70]"
|
|
456
455
|
])
|
|
457
456
|
}, [
|
|
458
|
-
i.value > 1 ? (m(),
|
|
457
|
+
i.value > 1 ? (m(), le(t(S), {
|
|
459
458
|
key: 0,
|
|
460
459
|
name: "check",
|
|
461
460
|
size: "sm"
|
|
462
|
-
})) : (m(), y("span",
|
|
461
|
+
})) : (m(), y("span", zn, "2"))
|
|
463
462
|
], 2),
|
|
464
463
|
e("span", {
|
|
465
464
|
class: J(["fm-typo-en-body-xs-500 whitespace-nowrap transition-colors duration-150", i.value >= 1 ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
|
|
466
|
-
},
|
|
467
|
-
], 8,
|
|
465
|
+
}, p(P.value), 3)
|
|
466
|
+
], 8, Ln),
|
|
468
467
|
e("div", {
|
|
469
468
|
class: J(["flex-1 h-1 mx-8 transition-colors duration-200", i.value > 1 ? "bg-[#FF7823]" : "bg-[#E0E0E0]"])
|
|
470
469
|
}, null, 2),
|
|
471
|
-
e("button",
|
|
470
|
+
e("button", Mn, [
|
|
472
471
|
e("div", {
|
|
473
472
|
class: J([
|
|
474
473
|
"w-32 h-32 rounded-full flex items-center justify-center text-sm font-semibold transition-colors duration-150",
|
|
@@ -479,68 +478,68 @@ const An = {
|
|
|
479
478
|
]), 2),
|
|
480
479
|
e("span", {
|
|
481
480
|
class: J(["fm-typo-en-body-xs-500 whitespace-nowrap transition-colors duration-150", i.value >= 2 ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
|
|
482
|
-
},
|
|
481
|
+
}, p(F.value), 3)
|
|
483
482
|
])
|
|
484
483
|
])
|
|
485
484
|
])),
|
|
486
|
-
e("div",
|
|
487
|
-
e("div",
|
|
488
|
-
i.value === 0 ? (m(), y("div",
|
|
489
|
-
e("div",
|
|
490
|
-
e("h3",
|
|
491
|
-
e("p",
|
|
485
|
+
e("div", Un, [
|
|
486
|
+
e("div", Vn, [
|
|
487
|
+
i.value === 0 ? (m(), y("div", Jn, [
|
|
488
|
+
e("div", jn, [
|
|
489
|
+
e("h3", Wn, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step1Heading")), 1),
|
|
490
|
+
e("p", Yn, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step1Desc")), 1)
|
|
492
491
|
]),
|
|
493
|
-
e("div",
|
|
494
|
-
E(t(
|
|
492
|
+
e("div", Hn, [
|
|
493
|
+
E(t(z), {
|
|
495
494
|
"model-value": H.value,
|
|
496
495
|
"onUpdate:modelValue": a[2] || (a[2] = (s) => H.value = s),
|
|
497
496
|
"prepend-icon": "search",
|
|
498
497
|
placeholder: t(c)("inventory.transfer.receiveRequest.bulk.wizard.step1SearchPlaceholder")
|
|
499
498
|
}, null, 8, ["model-value", "placeholder"])
|
|
500
499
|
]),
|
|
501
|
-
e("div",
|
|
502
|
-
(m(!0), y(
|
|
503
|
-
var
|
|
500
|
+
e("div", Qn, [
|
|
501
|
+
(m(!0), y(ye, null, Qe(B.value, (s, X) => {
|
|
502
|
+
var te, fe, se, Ue, Xe, vt, yt;
|
|
504
503
|
return m(), y("div", {
|
|
505
504
|
key: s.dbName,
|
|
506
505
|
class: J(["flex items-center gap-8 px-12 h-[67px] cursor-pointer transition-colors duration-150", [
|
|
507
|
-
((
|
|
508
|
-
|
|
506
|
+
((te = o.value) == null ? void 0 : te.dbName) === s.dbName ? "bg-[#FFF5EE]" : "hover:bg-[#FAFAFA]",
|
|
507
|
+
X > 0 ? "border-t border-[#F0F0F0]" : ""
|
|
509
508
|
]]),
|
|
510
|
-
onClick: (
|
|
509
|
+
onClick: (ka) => o.value = s
|
|
511
510
|
}, [
|
|
512
|
-
e("div",
|
|
513
|
-
e("span",
|
|
511
|
+
e("div", Gn, [
|
|
512
|
+
e("span", Xn, p(s.name.slice(0, 2).toUpperCase()), 1)
|
|
514
513
|
]),
|
|
515
|
-
e("div",
|
|
516
|
-
e("div",
|
|
517
|
-
e("div",
|
|
518
|
-
|
|
519
|
-
(
|
|
520
|
-
|
|
514
|
+
e("div", Zn, [
|
|
515
|
+
e("div", eo, p(s.name), 1),
|
|
516
|
+
e("div", to, [
|
|
517
|
+
ot(p(s.doc.profile.code ? `#${s.doc.profile.code}` : t(c)("inventory.transfer.receiveRequest.bulk.wizard.noCode")) + " ", 1),
|
|
518
|
+
(fe = s.doc.profile.address) != null && fe.line1 || (se = s.doc.profile.address) != null && se.city ? (m(), y(ye, { key: 0 }, [
|
|
519
|
+
ot(" · " + p([(Ue = s.doc.profile.address) == null ? void 0 : Ue.line1, (Xe = s.doc.profile.address) == null ? void 0 : Xe.city].filter(Boolean).join(" · ")), 1)
|
|
521
520
|
], 64)) : D("", !0)
|
|
522
521
|
])
|
|
523
522
|
]),
|
|
524
|
-
e("span",
|
|
523
|
+
e("span", no, p(s.type === "warehouse" ? "Warehouse" : "Restaurant"), 1),
|
|
525
524
|
e("div", {
|
|
526
525
|
class: J([
|
|
527
526
|
"w-[18px] h-[18px] rounded-full border flex items-center justify-center shrink-0 transition-colors duration-150",
|
|
528
527
|
((vt = o.value) == null ? void 0 : vt.dbName) === s.dbName ? "border-[#FF7823]" : "border-[#CCCCCC]"
|
|
529
528
|
])
|
|
530
529
|
}, [
|
|
531
|
-
((yt = o.value) == null ? void 0 : yt.dbName) === s.dbName ? (m(), y("div",
|
|
530
|
+
((yt = o.value) == null ? void 0 : yt.dbName) === s.dbName ? (m(), y("div", oo)) : D("", !0)
|
|
532
531
|
], 2)
|
|
533
|
-
], 10,
|
|
532
|
+
], 10, Kn);
|
|
534
533
|
}), 128)),
|
|
535
|
-
B.value.length === 0 ? (m(), y("div",
|
|
534
|
+
B.value.length === 0 ? (m(), y("div", so, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.noOutletsAvailable")), 1)) : D("", !0)
|
|
536
535
|
])
|
|
537
536
|
])) : D("", !0),
|
|
538
|
-
i.value === 1 ? (m(), y("div",
|
|
539
|
-
e("div",
|
|
540
|
-
e("h3",
|
|
541
|
-
e("p",
|
|
537
|
+
i.value === 1 ? (m(), y("div", ao, [
|
|
538
|
+
e("div", ro, [
|
|
539
|
+
e("h3", lo, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step2Heading")), 1),
|
|
540
|
+
e("p", io, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step2Desc")), 1)
|
|
542
541
|
]),
|
|
543
|
-
e("div",
|
|
542
|
+
e("div", uo, [
|
|
544
543
|
e("div", {
|
|
545
544
|
class: J([
|
|
546
545
|
"border rounded-xl p-16 cursor-pointer transition-all duration-150 flex flex-col",
|
|
@@ -548,7 +547,7 @@ const An = {
|
|
|
548
547
|
]),
|
|
549
548
|
onClick: a[3] || (a[3] = (s) => Ne("transfer"))
|
|
550
549
|
}, [
|
|
551
|
-
e("div",
|
|
550
|
+
e("div", co, [
|
|
552
551
|
e("div", {
|
|
553
552
|
class: J(["w-36 h-36 rounded-xl flex items-center justify-center shrink-0", R.value === "transfer" ? "bg-[#FF7823]" : "bg-[#F0F0F0]"])
|
|
554
553
|
}, [
|
|
@@ -561,7 +560,7 @@ const An = {
|
|
|
561
560
|
e("div", {
|
|
562
561
|
class: J(["w-16 h-16 rounded-full flex items-center justify-center shrink-0", R.value === "transfer" ? "bg-[#FF7823]" : "border border-[#CCCCCC]"])
|
|
563
562
|
}, [
|
|
564
|
-
R.value === "transfer" ? (m(),
|
|
563
|
+
R.value === "transfer" ? (m(), le(t(S), {
|
|
565
564
|
key: 0,
|
|
566
565
|
name: "check",
|
|
567
566
|
size: "sm",
|
|
@@ -569,8 +568,8 @@ const An = {
|
|
|
569
568
|
})) : D("", !0)
|
|
570
569
|
], 2)
|
|
571
570
|
]),
|
|
572
|
-
e("div",
|
|
573
|
-
e("div",
|
|
571
|
+
e("div", mo, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.outletToOutlet")), 1),
|
|
572
|
+
e("div", fo, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.outletToOutletDesc")), 1)
|
|
574
573
|
], 2),
|
|
575
574
|
e("div", {
|
|
576
575
|
class: J([
|
|
@@ -579,7 +578,7 @@ const An = {
|
|
|
579
578
|
]),
|
|
580
579
|
onClick: a[4] || (a[4] = (s) => Ne("template"))
|
|
581
580
|
}, [
|
|
582
|
-
e("div",
|
|
581
|
+
e("div", po, [
|
|
583
582
|
e("div", {
|
|
584
583
|
class: J(["w-36 h-36 rounded-xl flex items-center justify-center shrink-0", R.value === "template" ? "bg-[#FF7823]" : "bg-[#F0F0F0]"])
|
|
585
584
|
}, [
|
|
@@ -592,7 +591,7 @@ const An = {
|
|
|
592
591
|
e("div", {
|
|
593
592
|
class: J(["w-16 h-16 rounded-full flex items-center justify-center shrink-0", R.value === "template" ? "bg-[#FF7823]" : "border border-[#CCCCCC]"])
|
|
594
593
|
}, [
|
|
595
|
-
R.value === "template" ? (m(),
|
|
594
|
+
R.value === "template" ? (m(), le(t(S), {
|
|
596
595
|
key: 0,
|
|
597
596
|
name: "check",
|
|
598
597
|
size: "sm",
|
|
@@ -600,159 +599,159 @@ const An = {
|
|
|
600
599
|
})) : D("", !0)
|
|
601
600
|
], 2)
|
|
602
601
|
]),
|
|
603
|
-
e("div",
|
|
604
|
-
e("div",
|
|
602
|
+
e("div", vo, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.fromTemplate")), 1),
|
|
603
|
+
e("div", yo, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.fromTemplateDesc")), 1)
|
|
605
604
|
], 2)
|
|
606
605
|
]),
|
|
607
|
-
R.value === "transfer" ? (m(), y(
|
|
608
|
-
e("div",
|
|
609
|
-
e("div",
|
|
610
|
-
E(t(
|
|
611
|
-
"model-value":
|
|
612
|
-
"onUpdate:modelValue": a[5] || (a[5] = (s) =>
|
|
606
|
+
R.value === "transfer" ? (m(), y(ye, { key: 0 }, [
|
|
607
|
+
e("div", bo, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step2SourceHeading")), 1),
|
|
608
|
+
e("div", ho, [
|
|
609
|
+
E(t(z), {
|
|
610
|
+
"model-value": be.value,
|
|
611
|
+
"onUpdate:modelValue": a[5] || (a[5] = (s) => be.value = s),
|
|
613
612
|
"prepend-icon": "search",
|
|
614
613
|
placeholder: t(c)(
|
|
615
614
|
"inventory.transfer.receiveRequest.bulk.wizard.step2SearchSourcePlaceholder"
|
|
616
615
|
)
|
|
617
616
|
}, null, 8, ["model-value", "placeholder"])
|
|
618
617
|
]),
|
|
619
|
-
e("div",
|
|
620
|
-
(m(!0), y(
|
|
621
|
-
var
|
|
618
|
+
e("div", go, [
|
|
619
|
+
(m(!0), y(ye, null, Qe(K.value, (s, X) => {
|
|
620
|
+
var te, fe, se;
|
|
622
621
|
return m(), y("div", {
|
|
623
622
|
key: s.dbName,
|
|
624
623
|
class: J(["flex items-center gap-8 px-12 h-[67px] cursor-pointer transition-colors duration-150", [
|
|
625
|
-
((
|
|
626
|
-
|
|
624
|
+
((te = N.value) == null ? void 0 : te.doc._id) === s.doc._id ? "bg-[#FFF5EE]" : "hover:bg-[#FAFAFA]",
|
|
625
|
+
X > 0 ? "border-t border-[#F0F0F0]" : ""
|
|
627
626
|
]]),
|
|
628
|
-
onClick: (Ue) =>
|
|
627
|
+
onClick: (Ue) => N.value = s
|
|
629
628
|
}, [
|
|
630
|
-
e("div",
|
|
631
|
-
e("span",
|
|
629
|
+
e("div", _o, [
|
|
630
|
+
e("span", wo, p(s.name.slice(0, 2).toUpperCase()), 1)
|
|
632
631
|
]),
|
|
633
|
-
e("div",
|
|
634
|
-
e("div",
|
|
635
|
-
e("div",
|
|
636
|
-
|
|
637
|
-
r(s) ? (m(), y(
|
|
638
|
-
|
|
632
|
+
e("div", ko, [
|
|
633
|
+
e("div", Co, p(s.name), 1),
|
|
634
|
+
e("div", Fo, [
|
|
635
|
+
ot(p(Te(s) ? `#${Te(s)}` : t(c)("inventory.transfer.receiveRequest.bulk.wizard.noCode")) + " ", 1),
|
|
636
|
+
r(s) ? (m(), y(ye, { key: 0 }, [
|
|
637
|
+
ot(" · " + p(r(s)), 1)
|
|
639
638
|
], 64)) : D("", !0)
|
|
640
639
|
])
|
|
641
640
|
]),
|
|
642
|
-
e("span",
|
|
641
|
+
e("span", So, p(s.type === "warehouse" ? "Warehouse" : s.type === "supplier" ? "Supplier" : "Restaurant"), 1),
|
|
643
642
|
e("div", {
|
|
644
643
|
class: J([
|
|
645
644
|
"w-[18px] h-[18px] rounded-full border flex items-center justify-center shrink-0 transition-colors duration-150",
|
|
646
|
-
((
|
|
645
|
+
((fe = N.value) == null ? void 0 : fe.doc._id) === s.doc._id ? "border-[#FF7823]" : "border-[#CCCCCC]"
|
|
647
646
|
])
|
|
648
647
|
}, [
|
|
649
|
-
((
|
|
648
|
+
((se = N.value) == null ? void 0 : se.doc._id) === s.doc._id ? (m(), y("div", Ro)) : D("", !0)
|
|
650
649
|
], 2)
|
|
651
|
-
], 10,
|
|
650
|
+
], 10, xo);
|
|
652
651
|
}), 128)),
|
|
653
|
-
K.value.length === 0 ? (m(), y("div",
|
|
652
|
+
K.value.length === 0 ? (m(), y("div", Po, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.noOutletsAvailable")), 1)) : D("", !0)
|
|
654
653
|
])
|
|
655
654
|
], 64)) : D("", !0),
|
|
656
|
-
R.value === "template" ? (m(), y(
|
|
657
|
-
e("div",
|
|
658
|
-
e("div",
|
|
659
|
-
E(t(
|
|
660
|
-
"model-value":
|
|
661
|
-
"onUpdate:modelValue": a[6] || (a[6] = (s) =>
|
|
655
|
+
R.value === "template" ? (m(), y(ye, { key: 1 }, [
|
|
656
|
+
e("div", Do, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step2TemplateHeading")), 1),
|
|
657
|
+
e("div", Eo, [
|
|
658
|
+
E(t(z), {
|
|
659
|
+
"model-value": he.value,
|
|
660
|
+
"onUpdate:modelValue": a[6] || (a[6] = (s) => he.value = s),
|
|
662
661
|
"prepend-icon": "search",
|
|
663
662
|
placeholder: t(c)(
|
|
664
663
|
"inventory.transfer.receiveRequest.bulk.wizard.step2SearchTemplatePlaceholder"
|
|
665
664
|
)
|
|
666
665
|
}, null, 8, ["model-value", "placeholder"])
|
|
667
666
|
]),
|
|
668
|
-
t(d).loading ? (m(), y("div",
|
|
667
|
+
t(d).loading ? (m(), y("div", qo, [
|
|
669
668
|
E(t(S), {
|
|
670
669
|
name: "progress_activity",
|
|
671
670
|
class: "text-[#FF7823] animate-spin"
|
|
672
671
|
})
|
|
673
|
-
])) :
|
|
674
|
-
(m(!0), y(
|
|
672
|
+
])) : G.value.length === 0 ? (m(), y("div", No, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.noTemplatesAvailable")), 1)) : (m(), y("div", Ao, [
|
|
673
|
+
(m(!0), y(ye, null, Qe(G.value, (s) => (m(), y("div", {
|
|
675
674
|
key: s._id,
|
|
676
675
|
class: J([
|
|
677
676
|
"border rounded-lg px-16 py-12 cursor-pointer transition-all duration-150 flex items-center gap-12",
|
|
678
|
-
|
|
677
|
+
M.value === s._id ? "border-[#FF7823] bg-[#FFF5EE]" : "border-[#E0E0E0] bg-white hover:bg-[#FAFAFA]"
|
|
679
678
|
]),
|
|
680
|
-
onClick: (
|
|
679
|
+
onClick: (X) => M.value = s._id
|
|
681
680
|
}, [
|
|
682
|
-
e("div",
|
|
683
|
-
e("div",
|
|
684
|
-
e("div",
|
|
681
|
+
e("div", Oo, [
|
|
682
|
+
e("div", Bo, p(s.name), 1),
|
|
683
|
+
e("div", To, p(I(s)) + " · " + p(s.purchaseOrder.items.length) + " items ", 1)
|
|
685
684
|
]),
|
|
686
685
|
e("div", {
|
|
687
686
|
class: J([
|
|
688
687
|
"w-[18px] h-[18px] rounded-full border flex items-center justify-center shrink-0 transition-colors duration-150",
|
|
689
|
-
|
|
688
|
+
M.value === s._id ? "border-[#FF7823]" : "border-[#CCCCCC]"
|
|
690
689
|
])
|
|
691
690
|
}, [
|
|
692
|
-
|
|
691
|
+
M.value === s._id ? (m(), y("div", Io)) : D("", !0)
|
|
693
692
|
], 2)
|
|
694
|
-
], 10,
|
|
693
|
+
], 10, $o))), 128))
|
|
695
694
|
]))
|
|
696
695
|
], 64)) : D("", !0)
|
|
697
696
|
])) : D("", !0),
|
|
698
|
-
i.value === 2 ? (m(), y("div",
|
|
699
|
-
e("div",
|
|
700
|
-
e("h3",
|
|
697
|
+
i.value === 2 ? (m(), y("div", Lo, [
|
|
698
|
+
e("div", zo, [
|
|
699
|
+
e("h3", Mo, p(F.value), 1)
|
|
701
700
|
]),
|
|
702
|
-
(m(),
|
|
701
|
+
(m(), le(dn, {
|
|
703
702
|
ref_key: "formRef",
|
|
704
703
|
ref: Ee,
|
|
705
704
|
class: "w-full",
|
|
706
|
-
"onForm:ready": a[7] || (a[7] = () =>
|
|
705
|
+
"onForm:ready": a[7] || (a[7] = () => ve.value = !0),
|
|
707
706
|
"onForm:dataChange": ke,
|
|
708
|
-
onValidationSuccess:
|
|
709
|
-
modelValue:
|
|
710
|
-
"onUpdate:modelValue": a[8] || (a[8] = (s) =>
|
|
711
|
-
disabled:
|
|
712
|
-
"locked-supplier":
|
|
713
|
-
suppliers: t(
|
|
714
|
-
skus: t(
|
|
715
|
-
key:
|
|
707
|
+
onValidationSuccess: ie,
|
|
708
|
+
modelValue: A.value,
|
|
709
|
+
"onUpdate:modelValue": a[8] || (a[8] = (s) => A.value = s),
|
|
710
|
+
disabled: Ge.value,
|
|
711
|
+
"locked-supplier": A.value.supplier,
|
|
712
|
+
suppliers: t(V).suppliers,
|
|
713
|
+
skus: t(de).skus,
|
|
714
|
+
key: Z.value,
|
|
716
715
|
"last-closing-date": n.lastClosingDate,
|
|
717
|
-
"sku-balance-map":
|
|
718
|
-
"is-balance-loading":
|
|
716
|
+
"sku-balance-map": Ae.value,
|
|
717
|
+
"is-balance-loading": _e.value
|
|
719
718
|
}, null, 8, ["modelValue", "disabled", "locked-supplier", "suppliers", "skus", "last-closing-date", "sku-balance-map", "is-balance-loading"]))
|
|
720
719
|
])) : D("", !0)
|
|
721
720
|
]),
|
|
722
|
-
e("div",
|
|
723
|
-
e("div",
|
|
724
|
-
e("div",
|
|
725
|
-
e("div",
|
|
726
|
-
e("div",
|
|
721
|
+
e("div", Uo, [
|
|
722
|
+
e("div", Vo, [
|
|
723
|
+
e("div", Jo, [
|
|
724
|
+
e("div", jo, [
|
|
725
|
+
e("div", Wo, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.summaryTitle")), 1)
|
|
727
726
|
]),
|
|
728
|
-
e("div",
|
|
729
|
-
e("span",
|
|
727
|
+
e("div", Yo, [
|
|
728
|
+
e("span", Ho, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.summaryDestination")), 1),
|
|
730
729
|
e("span", {
|
|
731
730
|
class: J(["text-[15px] leading-[20px] font-semibold transition-colors duration-200", o.value ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
|
|
732
|
-
},
|
|
733
|
-
u.value ? (m(), y("span",
|
|
731
|
+
}, p(Re.value), 3),
|
|
732
|
+
u.value ? (m(), y("span", Qo, p(u.value), 1)) : D("", !0)
|
|
734
733
|
]),
|
|
735
|
-
e("div",
|
|
736
|
-
e("span",
|
|
734
|
+
e("div", Ko, [
|
|
735
|
+
e("span", Go, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.summaryMethod")), 1),
|
|
737
736
|
e("span", {
|
|
738
737
|
class: J(["text-[15px] leading-[20px] font-semibold transition-colors duration-200", R.value ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
|
|
739
|
-
},
|
|
738
|
+
}, p(we.value), 3)
|
|
740
739
|
]),
|
|
741
|
-
e("div",
|
|
742
|
-
e("span",
|
|
740
|
+
e("div", Xo, [
|
|
741
|
+
e("span", Zo, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.summarySource")), 1),
|
|
743
742
|
e("span", {
|
|
744
743
|
class: J([
|
|
745
744
|
"text-[15px] leading-[20px] font-semibold transition-colors duration-200",
|
|
746
|
-
|
|
745
|
+
N.value || M.value ? "text-[#1C1C1E]" : "text-[#B2B3B6]"
|
|
747
746
|
])
|
|
748
|
-
},
|
|
749
|
-
b.value ? (m(), y("span",
|
|
747
|
+
}, p(j.value), 3),
|
|
748
|
+
b.value ? (m(), y("span", es, p(b.value), 1)) : D("", !0)
|
|
750
749
|
]),
|
|
751
|
-
e("div",
|
|
752
|
-
e("span",
|
|
750
|
+
e("div", ts, [
|
|
751
|
+
e("span", ns, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.summaryItems")), 1),
|
|
753
752
|
e("span", {
|
|
754
753
|
class: J(["text-[15px] leading-[20px] font-medium transition-colors duration-200", Fe.value ? "text-[#1C1C1E]" : "text-[#6B6C70]"])
|
|
755
|
-
},
|
|
754
|
+
}, p(T.value), 3)
|
|
756
755
|
])
|
|
757
756
|
])
|
|
758
757
|
])
|
|
@@ -763,55 +762,55 @@ const An = {
|
|
|
763
762
|
_: 1
|
|
764
763
|
})
|
|
765
764
|
])),
|
|
766
|
-
E(t(
|
|
765
|
+
E(t(O), {
|
|
767
766
|
modelValue: De.value,
|
|
768
767
|
"onUpdate:modelValue": a[10] || (a[10] = (s) => De.value = s),
|
|
769
768
|
overlay: !0
|
|
770
769
|
}, {
|
|
771
770
|
"dialog-header": Pe(() => [
|
|
772
|
-
e("div",
|
|
771
|
+
e("div", os, p(t(c)("inventory.transfer.template.zeroQuantity.title")), 1)
|
|
773
772
|
]),
|
|
774
773
|
"dialog-footer": Pe(() => [
|
|
775
|
-
e("div",
|
|
776
|
-
E(t(
|
|
774
|
+
e("div", us, [
|
|
775
|
+
E(t(w), {
|
|
777
776
|
label: t(c)("common.cancel"),
|
|
778
777
|
variant: "tertiary",
|
|
779
778
|
size: "md",
|
|
780
779
|
onClick: a[9] || (a[9] = (s) => De.value = !1)
|
|
781
780
|
}, null, 8, ["label"]),
|
|
782
|
-
E(t(
|
|
781
|
+
E(t(w), {
|
|
783
782
|
label: t(c)("inventory.transfer.template.zeroQuantity.removeAll"),
|
|
784
783
|
variant: "primary",
|
|
785
784
|
size: "md",
|
|
786
785
|
"prepend-icon": "delete",
|
|
787
|
-
onClick:
|
|
786
|
+
onClick: x
|
|
788
787
|
}, null, 8, ["label"])
|
|
789
788
|
])
|
|
790
789
|
]),
|
|
791
790
|
default: Pe(() => [
|
|
792
|
-
e("div",
|
|
793
|
-
e("div",
|
|
794
|
-
count:
|
|
791
|
+
e("div", ss, [
|
|
792
|
+
e("div", as, p(t(c)("inventory.transfer.template.zeroQuantity.message", {
|
|
793
|
+
count: U.value.length
|
|
795
794
|
})), 1),
|
|
796
|
-
e("div",
|
|
797
|
-
e("ul",
|
|
798
|
-
(m(!0), y(
|
|
795
|
+
e("div", rs, [
|
|
796
|
+
e("ul", ls, [
|
|
797
|
+
(m(!0), y(ye, null, Qe(U.value, (s) => (m(), y("li", {
|
|
799
798
|
key: s.sku._id,
|
|
800
799
|
class: "fm-typo-en-body-md-400"
|
|
801
|
-
},
|
|
800
|
+
}, p(s.sku.name) + " (" + p(s.sku.code) + ") ", 1))), 128))
|
|
802
801
|
])
|
|
803
802
|
]),
|
|
804
|
-
e("div",
|
|
803
|
+
e("div", is, p(t(c)("inventory.transfer.template.zeroQuantity.prompt")), 1)
|
|
805
804
|
])
|
|
806
805
|
]),
|
|
807
806
|
_: 1
|
|
808
807
|
}, 8, ["modelValue"])
|
|
809
808
|
], 64));
|
|
810
809
|
}
|
|
811
|
-
}),
|
|
810
|
+
}), ds = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-2xl overflow-hidden" }, ms = { class: "flex justify-between items-center px-16 py-3 border-b border-gray-200 bg-gray-50" }, fs = { class: "flex gap-2 items-center" }, ps = ["disabled"], vs = { class: "flex-1 overflow-auto bg-gray-100 flex items-center justify-center" }, ys = {
|
|
812
811
|
key: 0,
|
|
813
812
|
class: "flex flex-col items-center gap-3 text-gray-500"
|
|
814
|
-
},
|
|
813
|
+
}, bs = ["src"], hs = /* @__PURE__ */ tt({
|
|
815
814
|
__name: "PdfPreviewDialog",
|
|
816
815
|
props: {
|
|
817
816
|
modelValue: { type: Boolean },
|
|
@@ -819,44 +818,44 @@ const An = {
|
|
|
819
818
|
blobUrl: {}
|
|
820
819
|
},
|
|
821
820
|
emits: ["update:modelValue"],
|
|
822
|
-
setup(
|
|
823
|
-
const
|
|
824
|
-
function
|
|
825
|
-
|
|
821
|
+
setup(_, { emit: h }) {
|
|
822
|
+
const w = _, O = h, S = k(null);
|
|
823
|
+
function z() {
|
|
824
|
+
O("update:modelValue", !1);
|
|
826
825
|
}
|
|
827
826
|
function Y() {
|
|
828
|
-
var
|
|
829
|
-
if (
|
|
827
|
+
var $, c;
|
|
828
|
+
if (w.blobUrl)
|
|
830
829
|
try {
|
|
831
|
-
(c = (
|
|
830
|
+
(c = ($ = S.value) == null ? void 0 : $.contentWindow) == null || c.print();
|
|
832
831
|
} catch {
|
|
833
832
|
const l = document.createElement("a");
|
|
834
|
-
l.href =
|
|
833
|
+
l.href = w.blobUrl, l.download = "purchase-order.pdf", document.body.appendChild(l), l.click(), document.body.removeChild(l);
|
|
835
834
|
}
|
|
836
835
|
}
|
|
837
|
-
return (
|
|
838
|
-
|
|
836
|
+
return ($, c) => (m(), le(lt, { to: "body" }, [
|
|
837
|
+
$.modelValue ? (m(), y("div", {
|
|
839
838
|
key: 0,
|
|
840
839
|
class: "fixed inset-0 z-[9999] bg-black/50 flex justify-center items-center",
|
|
841
|
-
onClick:
|
|
840
|
+
onClick: Et(z, ["self"])
|
|
842
841
|
}, [
|
|
843
|
-
e("div",
|
|
844
|
-
e("div",
|
|
842
|
+
e("div", ds, [
|
|
843
|
+
e("div", ms, [
|
|
845
844
|
c[0] || (c[0] = e("span", { class: "text-base font-semibold text-gray-700" }, "Print Preview", -1)),
|
|
846
|
-
e("div",
|
|
845
|
+
e("div", fs, [
|
|
847
846
|
e("button", {
|
|
848
|
-
disabled:
|
|
847
|
+
disabled: $.loading || !$.blobUrl,
|
|
849
848
|
class: "px-8 py-1.5 bg-blue-500 text-white border-none rounded text-sm cursor-pointer hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
850
849
|
onClick: Y
|
|
851
|
-
}, " Print ", 8,
|
|
850
|
+
}, " Print ", 8, ps),
|
|
852
851
|
e("button", {
|
|
853
852
|
class: "px-2.5 py-1 bg-transparent border border-gray-300 rounded text-xl leading-none cursor-pointer text-gray-500 hover:bg-gray-100",
|
|
854
|
-
onClick:
|
|
853
|
+
onClick: z
|
|
855
854
|
}, " × ")
|
|
856
855
|
])
|
|
857
856
|
]),
|
|
858
|
-
e("div",
|
|
859
|
-
|
|
857
|
+
e("div", vs, [
|
|
858
|
+
$.loading ? (m(), y("div", ys, c[1] || (c[1] = [
|
|
860
859
|
e("svg", {
|
|
861
860
|
class: "animate-spin h-10 w-10 text-blue-500",
|
|
862
861
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -878,67 +877,67 @@ const An = {
|
|
|
878
877
|
})
|
|
879
878
|
], -1),
|
|
880
879
|
e("span", { class: "text-sm" }, "Generating PDF…", -1)
|
|
881
|
-
]))) :
|
|
880
|
+
]))) : $.blobUrl ? (m(), y("iframe", {
|
|
882
881
|
key: 1,
|
|
883
882
|
ref_key: "iframeRef",
|
|
884
883
|
ref: S,
|
|
885
|
-
src:
|
|
884
|
+
src: $.blobUrl,
|
|
886
885
|
class: "w-full h-full border-none"
|
|
887
|
-
}, null, 8,
|
|
886
|
+
}, null, 8, bs)) : D("", !0)
|
|
888
887
|
])
|
|
889
888
|
])
|
|
890
889
|
])) : D("", !0)
|
|
891
890
|
]));
|
|
892
891
|
}
|
|
893
|
-
}),
|
|
892
|
+
}), gs = /* @__PURE__ */ tt({
|
|
894
893
|
__name: "MultiLocationSelector",
|
|
895
|
-
props: /* @__PURE__ */
|
|
894
|
+
props: /* @__PURE__ */ qt({
|
|
896
895
|
locations: {}
|
|
897
896
|
}, {
|
|
898
897
|
modelValue: { default: () => [] },
|
|
899
898
|
modelModifiers: {}
|
|
900
899
|
}),
|
|
901
900
|
emits: ["update:modelValue"],
|
|
902
|
-
setup(
|
|
903
|
-
const { t: h } =
|
|
904
|
-
const f =
|
|
905
|
-
return f ?
|
|
901
|
+
setup(_) {
|
|
902
|
+
const { t: h } = nt(), w = _, O = Nt(_, "modelValue"), S = k(!1), z = k(""), Y = L(() => {
|
|
903
|
+
const f = z.value.trim().toLowerCase();
|
|
904
|
+
return f ? w.locations.filter(
|
|
906
905
|
(d) => d.name.toLowerCase().includes(f) || (d.doc.profile.code ?? "").toLowerCase().includes(f)
|
|
907
|
-
) :
|
|
908
|
-
}),
|
|
909
|
-
() => Y.value.length > 0 && Y.value.every((f) =>
|
|
906
|
+
) : w.locations;
|
|
907
|
+
}), $ = L(() => O.value.length), c = L(
|
|
908
|
+
() => Y.value.length > 0 && Y.value.every((f) => O.value.includes(f.dbName))
|
|
910
909
|
), l = L(
|
|
911
|
-
() => Y.value.some((f) =>
|
|
910
|
+
() => Y.value.some((f) => O.value.includes(f.dbName)) && !c.value
|
|
912
911
|
), g = L(() => {
|
|
913
|
-
if (
|
|
914
|
-
if (
|
|
915
|
-
const f =
|
|
916
|
-
return f ? `${f.name} (${f.doc.profile.code ?? "--"})` :
|
|
912
|
+
if ($.value === 0) return h("inventory.transfer.receiveRequest.bulk.noLocationsSelected");
|
|
913
|
+
if ($.value === 1) {
|
|
914
|
+
const f = w.locations.find((d) => d.dbName === O.value[0]);
|
|
915
|
+
return f ? `${f.name} (${f.doc.profile.code ?? "--"})` : O.value[0];
|
|
917
916
|
}
|
|
918
|
-
return h("inventory.transfer.receiveRequest.bulk.locationsSelected", [
|
|
917
|
+
return h("inventory.transfer.receiveRequest.bulk.locationsSelected", [$.value]);
|
|
919
918
|
});
|
|
920
|
-
function
|
|
919
|
+
function V() {
|
|
921
920
|
const f = Y.value.map((d) => d.dbName);
|
|
922
|
-
c.value ?
|
|
921
|
+
c.value ? O.value = O.value.filter((d) => !f.includes(d)) : O.value = [.../* @__PURE__ */ new Set([...O.value, ...f])];
|
|
923
922
|
}
|
|
924
|
-
function
|
|
925
|
-
|
|
923
|
+
function de(f) {
|
|
924
|
+
O.value.includes(f) ? O.value = O.value.filter((d) => d !== f) : O.value = [...O.value, f];
|
|
926
925
|
}
|
|
927
|
-
function
|
|
928
|
-
return
|
|
926
|
+
function v(f) {
|
|
927
|
+
return O.value.includes(f);
|
|
929
928
|
}
|
|
930
929
|
return (f, d) => {
|
|
931
|
-
const i = Ce("FmIcon"),
|
|
932
|
-
return m(),
|
|
930
|
+
const i = Ce("FmIcon"), C = Ce("FmChip"), o = Ce("FmTextField"), H = Ce("FmMenuItem"), R = Ce("FmMenu");
|
|
931
|
+
return m(), le(R, {
|
|
933
932
|
"model-value": S.value,
|
|
934
933
|
placement: "bottom-end",
|
|
935
934
|
"close-on-click": !1,
|
|
936
|
-
onMenuChanged: d[1] || (d[1] = (
|
|
937
|
-
S.value =
|
|
935
|
+
onMenuChanged: d[1] || (d[1] = (N) => {
|
|
936
|
+
S.value = N, N || (z.value = "");
|
|
938
937
|
})
|
|
939
938
|
}, {
|
|
940
939
|
"menu-button": Pe(() => [
|
|
941
|
-
E(
|
|
940
|
+
E(C, {
|
|
942
941
|
label: g.value,
|
|
943
942
|
class: "text-fm-color-neutral-gray-400 cursor-pointer"
|
|
944
943
|
}, {
|
|
@@ -949,8 +948,8 @@ const An = {
|
|
|
949
948
|
size: "sm"
|
|
950
949
|
}),
|
|
951
950
|
e("div", {
|
|
952
|
-
class: J(["fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap max-w-[200px]", { "text-fm-color-typo-primary":
|
|
953
|
-
},
|
|
951
|
+
class: J(["fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap max-w-[200px]", { "text-fm-color-typo-primary": $.value > 0 }])
|
|
952
|
+
}, p(g.value), 3),
|
|
954
953
|
E(i, {
|
|
955
954
|
name: S.value ? "keyboard_arrow_up" : "keyboard_arrow_down",
|
|
956
955
|
outline: "",
|
|
@@ -962,8 +961,8 @@ const An = {
|
|
|
962
961
|
]),
|
|
963
962
|
default: Pe(() => [
|
|
964
963
|
E(o, {
|
|
965
|
-
"model-value":
|
|
966
|
-
"onUpdate:modelValue": d[0] || (d[0] = (
|
|
964
|
+
"model-value": z.value,
|
|
965
|
+
"onUpdate:modelValue": d[0] || (d[0] = (N) => z.value = N),
|
|
967
966
|
placeholder: t(h)("inventory.common.table.toolbar.filterItems"),
|
|
968
967
|
class: "my-8"
|
|
969
968
|
}, null, 8, ["model-value", "placeholder"]),
|
|
@@ -972,17 +971,17 @@ const An = {
|
|
|
972
971
|
label: t(h)("inventory.common.selectAll"),
|
|
973
972
|
"has-checkbox": !0,
|
|
974
973
|
indeterminate: l.value,
|
|
975
|
-
onClick:
|
|
974
|
+
onClick: V
|
|
976
975
|
}, null, 8, ["model-value", "label", "indeterminate"]),
|
|
977
|
-
(m(!0), y(
|
|
978
|
-
key:
|
|
979
|
-
"model-value":
|
|
980
|
-
label: `${
|
|
981
|
-
sublabel:
|
|
976
|
+
(m(!0), y(ye, null, Qe(Y.value, (N) => (m(), le(H, {
|
|
977
|
+
key: N.dbName,
|
|
978
|
+
"model-value": v(N.dbName),
|
|
979
|
+
label: `${N.name} (${N.doc.profile.code ?? "--"})`,
|
|
980
|
+
sublabel: N.type === "restaurant" ? t(h)("inventory.common.restaurant") : t(h)("inventory.common.warehouse"),
|
|
982
981
|
"has-checkbox": !0,
|
|
983
|
-
onClick: (
|
|
982
|
+
onClick: (M) => de(N.dbName)
|
|
984
983
|
}, null, 8, ["model-value", "label", "sublabel", "onClick"]))), 128)),
|
|
985
|
-
Y.value.length === 0 ? (m(),
|
|
984
|
+
Y.value.length === 0 ? (m(), le(H, {
|
|
986
985
|
key: 0,
|
|
987
986
|
disabled: "",
|
|
988
987
|
label: t(h)("inventory.common.noResultFound")
|
|
@@ -992,121 +991,105 @@ const An = {
|
|
|
992
991
|
}, 8, ["model-value"]);
|
|
993
992
|
};
|
|
994
993
|
}
|
|
995
|
-
}),
|
|
996
|
-
function
|
|
994
|
+
}), Pt = "bulk-jobs-v1";
|
|
995
|
+
function xs() {
|
|
997
996
|
try {
|
|
998
|
-
const
|
|
999
|
-
return
|
|
997
|
+
const _ = localStorage.getItem(Pt);
|
|
998
|
+
return _ ? JSON.parse(_) : [];
|
|
1000
999
|
} catch {
|
|
1001
1000
|
return [];
|
|
1002
1001
|
}
|
|
1003
1002
|
}
|
|
1004
|
-
function
|
|
1003
|
+
function _s(_) {
|
|
1005
1004
|
try {
|
|
1006
|
-
localStorage.setItem(
|
|
1005
|
+
localStorage.setItem(Pt, JSON.stringify(_));
|
|
1007
1006
|
} catch {
|
|
1008
1007
|
}
|
|
1009
1008
|
}
|
|
1010
|
-
const
|
|
1011
|
-
function
|
|
1012
|
-
var
|
|
1013
|
-
return
|
|
1009
|
+
const ws = 300, rt = ["completed", "failed", "cancelled"];
|
|
1010
|
+
function ks(_, h) {
|
|
1011
|
+
var w;
|
|
1012
|
+
return _.cancelled ? "cancelled" : _.message === "completed" ? "completed" : _.message === "error" || (w = _.message) != null && w.startsWith("error:") ? "failed" : _.message === "processing" ? "active" : "waiting";
|
|
1014
1013
|
}
|
|
1015
|
-
const pt =
|
|
1016
|
-
const
|
|
1017
|
-
let
|
|
1018
|
-
Ve(
|
|
1019
|
-
|
|
1014
|
+
const pt = Rn("bulkJob", () => {
|
|
1015
|
+
const _ = k(xs()), h = /* @__PURE__ */ new Map();
|
|
1016
|
+
let w = null;
|
|
1017
|
+
Ve(_, (v) => {
|
|
1018
|
+
w && clearTimeout(w), w = setTimeout(() => _s(v), ws);
|
|
1020
1019
|
}, { deep: !0 });
|
|
1021
|
-
function
|
|
1020
|
+
function O(v, f) {
|
|
1022
1021
|
var R;
|
|
1023
|
-
const d =
|
|
1024
|
-
let i =
|
|
1025
|
-
const
|
|
1026
|
-
i === "completed" &&
|
|
1022
|
+
const d = _.value.find((N) => N.jobId === v);
|
|
1023
|
+
let i = ks(f, d == null ? void 0 : d.type);
|
|
1024
|
+
const C = f.errorCount ?? 0;
|
|
1025
|
+
i === "completed" && C > 0 && (d == null ? void 0 : d.type) === "download" && (i = "failed");
|
|
1027
1026
|
const o = f.total ?? 0, H = f.current ?? 0;
|
|
1028
|
-
|
|
1027
|
+
$(v, {
|
|
1029
1028
|
status: i,
|
|
1030
1029
|
progress: o > 0 ? Math.round(H / o * 100) : 0,
|
|
1031
1030
|
current: H,
|
|
1032
1031
|
total: o,
|
|
1033
1032
|
currentItem: f.currentItem ?? void 0,
|
|
1034
|
-
errorCount:
|
|
1033
|
+
errorCount: C,
|
|
1035
1034
|
// Only expose the download button when the job fully succeeded.
|
|
1036
1035
|
downloadReady: i === "completed" ? f.downloadReady : !1,
|
|
1037
1036
|
zipSizeBytes: f.zipSizeBytes ?? void 0,
|
|
1038
1037
|
stalePoIds: (R = f.stalePoIds) != null && R.length ? f.stalePoIds : void 0
|
|
1039
|
-
}),
|
|
1038
|
+
}), rt.includes(i) && z(v);
|
|
1040
1039
|
}
|
|
1041
|
-
function S(
|
|
1042
|
-
if (h.has(
|
|
1043
|
-
const
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
const ee = x.value.find((de) => de.jobId === p);
|
|
1054
|
-
ee && !Qe.includes(ee.status) && (_ = setTimeout(H, kt));
|
|
1055
|
-
}
|
|
1056
|
-
} catch {
|
|
1057
|
-
o || (_ = setTimeout(H, kt));
|
|
1058
|
-
}
|
|
1059
|
-
}
|
|
1060
|
-
const R = En(), { unsubscribe: q, initialState: z } = R.subscribe(
|
|
1061
|
-
{ type: "bulkPo", params: { jobId: p } },
|
|
1062
|
-
(G) => {
|
|
1063
|
-
i = !0, _ && (clearTimeout(_), _ = null), A(p, G);
|
|
1040
|
+
function S(v) {
|
|
1041
|
+
if (h.has(v)) return;
|
|
1042
|
+
const f = _.value.find((H) => H.jobId === v);
|
|
1043
|
+
if (!f) return;
|
|
1044
|
+
const d = 5;
|
|
1045
|
+
let i = 0;
|
|
1046
|
+
const C = async () => {
|
|
1047
|
+
const H = Ke();
|
|
1048
|
+
try {
|
|
1049
|
+
const R = await H.getBulkJobStatus(f.dbName, v);
|
|
1050
|
+
R ? (i = 0, O(v, R)) : (i++, i >= d && ($(v, { status: "failed" }), z(v)));
|
|
1051
|
+
} catch {
|
|
1064
1052
|
}
|
|
1065
|
-
), pe = () => {
|
|
1066
|
-
o = !0, q(), _ && (clearTimeout(_), _ = null);
|
|
1067
1053
|
};
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
}), setTimeout(() => {
|
|
1072
|
-
!i && !o && (console.warn(`[bulkJob] SSE silent for job ${p} after ${wt}ms — starting polling fallback`), H());
|
|
1073
|
-
}, wt);
|
|
1054
|
+
C();
|
|
1055
|
+
const o = setInterval(C, 2e3);
|
|
1056
|
+
h.set(v, o);
|
|
1074
1057
|
}
|
|
1075
|
-
function
|
|
1076
|
-
const f = h.get(
|
|
1077
|
-
f !== void 0 && (f
|
|
1058
|
+
function z(v) {
|
|
1059
|
+
const f = h.get(v);
|
|
1060
|
+
f !== void 0 && (clearInterval(f), h.delete(v));
|
|
1078
1061
|
}
|
|
1079
|
-
function Y(
|
|
1080
|
-
|
|
1062
|
+
function Y(v) {
|
|
1063
|
+
_.value = [v, ..._.value], S(v.jobId);
|
|
1081
1064
|
}
|
|
1082
|
-
for (const
|
|
1083
|
-
|
|
1084
|
-
function
|
|
1085
|
-
const d =
|
|
1065
|
+
for (const v of _.value)
|
|
1066
|
+
rt.includes(v.status) || S(v.jobId);
|
|
1067
|
+
function $(v, f) {
|
|
1068
|
+
const d = _.value.findIndex((i) => i.jobId === v);
|
|
1086
1069
|
if (d !== -1) {
|
|
1087
|
-
const i =
|
|
1088
|
-
|
|
1070
|
+
const i = _.value[d], C = f.status ?? i.status, o = rt.includes(C) && !rt.includes(i.status) && !i.completedAt;
|
|
1071
|
+
_.value[d] = {
|
|
1089
1072
|
...i,
|
|
1090
1073
|
...f,
|
|
1091
1074
|
...o ? { completedAt: Date.now() } : {}
|
|
1092
1075
|
};
|
|
1093
1076
|
}
|
|
1094
1077
|
}
|
|
1095
|
-
function c(
|
|
1096
|
-
|
|
1078
|
+
function c(v) {
|
|
1079
|
+
z(v), _.value = _.value.filter((f) => f.jobId !== v);
|
|
1097
1080
|
}
|
|
1098
|
-
async function l(
|
|
1099
|
-
const f =
|
|
1081
|
+
async function l(v) {
|
|
1082
|
+
const f = _.value.find((d) => d.jobId === v);
|
|
1100
1083
|
if (f)
|
|
1101
1084
|
try {
|
|
1102
|
-
await
|
|
1085
|
+
await Ke().cancelBulkJob(f.dbName, v);
|
|
1103
1086
|
} catch (d) {
|
|
1104
|
-
console.warn("[cancelJob] cancel API call failed for job",
|
|
1087
|
+
console.warn("[cancelJob] cancel API call failed for job", v, d);
|
|
1105
1088
|
}
|
|
1106
1089
|
}
|
|
1107
|
-
function g(
|
|
1108
|
-
return
|
|
1109
|
-
jobId:
|
|
1090
|
+
function g(v, f) {
|
|
1091
|
+
return _.value.find((d) => d.jobId === v) || Y({
|
|
1092
|
+
jobId: v,
|
|
1110
1093
|
type: "download",
|
|
1111
1094
|
dbName: f,
|
|
1112
1095
|
title: "",
|
|
@@ -1117,23 +1100,23 @@ const pt = Dn("bulkJob", () => {
|
|
|
1117
1100
|
errorCount: 0,
|
|
1118
1101
|
startedAt: Date.now()
|
|
1119
1102
|
}), new Promise((d, i) => {
|
|
1120
|
-
const
|
|
1121
|
-
() =>
|
|
1103
|
+
const C = Ve(
|
|
1104
|
+
() => _.value.find((o) => o.jobId === v),
|
|
1122
1105
|
(o) => {
|
|
1123
1106
|
if (!o) {
|
|
1124
|
-
|
|
1107
|
+
C(), i(new Error("PDF generation job not found"));
|
|
1125
1108
|
return;
|
|
1126
1109
|
}
|
|
1127
1110
|
if (o.status === "failed") {
|
|
1128
|
-
|
|
1111
|
+
C(), i(new Error("PDF generation failed"));
|
|
1129
1112
|
return;
|
|
1130
1113
|
}
|
|
1131
1114
|
if (o.status === "cancelled") {
|
|
1132
|
-
|
|
1115
|
+
C(), i(new Error("PDF generation cancelled"));
|
|
1133
1116
|
return;
|
|
1134
1117
|
}
|
|
1135
1118
|
if (o.downloadReady) {
|
|
1136
|
-
|
|
1119
|
+
C(), d();
|
|
1137
1120
|
return;
|
|
1138
1121
|
}
|
|
1139
1122
|
},
|
|
@@ -1141,81 +1124,81 @@ const pt = Dn("bulkJob", () => {
|
|
|
1141
1124
|
);
|
|
1142
1125
|
});
|
|
1143
1126
|
}
|
|
1144
|
-
const
|
|
1145
|
-
() =>
|
|
1146
|
-
),
|
|
1147
|
-
return { jobs:
|
|
1148
|
-
}),
|
|
1149
|
-
function
|
|
1150
|
-
const h =
|
|
1127
|
+
const V = L(
|
|
1128
|
+
() => _.value.filter((v) => v.status === "waiting" || v.status === "active")
|
|
1129
|
+
), de = L(() => V.value.length > 0);
|
|
1130
|
+
return { jobs: _, addJob: Y, updateJob: $, removeJob: c, cancelJob: l, waitForPdfJob: g, activeJobs: V, hasActiveJobs: de };
|
|
1131
|
+
}), et = k(), pe = k(), dt = k();
|
|
1132
|
+
function Cs(_) {
|
|
1133
|
+
const h = un(), w = it(), O = Rt(), S = Ft(), z = Ct(), Y = hn(), $ = St(), c = k(!1), l = ut(), { t: g } = nt(), V = Ke(), de = Yt(), v = pt(), f = k([]), d = k([]), i = k(new Array()), C = k(
|
|
1151
1134
|
new Array()
|
|
1152
|
-
), o =
|
|
1153
|
-
|
|
1135
|
+
), o = k(
|
|
1136
|
+
_ != null && _.startDate && (_ != null && _.endDate) ? _ : ft()
|
|
1154
1137
|
), H = L(() => {
|
|
1155
1138
|
const r = new Date(o.value.startDate), u = new Date(o.value.endDate);
|
|
1156
1139
|
return {
|
|
1157
|
-
start:
|
|
1158
|
-
end:
|
|
1140
|
+
start: Fn(r).toISOString(),
|
|
1141
|
+
end: Cn(u).toISOString()
|
|
1159
1142
|
};
|
|
1160
|
-
}), R =
|
|
1161
|
-
let
|
|
1162
|
-
function
|
|
1163
|
-
|
|
1143
|
+
}), R = zt(), N = k(null), M = k([]), be = k(), he = k(!1), ue = k(null);
|
|
1144
|
+
let ne = null;
|
|
1145
|
+
function ve() {
|
|
1146
|
+
ne && (ne.abort(), ne = null, c.value = !1, he.value = !1, ue.value = null);
|
|
1164
1147
|
}
|
|
1165
1148
|
function De(r) {
|
|
1166
|
-
const u =
|
|
1149
|
+
const u = w.locations.find((b) => b.dbName === r._locationDbName);
|
|
1167
1150
|
if (!u) return null;
|
|
1168
1151
|
if (u.type === "restaurant") {
|
|
1169
|
-
const b =
|
|
1152
|
+
const b = w.locationRestaurantFromCore(u.doc._id);
|
|
1170
1153
|
if (b !== null)
|
|
1171
1154
|
return { ...u, doc: b };
|
|
1172
1155
|
}
|
|
1173
1156
|
return u;
|
|
1174
1157
|
}
|
|
1175
|
-
function
|
|
1176
|
-
const u =
|
|
1177
|
-
u && (
|
|
1158
|
+
function _e(r) {
|
|
1159
|
+
const u = w.locations.find((b) => b.dbName === r._locationDbName);
|
|
1160
|
+
u && (w._currentLocation = u);
|
|
1178
1161
|
}
|
|
1179
|
-
async function
|
|
1180
|
-
const T = f.value.map((
|
|
1181
|
-
|
|
1182
|
-
let
|
|
1162
|
+
async function Ae(r, u, b) {
|
|
1163
|
+
const T = f.value.map((A) => ({ dbName: A })), I = T.length;
|
|
1164
|
+
ue.value = { done: 0, total: I };
|
|
1165
|
+
let q = u.cursor, W = u.retryFailed, Q = !0;
|
|
1183
1166
|
for (; Q && !b.aborted; ) {
|
|
1184
|
-
const
|
|
1167
|
+
const A = await V.getBulkPaginatedPurchaseOrders(
|
|
1185
1168
|
{
|
|
1186
1169
|
locations: T,
|
|
1187
1170
|
...H.value,
|
|
1188
1171
|
pageSize: 100,
|
|
1189
|
-
cursor:
|
|
1172
|
+
cursor: q,
|
|
1190
1173
|
retryFailed: W
|
|
1191
1174
|
},
|
|
1192
1175
|
b
|
|
1193
1176
|
);
|
|
1194
1177
|
if (b.aborted) return;
|
|
1195
|
-
W = void 0,
|
|
1196
|
-
done: Math.max(0, I -
|
|
1178
|
+
W = void 0, ue.value = {
|
|
1179
|
+
done: Math.max(0, I - A.pendingLocations),
|
|
1197
1180
|
total: I
|
|
1198
1181
|
}, r.push(
|
|
1199
|
-
|
|
1200
|
-
({ locationDbName:
|
|
1182
|
+
...A.data.map(
|
|
1183
|
+
({ locationDbName: Z, ...U }) => ({ ...U, _locationDbName: Z })
|
|
1201
1184
|
)
|
|
1202
|
-
), d.value = [...r].sort((
|
|
1185
|
+
), d.value = [...r].sort((Z, U) => U._id.localeCompare(Z._id)), M.value = A.failed, be.value = A.cursor, Q = A.hasNext, q = A.cursor;
|
|
1203
1186
|
}
|
|
1204
1187
|
}
|
|
1205
1188
|
async function Ee() {
|
|
1206
1189
|
const r = d.value.flatMap((u) => u.shipmentIds || []).filter(Boolean);
|
|
1207
|
-
i.value = r.length > 0 ? await
|
|
1190
|
+
i.value = r.length > 0 ? await de.getShipmentsByIds(r) : [];
|
|
1208
1191
|
}
|
|
1209
|
-
async function
|
|
1192
|
+
async function me(r) {
|
|
1210
1193
|
const u = r.map((b) => {
|
|
1211
1194
|
var T;
|
|
1212
1195
|
return ((T = b.request) == null ? void 0 : T.id) ?? "";
|
|
1213
1196
|
}).filter((b) => b);
|
|
1214
|
-
|
|
1197
|
+
C.value = u.length > 0 ? await V.readRequestByIds(u) : [];
|
|
1215
1198
|
}
|
|
1216
1199
|
const ge = 25;
|
|
1217
|
-
async function
|
|
1218
|
-
if (d.value = [], i.value = [],
|
|
1200
|
+
async function $e() {
|
|
1201
|
+
if (d.value = [], i.value = [], M.value = [], be.value = void 0, f.value.length === 0)
|
|
1219
1202
|
return;
|
|
1220
1203
|
if (f.value.length > ge) {
|
|
1221
1204
|
l.open({
|
|
@@ -1225,17 +1208,17 @@ function Rs(x) {
|
|
|
1225
1208
|
});
|
|
1226
1209
|
return;
|
|
1227
1210
|
}
|
|
1228
|
-
|
|
1211
|
+
ve();
|
|
1229
1212
|
const r = new AbortController();
|
|
1230
|
-
|
|
1213
|
+
ne = r, c.value = !0;
|
|
1231
1214
|
try {
|
|
1232
|
-
await
|
|
1215
|
+
await Ae([], {}, r.signal), M.value.length > 0 && l.open({
|
|
1233
1216
|
title: "Some locations failed to load",
|
|
1234
|
-
message: `Purchase orders could not be loaded for ${
|
|
1217
|
+
message: `Purchase orders could not be loaded for ${M.value.length} location(s)`,
|
|
1235
1218
|
type: "error"
|
|
1236
1219
|
}), await Ee();
|
|
1237
1220
|
const b = await R.readCurrentLocationLastClosing(!0), T = b == null ? void 0 : b._id;
|
|
1238
|
-
T && (
|
|
1221
|
+
T && (N.value = Sn(T)), await O.awaitFeatureLoaded(() => O.mustUsePoTemplate) && await $.fetchTemplates();
|
|
1239
1222
|
} catch (u) {
|
|
1240
1223
|
if (r.signal.aborted) return;
|
|
1241
1224
|
l.open({
|
|
@@ -1245,17 +1228,17 @@ function Rs(x) {
|
|
|
1245
1228
|
type: "error"
|
|
1246
1229
|
});
|
|
1247
1230
|
} finally {
|
|
1248
|
-
|
|
1231
|
+
ne === r && (ne = null, c.value = !1, ue.value = null);
|
|
1249
1232
|
}
|
|
1250
1233
|
}
|
|
1251
1234
|
async function Fe() {
|
|
1252
|
-
if (!
|
|
1253
|
-
|
|
1235
|
+
if (!be.value || !M.value.some((u) => u.retryable)) return;
|
|
1236
|
+
ve();
|
|
1254
1237
|
const r = new AbortController();
|
|
1255
|
-
|
|
1238
|
+
ne = r, he.value = !0;
|
|
1256
1239
|
try {
|
|
1257
1240
|
const u = [...d.value];
|
|
1258
|
-
if (await
|
|
1241
|
+
if (await Ae(u, { cursor: be.value, retryFailed: !0 }, r.signal), r.signal.aborted) return;
|
|
1259
1242
|
await Ee();
|
|
1260
1243
|
} catch (u) {
|
|
1261
1244
|
if (r.signal.aborted) return;
|
|
@@ -1265,34 +1248,34 @@ function Rs(x) {
|
|
|
1265
1248
|
type: "error"
|
|
1266
1249
|
});
|
|
1267
1250
|
} finally {
|
|
1268
|
-
|
|
1251
|
+
ne === r && (ne = null, he.value = !1, ue.value = null);
|
|
1269
1252
|
}
|
|
1270
1253
|
}
|
|
1271
|
-
function
|
|
1272
|
-
o.value = { startDate: r, endDate: u },
|
|
1254
|
+
function Ge(r, u) {
|
|
1255
|
+
o.value = { startDate: r, endDate: u }, $e();
|
|
1273
1256
|
}
|
|
1274
|
-
const qe =
|
|
1257
|
+
const qe = k();
|
|
1275
1258
|
async function Oe(r) {
|
|
1276
1259
|
const u = f.value[0];
|
|
1277
1260
|
if (u) {
|
|
1278
|
-
const I =
|
|
1279
|
-
I && (
|
|
1261
|
+
const I = w.locations.find((q) => q.dbName === u);
|
|
1262
|
+
I && (w._currentLocation = I);
|
|
1280
1263
|
}
|
|
1281
1264
|
function b(I) {
|
|
1282
|
-
const
|
|
1283
|
-
mode:
|
|
1265
|
+
const q = {
|
|
1266
|
+
mode: _t.CREATE,
|
|
1284
1267
|
modelValue: r || void 0,
|
|
1285
1268
|
show: !0,
|
|
1286
1269
|
"onUpdate:show"(W) {
|
|
1287
|
-
|
|
1270
|
+
et.value.show = W;
|
|
1288
1271
|
},
|
|
1289
1272
|
templateId: I,
|
|
1290
|
-
lastClosingDate:
|
|
1273
|
+
lastClosingDate: N.value
|
|
1291
1274
|
};
|
|
1292
|
-
|
|
1275
|
+
et.value = q;
|
|
1293
1276
|
}
|
|
1294
1277
|
let T;
|
|
1295
|
-
|
|
1278
|
+
O.mustUsePoTemplate && !(r != null && r.template) ? h.open({
|
|
1296
1279
|
title: "Create transfer",
|
|
1297
1280
|
message: "",
|
|
1298
1281
|
primaryActions: { text: "Select a template", close: !0 },
|
|
@@ -1303,84 +1286,84 @@ function Rs(x) {
|
|
|
1303
1286
|
b(void 0);
|
|
1304
1287
|
}) : b(T);
|
|
1305
1288
|
}
|
|
1306
|
-
const Se =
|
|
1289
|
+
const Se = Pn();
|
|
1307
1290
|
async function P(r, u) {
|
|
1308
|
-
return r.items != null ? r : await
|
|
1291
|
+
return r.items != null ? r : await V.getPurchaseOrderById(r._id, void 0, u);
|
|
1309
1292
|
}
|
|
1310
1293
|
async function F(r) {
|
|
1311
1294
|
await Se.run(async (u) => {
|
|
1312
|
-
|
|
1295
|
+
_e(r);
|
|
1313
1296
|
const b = await P(r, u), T = {
|
|
1314
|
-
mode:
|
|
1315
|
-
modelValue:
|
|
1297
|
+
mode: _t.UPDATE,
|
|
1298
|
+
modelValue: Vt(b),
|
|
1316
1299
|
show: !0,
|
|
1317
1300
|
"onUpdate:show"(I) {
|
|
1318
|
-
|
|
1301
|
+
et.value.show = I;
|
|
1319
1302
|
},
|
|
1320
|
-
lastClosingDate:
|
|
1303
|
+
lastClosingDate: N.value
|
|
1321
1304
|
};
|
|
1322
|
-
|
|
1305
|
+
et.value = T;
|
|
1323
1306
|
});
|
|
1324
1307
|
}
|
|
1325
1308
|
async function B(r) {
|
|
1326
|
-
var Q,
|
|
1327
|
-
if (
|
|
1309
|
+
var Q, A, Z;
|
|
1310
|
+
if (_e(r), !z.currentBusiness.value) return;
|
|
1328
1311
|
const u = r, b = S.supplierById[r.supplier._id], T = (b == null ? void 0 : b.email) ?? ((Q = r.supplier) == null ? void 0 : Q.email) ?? "";
|
|
1329
1312
|
let I = null;
|
|
1330
|
-
|
|
1313
|
+
pe.value = {
|
|
1331
1314
|
recipientName: b == null ? void 0 : b.name,
|
|
1332
1315
|
email: T,
|
|
1333
|
-
business:
|
|
1316
|
+
business: z.currentBusiness.value,
|
|
1334
1317
|
pdfLoading: !0,
|
|
1335
1318
|
show: !0,
|
|
1336
|
-
"onUpdate:show"(
|
|
1337
|
-
!
|
|
1319
|
+
"onUpdate:show"(U) {
|
|
1320
|
+
!U && I && (URL.revokeObjectURL(I), I = null), pe.value && (pe.value = { ...pe.value, show: U });
|
|
1338
1321
|
}
|
|
1339
1322
|
};
|
|
1340
|
-
const
|
|
1341
|
-
if (!
|
|
1342
|
-
|
|
1323
|
+
const q = await Se.run((U) => P(u, U));
|
|
1324
|
+
if (!q) {
|
|
1325
|
+
pe.value && (pe.value = { ...pe.value, show: !1, pdfLoading: !1 });
|
|
1343
1326
|
return;
|
|
1344
1327
|
}
|
|
1345
|
-
const W =
|
|
1328
|
+
const W = q._rev;
|
|
1346
1329
|
try {
|
|
1347
|
-
let
|
|
1348
|
-
"pending" in
|
|
1349
|
-
const
|
|
1350
|
-
(
|
|
1351
|
-
...
|
|
1352
|
-
pdfBlobUrl:
|
|
1330
|
+
let U = await V.getPurchaseOrderPdf(r._id, u._locationDbName, W);
|
|
1331
|
+
"pending" in U && (await v.waitForPdfJob(U.jobId, u._locationDbName), U = await V.getPurchaseOrderPdf(r._id, u._locationDbName, W));
|
|
1332
|
+
const re = URL.createObjectURL(U);
|
|
1333
|
+
(A = pe.value) != null && A.show ? (I = re, pe.value = {
|
|
1334
|
+
...pe.value,
|
|
1335
|
+
pdfBlobUrl: re,
|
|
1353
1336
|
pdfLoading: !1
|
|
1354
|
-
}) : URL.revokeObjectURL(
|
|
1355
|
-
} catch (
|
|
1356
|
-
console.error("[promptEmailDialog] PDF fetch failed:",
|
|
1337
|
+
}) : URL.revokeObjectURL(re);
|
|
1338
|
+
} catch (U) {
|
|
1339
|
+
console.error("[promptEmailDialog] PDF fetch failed:", U), (Z = pe.value) != null && Z.show && (pe.value = { ...pe.value, pdfLoading: !1 }, l.open({
|
|
1357
1340
|
title: g("inventory.common.somethingWentWrong"),
|
|
1358
|
-
message: g("inventory.
|
|
1341
|
+
message: (U == null ? void 0 : U.message) || g("inventory.common.tryAgain"),
|
|
1359
1342
|
type: "error"
|
|
1360
1343
|
}));
|
|
1361
1344
|
}
|
|
1362
1345
|
}
|
|
1363
1346
|
async function K(r) {
|
|
1364
|
-
if (
|
|
1347
|
+
if (_e(r), r.items != null)
|
|
1365
1348
|
return r;
|
|
1366
1349
|
try {
|
|
1367
|
-
return { ...await
|
|
1350
|
+
return { ...await V.getPurchaseOrderById(r._id), _locationDbName: r._locationDbName };
|
|
1368
1351
|
} catch (u) {
|
|
1369
1352
|
throw console.error(`Failed to hydrate PO ${r._id} for action`, u), u;
|
|
1370
1353
|
}
|
|
1371
1354
|
}
|
|
1372
|
-
async function
|
|
1355
|
+
async function G(r, u) {
|
|
1373
1356
|
var W;
|
|
1374
|
-
|
|
1357
|
+
_e(r);
|
|
1375
1358
|
const b = await Se.run((Q) => P(r, Q));
|
|
1376
1359
|
if (!b) return;
|
|
1377
1360
|
if (u === void 0 && ((W = r.request) != null && W.id))
|
|
1378
1361
|
try {
|
|
1379
|
-
u = await
|
|
1362
|
+
u = await V.getLatestPurchaseOrderRequest(r._id);
|
|
1380
1363
|
} catch (Q) {
|
|
1381
1364
|
console.warn("[transfer-details] POR fetch failed for", r._id, Q);
|
|
1382
1365
|
}
|
|
1383
|
-
const I = De(r),
|
|
1366
|
+
const I = De(r), q = {
|
|
1384
1367
|
poRequest: u,
|
|
1385
1368
|
purchaseOrder: b,
|
|
1386
1369
|
transferTo: I == null ? void 0 : I.name,
|
|
@@ -1391,21 +1374,21 @@ function Rs(x) {
|
|
|
1391
1374
|
"onUpdate:show"(Q) {
|
|
1392
1375
|
qe.value && (qe.value = { ...qe.value, show: Q });
|
|
1393
1376
|
},
|
|
1394
|
-
scope:
|
|
1395
|
-
receivedMap:
|
|
1377
|
+
scope: kt.RECEIVE_REQUEST,
|
|
1378
|
+
receivedMap: Gt(b) ?? {},
|
|
1396
1379
|
shipments: i.value
|
|
1397
1380
|
};
|
|
1398
|
-
qe.value =
|
|
1381
|
+
qe.value = q;
|
|
1399
1382
|
}
|
|
1400
|
-
async function
|
|
1401
|
-
const
|
|
1383
|
+
async function ee(r, u, b, T, I) {
|
|
1384
|
+
const q = Xt();
|
|
1402
1385
|
c.value = !0;
|
|
1403
1386
|
try {
|
|
1404
|
-
await
|
|
1387
|
+
await q({
|
|
1405
1388
|
operate: {
|
|
1406
1389
|
operation: u,
|
|
1407
1390
|
doc: r,
|
|
1408
|
-
options: (u === Ye.enum.confirmDraft || u === Ye.enum.completeReceive) &&
|
|
1391
|
+
options: (u === Ye.enum.confirmDraft || u === Ye.enum.completeReceive) && O.autoReceiveWarehouse ? { autoReceive: !0 } : void 0
|
|
1409
1392
|
},
|
|
1410
1393
|
operateV2: {
|
|
1411
1394
|
_id: r._id,
|
|
@@ -1422,49 +1405,49 @@ function Rs(x) {
|
|
|
1422
1405
|
type: "error"
|
|
1423
1406
|
}), console.error("Error when submitting PO operation", u, r, W);
|
|
1424
1407
|
} finally {
|
|
1425
|
-
c.value = !1,
|
|
1408
|
+
c.value = !1, $e();
|
|
1426
1409
|
}
|
|
1427
1410
|
}
|
|
1428
1411
|
async function Re(r, u, b) {
|
|
1429
|
-
|
|
1430
|
-
const T =
|
|
1412
|
+
_e(r);
|
|
1413
|
+
const T = Ht[u];
|
|
1431
1414
|
if (!T) {
|
|
1432
1415
|
l.open({
|
|
1433
1416
|
title: "Something went wrong",
|
|
1434
|
-
message: `Cannot process order: ${
|
|
1417
|
+
message: `Cannot process order: ${Mt(u)}`,
|
|
1435
1418
|
type: "error"
|
|
1436
1419
|
});
|
|
1437
1420
|
return;
|
|
1438
1421
|
}
|
|
1439
|
-
const { successMessage: I, ...
|
|
1422
|
+
const { successMessage: I, ...q } = T;
|
|
1440
1423
|
if (u === Ye.enum.rejectDraft) {
|
|
1441
|
-
let
|
|
1424
|
+
let A = "";
|
|
1442
1425
|
h.open({
|
|
1443
|
-
title:
|
|
1444
|
-
message:
|
|
1445
|
-
primaryActions:
|
|
1446
|
-
contentComponent:
|
|
1426
|
+
title: q.title,
|
|
1427
|
+
message: q.message,
|
|
1428
|
+
primaryActions: q.primaryActions,
|
|
1429
|
+
contentComponent: Qt,
|
|
1447
1430
|
contentComponentProps: {
|
|
1448
|
-
message:
|
|
1449
|
-
onChange: (
|
|
1431
|
+
message: q.message,
|
|
1432
|
+
onChange: (Z) => A = Z
|
|
1450
1433
|
}
|
|
1451
1434
|
}).onPrimary(() => {
|
|
1452
|
-
|
|
1453
|
-
{ action: "rejectDraft", payload: { rejectReason:
|
|
1435
|
+
ee(r, u, I, b, [
|
|
1436
|
+
{ action: "rejectDraft", payload: { rejectReason: A } }
|
|
1454
1437
|
]);
|
|
1455
1438
|
});
|
|
1456
1439
|
return;
|
|
1457
1440
|
}
|
|
1458
|
-
const W = [], Q =
|
|
1441
|
+
const W = [], Q = Kt();
|
|
1459
1442
|
Q.init(r), (u === Ye.enum.confirmDraft || u === Ye.enum.submitRequest) && W.push({
|
|
1460
1443
|
action: "confirmDraft",
|
|
1461
|
-
payload: Q.controller.value.toConfirmDraftData(
|
|
1444
|
+
payload: Q.controller.value.toConfirmDraftData(Ut())
|
|
1462
1445
|
}), h.open({
|
|
1463
|
-
title:
|
|
1464
|
-
message:
|
|
1465
|
-
primaryActions:
|
|
1446
|
+
title: q.title,
|
|
1447
|
+
message: q.message,
|
|
1448
|
+
primaryActions: q.primaryActions
|
|
1466
1449
|
}).onPrimary(() => {
|
|
1467
|
-
|
|
1450
|
+
ee(
|
|
1468
1451
|
r,
|
|
1469
1452
|
u,
|
|
1470
1453
|
I,
|
|
@@ -1491,11 +1474,11 @@ function Rs(x) {
|
|
|
1491
1474
|
async function j() {
|
|
1492
1475
|
const { start: r, end: u } = H.value;
|
|
1493
1476
|
return (await Promise.allSettled(
|
|
1494
|
-
f.value.map(async (T) => (await
|
|
1477
|
+
f.value.map(async (T) => (await V.getPurchaseOrders({ start: r, end: u, dbName: T })).map((q) => ({ ...q, _locationDbName: T })))
|
|
1495
1478
|
)).flatMap((T) => T.status === "fulfilled" ? T.value : []);
|
|
1496
1479
|
}
|
|
1497
|
-
async function
|
|
1498
|
-
return
|
|
1480
|
+
async function ae(r) {
|
|
1481
|
+
return v.activeJobs.find((b) => b.type === r) ? new Promise((b) => {
|
|
1499
1482
|
h.open({
|
|
1500
1483
|
title: g("inventory.transfer.receiveRequest.bulk.activeJobWarningTitle"),
|
|
1501
1484
|
message: g("inventory.transfer.receiveRequest.bulk.activeJobWarningMsg", [r]),
|
|
@@ -1505,7 +1488,7 @@ function Rs(x) {
|
|
|
1505
1488
|
}) : !0;
|
|
1506
1489
|
}
|
|
1507
1490
|
async function Be(r) {
|
|
1508
|
-
if (!await
|
|
1491
|
+
if (!await ae("download")) return;
|
|
1509
1492
|
const { startDate: u, endDate: b } = o.value;
|
|
1510
1493
|
if (He(b).diff(He(u), "month", !0) > 2) {
|
|
1511
1494
|
l.open({
|
|
@@ -1523,15 +1506,15 @@ function Rs(x) {
|
|
|
1523
1506
|
});
|
|
1524
1507
|
return;
|
|
1525
1508
|
}
|
|
1526
|
-
const T = r.map((
|
|
1527
|
-
var
|
|
1528
|
-
const Q = (((
|
|
1529
|
-
return { poId:
|
|
1509
|
+
const T = r.map((q) => {
|
|
1510
|
+
var U;
|
|
1511
|
+
const Q = (((U = w.locations.find((re) => re.dbName === q._locationDbName)) == null ? void 0 : U.name) || q._locationDbName).replace(/[/\\?%*:|"<>]/g, "-").trim().slice(0, 50), A = `PO_${q.seqNumber || q._id}`.replace(/[/\\?%*:|"<>]/g, "-").slice(0, 50), Z = `${Q}/${A}`;
|
|
1512
|
+
return { poId: q._id, dbName: q._locationDbName, filename: Z, rev: q._rev };
|
|
1530
1513
|
}), I = f.value[0];
|
|
1531
1514
|
try {
|
|
1532
|
-
const { jobId:
|
|
1533
|
-
|
|
1534
|
-
jobId:
|
|
1515
|
+
const { jobId: q, fromCache: W } = await V.enqueueBulkDownload(I, { items: T });
|
|
1516
|
+
v.addJob({
|
|
1517
|
+
jobId: q,
|
|
1535
1518
|
type: "download",
|
|
1536
1519
|
dbName: I,
|
|
1537
1520
|
title: `Download All (${r.length} POs)`,
|
|
@@ -1550,8 +1533,8 @@ function Rs(x) {
|
|
|
1550
1533
|
message: g("inventory.transfer.receiveRequest.bulk.downloadQueued"),
|
|
1551
1534
|
type: "success"
|
|
1552
1535
|
});
|
|
1553
|
-
} catch (
|
|
1554
|
-
console.error("Bulk download enqueue failed",
|
|
1536
|
+
} catch (q) {
|
|
1537
|
+
console.error("Bulk download enqueue failed", q), l.open({
|
|
1555
1538
|
title: g("inventory.transfer.receiveRequest.bulk.downloadError"),
|
|
1556
1539
|
message: g("inventory.transfer.receiveRequest.bulk.downloadErrorMsg"),
|
|
1557
1540
|
type: "error"
|
|
@@ -1560,12 +1543,12 @@ function Rs(x) {
|
|
|
1560
1543
|
}
|
|
1561
1544
|
async function Te(r) {
|
|
1562
1545
|
var Me, je, We;
|
|
1563
|
-
if (!await
|
|
1546
|
+
if (!await ae("email")) return;
|
|
1564
1547
|
const u = [
|
|
1565
1548
|
gt.enum.RECEIVING,
|
|
1566
1549
|
gt.enum.PROCESSING
|
|
1567
1550
|
// PARTIAL_RECEIVED display status maps from PROCESSING
|
|
1568
|
-
], b = r.filter((
|
|
1551
|
+
], b = r.filter((x) => u.includes(x.status));
|
|
1569
1552
|
if (b.length === 0) {
|
|
1570
1553
|
l.open({
|
|
1571
1554
|
title: g("inventory.transfer.receiveRequest.bulk.emailSendError"),
|
|
@@ -1574,58 +1557,58 @@ function Rs(x) {
|
|
|
1574
1557
|
});
|
|
1575
1558
|
return;
|
|
1576
1559
|
}
|
|
1577
|
-
if (!((Me =
|
|
1578
|
-
await
|
|
1579
|
-
const T =
|
|
1560
|
+
if (!((Me = z.currentBusiness.value) != null && Me._id)) return;
|
|
1561
|
+
await me(b);
|
|
1562
|
+
const T = mn(), I = yn(), q = /* @__PURE__ */ new Map(), W = w.locations.map((x) => x.dbName), Q = `business_${z.currentBusiness.value._id}`, A = [.../* @__PURE__ */ new Set([...W, Q])];
|
|
1580
1563
|
await Promise.allSettled(
|
|
1581
|
-
|
|
1564
|
+
A.map(async (x) => {
|
|
1582
1565
|
try {
|
|
1583
|
-
(await I.readSuppliersByDbName(
|
|
1584
|
-
const
|
|
1585
|
-
(!
|
|
1566
|
+
(await I.readSuppliersByDbName(x)).forEach((ie) => {
|
|
1567
|
+
const ce = q.get(ie._id);
|
|
1568
|
+
(!ce || !ce.email && ie.email) && q.set(ie._id, ie);
|
|
1586
1569
|
});
|
|
1587
|
-
} catch (
|
|
1588
|
-
console.warn("[emailAll] fetch failed for",
|
|
1570
|
+
} catch (oe) {
|
|
1571
|
+
console.warn("[emailAll] fetch failed for", x, oe);
|
|
1589
1572
|
}
|
|
1590
1573
|
})
|
|
1591
1574
|
);
|
|
1592
|
-
function
|
|
1593
|
-
var
|
|
1594
|
-
const
|
|
1595
|
-
return (
|
|
1596
|
-
}
|
|
1597
|
-
const
|
|
1598
|
-
for (const
|
|
1599
|
-
|
|
1600
|
-
const Je =
|
|
1575
|
+
function Z(x) {
|
|
1576
|
+
var ie;
|
|
1577
|
+
const oe = q.get(x.supplier._id);
|
|
1578
|
+
return (oe == null ? void 0 : oe.email) || ((ie = x.supplier) == null ? void 0 : ie.email);
|
|
1579
|
+
}
|
|
1580
|
+
const U = [], re = [];
|
|
1581
|
+
for (const x of b)
|
|
1582
|
+
Z(x) ? U.push(x) : re.push(x);
|
|
1583
|
+
const Je = xe(
|
|
1601
1584
|
"p",
|
|
1602
1585
|
{ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
|
|
1603
1586
|
g("inventory.transfer.receiveRequest.bulk.emailAllowedStatusInfo")
|
|
1604
1587
|
);
|
|
1605
|
-
if (
|
|
1606
|
-
const
|
|
1607
|
-
for (const
|
|
1608
|
-
const n =
|
|
1609
|
-
|
|
1588
|
+
if (re.length > 0) {
|
|
1589
|
+
const x = /* @__PURE__ */ new Map();
|
|
1590
|
+
for (const ce of re) {
|
|
1591
|
+
const n = ce.supplier._id;
|
|
1592
|
+
x.has(n) || x.set(n, { supplierName: ce.supplier.name, pos: [] }), x.get(n).pos.push(ce);
|
|
1610
1593
|
}
|
|
1611
|
-
const
|
|
1594
|
+
const oe = xe("div", { class: "flex flex-col gap-12" }, [
|
|
1612
1595
|
Je,
|
|
1613
|
-
|
|
1596
|
+
xe(
|
|
1614
1597
|
"p",
|
|
1615
1598
|
{ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
1616
|
-
g("inventory.transfer.receiveRequest.bulk.missingEmailMsg", [
|
|
1599
|
+
g("inventory.transfer.receiveRequest.bulk.missingEmailMsg", [re.length])
|
|
1617
1600
|
),
|
|
1618
|
-
|
|
1601
|
+
xe(
|
|
1619
1602
|
"div",
|
|
1620
1603
|
{ class: "flex flex-col gap-4 max-h-[320px] overflow-y-auto rounded-md border border-fm-color-neutral-gray-100 p-8" },
|
|
1621
|
-
[...
|
|
1622
|
-
({ supplierName:
|
|
1623
|
-
|
|
1624
|
-
|
|
1604
|
+
[...x.values()].map(
|
|
1605
|
+
({ supplierName: ce, pos: n }) => xe("div", { class: "flex flex-col gap-2 py-6 border-b border-fm-color-neutral-gray-100 last:border-0" }, [
|
|
1606
|
+
xe("div", { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" }, ce),
|
|
1607
|
+
xe(
|
|
1625
1608
|
"div",
|
|
1626
1609
|
{ class: "flex flex-wrap gap-4" },
|
|
1627
1610
|
n.map(
|
|
1628
|
-
(a) =>
|
|
1611
|
+
(a) => xe("span", {
|
|
1629
1612
|
class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100 rounded px-6 py-2"
|
|
1630
1613
|
}, `PO #${a.seqNumber ?? a._id}`)
|
|
1631
1614
|
)
|
|
@@ -1633,52 +1616,52 @@ function Rs(x) {
|
|
|
1633
1616
|
])
|
|
1634
1617
|
)
|
|
1635
1618
|
),
|
|
1636
|
-
|
|
1619
|
+
xe(
|
|
1637
1620
|
"p",
|
|
1638
1621
|
{ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
|
|
1639
|
-
g("inventory.transfer.receiveRequest.bulk.emailWillSendCount", [
|
|
1622
|
+
g("inventory.transfer.receiveRequest.bulk.emailWillSendCount", [U.length, b.length])
|
|
1640
1623
|
),
|
|
1641
|
-
|
|
1624
|
+
xe(
|
|
1642
1625
|
"p",
|
|
1643
1626
|
{ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
|
|
1644
1627
|
g("inventory.transfer.receiveRequest.bulk.missingEmailConfirm")
|
|
1645
1628
|
)
|
|
1646
1629
|
]);
|
|
1647
|
-
if (!await new Promise((
|
|
1630
|
+
if (!await new Promise((ce) => {
|
|
1648
1631
|
h.open({
|
|
1649
1632
|
title: g("inventory.transfer.receiveRequest.bulk.missingEmailTitle"),
|
|
1650
|
-
contentComponent:
|
|
1633
|
+
contentComponent: oe,
|
|
1651
1634
|
contentComponentProps: {},
|
|
1652
1635
|
primaryActions: {
|
|
1653
1636
|
text: g("inventory.transfer.receiveRequest.bulk.skipAndContinue"),
|
|
1654
1637
|
close: !0
|
|
1655
1638
|
},
|
|
1656
1639
|
secondaryActions: { text: g("inventory.common.cancel"), close: !0 }
|
|
1657
|
-
}).onPrimary(() =>
|
|
1640
|
+
}).onPrimary(() => ce(!0)).onSecondary(() => ce(!1));
|
|
1658
1641
|
})) return;
|
|
1659
1642
|
} else {
|
|
1660
|
-
const
|
|
1643
|
+
const x = xe("div", { class: "flex flex-col gap-12" }, [
|
|
1661
1644
|
Je,
|
|
1662
|
-
|
|
1645
|
+
xe(
|
|
1663
1646
|
"p",
|
|
1664
1647
|
{ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
1665
|
-
g("inventory.transfer.receiveRequest.bulk.emailAllConfirmMsg", [
|
|
1648
|
+
g("inventory.transfer.receiveRequest.bulk.emailAllConfirmMsg", [U.length])
|
|
1666
1649
|
)
|
|
1667
1650
|
]);
|
|
1668
|
-
if (!await new Promise((
|
|
1651
|
+
if (!await new Promise((ie) => {
|
|
1669
1652
|
h.open({
|
|
1670
1653
|
title: g("inventory.transfer.receiveRequest.bulk.missingEmailTitle"),
|
|
1671
|
-
contentComponent:
|
|
1654
|
+
contentComponent: x,
|
|
1672
1655
|
contentComponentProps: {},
|
|
1673
1656
|
primaryActions: {
|
|
1674
1657
|
text: g("inventory.transfer.receiveRequest.bulk.emailConfirm"),
|
|
1675
1658
|
close: !0
|
|
1676
1659
|
},
|
|
1677
1660
|
secondaryActions: { text: g("inventory.common.cancel"), close: !0 }
|
|
1678
|
-
}).onPrimary(() =>
|
|
1661
|
+
}).onPrimary(() => ie(!0)).onSecondary(() => ie(!1));
|
|
1679
1662
|
})) return;
|
|
1680
1663
|
}
|
|
1681
|
-
if (
|
|
1664
|
+
if (U.length === 0) {
|
|
1682
1665
|
l.open({
|
|
1683
1666
|
title: g("inventory.transfer.receiveRequest.bulk.emailSendError"),
|
|
1684
1667
|
message: g("inventory.transfer.receiveRequest.bulk.noEmailsToSend"),
|
|
@@ -1688,7 +1671,7 @@ function Rs(x) {
|
|
|
1688
1671
|
}
|
|
1689
1672
|
let Ie = [];
|
|
1690
1673
|
try {
|
|
1691
|
-
Ie = await T.getEmailList(
|
|
1674
|
+
Ie = await T.getEmailList(z.currentBusiness.value._id);
|
|
1692
1675
|
} catch {
|
|
1693
1676
|
l.open({
|
|
1694
1677
|
title: g("inventory.transfer.receiveRequest.bulk.emailSendError"),
|
|
@@ -1697,7 +1680,7 @@ function Rs(x) {
|
|
|
1697
1680
|
});
|
|
1698
1681
|
return;
|
|
1699
1682
|
}
|
|
1700
|
-
const Le = Ie.find((
|
|
1683
|
+
const Le = Ie.find((x) => x.verified);
|
|
1701
1684
|
if (!Le) {
|
|
1702
1685
|
l.open({
|
|
1703
1686
|
title: g("inventory.transfer.receiveRequest.bulk.emailSendError"),
|
|
@@ -1707,34 +1690,34 @@ function Rs(x) {
|
|
|
1707
1690
|
return;
|
|
1708
1691
|
}
|
|
1709
1692
|
const Ne = /* @__PURE__ */ new Map();
|
|
1710
|
-
for (const
|
|
1711
|
-
const
|
|
1712
|
-
if (!
|
|
1713
|
-
const
|
|
1714
|
-
s ? (s.pos.push(a), s.seqNumbers.push(
|
|
1715
|
-
recipientName:
|
|
1716
|
-
recipientEmail:
|
|
1693
|
+
for (const x of U) {
|
|
1694
|
+
const oe = Z(x);
|
|
1695
|
+
if (!oe) continue;
|
|
1696
|
+
const ce = (((je = w.locations.find((X) => X.dbName === x._locationDbName)) == null ? void 0 : je.name) || x._locationDbName).replace(/[/\\?%*:|"<>]/g, "-").trim().slice(0, 50), n = `PO_${x.seqNumber || x._id}`.replace(/[/\\?%*:|"<>]/g, "-").slice(0, 50), a = { poId: x._id, dbName: x._locationDbName, filename: `${ce}/${n}` }, s = Ne.get(oe);
|
|
1697
|
+
s ? (s.pos.push(a), s.seqNumbers.push(x.seqNumber ?? x._id)) : Ne.set(oe, {
|
|
1698
|
+
recipientName: x.supplier.name,
|
|
1699
|
+
recipientEmail: oe,
|
|
1717
1700
|
pos: [a],
|
|
1718
|
-
seqNumbers: [
|
|
1701
|
+
seqNumbers: [x.seqNumber ?? x._id]
|
|
1719
1702
|
});
|
|
1720
1703
|
}
|
|
1721
|
-
const ke = [...Ne.values()].map((
|
|
1722
|
-
subject:
|
|
1723
|
-
recipientName:
|
|
1724
|
-
recipientEmail:
|
|
1725
|
-
pos:
|
|
1704
|
+
const ke = [...Ne.values()].map((x) => ({
|
|
1705
|
+
subject: x.pos.length > 1 ? `Purchase Orders (${x.pos.length})` : `Purchase Order #${x.seqNumbers[0]}`,
|
|
1706
|
+
recipientName: x.recipientName,
|
|
1707
|
+
recipientEmail: x.recipientEmail,
|
|
1708
|
+
pos: x.pos
|
|
1726
1709
|
})), ze = f.value[0];
|
|
1727
1710
|
try {
|
|
1728
|
-
const { jobId:
|
|
1711
|
+
const { jobId: x } = await V.enqueueBulkEmail(ze, {
|
|
1729
1712
|
senderEmail: Le.emailAddress,
|
|
1730
|
-
senderName: Le.name || ((We =
|
|
1713
|
+
senderName: Le.name || ((We = z.currentBusiness.value) == null ? void 0 : We.name) || "FeedMe Inventory",
|
|
1731
1714
|
items: ke
|
|
1732
1715
|
});
|
|
1733
|
-
|
|
1734
|
-
jobId:
|
|
1716
|
+
v.addJob({
|
|
1717
|
+
jobId: x,
|
|
1735
1718
|
type: "email",
|
|
1736
1719
|
dbName: ze,
|
|
1737
|
-
title: `Email All (${ke.length} supplier${ke.length === 1 ? "" : "s"}, ${
|
|
1720
|
+
title: `Email All (${ke.length} supplier${ke.length === 1 ? "" : "s"}, ${U.length} POs)`,
|
|
1738
1721
|
status: "waiting",
|
|
1739
1722
|
progress: 0,
|
|
1740
1723
|
current: 0,
|
|
@@ -1746,8 +1729,8 @@ function Rs(x) {
|
|
|
1746
1729
|
message: g("inventory.transfer.receiveRequest.bulk.emailQueued"),
|
|
1747
1730
|
type: "success"
|
|
1748
1731
|
});
|
|
1749
|
-
} catch (
|
|
1750
|
-
console.error("Bulk email enqueue failed",
|
|
1732
|
+
} catch (x) {
|
|
1733
|
+
console.error("Bulk email enqueue failed", x), l.open({
|
|
1751
1734
|
title: g("inventory.transfer.receiveRequest.bulk.emailSendError"),
|
|
1752
1735
|
message: g("inventory.transfer.receiveRequest.bulk.emailErrorMsg"),
|
|
1753
1736
|
type: "error"
|
|
@@ -1758,60 +1741,60 @@ function Rs(x) {
|
|
|
1758
1741
|
selectedLocationDbNames: f,
|
|
1759
1742
|
purchaseOrders: d,
|
|
1760
1743
|
shipments: i,
|
|
1761
|
-
purchaseRequests:
|
|
1744
|
+
purchaseRequests: C,
|
|
1762
1745
|
rowAction: Se,
|
|
1763
|
-
updateDateRange:
|
|
1764
|
-
fetchData:
|
|
1765
|
-
failedLocations:
|
|
1746
|
+
updateDateRange: Ge,
|
|
1747
|
+
fetchData: $e,
|
|
1748
|
+
failedLocations: M,
|
|
1766
1749
|
retryFailedLocations: Fe,
|
|
1767
|
-
retryingFailed:
|
|
1768
|
-
fetchProgress:
|
|
1769
|
-
abortOngoingBrowse:
|
|
1750
|
+
retryingFailed: he,
|
|
1751
|
+
fetchProgress: ue,
|
|
1752
|
+
abortOngoingBrowse: ve,
|
|
1770
1753
|
fetchFullPurchaseOrders: j,
|
|
1771
1754
|
loading: c,
|
|
1772
|
-
transferDialogProps:
|
|
1755
|
+
transferDialogProps: et,
|
|
1773
1756
|
promptCreateTransferDialog: Oe,
|
|
1774
1757
|
promptUpdateTransferDialog: F,
|
|
1775
1758
|
transferDetailsProps: qe,
|
|
1776
|
-
promptShowTransferDetails:
|
|
1759
|
+
promptShowTransferDetails: G,
|
|
1777
1760
|
resolvePO: K,
|
|
1778
1761
|
submitAction: Re,
|
|
1779
1762
|
xilnexImportDialogProps: dt,
|
|
1780
1763
|
promptUploadTransferDialog: we,
|
|
1781
|
-
emailDialogProps:
|
|
1764
|
+
emailDialogProps: pe,
|
|
1782
1765
|
promptEmailDialog: B,
|
|
1783
1766
|
downloadAll: Be,
|
|
1784
1767
|
emailAll: Te,
|
|
1785
|
-
lastClosingDate:
|
|
1768
|
+
lastClosingDate: N
|
|
1786
1769
|
};
|
|
1787
1770
|
}
|
|
1788
|
-
function
|
|
1789
|
-
const
|
|
1790
|
-
if (!
|
|
1791
|
-
const S = h.find((
|
|
1771
|
+
function Fs(_, h, w) {
|
|
1772
|
+
const O = _._locationDbName;
|
|
1773
|
+
if (!O) return null;
|
|
1774
|
+
const S = h.find((z) => z.dbName === O);
|
|
1792
1775
|
if (!S) return null;
|
|
1793
1776
|
if (S.type === "restaurant") {
|
|
1794
|
-
const
|
|
1795
|
-
if (
|
|
1777
|
+
const z = w(S.doc._id);
|
|
1778
|
+
if (z !== null) return { ...S, doc: z };
|
|
1796
1779
|
}
|
|
1797
1780
|
return S;
|
|
1798
1781
|
}
|
|
1799
|
-
function
|
|
1800
|
-
return h.find((
|
|
1782
|
+
function Ss(_, h) {
|
|
1783
|
+
return h.find((w) => w.purchaseOrderId === _._id);
|
|
1801
1784
|
}
|
|
1802
|
-
function
|
|
1803
|
-
const
|
|
1804
|
-
async function g(
|
|
1805
|
-
if (
|
|
1806
|
-
const i = f._locationDbName,
|
|
1807
|
-
l.value && (URL.revokeObjectURL(l.value), l.value = null), c.value = !0,
|
|
1785
|
+
function Rs(_, h) {
|
|
1786
|
+
const w = it(), { t: O } = nt(), S = Ke(), z = ut(), Y = pt(), $ = k(!1), c = k(!1), l = k(null);
|
|
1787
|
+
async function g(v, f) {
|
|
1788
|
+
if (v !== at.PrintPdf) return !1;
|
|
1789
|
+
const i = f._locationDbName, C = f._rev;
|
|
1790
|
+
l.value && (URL.revokeObjectURL(l.value), l.value = null), c.value = !0, $.value = !0;
|
|
1808
1791
|
try {
|
|
1809
|
-
let o = await S.getPurchaseOrderPdf(f._id, i,
|
|
1810
|
-
"pending" in o && (await Y.waitForPdfJob(o.jobId, i), o = await S.getPurchaseOrderPdf(f._id, i,
|
|
1811
|
-
} catch {
|
|
1812
|
-
|
|
1813
|
-
title:
|
|
1814
|
-
message:
|
|
1792
|
+
let o = await S.getPurchaseOrderPdf(f._id, i, C);
|
|
1793
|
+
"pending" in o && (await Y.waitForPdfJob(o.jobId, i), o = await S.getPurchaseOrderPdf(f._id, i, C)), l.value = URL.createObjectURL(o);
|
|
1794
|
+
} catch (o) {
|
|
1795
|
+
$.value = !1, z.open({
|
|
1796
|
+
title: O("inventory.common.somethingWentWrong"),
|
|
1797
|
+
message: (o == null ? void 0 : o.message) || O("inventory.common.tryAgain"),
|
|
1815
1798
|
type: "error"
|
|
1816
1799
|
});
|
|
1817
1800
|
} finally {
|
|
@@ -1819,104 +1802,104 @@ function Es(x, h) {
|
|
|
1819
1802
|
}
|
|
1820
1803
|
return !0;
|
|
1821
1804
|
}
|
|
1822
|
-
const
|
|
1823
|
-
|
|
1824
|
-
|
|
1805
|
+
const V = Zt(
|
|
1806
|
+
kt.RECEIVE_REQUEST,
|
|
1807
|
+
_,
|
|
1825
1808
|
h,
|
|
1826
1809
|
{
|
|
1827
1810
|
// Bulk rows are summaries (no items) — print needs the full doc from the
|
|
1828
1811
|
// row's own location db, independent of the global current location.
|
|
1829
1812
|
// Runs behind the shared cancellable loading state; undefined (failed or
|
|
1830
1813
|
// cancelled) becomes null, which aborts the print.
|
|
1831
|
-
fetchFullPo: async (
|
|
1832
|
-
const f =
|
|
1833
|
-
return await
|
|
1834
|
-
(i) => S.getPurchaseOrderById(
|
|
1814
|
+
fetchFullPo: async (v) => {
|
|
1815
|
+
const f = v._locationDbName;
|
|
1816
|
+
return await _.rowAction.run(
|
|
1817
|
+
(i) => S.getPurchaseOrderById(v._id, f, i)
|
|
1835
1818
|
) ?? null;
|
|
1836
1819
|
},
|
|
1837
|
-
resolveLocation: (
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1820
|
+
resolveLocation: (v) => Fs(
|
|
1821
|
+
v,
|
|
1822
|
+
w.locations,
|
|
1823
|
+
w.locationRestaurantFromCore
|
|
1841
1824
|
),
|
|
1842
|
-
resolvePurchaseRequest: (
|
|
1825
|
+
resolvePurchaseRequest: (v) => Ss(v, _.purchaseRequests.value),
|
|
1843
1826
|
// Exclude both legacy Print and Print (Beta) — the bulk listing uses
|
|
1844
1827
|
// Lambda-generated PDF via PrintPdf instead.
|
|
1845
|
-
excludeRowActions: [
|
|
1828
|
+
excludeRowActions: [at.Print, at.PrintCustom],
|
|
1846
1829
|
// Inject the Lambda PDF print action into every row's context menu.
|
|
1847
|
-
appendRowActions: () => [
|
|
1830
|
+
appendRowActions: () => [Dn[at.PrintPdf]],
|
|
1848
1831
|
// Handle the PrintPdf action before the default handler runs.
|
|
1849
|
-
onCustomAction: (
|
|
1832
|
+
onCustomAction: (v, f) => g(v, f)
|
|
1850
1833
|
}
|
|
1851
1834
|
);
|
|
1852
1835
|
return {
|
|
1853
1836
|
columnDefs: L(() => {
|
|
1854
|
-
const
|
|
1837
|
+
const v = V.columnDefs.value, f = {
|
|
1855
1838
|
id: "location",
|
|
1856
|
-
header: () =>
|
|
1839
|
+
header: () => O("inventory.transfer.receiveRequest.bulk.locationColumn"),
|
|
1857
1840
|
cell(i) {
|
|
1858
|
-
const
|
|
1859
|
-
return o ? `${o.name} (${o.doc.profile.code ?? "--"})` :
|
|
1841
|
+
const C = i.row.original._locationDbName, o = w.locations.find((H) => H.dbName === C);
|
|
1842
|
+
return o ? `${o.name} (${o.doc.profile.code ?? "--"})` : C;
|
|
1860
1843
|
},
|
|
1861
1844
|
enableSorting: !1,
|
|
1862
1845
|
size: 160
|
|
1863
|
-
}, d = [...
|
|
1846
|
+
}, d = [...v];
|
|
1864
1847
|
return d.splice(1, 0, f), d;
|
|
1865
1848
|
}),
|
|
1866
|
-
showPdfDialog:
|
|
1849
|
+
showPdfDialog: $,
|
|
1867
1850
|
pdfPreviewLoading: c,
|
|
1868
1851
|
pdfPreviewBlobUrl: l
|
|
1869
1852
|
};
|
|
1870
1853
|
}
|
|
1871
|
-
const
|
|
1854
|
+
const Ps = {
|
|
1872
1855
|
key: 0,
|
|
1873
1856
|
class: "inline-flex items-center justify-center bg-white/25 text-white rounded-full min-w-[18px] h-[18px] px-[4px] text-[10px] font-semibold leading-none"
|
|
1874
|
-
},
|
|
1857
|
+
}, Ds = {
|
|
1875
1858
|
key: 1,
|
|
1876
1859
|
class: "bg-white rounded-lg shadow-xl border border-fm-color-neutral-gray-100 w-[360px] max-h-[480px] flex flex-col overflow-hidden"
|
|
1877
|
-
},
|
|
1860
|
+
}, Es = { class: "flex items-center justify-between px-16 py-12 border-b border-fm-color-neutral-gray-100" }, qs = { class: "fm-typo-en-title-sm-600" }, Ns = { class: "overflow-y-auto flex-1 divide-y divide-fm-color-neutral-gray-100" }, As = { class: "flex items-start justify-between gap-8" }, $s = { class: "flex flex-col gap-2" }, Os = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-primary line-clamp-1" }, Bs = { class: "fm-typo-en-body-xs-400 text-fm-color-typo-secondary capitalize" }, Ts = { class: "flex items-center gap-4" }, Is = ["disabled", "onClick"], Ls = ["disabled", "onClick"], zs = ["onClick"], Ms = {
|
|
1878
1861
|
key: 0,
|
|
1879
1862
|
class: "flex flex-col gap-4"
|
|
1880
|
-
},
|
|
1863
|
+
}, Us = { class: "w-full bg-fm-color-neutral-gray-200 rounded-full h-[3px]" }, Vs = { class: "flex justify-between fm-typo-en-body-xs-400 text-fm-color-typo-secondary" }, Js = {
|
|
1881
1864
|
key: 0,
|
|
1882
1865
|
class: "truncate max-w-[200px]"
|
|
1883
|
-
},
|
|
1866
|
+
}, js = { class: "ml-auto" }, Ws = {
|
|
1884
1867
|
key: 1,
|
|
1885
1868
|
class: "flex items-center gap-4 fm-typo-en-body-xs-400 text-fm-color-typo-success"
|
|
1886
|
-
},
|
|
1869
|
+
}, Ys = {
|
|
1887
1870
|
key: 2,
|
|
1888
1871
|
class: "flex items-center gap-4 fm-typo-en-body-xs-400 text-fm-color-typo-warning"
|
|
1889
|
-
},
|
|
1872
|
+
}, Hs = {
|
|
1890
1873
|
key: 3,
|
|
1891
1874
|
class: "flex items-center gap-4 fm-typo-en-body-xs-400 text-fm-color-typo-secondary"
|
|
1892
|
-
},
|
|
1875
|
+
}, Qs = {
|
|
1893
1876
|
key: 4,
|
|
1894
1877
|
class: "flex items-center gap-4 fm-typo-en-body-xs-400 text-fm-color-typo-error"
|
|
1895
|
-
},
|
|
1878
|
+
}, Ks = { key: 0 }, Gs = { key: 1 }, Xs = {
|
|
1896
1879
|
key: 5,
|
|
1897
1880
|
class: "flex items-center gap-[5px] text-[11px] leading-none text-fm-color-typo-secondary"
|
|
1898
|
-
},
|
|
1881
|
+
}, Zs = /* @__PURE__ */ tt({
|
|
1899
1882
|
__name: "BulkJobProgressPanel",
|
|
1900
|
-
setup(
|
|
1901
|
-
const { t: h } =
|
|
1883
|
+
setup(_) {
|
|
1884
|
+
const { t: h } = En(), w = pt(), O = Ke(), S = k(!1), z = k(null);
|
|
1902
1885
|
function Y(d) {
|
|
1903
|
-
S.value &&
|
|
1886
|
+
S.value && z.value && !z.value.contains(d.target) && (S.value = !1);
|
|
1904
1887
|
}
|
|
1905
|
-
|
|
1888
|
+
At(() => {
|
|
1906
1889
|
document.addEventListener("click", Y, !0);
|
|
1907
|
-
}),
|
|
1890
|
+
}), $t(() => {
|
|
1908
1891
|
document.removeEventListener("click", Y, !0);
|
|
1909
1892
|
});
|
|
1910
|
-
const
|
|
1893
|
+
const $ = k(/* @__PURE__ */ new Set()), c = k(/* @__PURE__ */ new Set());
|
|
1911
1894
|
async function l(d) {
|
|
1912
|
-
if (
|
|
1913
|
-
|
|
1895
|
+
if (!$.value.has(d.jobId)) {
|
|
1896
|
+
$.value = /* @__PURE__ */ new Set([...$.value, d.jobId]);
|
|
1914
1897
|
try {
|
|
1915
|
-
const i = await
|
|
1916
|
-
o.href =
|
|
1898
|
+
const i = await O.downloadBulkJob(d.dbName, d.jobId), C = URL.createObjectURL(i), o = document.createElement("a");
|
|
1899
|
+
o.href = C, o.download = "purchase-orders.zip", document.body.appendChild(o), o.click(), document.body.removeChild(o), setTimeout(() => URL.revokeObjectURL(C), 1e3);
|
|
1917
1900
|
} finally {
|
|
1918
|
-
const i = new Set(
|
|
1919
|
-
i.delete(d.jobId),
|
|
1901
|
+
const i = new Set($.value);
|
|
1902
|
+
i.delete(d.jobId), $.value = i;
|
|
1920
1903
|
}
|
|
1921
1904
|
}
|
|
1922
1905
|
}
|
|
@@ -1924,33 +1907,33 @@ const qs = {
|
|
|
1924
1907
|
if (!c.value.has(d.jobId)) {
|
|
1925
1908
|
c.value = /* @__PURE__ */ new Set([...c.value, d.jobId]);
|
|
1926
1909
|
try {
|
|
1927
|
-
await
|
|
1910
|
+
await w.cancelJob(d.jobId);
|
|
1928
1911
|
} finally {
|
|
1929
1912
|
const i = new Set(c.value);
|
|
1930
1913
|
i.delete(d.jobId), c.value = i;
|
|
1931
1914
|
}
|
|
1932
1915
|
}
|
|
1933
1916
|
}
|
|
1934
|
-
function
|
|
1935
|
-
|
|
1917
|
+
function V(d) {
|
|
1918
|
+
w.removeJob(d);
|
|
1936
1919
|
}
|
|
1937
|
-
function
|
|
1920
|
+
function de(d) {
|
|
1938
1921
|
return d === "completed" || d === "failed" || d === "cancelled";
|
|
1939
1922
|
}
|
|
1940
|
-
function
|
|
1941
|
-
const i = Math.round(d / 1e3),
|
|
1942
|
-
return
|
|
1923
|
+
function v(d) {
|
|
1924
|
+
const i = Math.round(d / 1e3), C = Math.floor(i / 60), o = i % 60;
|
|
1925
|
+
return C > 0 ? `${C}m ${o}s` : `${o}s`;
|
|
1943
1926
|
}
|
|
1944
1927
|
function f(d) {
|
|
1945
1928
|
return d < 1024 ? `${d} B` : d < 1024 * 1024 ? `${(d / 1024).toFixed(1)} KB` : `${(d / (1024 * 1024)).toFixed(1)} MB`;
|
|
1946
1929
|
}
|
|
1947
1930
|
return (d, i) => {
|
|
1948
|
-
const
|
|
1949
|
-
return m(),
|
|
1950
|
-
t(
|
|
1931
|
+
const C = Ce("FmIcon");
|
|
1932
|
+
return m(), le(lt, { to: "body" }, [
|
|
1933
|
+
t(w).jobs.length > 0 ? (m(), y("div", {
|
|
1951
1934
|
key: 0,
|
|
1952
1935
|
ref_key: "panelRef",
|
|
1953
|
-
ref:
|
|
1936
|
+
ref: z,
|
|
1954
1937
|
class: "fixed bottom-24 right-24 z-[9998] flex flex-col items-end gap-8"
|
|
1955
1938
|
}, [
|
|
1956
1939
|
S.value ? D("", !0) : (m(), y("button", {
|
|
@@ -1958,53 +1941,53 @@ const qs = {
|
|
|
1958
1941
|
class: "flex items-center gap-8 bg-fm-color-primary text-white rounded-full px-16 py-[6px] shadow-lg fm-typo-en-body-sm-600 cursor-pointer",
|
|
1959
1942
|
onClick: i[0] || (i[0] = (o) => S.value = !0)
|
|
1960
1943
|
}, [
|
|
1961
|
-
E(
|
|
1944
|
+
E(C, {
|
|
1962
1945
|
name: "cloud_upload",
|
|
1963
1946
|
size: "sm"
|
|
1964
1947
|
}),
|
|
1965
|
-
e("span", null,
|
|
1966
|
-
t(
|
|
1948
|
+
e("span", null, p(t(h)("inventory.transfer.receiveRequest.bulk.backgroundJobsTitle")), 1),
|
|
1949
|
+
t(w).activeJobs.length > 0 ? (m(), y("span", Ps, p(t(w).activeJobs.length), 1)) : D("", !0)
|
|
1967
1950
|
])),
|
|
1968
|
-
S.value ? (m(), y("div",
|
|
1969
|
-
e("div",
|
|
1970
|
-
e("span",
|
|
1951
|
+
S.value ? (m(), y("div", Ds, [
|
|
1952
|
+
e("div", Es, [
|
|
1953
|
+
e("span", qs, p(t(h)("inventory.transfer.receiveRequest.bulk.backgroundJobsTitle")), 1),
|
|
1971
1954
|
e("button", {
|
|
1972
1955
|
"aria-label": "Collapse",
|
|
1973
1956
|
onClick: i[1] || (i[1] = (o) => S.value = !1),
|
|
1974
1957
|
class: "text-fm-color-typo-secondary hover:text-fm-color-typo-primary"
|
|
1975
1958
|
}, [
|
|
1976
|
-
E(
|
|
1959
|
+
E(C, {
|
|
1977
1960
|
name: "close",
|
|
1978
1961
|
size: "sm"
|
|
1979
1962
|
})
|
|
1980
1963
|
])
|
|
1981
1964
|
]),
|
|
1982
|
-
e("div",
|
|
1983
|
-
(m(!0), y(
|
|
1965
|
+
e("div", Ns, [
|
|
1966
|
+
(m(!0), y(ye, null, Qe(t(w).jobs, (o) => {
|
|
1984
1967
|
var H;
|
|
1985
1968
|
return m(), y("div", {
|
|
1986
1969
|
key: o.jobId,
|
|
1987
1970
|
class: "px-16 py-12 flex flex-col gap-8"
|
|
1988
1971
|
}, [
|
|
1989
|
-
e("div",
|
|
1990
|
-
e("div",
|
|
1991
|
-
e("span",
|
|
1992
|
-
e("span",
|
|
1972
|
+
e("div", As, [
|
|
1973
|
+
e("div", $s, [
|
|
1974
|
+
e("span", Os, p(o.title), 1),
|
|
1975
|
+
e("span", Bs, p(o.status), 1)
|
|
1993
1976
|
]),
|
|
1994
|
-
e("div",
|
|
1977
|
+
e("div", Ts, [
|
|
1995
1978
|
o.downloadReady ? (m(), y("button", {
|
|
1996
1979
|
key: 0,
|
|
1997
1980
|
class: "text-fm-color-primary hover:opacity-80 disabled:opacity-40",
|
|
1998
|
-
disabled:
|
|
1981
|
+
disabled: $.value.has(o.jobId),
|
|
1999
1982
|
title: "Download",
|
|
2000
1983
|
"aria-label": "Download",
|
|
2001
1984
|
onClick: (R) => l(o)
|
|
2002
1985
|
}, [
|
|
2003
|
-
E(
|
|
2004
|
-
name:
|
|
1986
|
+
E(C, {
|
|
1987
|
+
name: $.value.has(o.jobId) ? "progress_activity" : "download",
|
|
2005
1988
|
size: "sm"
|
|
2006
1989
|
}, null, 8, ["name"])
|
|
2007
|
-
], 8,
|
|
1990
|
+
], 8, Is)) : D("", !0),
|
|
2008
1991
|
o.status === "waiting" || o.status === "active" ? (m(), y("button", {
|
|
2009
1992
|
key: 1,
|
|
2010
1993
|
class: "text-fm-color-semantic-error-500 hover:opacity-80 disabled:opacity-40",
|
|
@@ -2013,70 +1996,70 @@ const qs = {
|
|
|
2013
1996
|
"aria-label": "Cancel",
|
|
2014
1997
|
onClick: (R) => g(o)
|
|
2015
1998
|
}, [
|
|
2016
|
-
E(
|
|
1999
|
+
E(C, {
|
|
2017
2000
|
name: c.value.has(o.jobId) ? "progress_activity" : "cancel",
|
|
2018
2001
|
size: "sm"
|
|
2019
2002
|
}, null, 8, ["name"])
|
|
2020
|
-
], 8,
|
|
2021
|
-
|
|
2003
|
+
], 8, Ls)) : D("", !0),
|
|
2004
|
+
de(o.status) ? (m(), y("button", {
|
|
2022
2005
|
key: 2,
|
|
2023
2006
|
class: "text-fm-color-typo-secondary hover:text-fm-color-typo-primary",
|
|
2024
2007
|
title: "Dismiss",
|
|
2025
2008
|
"aria-label": "Dismiss",
|
|
2026
|
-
onClick: (R) =>
|
|
2009
|
+
onClick: (R) => V(o.jobId)
|
|
2027
2010
|
}, [
|
|
2028
|
-
E(
|
|
2011
|
+
E(C, {
|
|
2029
2012
|
name: "close",
|
|
2030
2013
|
size: "sm"
|
|
2031
2014
|
})
|
|
2032
|
-
], 8,
|
|
2015
|
+
], 8, zs)) : D("", !0)
|
|
2033
2016
|
])
|
|
2034
2017
|
]),
|
|
2035
|
-
o.status === "active" || o.status === "waiting" ? (m(), y("div",
|
|
2036
|
-
e("div",
|
|
2018
|
+
o.status === "active" || o.status === "waiting" ? (m(), y("div", Ms, [
|
|
2019
|
+
e("div", Us, [
|
|
2037
2020
|
e("div", {
|
|
2038
2021
|
class: "bg-fm-color-primary h-[3px] rounded-full transition-all duration-300",
|
|
2039
2022
|
style: mt({ width: `${o.progress}%` })
|
|
2040
2023
|
}, null, 4)
|
|
2041
2024
|
]),
|
|
2042
|
-
e("div",
|
|
2043
|
-
o.currentItem ? (m(), y("span",
|
|
2044
|
-
e("span",
|
|
2025
|
+
e("div", Vs, [
|
|
2026
|
+
o.currentItem ? (m(), y("span", Js, p(o.currentItem), 1)) : D("", !0),
|
|
2027
|
+
e("span", js, p(o.current) + " / " + p(o.total), 1)
|
|
2045
2028
|
])
|
|
2046
2029
|
])) : D("", !0),
|
|
2047
|
-
o.status === "completed" && o.errorCount === 0 ? (m(), y("div",
|
|
2048
|
-
E(
|
|
2030
|
+
o.status === "completed" && o.errorCount === 0 ? (m(), y("div", Ws, [
|
|
2031
|
+
E(C, {
|
|
2049
2032
|
name: "check_circle",
|
|
2050
2033
|
size: "sm"
|
|
2051
2034
|
}),
|
|
2052
|
-
e("span", null,
|
|
2035
|
+
e("span", null, p(t(h)("inventory.transfer.receiveRequest.bulk.jobDone")), 1)
|
|
2053
2036
|
])) : D("", !0),
|
|
2054
|
-
o.status === "completed" && (((H = o.stalePoIds) == null ? void 0 : H.length) ?? 0) > 0 ? (m(), y("div",
|
|
2055
|
-
E(
|
|
2037
|
+
o.status === "completed" && (((H = o.stalePoIds) == null ? void 0 : H.length) ?? 0) > 0 ? (m(), y("div", Ys, [
|
|
2038
|
+
E(C, {
|
|
2056
2039
|
name: "warning",
|
|
2057
2040
|
size: "sm"
|
|
2058
2041
|
}),
|
|
2059
|
-
e("span", null,
|
|
2042
|
+
e("span", null, p(t(h)("inventory.transfer.receiveRequest.bulk.jobStalePos", [o.stalePoIds.length])), 1)
|
|
2060
2043
|
])) : D("", !0),
|
|
2061
|
-
o.status === "cancelled" ? (m(), y("div",
|
|
2062
|
-
E(
|
|
2044
|
+
o.status === "cancelled" ? (m(), y("div", Hs, [
|
|
2045
|
+
E(C, {
|
|
2063
2046
|
name: "do_not_disturb_on",
|
|
2064
2047
|
size: "sm"
|
|
2065
2048
|
}),
|
|
2066
|
-
e("span", null,
|
|
2049
|
+
e("span", null, p(t(h)("inventory.transfer.receiveRequest.bulk.jobCancelled")), 1)
|
|
2067
2050
|
])) : D("", !0),
|
|
2068
|
-
o.status === "failed" ? (m(), y("div",
|
|
2069
|
-
E(
|
|
2051
|
+
o.status === "failed" ? (m(), y("div", Qs, [
|
|
2052
|
+
E(C, {
|
|
2070
2053
|
name: "cancel",
|
|
2071
2054
|
size: "sm"
|
|
2072
2055
|
}),
|
|
2073
|
-
o.errorCount > 0 ? (m(), y("span",
|
|
2056
|
+
o.errorCount > 0 ? (m(), y("span", Ks, p(t(h)("inventory.transfer.receiveRequest.bulk.jobDoneWithErrors", [o.errorCount])), 1)) : (m(), y("span", Gs, p(t(h)("inventory.transfer.receiveRequest.bulk.jobFailed")), 1))
|
|
2074
2057
|
])) : D("", !0),
|
|
2075
|
-
|
|
2076
|
-
e("span", null,
|
|
2077
|
-
o.zipSizeBytes ? (m(), y(
|
|
2058
|
+
de(o.status) && o.completedAt ? (m(), y("div", Xs, [
|
|
2059
|
+
e("span", null, p(t(h)("inventory.transfer.receiveRequest.bulk.jobCompletedIn", [v(o.completedAt - o.startedAt)])), 1),
|
|
2060
|
+
o.zipSizeBytes ? (m(), y(ye, { key: 0 }, [
|
|
2078
2061
|
i[2] || (i[2] = e("span", null, "·", -1)),
|
|
2079
|
-
e("span", null,
|
|
2062
|
+
e("span", null, p(f(o.zipSizeBytes)), 1)
|
|
2080
2063
|
], 64)) : D("", !0)
|
|
2081
2064
|
])) : D("", !0)
|
|
2082
2065
|
]);
|
|
@@ -2087,45 +2070,45 @@ const qs = {
|
|
|
2087
2070
|
]);
|
|
2088
2071
|
};
|
|
2089
2072
|
}
|
|
2090
|
-
}),
|
|
2073
|
+
}), ea = {
|
|
2091
2074
|
key: 0,
|
|
2092
2075
|
class: "flex flex-col items-center justify-center py-48 gap-8 text-fm-color-typo-secondary"
|
|
2093
|
-
},
|
|
2076
|
+
}, ta = { class: "flex-1 w-full flex items-center gap-4 xs:flex-col-reverse sm:flex-col-reverse" }, na = { class: "flex-1 xs:w-full sm:w-full" }, oa = {
|
|
2094
2077
|
key: 0,
|
|
2095
2078
|
class: "flex-1"
|
|
2096
|
-
},
|
|
2079
|
+
}, sa = { class: "w-full max-w-[343px] xs:max-w-[unset] sm:max-w-[unset]" }, aa = {
|
|
2097
2080
|
key: 0,
|
|
2098
2081
|
class: "flex flex-col items-center justify-center py-48 gap-8 text-fm-color-typo-secondary"
|
|
2099
|
-
},
|
|
2082
|
+
}, ra = { class: "fm-typo-en-body-md-400" }, la = {
|
|
2100
2083
|
key: 1,
|
|
2101
2084
|
class: "relative"
|
|
2102
|
-
},
|
|
2085
|
+
}, ia = {
|
|
2103
2086
|
key: 0,
|
|
2104
2087
|
class: "flex items-center gap-12 mb-8"
|
|
2105
|
-
},
|
|
2088
|
+
}, ua = { class: "flex-1 h-4 rounded-full bg-fm-color-neutral-gray-200 overflow-hidden" }, ca = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary whitespace-nowrap" }, da = {
|
|
2106
2089
|
key: 1,
|
|
2107
2090
|
class: "flex items-center justify-between gap-12 rounded-md border border-red-200 bg-red-50 px-16 py-8 mb-8"
|
|
2108
|
-
},
|
|
2091
|
+
}, ma = { class: "fm-typo-en-body-md-400 text-red-800" }, fa = { class: "flex flex-col py-8" }, pa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, va = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ya = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, ba = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1" }, ha = {
|
|
2109
2092
|
key: 0,
|
|
2110
2093
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1"
|
|
2111
|
-
},
|
|
2094
|
+
}, ga = { class: "pt-8" }, xa = {
|
|
2112
2095
|
key: 2,
|
|
2113
2096
|
class: "absolute inset-0 z-10 flex items-center justify-center bg-fm-color-opacity-sm"
|
|
2114
|
-
},
|
|
2097
|
+
}, _a = { class: "flex items-center gap-12 rounded-md bg-white px-16 py-8 shadow-lg" }, wa = { class: "fm-typo-en-body-md-400" }, wt = "BulkReceiveRequestViewSearchCriteria", Za = /* @__PURE__ */ tt({
|
|
2115
2098
|
__name: "BulkReceiveRequestView",
|
|
2116
|
-
setup(
|
|
2117
|
-
const { t: h } =
|
|
2118
|
-
|
|
2119
|
-
name:
|
|
2120
|
-
startDate:
|
|
2121
|
-
endDate:
|
|
2099
|
+
setup(_) {
|
|
2100
|
+
const { t: h } = nt(), w = ut();
|
|
2101
|
+
st.object({
|
|
2102
|
+
name: st.string().optional().nullable(),
|
|
2103
|
+
startDate: st.string().optional().nullable(),
|
|
2104
|
+
endDate: st.string().optional().nullable()
|
|
2122
2105
|
});
|
|
2123
|
-
const
|
|
2106
|
+
const O = sn(), S = Rt(), z = Tt();
|
|
2124
2107
|
function Y() {
|
|
2125
2108
|
const P = {
|
|
2126
2109
|
name: "",
|
|
2127
2110
|
...ft()
|
|
2128
|
-
}, F =
|
|
2111
|
+
}, F = O.getItem(wt);
|
|
2129
2112
|
if (!F) return P;
|
|
2130
2113
|
try {
|
|
2131
2114
|
return JSON.parse(F);
|
|
@@ -2133,20 +2116,20 @@ const qs = {
|
|
|
2133
2116
|
return P;
|
|
2134
2117
|
}
|
|
2135
2118
|
}
|
|
2136
|
-
function
|
|
2137
|
-
|
|
2119
|
+
function $() {
|
|
2120
|
+
O.setItem(wt, JSON.stringify(c.value));
|
|
2138
2121
|
}
|
|
2139
|
-
const c =
|
|
2140
|
-
columnDefs:
|
|
2122
|
+
const c = k(Y()), l = Cs(c.value), g = k(!1), { selectedLocationDbNames: V } = l, de = L(() => R.value.filter((P) => V.value.includes(P.dbName)).map((P) => P.doc._id)), {
|
|
2123
|
+
columnDefs: v,
|
|
2141
2124
|
showPdfDialog: f,
|
|
2142
2125
|
pdfPreviewLoading: d,
|
|
2143
2126
|
pdfPreviewBlobUrl: i
|
|
2144
|
-
} =
|
|
2145
|
-
|
|
2146
|
-
const P =
|
|
2127
|
+
} = Rs(l, l.shipments), C = it(), o = Jt(), H = Ct(), R = k([]);
|
|
2128
|
+
Ot(() => {
|
|
2129
|
+
const P = C.locations;
|
|
2147
2130
|
P.length > 0 && (R.value = P);
|
|
2148
2131
|
});
|
|
2149
|
-
async function
|
|
2132
|
+
async function N() {
|
|
2150
2133
|
var F;
|
|
2151
2134
|
if ((F = H.currentBusiness.value) != null && F._id)
|
|
2152
2135
|
try {
|
|
@@ -2158,25 +2141,25 @@ const qs = {
|
|
|
2158
2141
|
Ve(
|
|
2159
2142
|
[() => H.sessionUser.value, () => H.currentBusiness.value],
|
|
2160
2143
|
([P, F]) => {
|
|
2161
|
-
P && F &&
|
|
2144
|
+
P && F && N();
|
|
2162
2145
|
},
|
|
2163
2146
|
{ immediate: !0 }
|
|
2164
2147
|
);
|
|
2165
|
-
const
|
|
2148
|
+
const M = L(() => l.loading.value), be = L(
|
|
2166
2149
|
() => l.failedLocations.value.map((P) => {
|
|
2167
2150
|
var F;
|
|
2168
|
-
return ((F =
|
|
2151
|
+
return ((F = C.locations.find((B) => B.dbName === P.dbName)) == null ? void 0 : F.name) ?? P.dbName;
|
|
2169
2152
|
}).join(", ")
|
|
2170
|
-
),
|
|
2153
|
+
), he = L(
|
|
2171
2154
|
() => l.failedLocations.value.some((P) => P.retryable)
|
|
2172
2155
|
);
|
|
2173
|
-
async function
|
|
2156
|
+
async function ue() {
|
|
2174
2157
|
const P = `inventory-record_${He(c.value.startDate).format("DD-MM-YYYY_HH-mm")}-${He(c.value.endDate).format("DD-MM-YYYY_HH-mm")}.xlsx`;
|
|
2175
2158
|
let F = [];
|
|
2176
2159
|
try {
|
|
2177
2160
|
F = await l.fetchFullPurchaseOrders();
|
|
2178
2161
|
} catch {
|
|
2179
|
-
|
|
2162
|
+
w.open({
|
|
2180
2163
|
title: h("inventory.transfer.receiveRequest.export.error"),
|
|
2181
2164
|
message: h("inventory.transfer.receiveRequest.export.fetchError"),
|
|
2182
2165
|
type: "error"
|
|
@@ -2184,24 +2167,24 @@ const qs = {
|
|
|
2184
2167
|
return;
|
|
2185
2168
|
}
|
|
2186
2169
|
const B = F.flatMap(
|
|
2187
|
-
(
|
|
2170
|
+
(G) => G.items.map((ee) => {
|
|
2188
2171
|
var r, u;
|
|
2189
|
-
const Re = new Date(
|
|
2190
|
-
|
|
2191
|
-
),
|
|
2172
|
+
const Re = new Date(nn(G._id) ?? ""), we = G.effectiveAt ? new Date(G.effectiveAt) : void 0, j = xt(
|
|
2173
|
+
tn(ee.sku, G.deliveryOrder || [])
|
|
2174
|
+
), ae = xt(ee.quantity), Be = ((r = ee == null ? void 0 : ee.measurement) == null ? void 0 : r.abbrev) || ee.sku.unit.abbrev;
|
|
2192
2175
|
return {
|
|
2193
|
-
Location: ((u =
|
|
2194
|
-
"SKU code":
|
|
2195
|
-
"SKU name":
|
|
2196
|
-
"PO #":
|
|
2176
|
+
Location: ((u = C.locations.find((b) => b.dbName === G._locationDbName)) == null ? void 0 : u.name) ?? "",
|
|
2177
|
+
"SKU code": ee.code,
|
|
2178
|
+
"SKU name": ee.name,
|
|
2179
|
+
"PO #": G.seqNumber,
|
|
2197
2180
|
"Effective at": we,
|
|
2198
2181
|
Date: Re,
|
|
2199
|
-
Status:
|
|
2200
|
-
Reference:
|
|
2182
|
+
Status: G.status,
|
|
2183
|
+
Reference: G.ref ?? "",
|
|
2201
2184
|
"Received quantity": j,
|
|
2202
|
-
"Ordered quantity":
|
|
2185
|
+
"Ordered quantity": ae,
|
|
2203
2186
|
Unit: Be,
|
|
2204
|
-
"Total cost":
|
|
2187
|
+
"Total cost": ee.totalCost ? Wt(ee.totalCost) : null
|
|
2205
2188
|
};
|
|
2206
2189
|
})
|
|
2207
2190
|
), K = [
|
|
@@ -2216,45 +2199,45 @@ const qs = {
|
|
|
2216
2199
|
"Ordered quantity",
|
|
2217
2200
|
"Unit"
|
|
2218
2201
|
];
|
|
2219
|
-
S.enableBackdatePo && K.insert("Effective at", 5), S.enableTotalCost && K.push("Total cost"), await
|
|
2202
|
+
S.enableBackdatePo && K.insert("Effective at", 5), S.enableTotalCost && K.push("Total cost"), await on([{ name: "purchases", data: B, columns: K }], P), w.open({
|
|
2220
2203
|
title: h("inventory.transfer.receiveRequest.export.success"),
|
|
2221
2204
|
message: h("inventory.transfer.receiveRequest.export.message", [P]),
|
|
2222
2205
|
type: "success"
|
|
2223
2206
|
});
|
|
2224
2207
|
}
|
|
2225
|
-
const
|
|
2226
|
-
Ve([() =>
|
|
2208
|
+
const ne = k(ft()), ve = k("");
|
|
2209
|
+
Ve([() => ne.value], ([P]) => {
|
|
2227
2210
|
if (!P.startDate || !P.endDate) return;
|
|
2228
2211
|
if (He(P.endDate).diff(He(P.startDate), "day") > 60) {
|
|
2229
|
-
|
|
2212
|
+
w.open({
|
|
2230
2213
|
title: h("inventory.transfer.receiveRequest.bulk.dateRangeLimitTitle"),
|
|
2231
2214
|
message: h("inventory.transfer.receiveRequest.bulk.dateRangeLimitMsg"),
|
|
2232
2215
|
type: "warning"
|
|
2233
|
-
}),
|
|
2216
|
+
}), ne.value = {
|
|
2234
2217
|
startDate: P.startDate,
|
|
2235
2218
|
endDate: He(P.startDate).add(60, "day").format("YYYY-MM-DD")
|
|
2236
2219
|
};
|
|
2237
2220
|
return;
|
|
2238
2221
|
}
|
|
2239
|
-
c.value.startDate = P.startDate, c.value.endDate = P.endDate, l.updateDateRange(c.value.startDate, c.value.endDate),
|
|
2240
|
-
}), Ve([() =>
|
|
2241
|
-
|
|
2222
|
+
c.value.startDate = P.startDate, c.value.endDate = P.endDate, l.updateDateRange(c.value.startDate, c.value.endDate), $();
|
|
2223
|
+
}), Ve([() => ve.value], () => {
|
|
2224
|
+
$();
|
|
2242
2225
|
});
|
|
2243
|
-
const De =
|
|
2226
|
+
const De = It.debounce(() => l.fetchData(), 1500);
|
|
2244
2227
|
Ve(
|
|
2245
|
-
() =>
|
|
2228
|
+
() => V.value,
|
|
2246
2229
|
() => {
|
|
2247
2230
|
l.abortOngoingBrowse(), De();
|
|
2248
2231
|
}
|
|
2249
2232
|
);
|
|
2250
|
-
function
|
|
2233
|
+
function _e(P) {
|
|
2251
2234
|
if (P === "create") {
|
|
2252
|
-
if (
|
|
2253
|
-
|
|
2235
|
+
if (M.value) {
|
|
2236
|
+
w.open({ title: "Loading data...", message: "Please wait.", type: "info" });
|
|
2254
2237
|
return;
|
|
2255
2238
|
}
|
|
2256
|
-
if (
|
|
2257
|
-
|
|
2239
|
+
if (V.value.length === 0) {
|
|
2240
|
+
w.open({
|
|
2258
2241
|
title: "No outlets selected",
|
|
2259
2242
|
message: "Please select at least one outlet to create a transfer.",
|
|
2260
2243
|
type: "warning"
|
|
@@ -2267,13 +2250,13 @@ const qs = {
|
|
|
2267
2250
|
if (P === "upload" && S.enableXilnexTransferNote)
|
|
2268
2251
|
return l.promptUploadTransferDialog();
|
|
2269
2252
|
if (P === "refresh") return l.fetchData();
|
|
2270
|
-
if (P === "export") return
|
|
2271
|
-
if (P === "downloadAll") return
|
|
2253
|
+
if (P === "export") return ue();
|
|
2254
|
+
if (P === "downloadAll") return Ae();
|
|
2272
2255
|
if (P === "emailAll") return Ee();
|
|
2273
2256
|
}
|
|
2274
|
-
async function
|
|
2275
|
-
if (
|
|
2276
|
-
|
|
2257
|
+
async function Ae() {
|
|
2258
|
+
if (V.value.length === 0) {
|
|
2259
|
+
w.open({
|
|
2277
2260
|
title: h("inventory.transfer.receiveRequest.bulk.noLocationsSelected"),
|
|
2278
2261
|
message: "",
|
|
2279
2262
|
type: "warning"
|
|
@@ -2284,8 +2267,8 @@ const qs = {
|
|
|
2284
2267
|
}
|
|
2285
2268
|
async function Ee() {
|
|
2286
2269
|
if (S.enablePurchaseOrderEmail) {
|
|
2287
|
-
if (
|
|
2288
|
-
|
|
2270
|
+
if (V.value.length === 0) {
|
|
2271
|
+
w.open({
|
|
2289
2272
|
title: h("inventory.transfer.receiveRequest.bulk.noLocationsSelected"),
|
|
2290
2273
|
message: "",
|
|
2291
2274
|
type: "warning"
|
|
@@ -2295,7 +2278,7 @@ const qs = {
|
|
|
2295
2278
|
await l.emailAll(Se.value);
|
|
2296
2279
|
}
|
|
2297
2280
|
}
|
|
2298
|
-
const { breakpoints:
|
|
2281
|
+
const { breakpoints: me } = cn(), ge = L(() => me.value.xs || me.value.sm), $e = L(() => ge.value ? 10 : 20), Fe = an(), Ge = L(() => S.enableReceiveRequestBeta ? [
|
|
2299
2282
|
{
|
|
2300
2283
|
label: h("inventory.transfer.receiveRequest.actions.create"),
|
|
2301
2284
|
value: "create",
|
|
@@ -2305,14 +2288,14 @@ const qs = {
|
|
|
2305
2288
|
...S.enableXilnexTransferNote ? [{ label: h("inventory.common.upload"), value: "upload" }] : [],
|
|
2306
2289
|
{ label: h("inventory.common.refresh"), value: "refresh" },
|
|
2307
2290
|
{ label: h("inventory.common.export"), value: "export" },
|
|
2308
|
-
...S.enablePrintTemplate && !
|
|
2291
|
+
...S.enablePrintTemplate && !M.value ? [
|
|
2309
2292
|
{
|
|
2310
2293
|
label: h("inventory.transfer.receiveRequest.bulk.downloadAll"),
|
|
2311
2294
|
value: "downloadAll",
|
|
2312
2295
|
prependIcon: "download"
|
|
2313
2296
|
}
|
|
2314
2297
|
] : [],
|
|
2315
|
-
...S.enablePurchaseOrderEmail && !
|
|
2298
|
+
...S.enablePurchaseOrderEmail && !M.value ? [
|
|
2316
2299
|
{
|
|
2317
2300
|
label: h("inventory.transfer.receiveRequest.bulk.emailAll"),
|
|
2318
2301
|
value: "emailAll",
|
|
@@ -2340,7 +2323,7 @@ const qs = {
|
|
|
2340
2323
|
values: Array.from(
|
|
2341
2324
|
new Set(
|
|
2342
2325
|
l.purchaseOrders.value.map((B) => {
|
|
2343
|
-
const K =
|
|
2326
|
+
const K = C.locations.find((G) => G.dbName === B._locationDbName);
|
|
2344
2327
|
return (K == null ? void 0 : K.name) ?? B._locationDbName;
|
|
2345
2328
|
})
|
|
2346
2329
|
)
|
|
@@ -2352,8 +2335,8 @@ const qs = {
|
|
|
2352
2335
|
key: "netsuiteTransactionNumber",
|
|
2353
2336
|
entity: "purchaseOrder",
|
|
2354
2337
|
values: l.purchaseOrders.value.map((B) => {
|
|
2355
|
-
var K,
|
|
2356
|
-
return (
|
|
2338
|
+
var K, G;
|
|
2339
|
+
return (G = (K = B.netSuite) == null ? void 0 : K.additionalInfo) == null ? void 0 : G.transactionnumber;
|
|
2357
2340
|
}).filter((B) => B != null)
|
|
2358
2341
|
},
|
|
2359
2342
|
{
|
|
@@ -2375,16 +2358,16 @@ const qs = {
|
|
|
2375
2358
|
}).filter((B) => B != null)
|
|
2376
2359
|
}
|
|
2377
2360
|
];
|
|
2378
|
-
return [...P, ...
|
|
2379
|
-
}), Oe =
|
|
2361
|
+
return [...P, ...z.isEnabled ? F : []];
|
|
2362
|
+
}), Oe = k(null), Se = L(() => {
|
|
2380
2363
|
if (!Oe.value) return l.purchaseOrders.value;
|
|
2381
|
-
const P =
|
|
2364
|
+
const P = _n.build(Oe.value);
|
|
2382
2365
|
return l.purchaseOrders.value.filter((F) => {
|
|
2383
|
-
var K,
|
|
2384
|
-
const B = ((K =
|
|
2385
|
-
return
|
|
2366
|
+
var K, G, ee, Re, we;
|
|
2367
|
+
const B = ((K = C.locations.find((j) => j.dbName === F._locationDbName)) == null ? void 0 : K.name) ?? F._locationDbName;
|
|
2368
|
+
return wn(
|
|
2386
2369
|
{
|
|
2387
|
-
netsuiteTransactionNumber: (
|
|
2370
|
+
netsuiteTransactionNumber: (ee = (G = F.netSuite) == null ? void 0 : G.additionalInfo) == null ? void 0 : ee.transactionnumber,
|
|
2388
2371
|
netsuiteOrderNo: (Re = F.netSuite) == null ? void 0 : Re.refNo,
|
|
2389
2372
|
netsuiteOrderId: (we = F.netSuite) == null ? void 0 : we.id,
|
|
2390
2373
|
status: F.status,
|
|
@@ -2396,22 +2379,22 @@ const qs = {
|
|
|
2396
2379
|
});
|
|
2397
2380
|
});
|
|
2398
2381
|
return (P, F) => {
|
|
2399
|
-
const B = Ce("FmIcon"), K = Ce("FmTextField"),
|
|
2400
|
-
return m(),
|
|
2382
|
+
const B = Ce("FmIcon"), K = Ce("FmTextField"), G = Ce("FmButton"), ee = Ce("FmTable"), Re = Ce("FmCircularProgress");
|
|
2383
|
+
return m(), le(rn, {
|
|
2401
2384
|
title: t(h)("inventory.transfer.receiveRequest.bulk.title"),
|
|
2402
|
-
actions:
|
|
2403
|
-
"onClick:action":
|
|
2385
|
+
actions: Ge.value,
|
|
2386
|
+
"onClick:action": _e
|
|
2404
2387
|
}, {
|
|
2405
2388
|
default: Pe(() => {
|
|
2406
2389
|
var we;
|
|
2407
2390
|
return [
|
|
2408
|
-
t(S).isLoaded && !t(S).enableReceiveRequestBeta ? (m(), y("div",
|
|
2391
|
+
t(S).isLoaded && !t(S).enableReceiveRequestBeta ? (m(), y("div", ea, [
|
|
2409
2392
|
E(B, {
|
|
2410
2393
|
name: "block",
|
|
2411
2394
|
size: "xl"
|
|
2412
2395
|
}),
|
|
2413
2396
|
F[9] || (F[9] = e("p", { class: "fm-typo-en-body-md-400" }, "Not available", -1))
|
|
2414
|
-
])) : t(S).enableReceiveRequestBeta ? (m(), y(
|
|
2397
|
+
])) : t(S).enableReceiveRequestBeta ? (m(), y(ye, { key: 1 }, [
|
|
2415
2398
|
e("div", {
|
|
2416
2399
|
class: J(["flex flex-col gap-8 max-h-full", { "p-0": ge.value, "px-24": !ge.value }])
|
|
2417
2400
|
}, [
|
|
@@ -2431,29 +2414,29 @@ const qs = {
|
|
|
2431
2414
|
e("div", {
|
|
2432
2415
|
class: J(["flex gap-8 items-center", { "w-full overflow-x-auto": ge.value }])
|
|
2433
2416
|
}, [
|
|
2434
|
-
E(
|
|
2435
|
-
modelValue: t(
|
|
2436
|
-
"onUpdate:modelValue": F[0] || (F[0] = (j) => bt(
|
|
2417
|
+
E(gs, {
|
|
2418
|
+
modelValue: t(V),
|
|
2419
|
+
"onUpdate:modelValue": F[0] || (F[0] = (j) => bt(V) ? V.value = j : null),
|
|
2437
2420
|
locations: R.value
|
|
2438
2421
|
}, null, 8, ["modelValue", "locations"]),
|
|
2439
|
-
E(
|
|
2440
|
-
"model-value":
|
|
2441
|
-
"onUpdate:modelValue": F[1] || (F[1] = (j) =>
|
|
2422
|
+
E(jt, {
|
|
2423
|
+
"model-value": ne.value,
|
|
2424
|
+
"onUpdate:modelValue": F[1] || (F[1] = (j) => ne.value = j)
|
|
2442
2425
|
}, null, 8, ["model-value"])
|
|
2443
2426
|
], 2),
|
|
2444
|
-
e("div",
|
|
2445
|
-
e("div",
|
|
2446
|
-
E(t(
|
|
2427
|
+
e("div", ta, [
|
|
2428
|
+
e("div", na, [
|
|
2429
|
+
E(t(kn), {
|
|
2447
2430
|
modelValue: Oe.value,
|
|
2448
2431
|
"onUpdate:modelValue": F[2] || (F[2] = (j) => Oe.value = j),
|
|
2449
2432
|
attributes: qe.value
|
|
2450
2433
|
}, null, 8, ["modelValue", "attributes"])
|
|
2451
2434
|
]),
|
|
2452
|
-
ge.value ? D("", !0) : (m(), y("div",
|
|
2453
|
-
e("div",
|
|
2435
|
+
ge.value ? D("", !0) : (m(), y("div", oa)),
|
|
2436
|
+
e("div", sa, [
|
|
2454
2437
|
E(K, {
|
|
2455
|
-
"model-value":
|
|
2456
|
-
"onUpdate:modelValue": F[3] || (F[3] = (j) =>
|
|
2438
|
+
"model-value": ve.value,
|
|
2439
|
+
"onUpdate:modelValue": F[3] || (F[3] = (j) => ve.value = j),
|
|
2457
2440
|
"prepend-icon": "search",
|
|
2458
2441
|
placeholder: t(h)("inventory.common.table.toolbar.filterItems"),
|
|
2459
2442
|
class: "w-full"
|
|
@@ -2462,15 +2445,15 @@ const qs = {
|
|
|
2462
2445
|
])
|
|
2463
2446
|
], 2)
|
|
2464
2447
|
], 512),
|
|
2465
|
-
t(
|
|
2448
|
+
t(V).length === 0 && !M.value ? (m(), y("div", aa, [
|
|
2466
2449
|
E(B, {
|
|
2467
2450
|
name: "storefront",
|
|
2468
2451
|
size: "xl"
|
|
2469
2452
|
}),
|
|
2470
|
-
e("p",
|
|
2471
|
-
])) : (m(), y("div",
|
|
2472
|
-
(
|
|
2473
|
-
e("div",
|
|
2453
|
+
e("p", ra, p(t(h)("inventory.transfer.receiveRequest.bulk.selectLocationsHint")), 1)
|
|
2454
|
+
])) : (m(), y("div", la, [
|
|
2455
|
+
(M.value || t(l).retryingFailed.value) && t(l).fetchProgress.value ? (m(), y("div", ia, [
|
|
2456
|
+
e("div", ua, [
|
|
2474
2457
|
e("div", {
|
|
2475
2458
|
class: "h-full rounded-full bg-fm-color-primary transition-all duration-300",
|
|
2476
2459
|
style: mt({
|
|
@@ -2478,65 +2461,65 @@ const qs = {
|
|
|
2478
2461
|
})
|
|
2479
2462
|
}, null, 4)
|
|
2480
2463
|
]),
|
|
2481
|
-
e("span",
|
|
2464
|
+
e("span", ca, p(t(l).fetchProgress.value.done) + "/" + p(t(l).fetchProgress.value.total) + " locations ", 1)
|
|
2482
2465
|
])) : D("", !0),
|
|
2483
|
-
t(l).failedLocations.value.length > 0 ? (m(), y("div",
|
|
2484
|
-
e("span",
|
|
2485
|
-
|
|
2466
|
+
t(l).failedLocations.value.length > 0 ? (m(), y("div", da, [
|
|
2467
|
+
e("span", ma, " Failed to load: " + p(be.value), 1),
|
|
2468
|
+
he.value ? (m(), le(G, {
|
|
2486
2469
|
key: 0,
|
|
2487
2470
|
variant: "secondary",
|
|
2488
|
-
disabled: t(l).retryingFailed.value ||
|
|
2471
|
+
disabled: t(l).retryingFailed.value || M.value,
|
|
2489
2472
|
label: t(l).retryingFailed.value ? "Retrying…" : "Retry failed locations",
|
|
2490
2473
|
onClick: t(l).retryFailedLocations
|
|
2491
2474
|
}, null, 8, ["disabled", "label", "onClick"])) : D("", !0)
|
|
2492
2475
|
])) : D("", !0),
|
|
2493
|
-
E(
|
|
2476
|
+
E(ee, {
|
|
2494
2477
|
style: mt(t(Fe).tableHeight),
|
|
2495
|
-
"column-defs": t(
|
|
2478
|
+
"column-defs": t(v),
|
|
2496
2479
|
"row-data": Se.value,
|
|
2497
|
-
"search-value":
|
|
2498
|
-
loading:
|
|
2480
|
+
"search-value": ve.value,
|
|
2481
|
+
loading: M.value,
|
|
2499
2482
|
onRowClick: F[6] || (F[6] = (j) => t(l).promptShowTransferDetails(j.original)),
|
|
2500
|
-
"page-size":
|
|
2483
|
+
"page-size": $e.value
|
|
2501
2484
|
}, {
|
|
2502
2485
|
"list-row": Pe((j) => [
|
|
2503
|
-
E(
|
|
2486
|
+
E(xn, {
|
|
2504
2487
|
row: j,
|
|
2505
2488
|
onRowClick: t(l).promptShowTransferDetails
|
|
2506
2489
|
}, {
|
|
2507
|
-
default: Pe((
|
|
2508
|
-
var Be, Te, r, u, b, T, I,
|
|
2490
|
+
default: Pe((ae) => {
|
|
2491
|
+
var Be, Te, r, u, b, T, I, q, W, Q, A, Z, U, re, Je, Ie, Le, Ne, ke, ze, Me, je, We, x, oe;
|
|
2509
2492
|
return [
|
|
2510
|
-
e("div",
|
|
2511
|
-
e("div",
|
|
2512
|
-
E(t(
|
|
2513
|
-
render: (r = (Te = (Be =
|
|
2514
|
-
props: (b = (u =
|
|
2493
|
+
e("div", fa, [
|
|
2494
|
+
e("div", pa, [
|
|
2495
|
+
E(t(Ze), {
|
|
2496
|
+
render: (r = (Te = (Be = ae._id) == null ? void 0 : Be.column) == null ? void 0 : Te.columnDef) == null ? void 0 : r.cell,
|
|
2497
|
+
props: (b = (u = ae._id) == null ? void 0 : u.getContext) == null ? void 0 : b.call(u)
|
|
2515
2498
|
}, null, 8, ["render", "props"])
|
|
2516
2499
|
]),
|
|
2517
|
-
e("div",
|
|
2518
|
-
E(t(
|
|
2519
|
-
render: (
|
|
2520
|
-
props: (Q = (W =
|
|
2500
|
+
e("div", va, [
|
|
2501
|
+
E(t(Ze), {
|
|
2502
|
+
render: (q = (I = (T = ae.location) == null ? void 0 : T.column) == null ? void 0 : I.columnDef) == null ? void 0 : q.cell,
|
|
2503
|
+
props: (Q = (W = ae.location) == null ? void 0 : W.getContext) == null ? void 0 : Q.call(W)
|
|
2521
2504
|
}, null, 8, ["render", "props"])
|
|
2522
2505
|
]),
|
|
2523
|
-
e("div",
|
|
2524
|
-
E(t(
|
|
2525
|
-
render: (
|
|
2526
|
-
props: (Je = (
|
|
2506
|
+
e("div", ya, [
|
|
2507
|
+
E(t(Ze), {
|
|
2508
|
+
render: (U = (Z = (A = ae.supplier_name) == null ? void 0 : A.column) == null ? void 0 : Z.columnDef) == null ? void 0 : U.cell,
|
|
2509
|
+
props: (Je = (re = ae.supplier_name) == null ? void 0 : re.getContext) == null ? void 0 : Je.call(re)
|
|
2527
2510
|
}, null, 8, ["render", "props"])
|
|
2528
2511
|
]),
|
|
2529
|
-
e("div",
|
|
2530
|
-
j.original.ref ? (m(), y("div",
|
|
2531
|
-
E(t(
|
|
2532
|
-
render: (Ne = (Le = (Ie =
|
|
2533
|
-
props: (ze = (ke =
|
|
2512
|
+
e("div", ba, p(j.original.items.map((ie) => `${ie.name}`).join(", ")), 1),
|
|
2513
|
+
j.original.ref ? (m(), y("div", ha, [
|
|
2514
|
+
E(t(Ze), {
|
|
2515
|
+
render: (Ne = (Le = (Ie = ae.ref) == null ? void 0 : Ie.column) == null ? void 0 : Le.columnDef) == null ? void 0 : Ne.cell,
|
|
2516
|
+
props: (ze = (ke = ae.ref) == null ? void 0 : ke.getContext) == null ? void 0 : ze.call(ke)
|
|
2534
2517
|
}, null, 8, ["render", "props"])
|
|
2535
2518
|
])) : D("", !0),
|
|
2536
|
-
e("div",
|
|
2537
|
-
E(t(
|
|
2538
|
-
render: (We = (je = (Me =
|
|
2539
|
-
props: (
|
|
2519
|
+
e("div", ga, [
|
|
2520
|
+
E(t(Ze), {
|
|
2521
|
+
render: (We = (je = (Me = ae.status) == null ? void 0 : Me.column) == null ? void 0 : je.columnDef) == null ? void 0 : We.cell,
|
|
2522
|
+
props: (oe = (x = ae.status) == null ? void 0 : x.getContext) == null ? void 0 : oe.call(x)
|
|
2540
2523
|
}, null, 8, ["render", "props"])
|
|
2541
2524
|
])
|
|
2542
2525
|
])
|
|
@@ -2547,11 +2530,11 @@ const qs = {
|
|
|
2547
2530
|
]),
|
|
2548
2531
|
_: 1
|
|
2549
2532
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]),
|
|
2550
|
-
t(l).rowAction.pending.value ? (m(), y("div",
|
|
2551
|
-
e("div",
|
|
2533
|
+
t(l).rowAction.pending.value ? (m(), y("div", xa, [
|
|
2534
|
+
e("div", _a, [
|
|
2552
2535
|
E(Re, { size: "md" }),
|
|
2553
|
-
e("span",
|
|
2554
|
-
E(
|
|
2536
|
+
e("span", wa, p(t(h)("inventory.common.loading")), 1),
|
|
2537
|
+
E(G, {
|
|
2555
2538
|
variant: "secondary",
|
|
2556
2539
|
label: t(h)("inventory.common.cancel"),
|
|
2557
2540
|
onClick: t(l).rowAction.cancel
|
|
@@ -2560,28 +2543,28 @@ const qs = {
|
|
|
2560
2543
|
])) : D("", !0)
|
|
2561
2544
|
]))
|
|
2562
2545
|
], 2),
|
|
2563
|
-
(m(),
|
|
2564
|
-
E(
|
|
2565
|
-
t(S).enablePurchaseOrderEmail ? (m(),
|
|
2566
|
-
E(
|
|
2546
|
+
(m(), le(lt, { to: "body" }, [
|
|
2547
|
+
E(Zs),
|
|
2548
|
+
t(S).enablePurchaseOrderEmail ? (m(), le(fn, ht(ct({ key: 0 }, t(l).emailDialogProps.value)), null, 16)) : D("", !0),
|
|
2549
|
+
E(cs, {
|
|
2567
2550
|
show: g.value,
|
|
2568
2551
|
"onUpdate:show": F[7] || (F[7] = (j) => g.value = j),
|
|
2569
2552
|
"last-closing-date": t(l).lastClosingDate.value,
|
|
2570
|
-
"selected-outlet-ids":
|
|
2553
|
+
"selected-outlet-ids": de.value,
|
|
2571
2554
|
onSubmitted: t(l).fetchData
|
|
2572
2555
|
}, null, 8, ["show", "last-closing-date", "selected-outlet-ids", "onSubmitted"]),
|
|
2573
|
-
E(
|
|
2556
|
+
E(pn, ct(t(l).transferDialogProps.value, {
|
|
2574
2557
|
onSubmitted: t(l).fetchData
|
|
2575
2558
|
}), null, 16, ["onSubmitted"]),
|
|
2576
|
-
t(l).transferDetailsProps.value != null ? (m(),
|
|
2559
|
+
t(l).transferDetailsProps.value != null ? (m(), le(en, ct({ key: 1 }, {
|
|
2577
2560
|
...t(l).transferDetailsProps.value,
|
|
2578
2561
|
receivedMap: ((we = t(l).transferDetailsProps.value) == null ? void 0 : we.receivedMap) ?? {},
|
|
2579
2562
|
shipments: t(l).shipments.value ?? []
|
|
2580
2563
|
}, {
|
|
2581
2564
|
onSubmitted: t(l).fetchData
|
|
2582
2565
|
}), null, 16, ["onSubmitted"])) : D("", !0),
|
|
2583
|
-
E(
|
|
2584
|
-
E(
|
|
2566
|
+
E(vn, ht(Bt(t(l).xilnexImportDialogProps.value)), null, 16),
|
|
2567
|
+
E(hs, {
|
|
2585
2568
|
modelValue: t(f),
|
|
2586
2569
|
"onUpdate:modelValue": F[8] || (F[8] = (j) => bt(f) ? f.value = j : null),
|
|
2587
2570
|
loading: t(d),
|
|
@@ -2597,5 +2580,5 @@ const qs = {
|
|
|
2597
2580
|
}
|
|
2598
2581
|
});
|
|
2599
2582
|
export {
|
|
2600
|
-
|
|
2583
|
+
Za as default
|
|
2601
2584
|
};
|