@feedmepos/mf-inventory-portal 1.9.0-dev.2 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-0333Hh25.js → App-CjEtCJ3u.js} +10 -10
- package/dist/{ApprovalView-CZLYqnnT.js → ApprovalView-CWeB-z4R.js} +9 -9
- package/dist/{BindingsDialog-CA02lqel.js → BindingsDialog-B2WXjWQ0.js} +2 -2
- package/dist/{BindingsPicker-CwDLZ-ki.js → BindingsPicker-DTc0Q5Em.js} +2 -2
- package/dist/{BindingsTable-BX87v_kq.js → BindingsTable-x1FRAcgJ.js} +4 -4
- package/dist/{BulkReceiveRequestPage-Vh0Rfa8e.js → BulkReceiveRequestPage-Dk4K_vUX.js} +1022 -1047
- package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-0fI4-Pao.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-CPGujVFu.js} +1 -1
- package/dist/{ClosingDraftView-CxNgkVY_.js → ClosingDraftView-BqpTn8dY.js} +19 -19
- package/dist/{ClosingHistoryView-CUCepuA7.js → ClosingHistoryView-BJQWFz5X.js} +7 -7
- package/dist/ClosingTemplateView-Pj1Kj49d.js +2392 -0
- package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-B6Ge_6VY.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-Dxt4x9Ia.js} +1 -1
- package/dist/{DefaultView-V-9a_YfK.js → DefaultView-BIyIubVt.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-BiwT9953.js → DeliveryOrderPrintPreview-2nIVkxIe.js} +2 -2
- package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-I_6Wu-P-.js → EmailDialog.vue_vue_type_script_setup_true_lang-BnJdt92Q.js} +9769 -9731
- package/dist/{FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-BV5mX5w5.js → FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-FraKTknm.js} +1 -1
- package/dist/{FeatureCapabilityGate-B4VGdv_F.js → FeatureCapabilityGate-6_6psomb.js} +2 -2
- package/dist/{FeaturePageGate.vue_vue_type_script_setup_true_lang-CvFbN-7h.js → FeaturePageGate.vue_vue_type_script_setup_true_lang-CbrcFNoj.js} +1 -1
- package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-Qd3R-TWu.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-B-wMlDXd.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C8QTtw9i.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CxOLg-J3.js} +2 -2
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Cz5saN2u.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BeIfx9jE.js} +2 -2
- package/dist/{FmMultiselectDialog-BK0r-tyZ.js → FmMultiselectDialog-CcH__ggk.js} +2 -2
- package/dist/{FmMultiselectDialog-CFx8Qcyc.js → FmMultiselectDialog-snxpWhRm.js} +2 -2
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-Cuyu_K9x.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DHlqvBTh.js} +5 -5
- package/dist/{ImportView-Ci9vufCx.js → ImportView-C7KyQ6wA.js} +7 -7
- package/dist/{IngredientsView-4s7vcW9U.js → IngredientsView-z4pObocZ.js} +15 -15
- package/dist/{IntegrationExplorerView-CtGuW0uI.js → IntegrationExplorerView-thWjNTPa.js} +6 -6
- package/dist/{IntegrationPlatformView-SpCAu3Fu.js → IntegrationPlatformView-BDe83nB1.js} +4472 -4425
- package/dist/{IntegrationView-DjQ4wbXh.js → IntegrationView-CyR9BK3D.js} +15 -15
- package/dist/{InventoryBindingForm-Bb5k9tav.js → InventoryBindingForm-CjTZYqzB.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CISHYfRi.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DzXGyj0H.js} +4 -4
- package/dist/{InventoryBindingSummary-CkN9QdNL.js → InventoryBindingSummary-CnLEvpRL.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-C9hasqsO.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DpysXAz4.js} +2 -2
- package/dist/{ProductionRunDetailPage-BTNY3v9C.js → ProductionRunDetailPage-DqlFNDov.js} +4 -4
- package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-CTOibYjJ.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-D-GoCIbB.js} +8 -8
- package/dist/{ProductionRunPage-GrWt4iw2.js → ProductionRunPage-xr34sye0.js} +4 -4
- package/dist/{PublishView-1sBMVk4p.js → PublishView-CfuP-tjm.js} +15 -15
- package/dist/{PurchaseOrderPrintPreview-DYwbSUVy.js → PurchaseOrderPrintPreview-DjAxJ2cK.js} +2 -2
- package/dist/ReceiveRequestView-CVw76dPw.js +692 -0
- package/dist/{RecipeView-CGkE2cX2.js → RecipeView-UlHc-Voo.js} +16 -16
- package/dist/{SettingsView-j5UKU2Z5.js → SettingsView-C1OGXlIE.js} +7 -7
- package/dist/{StockView-CMYUShkK.js → StockView-CrKLqz-6.js} +543 -543
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CcomAJoj.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Cm5vtlP6.js} +1 -1
- package/dist/{SupplierView-whYEtaTf.js → SupplierView-DhH5eT5y.js} +13 -13
- package/dist/{SurchargeView-BqT_PfTk.js → SurchargeView-ByKH6JnI.js} +7 -7
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-CpiuOVuT.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-ZSuKa-oz.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-C5GOz40T.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CHvqcU44.js} +1 -1
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-CHyAdS3A.js +5002 -0
- package/dist/{TransferTemplateView-ZJYWzTCZ.js → TransferTemplateView-DJ1XO2Vg.js} +19 -19
- package/dist/{UnitCostHistoryView-DWcB9nbL.js → UnitCostHistoryView-CrBs_s0L.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-60B3tkI-.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-DRJptXCQ.js} +4 -4
- package/dist/{UnitView-BWX8BecE.js → UnitView--PWg-4ON.js} +7 -7
- package/dist/{WarehouseView-CfWLJlP2.js → WarehouseView-DoOwa0Zq.js} +8 -8
- package/dist/{WastageTemplateView-Gb64MBgD.js → WastageTemplateView-CiLs8nAz.js} +15 -15
- package/dist/api/purchase-order-template.d.ts +1 -1
- package/dist/{app-Coquqqkh.js → app-CFO3QhF-.js} +7558 -6916
- package/dist/app.d.ts +8 -0
- package/dist/app.js +1 -1
- package/dist/{bulk-edit-simulation.helper-DUAiYzrr.js → bulk-edit-simulation.helper-BjYd_yK4.js} +2 -2
- package/dist/{closing-template-BK-yS2H4.js → closing-template-DXfmztnK.js} +1 -1
- package/dist/{date2-79rkBzVf.js → date2-BMfqPhRQ.js} +1 -1
- package/dist/{dayjs.min-CciBGvaL.js → dayjs.min-BVjxIhrP.js} +1 -1
- package/dist/{decimal--BREmfoS.js → decimal-Drh1-c85.js} +2 -2
- package/dist/{defineDeepModel-BRSFHwsW.js → defineDeepModel-BuNVB2KT.js} +1 -1
- package/dist/{duplicate-template-CcEqsP8Q.js → duplicate-template-Dua82hTr.js} +1 -1
- package/dist/{feature-DdZZAV6X.js → feature-C1JuDWvs.js} +3 -3
- package/dist/feature-flags/plan-tier.d.ts +0 -2
- package/dist/{format-time-from-id-C7YvcXDM.js → format-time-from-id-Cq6U2Bxo.js} +1 -1
- package/dist/{format-unit-display-Dfiq_rw7.js → format-unit-display-DQLT3yWg.js} +99 -101
- package/dist/{id-to-date-6hzUYycs.js → id-to-date-F63bzmo9.js} +1 -1
- package/dist/{import-export.helper-D5QuDEDV.js → import-export.helper-C-wM1uvH.js} +5 -5
- package/dist/{index-CD9IHjp3.js → index-BI_mOT-T.js} +1 -1
- package/dist/{index-CPFsBIFO.js → index-CUK2ixs-.js} +3 -3
- package/dist/{index-Crdk73ES.js → index-CvbK4SMT.js} +1 -1
- package/dist/{lz-string-CCRQaGZF.js → lz-string-DaX9t6Vd.js} +1 -1
- package/dist/{netsuite-C_VLrQoH.js → netsuite-Zrpzr6d8.js} +2522 -2505
- package/dist/{netsuite-explorer-BCuM8JZ1.js → netsuite-explorer-C3fHF-PT.js} +1 -1
- package/dist/{predefined-templates-BV4NkB9O.js → predefined-templates-DG6CeFks.js} +1 -1
- package/dist/{publish-versions-BinCKAtn.js → publish-versions-Cr7-V-Br.js} +1 -1
- package/dist/purchase-order-template-wj3XUGRR.js +41 -0
- package/dist/{recalculationUtils-ISOYv_rW.js → recalculationUtils-B2fP6IRt.js} +1 -1
- package/dist/{row-action.enum-BQCb8S3i.js → row-action.enum-fy5kNv1e.js} +1 -1
- package/dist/{rules-CW08Pe1t.js → rules-BbnkP4bE.js} +3 -3
- package/dist/{stock-Bh5IJNfM.js → stock-2HrEwnse.js} +1 -1
- package/dist/{stock-Cv_zWpOe.js → stock-qgCoZCip.js} +2 -2
- package/dist/stores/inventory.in-flight.spec.d.ts +1 -0
- package/dist/{supplier-D3h2DfJz.js → supplier-jSpdakxP.js} +2 -2
- package/dist/{surcharge-9e8wa-vK.js → surcharge-BUcmyVUD.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-BRmDOW0t.js → uom-rules-CRVV9zbT.js} +1 -1
- package/dist/{use-ingredient-select-dialog-D8ibotty.js → use-ingredient-select-dialog-BEpP8U3E.js} +2 -2
- package/dist/{use-inventory-binding-dialog-D2xL-vbo.js → use-inventory-binding-dialog-C71O7N8L.js} +2 -2
- package/dist/{use-template-enabled-locations-Bb7vUiAf.js → use-template-enabled-locations-DIN3OgYg.js} +2 -2
- package/dist/{use-transfer-locations-B2yday-I.js → use-transfer-locations-Bp60KXqJ.js} +2 -2
- package/dist/{useHrmPermission-CPEJKpoy.js → useHrmPermission-isSBKi_1.js} +1 -1
- package/dist/{useNavigationMenu-SHKOcKP-.js → useNavigationMenu-B7i0bnUj.js} +5 -5
- package/dist/{useSseClient-ED9mFSXt.js → useSseClient-DOVhr07c.js} +1 -1
- package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +5 -0
- package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.spec.d.ts +1 -0
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-total-cost.d.ts +24 -0
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-total-cost.spec.d.ts +1 -0
- package/dist/views/receive-request/helper/purchase-export.d.ts +26 -0
- package/dist/views/receive-request/helper/purchase-export.spec.d.ts +1 -0
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +3 -3
- package/dist/{vue-Tmyz7_6a.js → vue-XyWi0ihT.js} +37 -30
- package/dist/{vue-i18n-BY0GeUdz.js → vue-i18n-B1LiOy9S.js} +479 -479
- package/dist/{xlsx.util-DQnB9ape.js → xlsx.util-CLxGkNhJ.js} +2 -2
- package/package.json +5 -7
- package/dist/ClosingTemplateView-BHe5gCFH.js +0 -2358
- package/dist/ReceiveRequestView-DuU5hqQU.js +0 -729
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-ajtRmauo.js +0 -4961
- package/dist/purchase-order-template-BZUOWGmV.js +0 -41
|
@@ -1,107 +1,105 @@
|
|
|
1
|
-
import { defineComponent as at, ref as P, onBeforeUnmount as
|
|
2
|
-
import { a as
|
|
3
|
-
import { u as
|
|
4
|
-
import { u as mt, a as
|
|
5
|
-
import { i as _t, _ as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { u as
|
|
17
|
-
import { u as
|
|
18
|
-
import { b as
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { b as Lt, a as Un } from "./format-unit-display-Dfiq_rw7.js";
|
|
22
|
-
import { _ as Vn } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-gJQQKKAC.js";
|
|
1
|
+
import { defineComponent as at, ref as P, onBeforeUnmount as Yt, computed as A, watch as Qe, createElementBlock as y, openBlock as i, Fragment as Se, createBlock as pe, createVNode as E, Teleport as dt, Transition as Ht, withCtx as Ae, createCommentVNode as q, createElementVNode as e, toDisplayString as p, unref as n, normalizeClass as Q, createTextVNode as rt, renderList as tt, withModifiers as Qt, mergeModels as Gt, useModel as Kt, resolveComponent as Oe, getCurrentScope as Xt, onScopeDispose as Zt, h as qe, onMounted as en, onUnmounted as tn, normalizeStyle as gt, watchEffect as nn, isRef as Rt, normalizeProps as Pt, mergeProps as yt, guardReactiveProps as an } from "vue";
|
|
2
|
+
import { a as sn } from "./FeaturePageGate.vue_vue_type_script_setup_true_lang-CbrcFNoj.js";
|
|
3
|
+
import { u as rn, l as on } from "./netsuite-Zrpzr6d8.js";
|
|
4
|
+
import { u as mt, a as ln, G as un, a1 as Dt, t as cn, a2 as Ke, q as dn, c as mn, D as ut, x as fn } from "./app-CFO3QhF-.js";
|
|
5
|
+
import { i as _t, _ as pn } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-B-wMlDXd.js";
|
|
6
|
+
import { d as vn, u as yn, _ as bn, a as hn, c as gn, p as _n } from "./EmailDialog.vue_vue_type_script_setup_true_lang-BnJdt92Q.js";
|
|
7
|
+
import { d as Xe } from "./dayjs.min-BVjxIhrP.js";
|
|
8
|
+
import { e as xn } from "./UnitDisplayControl.vue_vue_type_script_setup_true_lang-DRJptXCQ.js";
|
|
9
|
+
import { u as wn } from "./useTabStorage-BkIVScW_.js";
|
|
10
|
+
import { u as qt, _ as kn } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
|
|
11
|
+
import { components as Cn, useSnackbar as ft, useDialog as Fn, useBreakpoints as Sn } from "@feedmepos/ui-library";
|
|
12
|
+
import { useI18n as it, useCoreStore as Ot } from "@feedmepos/mf-common";
|
|
13
|
+
import { u as At, a as Rn } from "./supplier-jSpdakxP.js";
|
|
14
|
+
import { u as xt, P as Pn } from "./feature-C1JuDWvs.js";
|
|
15
|
+
import { b as Dn } from "./vue-XyWi0ihT.js";
|
|
16
|
+
import { u as qn } from "./stock-2HrEwnse.js";
|
|
17
|
+
import { u as nt } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-ZSuKa-oz.js";
|
|
18
|
+
import { b as Tt, a as En } from "./format-unit-display-DQLT3yWg.js";
|
|
19
|
+
import { b as Nn, d as $n, c as Bn, e as On, g as An, P as It, f as Tn, a as In, _ as Ln } from "./TransferDetails.vue_vue_type_script_setup_true_lang-CHyAdS3A.js";
|
|
20
|
+
import { _ as zn } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-gJQQKKAC.js";
|
|
23
21
|
import { F as ot } from "./index-eGvSlWMU.js";
|
|
24
|
-
import { P as
|
|
25
|
-
import { a as
|
|
26
|
-
import { F as
|
|
27
|
-
import { p as
|
|
28
|
-
import { defineStore as
|
|
29
|
-
import { u as
|
|
30
|
-
import { u as
|
|
31
|
-
import { R as ct, D as
|
|
32
|
-
import { u as
|
|
33
|
-
const
|
|
22
|
+
import { P as Mn, J as Un, D as Vn } from "./app-C39bYJmq.js";
|
|
23
|
+
import { a as Jn, t as jn } from "./date2-BMfqPhRQ.js";
|
|
24
|
+
import { F as Et } from "./form-mode.enum-BKiNVH6A.js";
|
|
25
|
+
import { p as Wn } from "./format-time-from-id-Cq6U2Bxo.js";
|
|
26
|
+
import { defineStore as Yn } from "pinia";
|
|
27
|
+
import { u as Hn } from "./useSseClient-DOVhr07c.js";
|
|
28
|
+
import { u as Qn } from "./use-row-action-Cvq6VO38.js";
|
|
29
|
+
import { R as ct, D as Gn } from "./row-action.enum-fy5kNv1e.js";
|
|
30
|
+
import { u as Kn } from "./vue-i18n-B1LiOy9S.js";
|
|
31
|
+
const Xn = {
|
|
34
32
|
key: 0,
|
|
35
33
|
class: "fixed inset-0 z-[200] bg-white flex flex-col overflow-hidden",
|
|
36
34
|
style: { "font-family": "Inter, sans-serif" }
|
|
37
|
-
},
|
|
35
|
+
}, Zn = {
|
|
38
36
|
key: 0,
|
|
39
37
|
class: "flex items-center justify-between px-24 h-[64px] border-b border-[#F0F0F0] shrink-0 bg-white"
|
|
40
|
-
},
|
|
38
|
+
}, ea = { class: "fm-typo-en-title-md-800 text-[#1C1C1E]" }, ta = { class: "flex items-center gap-8" }, na = {
|
|
41
39
|
key: 1,
|
|
42
40
|
class: "flex items-center justify-center px-32 py-16 border-b border-[#F0F0F0] shrink-0 bg-white"
|
|
43
|
-
},
|
|
41
|
+
}, aa = { class: "flex items-center max-w-[600px] w-full" }, sa = ["disabled"], ra = { key: 1 }, oa = ["disabled"], la = { key: 1 }, ia = {
|
|
44
42
|
class: "flex flex-col items-center gap-4 min-w-0",
|
|
45
43
|
disabled: !0
|
|
46
|
-
},
|
|
44
|
+
}, ua = { class: "flex flex-1 overflow-hidden" }, ca = { class: "flex-1 min-w-0 overflow-y-auto" }, da = {
|
|
47
45
|
key: 0,
|
|
48
46
|
class: "px-32 py-24"
|
|
49
|
-
},
|
|
47
|
+
}, ma = { class: "flex flex-col gap-4 mb-10" }, fa = { class: "fm-typo-en-title-sm-700 text-[#1C1C1E]" }, pa = { class: "fm-typo-en-body-md-400 text-[#4B4B4B]" }, va = {
|
|
50
48
|
key: 0,
|
|
51
49
|
"data-testid": "wizard-destination-checking",
|
|
52
50
|
role: "status",
|
|
53
51
|
class: "flex items-center gap-8 mb-12 fm-typo-en-body-md-400 text-[#6B6C70]"
|
|
54
|
-
},
|
|
52
|
+
}, ya = {
|
|
55
53
|
key: 1,
|
|
56
54
|
"data-testid": "wizard-destination-error",
|
|
57
55
|
role: "alert",
|
|
58
56
|
class: "flex items-center justify-between gap-12 rounded-md border border-red-200 bg-red-50 px-16 py-8 mb-12"
|
|
59
|
-
},
|
|
57
|
+
}, ba = { class: "fm-typo-en-body-md-400 text-red-800" }, ha = {
|
|
60
58
|
key: 2,
|
|
61
59
|
"data-testid": "wizard-destination-unavailable",
|
|
62
60
|
role: "alert",
|
|
63
61
|
class: "rounded-md border border-[#E0E0E0] bg-[#FAFAFA] px-16 py-8 mb-12 fm-typo-en-body-md-400 text-[#4B4B4B]"
|
|
64
|
-
},
|
|
62
|
+
}, ga = { class: "mb-12" }, _a = { class: "border border-[#E0E0E0] rounded-sm overflow-hidden bg-white" }, xa = ["onClick"], wa = { class: "w-32 h-32 rounded-full bg-[#F0F0F0] flex items-center justify-center shrink-0" }, ka = { class: "fm-typo-en-body-xs text-[#6B6C70]" }, Ca = { class: "flex-1 min-w-0" }, Fa = { class: "fm-typo-en-body-md-600 text-[#1C1C1E]" }, Sa = { class: "fm-typo-en-body-sm-400 text-[#6B6C70] truncate" }, Ra = { class: "text-[10px] leading-[12px] font-semibold text-[#6B6C70] bg-[#F6F7F8] px-4 py-1 rounded-[4px] uppercase tracking-[0.08em] shrink-0" }, Pa = {
|
|
65
63
|
key: 0,
|
|
66
64
|
class: "w-[8px] h-[8px] rounded-full bg-[#FF7823]"
|
|
67
|
-
},
|
|
65
|
+
}, Da = {
|
|
68
66
|
key: 0,
|
|
69
67
|
class: "py-40 text-center text-[#B2B3B6] fm-typo-en-body-md-400"
|
|
70
|
-
},
|
|
68
|
+
}, qa = {
|
|
71
69
|
key: 1,
|
|
72
70
|
class: "px-32 py-24"
|
|
73
|
-
},
|
|
71
|
+
}, Ea = { class: "flex flex-col gap-4 mb-12" }, Na = { class: "fm-typo-en-title-sm-700 text-[#1C1C1E]" }, $a = { class: "fm-typo-en-body-md-400 text-[#4B4B4B]" }, Ba = { class: "grid grid-cols-2 gap-12 mb-12" }, Oa = { class: "flex items-start justify-between mb-12" }, Aa = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-4" }, Ta = { class: "fm-typo-en-body-sm-400 text-[#6B6C70]" }, Ia = { class: "flex items-start justify-between mb-12" }, La = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-4" }, za = { class: "fm-typo-en-body-sm-400 text-[#6B6C70]" }, Ma = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-12" }, Ua = {
|
|
74
72
|
key: 0,
|
|
75
73
|
"data-testid": "wizard-template-required",
|
|
76
74
|
class: "fm-typo-en-body-sm-400 text-[#6B6C70] mb-12"
|
|
77
|
-
},
|
|
75
|
+
}, Va = { class: "mb-12" }, Ja = { class: "border border-[#E0E0E0] rounded-xl overflow-hidden bg-white" }, ja = ["onClick"], Wa = { class: "w-32 h-32 rounded-full bg-[#F0F0F0] flex items-center justify-center shrink-0" }, Ya = { class: "fm-typo-en-body-xs-600 text-[#6B6C70]" }, Ha = { class: "flex-1 min-w-0" }, Qa = { class: "fm-typo-en-body-md-600 text-[#1C1C1E]" }, Ga = { class: "fm-typo-en-body-sm-400 text-[#6B6C70] truncate" }, Ka = { class: "text-[10px] leading-[12px] font-semibold text-[#6B6C70] bg-[#F6F7F8] px-4 py-1 rounded-[4px] uppercase tracking-[0.08em] shrink-0" }, Xa = {
|
|
78
76
|
key: 0,
|
|
79
77
|
class: "w-[8px] h-[8px] rounded-full bg-[#FF7823]"
|
|
80
|
-
},
|
|
78
|
+
}, Za = {
|
|
81
79
|
key: 0,
|
|
82
80
|
class: "py-32 text-center text-[#B2B3B6] fm-typo-en-body-md-400"
|
|
83
|
-
},
|
|
81
|
+
}, es = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-12" }, ts = { class: "mb-12" }, ns = {
|
|
84
82
|
key: 0,
|
|
85
83
|
class: "py-32 flex justify-center"
|
|
86
|
-
},
|
|
84
|
+
}, as = {
|
|
87
85
|
key: 1,
|
|
88
86
|
class: "py-32 text-center text-[#B2B3B6] fm-typo-en-body-md-400"
|
|
89
|
-
},
|
|
87
|
+
}, ss = {
|
|
90
88
|
key: 2,
|
|
91
89
|
class: "flex flex-col gap-8"
|
|
92
|
-
},
|
|
90
|
+
}, rs = ["onClick"], os = { class: "flex-1 min-w-0" }, ls = { class: "fm-typo-en-body-md-600 text-[#1C1C1E] mb-2" }, is = { class: "fm-typo-en-body-sm-400 text-[#6B6C70]" }, us = {
|
|
93
91
|
key: 0,
|
|
94
92
|
class: "w-[8px] h-[8px] rounded-full bg-[#FF7823]"
|
|
95
|
-
},
|
|
93
|
+
}, cs = {
|
|
96
94
|
key: 2,
|
|
97
95
|
class: "px-32 py-24"
|
|
98
|
-
},
|
|
96
|
+
}, ds = { class: "flex flex-col gap-4 mb-12" }, ms = { class: "fm-typo-en-title-sm-700 text-[#1C1C1E]" }, fs = { class: "w-[332px] shrink-0 border-l border-[#F0F0F0] overflow-y-auto bg-white" }, ps = { class: "p-4" }, vs = { class: "flex flex-col gap-0 border border-[#E9EAEC] rounded-2xl bg-white overflow-hidden" }, ys = { class: "px-10 py-5 border-b border-[#F0F0F0]" }, bs = { class: "fm-typo-en-body-md-700 text-[#1C1C1E]" }, hs = { class: "flex flex-col gap-0.5 px-10 py-4 border-b border-[#F0F0F0]" }, gs = { class: "text-[11px] leading-[14px] font-medium text-[#6B6C70]" }, _s = {
|
|
99
97
|
key: 0,
|
|
100
98
|
class: "text-[11px] leading-[14px] text-[#6B6C70]"
|
|
101
|
-
},
|
|
99
|
+
}, xs = { class: "flex flex-col gap-0.5 px-10 py-4 border-b border-[#F0F0F0]" }, ws = { class: "text-[11px] leading-[14px] font-medium text-[#6B6C70]" }, ks = { class: "flex flex-col gap-0.5 px-10 py-4 border-b border-[#F0F0F0]" }, Cs = { class: "text-[11px] leading-[14px] font-medium text-[#6B6C70]" }, Fs = {
|
|
102
100
|
key: 0,
|
|
103
101
|
class: "text-[11px] leading-[14px] text-[#6B6C70]"
|
|
104
|
-
},
|
|
102
|
+
}, Ss = { class: "flex items-center justify-between gap-8 px-10 py-4" }, Rs = { class: "text-[15px] leading-[20px] font-semibold text-[#1C1C1E]" }, Ps = { class: "fm-typo-en-title-md-600" }, Ds = { class: "flex flex-col gap-16" }, qs = { class: "fm-typo-en-body-md-400" }, Es = { class: "max-h-[300px] overflow-y-auto" }, Ns = { class: "list-disc pl-16" }, $s = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Bs = { class: "flex w-full gap-8 justify-end" }, Os = /* @__PURE__ */ at({
|
|
105
103
|
__name: "CreateTransferWizard",
|
|
106
104
|
props: {
|
|
107
105
|
show: { type: Boolean },
|
|
@@ -110,91 +108,91 @@ const ta = {
|
|
|
110
108
|
},
|
|
111
109
|
emits: ["update:show", "submitted"],
|
|
112
110
|
setup(C, { emit: _ }) {
|
|
113
|
-
const { FmButton: x, FmDialog:
|
|
114
|
-
let
|
|
115
|
-
function
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
const Ze =
|
|
120
|
-
() =>
|
|
111
|
+
const { FmButton: x, FmDialog: B, FmIcon: $, FmTextField: L } = Cn, G = C, U = _, { t: o } = it(), s = ft(), h = mt(), V = At(), Ce = ln(), m = qn(), d = nt(), b = Tt(), c = xt(), w = Dn("bulk-receive-transfer"), l = P(0), f = P(!1), T = P(null), W = P(""), R = P(null), J = P(null), I = P(null), ae = P(""), ue = P(""), ce = P(!1), de = P(!1), Ue = P(!1), Fe = P(!1), Ve = P(!1), Je = P(/* @__PURE__ */ new Map()), Le = P(), oe = P([]), se = P("idle");
|
|
112
|
+
let ke = null, _e = null;
|
|
113
|
+
function Ee() {
|
|
114
|
+
_e == null || _e.abort(), _e = null;
|
|
115
|
+
}
|
|
116
|
+
Yt(Ee);
|
|
117
|
+
const Ze = A(
|
|
118
|
+
() => se.value === "ready" && c.warehouseRequestRequiresTemplate
|
|
121
119
|
);
|
|
122
|
-
function
|
|
120
|
+
function Ne(t) {
|
|
123
121
|
return !c.warehouseRequestRequiresTemplate || !!t.template || t.supplier.internal === "restaurant";
|
|
124
122
|
}
|
|
125
|
-
function
|
|
123
|
+
function je() {
|
|
126
124
|
var a;
|
|
127
125
|
const t = T.value;
|
|
128
|
-
return !!t &&
|
|
126
|
+
return !!t && se.value === "ready" && ke === t.dbName && ((a = h._currentLocation) == null ? void 0 : a.dbName) === t.dbName && w.state.value === "enabled";
|
|
129
127
|
}
|
|
130
|
-
const N =
|
|
131
|
-
() => !!T.value &&
|
|
132
|
-
), k =
|
|
133
|
-
() => z.value &&
|
|
134
|
-
),
|
|
128
|
+
const N = A(
|
|
129
|
+
() => !!T.value && se.value !== "checking"
|
|
130
|
+
), k = A(() => R.value === "transfer" ? !!J.value : R.value === "template" ? !!I.value : !1), z = A(() => (oe.value.length ? oe.value : Y.value.items ?? []).some((a) => a.quantity.amount > 0)), ne = A(() => ce.value), me = A(
|
|
131
|
+
() => z.value && de.value && Ue.value && !ce.value
|
|
132
|
+
), Te = A(() => l.value === 0 ? N.value : l.value === 1 ? k.value : l.value === 2 ? me.value : !1), We = A(
|
|
135
133
|
() => l.value === 2 ? o("inventory.transfer.receiveRequest.bulk.wizard.createTransferBtn") : o("inventory.transfer.receiveRequest.bulk.wizard.continueBtn")
|
|
136
|
-
),
|
|
134
|
+
), ze = A(
|
|
137
135
|
() => u.value === "Purchase" ? "Purchase method" : "Transfer method"
|
|
138
|
-
),
|
|
136
|
+
), j = A(
|
|
139
137
|
() => u.value === "Purchase" ? "Purchase details" : "Transfer details"
|
|
140
|
-
),
|
|
138
|
+
), xe = A(() => {
|
|
141
139
|
const t = W.value.trim().toLowerCase();
|
|
142
|
-
let a =
|
|
143
|
-
return
|
|
140
|
+
let a = h.locations;
|
|
141
|
+
return G.selectedOutletIds && G.selectedOutletIds.length > 0 && (a = a.filter((S) => G.selectedOutletIds.includes(S.doc._id))), t ? a.filter(
|
|
144
142
|
(S) => S.name.toLowerCase().includes(t) || (S.doc.profile.code ?? "").toLowerCase().includes(t)
|
|
145
143
|
) : a;
|
|
146
|
-
}),
|
|
147
|
-
var
|
|
148
|
-
const t = (
|
|
149
|
-
doc:
|
|
150
|
-
name:
|
|
144
|
+
}), Ge = A(() => {
|
|
145
|
+
var ge;
|
|
146
|
+
const t = (ge = T.value) == null ? void 0 : ge.doc._id, a = V.suppliers.map((ie) => ({
|
|
147
|
+
doc: ie,
|
|
148
|
+
name: ie.name,
|
|
151
149
|
dbName: "",
|
|
152
150
|
type: "supplier",
|
|
153
151
|
acceptRequest: !0
|
|
154
152
|
})), X = [
|
|
155
|
-
...
|
|
153
|
+
...h.allLocations ?? h.locations,
|
|
156
154
|
...a
|
|
157
155
|
].filter(
|
|
158
|
-
(
|
|
159
|
-
), v =
|
|
160
|
-
return v ? X.filter((
|
|
156
|
+
(ie) => ie.doc._id !== t && (!Ze.value || ie.type === "restaurant")
|
|
157
|
+
), v = ae.value.trim().toLowerCase();
|
|
158
|
+
return v ? X.filter((ie) => {
|
|
161
159
|
var He;
|
|
162
|
-
const
|
|
163
|
-
return
|
|
160
|
+
const Ie = ie.type === "supplier" ? "" : ((He = ie.doc.profile) == null ? void 0 : He.code) ?? "";
|
|
161
|
+
return ie.name.toLowerCase().includes(v) || Ie.toLowerCase().includes(v);
|
|
164
162
|
}) : X;
|
|
165
|
-
}), r =
|
|
166
|
-
const t =
|
|
163
|
+
}), r = A(() => {
|
|
164
|
+
const t = ue.value.trim().toLowerCase(), a = b.templates;
|
|
167
165
|
return t ? a.filter((S) => S.name.toLowerCase().includes(t)) : a;
|
|
168
|
-
}), u =
|
|
166
|
+
}), u = A(() => {
|
|
169
167
|
var t;
|
|
170
168
|
if (Y.value.supplier)
|
|
171
169
|
return typeof Y.value.supplier.internal == "string" ? "Transfer" : "Purchase";
|
|
172
|
-
if (R.value === "transfer" &&
|
|
173
|
-
return
|
|
170
|
+
if (R.value === "transfer" && J.value)
|
|
171
|
+
return J.value.type === "supplier" ? "Purchase" : "Transfer";
|
|
174
172
|
if (R.value === "template" && I.value) {
|
|
175
|
-
const a =
|
|
173
|
+
const a = b.templates.find(
|
|
176
174
|
(S) => S._id === I.value
|
|
177
175
|
);
|
|
178
176
|
if ((t = a == null ? void 0 : a.purchaseOrder) != null && t.supplier)
|
|
179
177
|
return typeof a.purchaseOrder.supplier.internal == "string" ? "Transfer" : "Purchase";
|
|
180
178
|
}
|
|
181
179
|
return "Transfer";
|
|
182
|
-
}),
|
|
180
|
+
}), g = A(() => T.value ? T.value.name : o("inventory.transfer.receiveRequest.bulk.wizard.notSelected")), O = A(() => R.value === "transfer" ? u.value === "Purchase" ? "Purchase from Supplier" : o("inventory.transfer.receiveRequest.bulk.wizard.outletToOutletMethod") : R.value === "template" ? o("inventory.transfer.receiveRequest.bulk.wizard.fromTemplateMethod") : o("inventory.transfer.receiveRequest.bulk.wizard.notChosen")), M = A(() => {
|
|
183
181
|
var t;
|
|
184
|
-
if (R.value === "transfer" &&
|
|
185
|
-
return
|
|
182
|
+
if (R.value === "transfer" && J.value)
|
|
183
|
+
return J.value.name;
|
|
186
184
|
if (R.value === "template" && I.value) {
|
|
187
|
-
const a =
|
|
185
|
+
const a = b.templates.find((S) => S._id === I.value);
|
|
188
186
|
return (t = a == null ? void 0 : a.purchaseOrder) != null && t.supplier ? a.purchaseOrder.supplier.name || I.value : (a == null ? void 0 : a.name) ?? I.value;
|
|
189
187
|
}
|
|
190
188
|
return o("inventory.transfer.receiveRequest.bulk.wizard.noneYet");
|
|
191
189
|
});
|
|
192
190
|
function F(t) {
|
|
193
|
-
var X, v,
|
|
194
|
-
const a = (X = t.doc.profile) != null && X.code ? `#${t.doc.profile.code}` : "", S = [(
|
|
191
|
+
var X, v, ge, ie, Ie;
|
|
192
|
+
const a = (X = t.doc.profile) != null && X.code ? `#${t.doc.profile.code}` : "", S = [(ge = (v = t.doc.profile) == null ? void 0 : v.address) == null ? void 0 : ge.line1, (Ie = (ie = t.doc.profile) == null ? void 0 : ie.address) == null ? void 0 : Ie.city].filter(Boolean).join(" · ");
|
|
195
193
|
return [a, S].filter(Boolean).join(" · ");
|
|
196
194
|
}
|
|
197
|
-
function
|
|
195
|
+
function H(t) {
|
|
198
196
|
var S, X;
|
|
199
197
|
return [(S = t.doc.address) == null ? void 0 : S.line1, (X = t.doc.address) == null ? void 0 : X.city].filter(Boolean).join(" · ");
|
|
200
198
|
}
|
|
@@ -203,23 +201,23 @@ const ta = {
|
|
|
203
201
|
return t.type === "supplier" ? "" : ((a = t.doc.profile) == null ? void 0 : a.code) ?? "";
|
|
204
202
|
}
|
|
205
203
|
function ee(t) {
|
|
206
|
-
var a, S, X, v,
|
|
207
|
-
return t.type === "supplier" ? [(a = t.doc.address) == null ? void 0 : a.line1, (S = t.doc.address) == null ? void 0 : S.city].filter(Boolean).join(" · ") : [(v = (X = t.doc.profile) == null ? void 0 : X.address) == null ? void 0 : v.line1, (
|
|
204
|
+
var a, S, X, v, ge, ie;
|
|
205
|
+
return t.type === "supplier" ? [(a = t.doc.address) == null ? void 0 : a.line1, (S = t.doc.address) == null ? void 0 : S.city].filter(Boolean).join(" · ") : [(v = (X = t.doc.profile) == null ? void 0 : X.address) == null ? void 0 : v.line1, (ie = (ge = t.doc.profile) == null ? void 0 : ge.address) == null ? void 0 : ie.city].filter(Boolean).join(" · ");
|
|
208
206
|
}
|
|
209
|
-
const
|
|
207
|
+
const re = A(
|
|
210
208
|
() => T.value ? F(T.value) : ""
|
|
211
|
-
), te =
|
|
212
|
-
() => R.value === "transfer" &&
|
|
213
|
-
),
|
|
214
|
-
const a = (
|
|
209
|
+
), te = A(
|
|
210
|
+
() => R.value === "transfer" && J.value ? J.value.type === "supplier" ? H(J.value) : F(J.value) : ""
|
|
211
|
+
), fe = A(() => {
|
|
212
|
+
const a = (oe.value.length ? oe.value : Y.value.items ?? []).filter((S) => S.quantity.amount > 0).length;
|
|
215
213
|
return a === 0 ? o("inventory.transfer.receiveRequest.bulk.wizard.noneYet") : `${a} ${a === 1 ? "item" : "items"}`;
|
|
216
214
|
});
|
|
217
|
-
function
|
|
215
|
+
function ve(t) {
|
|
218
216
|
var S;
|
|
219
217
|
const a = (S = t.purchaseOrder) == null ? void 0 : S.supplier;
|
|
220
218
|
return a ? a.internal === "warehouse" ? `Transfer from ${a.name}` : a.internal === "restaurant" ? `Transfer from ${a.name}` : `Purchase from ${a.name}` : "";
|
|
221
219
|
}
|
|
222
|
-
function
|
|
220
|
+
function Re(t) {
|
|
223
221
|
return {
|
|
224
222
|
_id: t.doc._id,
|
|
225
223
|
internal: t.type,
|
|
@@ -237,7 +235,7 @@ const ta = {
|
|
|
237
235
|
}
|
|
238
236
|
};
|
|
239
237
|
}
|
|
240
|
-
function
|
|
238
|
+
function $e(t) {
|
|
241
239
|
return {
|
|
242
240
|
_id: t._id,
|
|
243
241
|
internal: void 0,
|
|
@@ -258,9 +256,9 @@ const ta = {
|
|
|
258
256
|
}
|
|
259
257
|
};
|
|
260
258
|
}
|
|
261
|
-
function
|
|
259
|
+
function be() {
|
|
262
260
|
var X;
|
|
263
|
-
const t = I.value ?
|
|
261
|
+
const t = I.value ? b.templates.find((v) => v._id === I.value) : void 0, a = {
|
|
264
262
|
_rev: void 0,
|
|
265
263
|
email: void 0,
|
|
266
264
|
internal: void 0,
|
|
@@ -271,7 +269,7 @@ const ta = {
|
|
|
271
269
|
_id: "",
|
|
272
270
|
name: "",
|
|
273
271
|
address: { line2: void 0, line1: "", state: "", city: "", postcode: "", country: "" }
|
|
274
|
-
}, S = R.value === "transfer" &&
|
|
272
|
+
}, S = R.value === "transfer" && J.value ? J.value.type === "supplier" ? $e(J.value.doc) : Re(J.value) : R.value === "template" && (t != null && t.purchaseOrder.supplier) ? t.purchaseOrder.supplier : a;
|
|
275
273
|
return {
|
|
276
274
|
remark: void 0,
|
|
277
275
|
ref: void 0,
|
|
@@ -287,62 +285,62 @@ const ta = {
|
|
|
287
285
|
templateDoc: t
|
|
288
286
|
};
|
|
289
287
|
}
|
|
290
|
-
const Y = P(
|
|
288
|
+
const Y = P(be()), K = P(`${Math.random()}`), we = A(
|
|
291
289
|
() => {
|
|
292
290
|
var t;
|
|
293
291
|
return ((t = Y.value.items) == null ? void 0 : t.filter((a) => a.quantity.amount === 0)) ?? [];
|
|
294
292
|
}
|
|
295
293
|
);
|
|
296
|
-
|
|
297
|
-
() =>
|
|
294
|
+
Qe(
|
|
295
|
+
() => G.show,
|
|
298
296
|
(t) => {
|
|
299
|
-
if (
|
|
300
|
-
const a =
|
|
301
|
-
(S) => S.doc._id ===
|
|
297
|
+
if (Ee(), t && (l.value = 0, f.value = !1, T.value = null, se.value = "idle", ke = null, R.value = null, J.value = null, I.value = null, W.value = "", ae.value = "", ue.value = "", de.value = !1, Ue.value = !1, oe.value = [], Y.value = be(), K.value = `${Math.random()}`, G.selectedOutletIds && G.selectedOutletIds.length === 1)) {
|
|
298
|
+
const a = h.locations.find(
|
|
299
|
+
(S) => S.doc._id === G.selectedOutletIds[0]
|
|
302
300
|
);
|
|
303
|
-
a && (T.value = a,
|
|
301
|
+
a && (T.value = a, Pe(a));
|
|
304
302
|
}
|
|
305
303
|
}
|
|
306
304
|
);
|
|
307
|
-
async function
|
|
305
|
+
async function Pe(t) {
|
|
308
306
|
var X;
|
|
309
|
-
|
|
307
|
+
Ee();
|
|
310
308
|
const a = new AbortController();
|
|
311
|
-
|
|
309
|
+
_e = a, ke !== t.dbName && (ke = null, R.value = null, J.value = null, I.value = null, oe.value = []), de.value = !1, se.value = "checking", h._currentLocation = t;
|
|
312
310
|
const S = await c.awaitLocationFeatures(t.dbName, {
|
|
313
311
|
signal: a.signal,
|
|
314
312
|
retryOnError: !0
|
|
315
313
|
});
|
|
316
|
-
if (
|
|
314
|
+
if (_e === a) {
|
|
317
315
|
if (((X = T.value) == null ? void 0 : X.dbName) !== t.dbName) {
|
|
318
|
-
|
|
316
|
+
se.value = "idle";
|
|
319
317
|
return;
|
|
320
318
|
}
|
|
321
319
|
if (S !== "ready") {
|
|
322
|
-
|
|
320
|
+
se.value = "error";
|
|
323
321
|
return;
|
|
324
322
|
}
|
|
325
323
|
if (w.state.value !== "enabled") {
|
|
326
|
-
|
|
324
|
+
se.value = "unavailable";
|
|
327
325
|
return;
|
|
328
326
|
}
|
|
329
|
-
|
|
327
|
+
se.value = "ready", ke = t.dbName, pt(a.signal), zt(a.signal), b.fetchTemplates(), l.value = 1;
|
|
330
328
|
}
|
|
331
329
|
}
|
|
332
|
-
function
|
|
333
|
-
T.value = t,
|
|
330
|
+
function De(t) {
|
|
331
|
+
T.value = t, se.value !== "checking" && (se.value = "idle");
|
|
334
332
|
}
|
|
335
333
|
function D() {
|
|
336
|
-
T.value &&
|
|
334
|
+
T.value && Pe(T.value);
|
|
337
335
|
}
|
|
338
|
-
function
|
|
336
|
+
function le() {
|
|
339
337
|
if (l.value === 0) {
|
|
340
338
|
const t = T.value;
|
|
341
|
-
if (!t ||
|
|
342
|
-
|
|
339
|
+
if (!t || se.value === "checking") return;
|
|
340
|
+
Pe(t);
|
|
343
341
|
} else if (l.value === 1) {
|
|
344
|
-
if (!k.value || !
|
|
345
|
-
if (!
|
|
342
|
+
if (!k.value || !je()) return;
|
|
343
|
+
if (!Ne(be())) {
|
|
346
344
|
s.open({
|
|
347
345
|
title: "Template required",
|
|
348
346
|
message: "This outlet requires a template unless transferring from another outlet.",
|
|
@@ -350,20 +348,20 @@ const ta = {
|
|
|
350
348
|
});
|
|
351
349
|
return;
|
|
352
350
|
}
|
|
353
|
-
Y.value =
|
|
354
|
-
} else l.value === 2 &&
|
|
351
|
+
Y.value = be(), K.value = `${Math.random()}`, oe.value = [], l.value = 2;
|
|
352
|
+
} else l.value === 2 && Ut();
|
|
355
353
|
}
|
|
356
|
-
function
|
|
354
|
+
function ye() {
|
|
357
355
|
l.value > 0 && l.value--;
|
|
358
356
|
}
|
|
359
|
-
function
|
|
357
|
+
function he(t) {
|
|
360
358
|
t < l.value && (l.value = t);
|
|
361
359
|
}
|
|
362
|
-
function
|
|
363
|
-
|
|
360
|
+
function Me() {
|
|
361
|
+
U("update:show", !1);
|
|
364
362
|
}
|
|
365
|
-
function
|
|
366
|
-
R.value !== t && (R.value = t,
|
|
363
|
+
function Ye(t) {
|
|
364
|
+
R.value !== t && (R.value = t, J.value = null, I.value = null, oe.value = [], Y.value = {
|
|
367
365
|
...Y.value,
|
|
368
366
|
items: [],
|
|
369
367
|
template: void 0,
|
|
@@ -371,16 +369,16 @@ const ta = {
|
|
|
371
369
|
});
|
|
372
370
|
}
|
|
373
371
|
function st(t) {
|
|
374
|
-
|
|
372
|
+
oe.value = t ?? [];
|
|
375
373
|
}
|
|
376
|
-
|
|
377
|
-
R.value === "template" && t && (Y.value =
|
|
374
|
+
Qe(I, (t) => {
|
|
375
|
+
R.value === "template" && t && (Y.value = be(), K.value = `${Math.random()}`);
|
|
378
376
|
});
|
|
379
377
|
async function pt(t) {
|
|
380
|
-
|
|
378
|
+
de.value = !1;
|
|
381
379
|
try {
|
|
382
|
-
if (await
|
|
383
|
-
|
|
380
|
+
if (await V.readSuppliers(), t.aborted) return;
|
|
381
|
+
de.value = !0;
|
|
384
382
|
} catch {
|
|
385
383
|
if (t.aborted) return;
|
|
386
384
|
s.open({
|
|
@@ -390,39 +388,39 @@ const ta = {
|
|
|
390
388
|
});
|
|
391
389
|
}
|
|
392
390
|
}
|
|
393
|
-
async function
|
|
394
|
-
|
|
391
|
+
async function zt(t) {
|
|
392
|
+
Ve.value = !0, Je.value = /* @__PURE__ */ new Map();
|
|
395
393
|
try {
|
|
396
394
|
const a = await m.readStockBalance();
|
|
397
395
|
if (t.aborted) return;
|
|
398
396
|
const S = /* @__PURE__ */ new Map();
|
|
399
397
|
for (const X of a.skus ?? [])
|
|
400
398
|
S.set(X.id, X);
|
|
401
|
-
|
|
399
|
+
Je.value = S;
|
|
402
400
|
} catch {
|
|
403
401
|
} finally {
|
|
404
|
-
t.aborted || (
|
|
402
|
+
t.aborted || (Ve.value = !1);
|
|
405
403
|
}
|
|
406
404
|
}
|
|
407
|
-
function
|
|
405
|
+
function Mt() {
|
|
408
406
|
var t;
|
|
409
|
-
(t =
|
|
407
|
+
(t = Le.value) != null && t.getFormData && (Y.value = { ...Y.value, ...Le.value.getFormData() });
|
|
410
408
|
}
|
|
411
|
-
function
|
|
412
|
-
if (
|
|
413
|
-
|
|
409
|
+
function Ut() {
|
|
410
|
+
if (Mt(), we.value.length > 0) {
|
|
411
|
+
Fe.value = !0;
|
|
414
412
|
return;
|
|
415
413
|
}
|
|
416
414
|
kt();
|
|
417
415
|
}
|
|
418
|
-
function
|
|
416
|
+
function Vt() {
|
|
419
417
|
var t;
|
|
420
|
-
Y.value.items = ((t = Y.value.items) == null ? void 0 : t.filter((a) => a.quantity.amount > 0)) ?? [],
|
|
418
|
+
Y.value.items = ((t = Y.value.items) == null ? void 0 : t.filter((a) => a.quantity.amount > 0)) ?? [], Fe.value = !1, kt();
|
|
421
419
|
}
|
|
422
420
|
function kt() {
|
|
423
421
|
var S, X;
|
|
424
|
-
const t =
|
|
425
|
-
skusById:
|
|
422
|
+
const t = Pn.validatePurchaseOrderItems({
|
|
423
|
+
skusById: Ce.skuById ?? {},
|
|
426
424
|
items: Y.value.items ?? []
|
|
427
425
|
}), a = Object.values(t).flat();
|
|
428
426
|
if (a.length > 0) {
|
|
@@ -434,17 +432,17 @@ const ta = {
|
|
|
434
432
|
});
|
|
435
433
|
return;
|
|
436
434
|
}
|
|
437
|
-
(X = (S =
|
|
435
|
+
(X = (S = Le.value) == null ? void 0 : S.validateInputs) == null || X.call(S);
|
|
438
436
|
}
|
|
439
|
-
async function
|
|
440
|
-
var v,
|
|
441
|
-
const a = T.value, S =
|
|
442
|
-
if (!a || !S ||
|
|
437
|
+
async function Jt(t) {
|
|
438
|
+
var v, ge;
|
|
439
|
+
const a = T.value, S = _e;
|
|
440
|
+
if (!a || !S || ke !== a.dbName) return !1;
|
|
443
441
|
const X = await c.awaitLocationFeatures(a.dbName, {
|
|
444
442
|
signal: S.signal,
|
|
445
443
|
retryOnError: !0
|
|
446
444
|
});
|
|
447
|
-
return S.signal.aborted ||
|
|
445
|
+
return S.signal.aborted || _e !== S || ((v = T.value) == null ? void 0 : v.dbName) !== a.dbName || ((ge = h._currentLocation) == null ? void 0 : ge.dbName) !== a.dbName ? !1 : X !== "ready" ? (s.open({
|
|
448
446
|
title: "Outlet settings couldn’t load",
|
|
449
447
|
message: `Transfer requirements for ${a.name} are unconfirmed. Your details are kept — please try again.`,
|
|
450
448
|
type: "warning"
|
|
@@ -452,17 +450,17 @@ const ta = {
|
|
|
452
450
|
title: "Bulk Receive / Transfer is unavailable",
|
|
453
451
|
message: `Transfers can’t be created for ${a.name}.`,
|
|
454
452
|
type: "error"
|
|
455
|
-
}), !1) :
|
|
453
|
+
}), !1) : Ne(t) ? !0 : (s.open({
|
|
456
454
|
title: "Template required",
|
|
457
455
|
message: "This outlet requires a template unless transferring from another outlet.",
|
|
458
456
|
type: "warning"
|
|
459
457
|
}), !1);
|
|
460
458
|
}
|
|
461
|
-
async function
|
|
462
|
-
if (
|
|
459
|
+
async function jt() {
|
|
460
|
+
if (ce.value) return;
|
|
463
461
|
const t = Y.value;
|
|
464
|
-
if (
|
|
465
|
-
|
|
462
|
+
if (ce.value = !0, !await Jt(t)) {
|
|
463
|
+
ce.value = !1;
|
|
466
464
|
return;
|
|
467
465
|
}
|
|
468
466
|
if (t.items = t.items.filter((a) => a.quantity.amount > 0), !t.items.length) {
|
|
@@ -470,7 +468,7 @@ const ta = {
|
|
|
470
468
|
title: "Cannot create order",
|
|
471
469
|
message: "There are no items with non-zero amount in your request.",
|
|
472
470
|
type: "error"
|
|
473
|
-
}),
|
|
471
|
+
}), ce.value = !1;
|
|
474
472
|
return;
|
|
475
473
|
}
|
|
476
474
|
(t.supplier.internal === "warehouse" || t.supplier.internal === "restaurant") && (t.items = t.items.map(({ totalCost: a, ...S }) => S));
|
|
@@ -479,7 +477,7 @@ const ta = {
|
|
|
479
477
|
title: o("inventory.transfer.receiveRequest.create.success"),
|
|
480
478
|
message: o("inventory.transfer.receiveRequest.create.successMessage"),
|
|
481
479
|
type: "success"
|
|
482
|
-
}),
|
|
480
|
+
}), U("submitted"), U("update:show", !1), Wt();
|
|
483
481
|
} catch (a) {
|
|
484
482
|
s.open({
|
|
485
483
|
title: o("inventory.transfer.receiveRequest.create.error.title"),
|
|
@@ -487,14 +485,14 @@ const ta = {
|
|
|
487
485
|
type: "error"
|
|
488
486
|
}), console.error("Error creating purchase order", a);
|
|
489
487
|
} finally {
|
|
490
|
-
|
|
488
|
+
ce.value = !1;
|
|
491
489
|
}
|
|
492
490
|
}
|
|
493
|
-
function
|
|
494
|
-
l.value = 0, f.value = !1, T.value = null, R.value = null,
|
|
491
|
+
function Wt() {
|
|
492
|
+
l.value = 0, f.value = !1, T.value = null, R.value = null, J.value = null, I.value = null, W.value = "", ae.value = "", ue.value = "", de.value = !1, Ue.value = !1, oe.value = [], Y.value = be(), K.value = `${Math.random()}`;
|
|
495
493
|
}
|
|
496
|
-
return (t, a) => (i(), y(
|
|
497
|
-
(i(),
|
|
494
|
+
return (t, a) => (i(), y(Se, null, [
|
|
495
|
+
(i(), pe(dt, { to: "body" }, [
|
|
498
496
|
E(Ht, {
|
|
499
497
|
"enter-active-class": "transition-opacity duration-150 ease-out",
|
|
500
498
|
"enter-from-class": "opacity-0",
|
|
@@ -503,89 +501,89 @@ const ta = {
|
|
|
503
501
|
"leave-from-class": "opacity-100",
|
|
504
502
|
"leave-to-class": "opacity-0"
|
|
505
503
|
}, {
|
|
506
|
-
default:
|
|
504
|
+
default: Ae(() => {
|
|
507
505
|
var S, X;
|
|
508
506
|
return [
|
|
509
|
-
t.show ? (i(), y("div",
|
|
510
|
-
f.value ? q("", !0) : (i(), y("div",
|
|
511
|
-
e("span",
|
|
512
|
-
e("div",
|
|
507
|
+
t.show ? (i(), y("div", Xn, [
|
|
508
|
+
f.value ? q("", !0) : (i(), y("div", Zn, [
|
|
509
|
+
e("span", ea, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.title")), 1),
|
|
510
|
+
e("div", ta, [
|
|
513
511
|
E(n(x), {
|
|
514
512
|
variant: "tertiary",
|
|
515
513
|
size: "md",
|
|
516
514
|
label: n(o)("inventory.transfer.receiveRequest.bulk.wizard.cancelBtn"),
|
|
517
|
-
onClick:
|
|
515
|
+
onClick: Me
|
|
518
516
|
}, null, 8, ["label"]),
|
|
519
|
-
l.value > 0 ? (i(),
|
|
517
|
+
l.value > 0 ? (i(), pe(n(x), {
|
|
520
518
|
key: 0,
|
|
521
519
|
variant: "secondary",
|
|
522
520
|
size: "md",
|
|
523
521
|
"prepend-icon": "arrow_back",
|
|
524
522
|
label: n(o)("inventory.transfer.receiveRequest.bulk.wizard.backBtn"),
|
|
525
|
-
onClick:
|
|
523
|
+
onClick: ye
|
|
526
524
|
}, null, 8, ["label"])) : q("", !0),
|
|
527
525
|
E(n(x), {
|
|
528
526
|
size: "md",
|
|
529
|
-
disabled: !
|
|
530
|
-
loading:
|
|
531
|
-
label:
|
|
532
|
-
onClick:
|
|
527
|
+
disabled: !Te.value,
|
|
528
|
+
loading: ce.value || se.value === "checking",
|
|
529
|
+
label: We.value,
|
|
530
|
+
onClick: le
|
|
533
531
|
}, null, 8, ["disabled", "loading", "label"])
|
|
534
532
|
])
|
|
535
533
|
])),
|
|
536
|
-
f.value ? q("", !0) : (i(), y("div",
|
|
537
|
-
e("div",
|
|
534
|
+
f.value ? q("", !0) : (i(), y("div", na, [
|
|
535
|
+
e("div", aa, [
|
|
538
536
|
e("button", {
|
|
539
537
|
class: "flex flex-col items-center gap-4 min-w-0 group",
|
|
540
538
|
disabled: l.value <= 0,
|
|
541
|
-
onClick: a[0] || (a[0] = (v) =>
|
|
539
|
+
onClick: a[0] || (a[0] = (v) => he(0))
|
|
542
540
|
}, [
|
|
543
541
|
e("div", {
|
|
544
|
-
class:
|
|
542
|
+
class: Q([
|
|
545
543
|
"w-32 h-32 rounded-full flex items-center justify-center text-sm font-semibold transition-colors duration-150",
|
|
546
544
|
l.value > 0 || l.value === 0 ? "bg-[#FF7823] text-white" : "bg-[#F0F0F0] text-[#6B6C70]"
|
|
547
545
|
])
|
|
548
546
|
}, [
|
|
549
|
-
l.value > 0 ? (i(),
|
|
547
|
+
l.value > 0 ? (i(), pe(n($), {
|
|
550
548
|
key: 0,
|
|
551
549
|
name: "check",
|
|
552
550
|
size: "sm"
|
|
553
|
-
})) : (i(), y("span",
|
|
551
|
+
})) : (i(), y("span", ra, "1"))
|
|
554
552
|
], 2),
|
|
555
553
|
e("span", {
|
|
556
|
-
class:
|
|
554
|
+
class: Q(["fm-typo-en-body-xs-500 whitespace-nowrap transition-colors duration-150", l.value >= 0 ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
|
|
557
555
|
}, " Select destination ", 2)
|
|
558
|
-
], 8,
|
|
556
|
+
], 8, sa),
|
|
559
557
|
e("div", {
|
|
560
|
-
class:
|
|
558
|
+
class: Q(["flex-1 h-1 mx-8 transition-colors duration-200", l.value > 0 ? "bg-[#FF7823]" : "bg-[#E0E0E0]"])
|
|
561
559
|
}, null, 2),
|
|
562
560
|
e("button", {
|
|
563
561
|
class: "flex flex-col items-center gap-4 min-w-0 group",
|
|
564
562
|
disabled: l.value <= 1,
|
|
565
|
-
onClick: a[1] || (a[1] = (v) =>
|
|
563
|
+
onClick: a[1] || (a[1] = (v) => he(1))
|
|
566
564
|
}, [
|
|
567
565
|
e("div", {
|
|
568
|
-
class:
|
|
566
|
+
class: Q([
|
|
569
567
|
"w-32 h-32 rounded-full flex items-center justify-center text-sm font-semibold transition-colors duration-150",
|
|
570
568
|
l.value > 1 || l.value === 1 ? "bg-[#FF7823] text-white" : "bg-[#F0F0F0] text-[#6B6C70]"
|
|
571
569
|
])
|
|
572
570
|
}, [
|
|
573
|
-
l.value > 1 ? (i(),
|
|
571
|
+
l.value > 1 ? (i(), pe(n($), {
|
|
574
572
|
key: 0,
|
|
575
573
|
name: "check",
|
|
576
574
|
size: "sm"
|
|
577
|
-
})) : (i(), y("span",
|
|
575
|
+
})) : (i(), y("span", la, "2"))
|
|
578
576
|
], 2),
|
|
579
577
|
e("span", {
|
|
580
|
-
class:
|
|
581
|
-
}, p(
|
|
582
|
-
], 8,
|
|
578
|
+
class: Q(["fm-typo-en-body-xs-500 whitespace-nowrap transition-colors duration-150", l.value >= 1 ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
|
|
579
|
+
}, p(ze.value), 3)
|
|
580
|
+
], 8, oa),
|
|
583
581
|
e("div", {
|
|
584
|
-
class:
|
|
582
|
+
class: Q(["flex-1 h-1 mx-8 transition-colors duration-200", l.value > 1 ? "bg-[#FF7823]" : "bg-[#E0E0E0]"])
|
|
585
583
|
}, null, 2),
|
|
586
|
-
e("button",
|
|
584
|
+
e("button", ia, [
|
|
587
585
|
e("div", {
|
|
588
|
-
class:
|
|
586
|
+
class: Q([
|
|
589
587
|
"w-32 h-32 rounded-full flex items-center justify-center text-sm font-semibold transition-colors duration-150",
|
|
590
588
|
l.value === 2 ? "bg-[#FF7823] text-white" : "bg-[#F0F0F0] text-[#6B6C70]"
|
|
591
589
|
])
|
|
@@ -593,33 +591,33 @@ const ta = {
|
|
|
593
591
|
e("span", null, "3", -1)
|
|
594
592
|
]), 2),
|
|
595
593
|
e("span", {
|
|
596
|
-
class:
|
|
597
|
-
}, p(
|
|
594
|
+
class: Q(["fm-typo-en-body-xs-500 whitespace-nowrap transition-colors duration-150", l.value >= 2 ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
|
|
595
|
+
}, p(j.value), 3)
|
|
598
596
|
])
|
|
599
597
|
])
|
|
600
598
|
])),
|
|
601
|
-
e("div",
|
|
602
|
-
e("div",
|
|
603
|
-
l.value === 0 ? (i(), y("div",
|
|
604
|
-
e("div",
|
|
605
|
-
e("h3",
|
|
606
|
-
e("p",
|
|
599
|
+
e("div", ua, [
|
|
600
|
+
e("div", ca, [
|
|
601
|
+
l.value === 0 ? (i(), y("div", da, [
|
|
602
|
+
e("div", ma, [
|
|
603
|
+
e("h3", fa, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.step1Heading")), 1),
|
|
604
|
+
e("p", pa, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.step1Desc")), 1)
|
|
607
605
|
]),
|
|
608
|
-
|
|
609
|
-
E(n(
|
|
606
|
+
se.value === "checking" ? (i(), y("div", va, [
|
|
607
|
+
E(n($), {
|
|
610
608
|
name: "progress_activity",
|
|
611
609
|
class: "text-[#FF7823] animate-spin"
|
|
612
610
|
}),
|
|
613
611
|
a[12] || (a[12] = rt(" Checking outlet settings… "))
|
|
614
|
-
])) :
|
|
615
|
-
e("span",
|
|
612
|
+
])) : se.value === "error" ? (i(), y("div", ya, [
|
|
613
|
+
e("span", ba, " Settings for " + p((S = T.value) == null ? void 0 : S.name) + " couldn’t load, so its transfer requirements are unconfirmed. ", 1),
|
|
616
614
|
E(n(x), {
|
|
617
615
|
variant: "secondary",
|
|
618
616
|
label: "Retry",
|
|
619
617
|
onClick: D
|
|
620
618
|
})
|
|
621
|
-
])) :
|
|
622
|
-
e("div",
|
|
619
|
+
])) : se.value === "unavailable" ? (i(), y("div", ha, " Bulk Receive / Transfer isn’t available for " + p((X = T.value) == null ? void 0 : X.name) + ". Choose another outlet. ", 1)) : q("", !0),
|
|
620
|
+
e("div", ga, [
|
|
623
621
|
E(n(L), {
|
|
624
622
|
"model-value": W.value,
|
|
625
623
|
"onUpdate:modelValue": a[2] || (a[2] = (v) => W.value = v),
|
|
@@ -627,70 +625,70 @@ const ta = {
|
|
|
627
625
|
placeholder: n(o)("inventory.transfer.receiveRequest.bulk.wizard.step1SearchPlaceholder")
|
|
628
626
|
}, null, 8, ["model-value", "placeholder"])
|
|
629
627
|
]),
|
|
630
|
-
e("div",
|
|
631
|
-
(i(!0), y(
|
|
632
|
-
var
|
|
628
|
+
e("div", _a, [
|
|
629
|
+
(i(!0), y(Se, null, tt(xe.value, (v, ge) => {
|
|
630
|
+
var ie, Ie, He, vt, Ct, Ft, St;
|
|
633
631
|
return i(), y("div", {
|
|
634
632
|
key: v.dbName,
|
|
635
|
-
class:
|
|
636
|
-
((
|
|
637
|
-
|
|
633
|
+
class: Q(["flex items-center gap-8 px-12 h-[67px] cursor-pointer transition-colors duration-150", [
|
|
634
|
+
((ie = T.value) == null ? void 0 : ie.dbName) === v.dbName ? "bg-[#FFF5EE]" : "hover:bg-[#FAFAFA]",
|
|
635
|
+
ge > 0 ? "border-t border-[#F0F0F0]" : ""
|
|
638
636
|
]]),
|
|
639
|
-
onClick: (
|
|
637
|
+
onClick: (Qr) => De(v)
|
|
640
638
|
}, [
|
|
641
|
-
e("div",
|
|
642
|
-
e("span",
|
|
639
|
+
e("div", wa, [
|
|
640
|
+
e("span", ka, p(v.name.slice(0, 2).toUpperCase()), 1)
|
|
643
641
|
]),
|
|
644
|
-
e("div",
|
|
645
|
-
e("div",
|
|
646
|
-
e("div",
|
|
642
|
+
e("div", Ca, [
|
|
643
|
+
e("div", Fa, p(v.name), 1),
|
|
644
|
+
e("div", Sa, [
|
|
647
645
|
rt(p(v.doc.profile.code ? `#${v.doc.profile.code}` : n(o)("inventory.transfer.receiveRequest.bulk.wizard.noCode")) + " ", 1),
|
|
648
|
-
(
|
|
646
|
+
(Ie = v.doc.profile.address) != null && Ie.line1 || (He = v.doc.profile.address) != null && He.city ? (i(), y(Se, { key: 0 }, [
|
|
649
647
|
rt(" · " + p([(vt = v.doc.profile.address) == null ? void 0 : vt.line1, (Ct = v.doc.profile.address) == null ? void 0 : Ct.city].filter(Boolean).join(" · ")), 1)
|
|
650
648
|
], 64)) : q("", !0)
|
|
651
649
|
])
|
|
652
650
|
]),
|
|
653
|
-
e("span",
|
|
651
|
+
e("span", Ra, p(v.type === "warehouse" ? "Warehouse" : "Restaurant"), 1),
|
|
654
652
|
e("div", {
|
|
655
|
-
class:
|
|
653
|
+
class: Q([
|
|
656
654
|
"w-[18px] h-[18px] rounded-full border flex items-center justify-center shrink-0 transition-colors duration-150",
|
|
657
655
|
((Ft = T.value) == null ? void 0 : Ft.dbName) === v.dbName ? "border-[#FF7823]" : "border-[#CCCCCC]"
|
|
658
656
|
])
|
|
659
657
|
}, [
|
|
660
|
-
((St = T.value) == null ? void 0 : St.dbName) === v.dbName ? (i(), y("div",
|
|
658
|
+
((St = T.value) == null ? void 0 : St.dbName) === v.dbName ? (i(), y("div", Pa)) : q("", !0)
|
|
661
659
|
], 2)
|
|
662
|
-
], 10,
|
|
660
|
+
], 10, xa);
|
|
663
661
|
}), 128)),
|
|
664
|
-
|
|
662
|
+
xe.value.length === 0 ? (i(), y("div", Da, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.noOutletsAvailable")), 1)) : q("", !0)
|
|
665
663
|
])
|
|
666
664
|
])) : q("", !0),
|
|
667
|
-
l.value === 1 ? (i(), y("div",
|
|
668
|
-
e("div",
|
|
669
|
-
e("h3",
|
|
670
|
-
e("p",
|
|
665
|
+
l.value === 1 ? (i(), y("div", qa, [
|
|
666
|
+
e("div", Ea, [
|
|
667
|
+
e("h3", Na, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.step2Heading")), 1),
|
|
668
|
+
e("p", $a, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.step2Desc")), 1)
|
|
671
669
|
]),
|
|
672
|
-
e("div",
|
|
670
|
+
e("div", Ba, [
|
|
673
671
|
e("div", {
|
|
674
|
-
class:
|
|
672
|
+
class: Q([
|
|
675
673
|
"border rounded-xl p-16 cursor-pointer transition-all duration-150 flex flex-col",
|
|
676
674
|
R.value === "transfer" ? "border-[#FF7823] bg-[#FFF5EE]" : "border-[#E0E0E0] bg-white hover:bg-[#FAFAFA]"
|
|
677
675
|
]),
|
|
678
|
-
onClick: a[3] || (a[3] = (v) =>
|
|
676
|
+
onClick: a[3] || (a[3] = (v) => Ye("transfer"))
|
|
679
677
|
}, [
|
|
680
|
-
e("div",
|
|
678
|
+
e("div", Oa, [
|
|
681
679
|
e("div", {
|
|
682
|
-
class:
|
|
680
|
+
class: Q(["w-36 h-36 rounded-xl flex items-center justify-center shrink-0", R.value === "transfer" ? "bg-[#FF7823]" : "bg-[#F0F0F0]"])
|
|
683
681
|
}, [
|
|
684
|
-
E(n(
|
|
682
|
+
E(n($), {
|
|
685
683
|
name: "swap_horiz",
|
|
686
684
|
size: "md",
|
|
687
|
-
class:
|
|
685
|
+
class: Q(R.value === "transfer" ? "text-white" : "text-[#6B6C70]")
|
|
688
686
|
}, null, 8, ["class"])
|
|
689
687
|
], 2),
|
|
690
688
|
e("div", {
|
|
691
|
-
class:
|
|
689
|
+
class: Q(["w-16 h-16 rounded-full flex items-center justify-center shrink-0", R.value === "transfer" ? "bg-[#FF7823]" : "border border-[#CCCCCC]"])
|
|
692
690
|
}, [
|
|
693
|
-
R.value === "transfer" ? (i(),
|
|
691
|
+
R.value === "transfer" ? (i(), pe(n($), {
|
|
694
692
|
key: 0,
|
|
695
693
|
name: "check",
|
|
696
694
|
size: "sm",
|
|
@@ -698,30 +696,30 @@ const ta = {
|
|
|
698
696
|
})) : q("", !0)
|
|
699
697
|
], 2)
|
|
700
698
|
]),
|
|
701
|
-
e("div",
|
|
702
|
-
e("div",
|
|
699
|
+
e("div", Aa, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.outletToOutlet")), 1),
|
|
700
|
+
e("div", Ta, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.outletToOutletDesc")), 1)
|
|
703
701
|
], 2),
|
|
704
702
|
e("div", {
|
|
705
|
-
class:
|
|
703
|
+
class: Q([
|
|
706
704
|
"border rounded-xl p-16 cursor-pointer transition-all duration-150 flex flex-col",
|
|
707
705
|
R.value === "template" ? "border-[#FF7823] bg-[#FFF5EE]" : "border-[#E0E0E0] bg-white hover:bg-[#FAFAFA]"
|
|
708
706
|
]),
|
|
709
|
-
onClick: a[4] || (a[4] = (v) =>
|
|
707
|
+
onClick: a[4] || (a[4] = (v) => Ye("template"))
|
|
710
708
|
}, [
|
|
711
|
-
e("div",
|
|
709
|
+
e("div", Ia, [
|
|
712
710
|
e("div", {
|
|
713
|
-
class:
|
|
711
|
+
class: Q(["w-36 h-36 rounded-xl flex items-center justify-center shrink-0", R.value === "template" ? "bg-[#FF7823]" : "bg-[#F0F0F0]"])
|
|
714
712
|
}, [
|
|
715
|
-
E(n(
|
|
713
|
+
E(n($), {
|
|
716
714
|
name: "description",
|
|
717
715
|
size: "md",
|
|
718
|
-
class:
|
|
716
|
+
class: Q(R.value === "template" ? "text-white" : "text-[#6B6C70]")
|
|
719
717
|
}, null, 8, ["class"])
|
|
720
718
|
], 2),
|
|
721
719
|
e("div", {
|
|
722
|
-
class:
|
|
720
|
+
class: Q(["w-16 h-16 rounded-full flex items-center justify-center shrink-0", R.value === "template" ? "bg-[#FF7823]" : "border border-[#CCCCCC]"])
|
|
723
721
|
}, [
|
|
724
|
-
R.value === "template" ? (i(),
|
|
722
|
+
R.value === "template" ? (i(), pe(n($), {
|
|
725
723
|
key: 0,
|
|
726
724
|
name: "check",
|
|
727
725
|
size: "sm",
|
|
@@ -729,160 +727,160 @@ const ta = {
|
|
|
729
727
|
})) : q("", !0)
|
|
730
728
|
], 2)
|
|
731
729
|
]),
|
|
732
|
-
e("div",
|
|
733
|
-
e("div",
|
|
730
|
+
e("div", La, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.fromTemplate")), 1),
|
|
731
|
+
e("div", za, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.fromTemplateDesc")), 1)
|
|
734
732
|
], 2)
|
|
735
733
|
]),
|
|
736
|
-
R.value === "transfer" ? (i(), y(
|
|
737
|
-
e("div",
|
|
738
|
-
Ze.value ? (i(), y("p",
|
|
739
|
-
e("div",
|
|
734
|
+
R.value === "transfer" ? (i(), y(Se, { key: 0 }, [
|
|
735
|
+
e("div", Ma, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.step2SourceHeading")), 1),
|
|
736
|
+
Ze.value ? (i(), y("p", Ua, " This outlet requires a template for purchases and warehouse transfers. Transfers from another outlet are still available. ")) : q("", !0),
|
|
737
|
+
e("div", Va, [
|
|
740
738
|
E(n(L), {
|
|
741
|
-
"model-value":
|
|
742
|
-
"onUpdate:modelValue": a[5] || (a[5] = (v) =>
|
|
739
|
+
"model-value": ae.value,
|
|
740
|
+
"onUpdate:modelValue": a[5] || (a[5] = (v) => ae.value = v),
|
|
743
741
|
"prepend-icon": "search",
|
|
744
742
|
placeholder: n(o)(
|
|
745
743
|
"inventory.transfer.receiveRequest.bulk.wizard.step2SearchSourcePlaceholder"
|
|
746
744
|
)
|
|
747
745
|
}, null, 8, ["model-value", "placeholder"])
|
|
748
746
|
]),
|
|
749
|
-
e("div",
|
|
750
|
-
(i(!0), y(
|
|
751
|
-
var
|
|
747
|
+
e("div", Ja, [
|
|
748
|
+
(i(!0), y(Se, null, tt(Ge.value, (v, ge) => {
|
|
749
|
+
var ie, Ie, He;
|
|
752
750
|
return i(), y("div", {
|
|
753
751
|
key: v.dbName,
|
|
754
|
-
class:
|
|
755
|
-
((
|
|
756
|
-
|
|
752
|
+
class: Q(["flex items-center gap-8 px-12 h-[67px] cursor-pointer transition-colors duration-150", [
|
|
753
|
+
((ie = J.value) == null ? void 0 : ie.doc._id) === v.doc._id ? "bg-[#FFF5EE]" : "hover:bg-[#FAFAFA]",
|
|
754
|
+
ge > 0 ? "border-t border-[#F0F0F0]" : ""
|
|
757
755
|
]]),
|
|
758
|
-
onClick: (vt) =>
|
|
756
|
+
onClick: (vt) => J.value = v
|
|
759
757
|
}, [
|
|
760
|
-
e("div",
|
|
761
|
-
e("span",
|
|
758
|
+
e("div", Wa, [
|
|
759
|
+
e("span", Ya, p(v.name.slice(0, 2).toUpperCase()), 1)
|
|
762
760
|
]),
|
|
763
|
-
e("div",
|
|
764
|
-
e("div",
|
|
765
|
-
e("div",
|
|
761
|
+
e("div", Ha, [
|
|
762
|
+
e("div", Qa, p(v.name), 1),
|
|
763
|
+
e("div", Ga, [
|
|
766
764
|
rt(p(Z(v) ? `#${Z(v)}` : n(o)("inventory.transfer.receiveRequest.bulk.wizard.noCode")) + " ", 1),
|
|
767
|
-
ee(v) ? (i(), y(
|
|
765
|
+
ee(v) ? (i(), y(Se, { key: 0 }, [
|
|
768
766
|
rt(" · " + p(ee(v)), 1)
|
|
769
767
|
], 64)) : q("", !0)
|
|
770
768
|
])
|
|
771
769
|
]),
|
|
772
|
-
e("span",
|
|
770
|
+
e("span", Ka, p(v.type === "warehouse" ? "Warehouse" : v.type === "supplier" ? "Supplier" : "Restaurant"), 1),
|
|
773
771
|
e("div", {
|
|
774
|
-
class:
|
|
772
|
+
class: Q([
|
|
775
773
|
"w-[18px] h-[18px] rounded-full border flex items-center justify-center shrink-0 transition-colors duration-150",
|
|
776
|
-
((
|
|
774
|
+
((Ie = J.value) == null ? void 0 : Ie.doc._id) === v.doc._id ? "border-[#FF7823]" : "border-[#CCCCCC]"
|
|
777
775
|
])
|
|
778
776
|
}, [
|
|
779
|
-
((He =
|
|
777
|
+
((He = J.value) == null ? void 0 : He.doc._id) === v.doc._id ? (i(), y("div", Xa)) : q("", !0)
|
|
780
778
|
], 2)
|
|
781
|
-
], 10,
|
|
779
|
+
], 10, ja);
|
|
782
780
|
}), 128)),
|
|
783
|
-
|
|
781
|
+
Ge.value.length === 0 ? (i(), y("div", Za, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.noOutletsAvailable")), 1)) : q("", !0)
|
|
784
782
|
])
|
|
785
783
|
], 64)) : q("", !0),
|
|
786
|
-
R.value === "template" ? (i(), y(
|
|
787
|
-
e("div",
|
|
788
|
-
e("div",
|
|
784
|
+
R.value === "template" ? (i(), y(Se, { key: 1 }, [
|
|
785
|
+
e("div", es, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.step2TemplateHeading")), 1),
|
|
786
|
+
e("div", ts, [
|
|
789
787
|
E(n(L), {
|
|
790
|
-
"model-value":
|
|
791
|
-
"onUpdate:modelValue": a[6] || (a[6] = (v) =>
|
|
788
|
+
"model-value": ue.value,
|
|
789
|
+
"onUpdate:modelValue": a[6] || (a[6] = (v) => ue.value = v),
|
|
792
790
|
"prepend-icon": "search",
|
|
793
791
|
placeholder: n(o)(
|
|
794
792
|
"inventory.transfer.receiveRequest.bulk.wizard.step2SearchTemplatePlaceholder"
|
|
795
793
|
)
|
|
796
794
|
}, null, 8, ["model-value", "placeholder"])
|
|
797
795
|
]),
|
|
798
|
-
n(
|
|
799
|
-
E(n(
|
|
796
|
+
n(b).loading ? (i(), y("div", ns, [
|
|
797
|
+
E(n($), {
|
|
800
798
|
name: "progress_activity",
|
|
801
799
|
class: "text-[#FF7823] animate-spin"
|
|
802
800
|
})
|
|
803
|
-
])) : r.value.length === 0 ? (i(), y("div",
|
|
804
|
-
(i(!0), y(
|
|
801
|
+
])) : r.value.length === 0 ? (i(), y("div", as, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.noTemplatesAvailable")), 1)) : (i(), y("div", ss, [
|
|
802
|
+
(i(!0), y(Se, null, tt(r.value, (v) => (i(), y("div", {
|
|
805
803
|
key: v._id,
|
|
806
|
-
class:
|
|
804
|
+
class: Q([
|
|
807
805
|
"border rounded-lg px-16 py-12 cursor-pointer transition-all duration-150 flex items-center gap-12",
|
|
808
806
|
I.value === v._id ? "border-[#FF7823] bg-[#FFF5EE]" : "border-[#E0E0E0] bg-white hover:bg-[#FAFAFA]"
|
|
809
807
|
]),
|
|
810
|
-
onClick: (
|
|
808
|
+
onClick: (ge) => I.value = v._id
|
|
811
809
|
}, [
|
|
812
|
-
e("div",
|
|
813
|
-
e("div",
|
|
814
|
-
e("div",
|
|
810
|
+
e("div", os, [
|
|
811
|
+
e("div", ls, p(v.name), 1),
|
|
812
|
+
e("div", is, p(ve(v)) + " · " + p(v.purchaseOrder.items.length) + " items ", 1)
|
|
815
813
|
]),
|
|
816
814
|
e("div", {
|
|
817
|
-
class:
|
|
815
|
+
class: Q([
|
|
818
816
|
"w-[18px] h-[18px] rounded-full border flex items-center justify-center shrink-0 transition-colors duration-150",
|
|
819
817
|
I.value === v._id ? "border-[#FF7823]" : "border-[#CCCCCC]"
|
|
820
818
|
])
|
|
821
819
|
}, [
|
|
822
|
-
I.value === v._id ? (i(), y("div",
|
|
820
|
+
I.value === v._id ? (i(), y("div", us)) : q("", !0)
|
|
823
821
|
], 2)
|
|
824
|
-
], 10,
|
|
822
|
+
], 10, rs))), 128))
|
|
825
823
|
]))
|
|
826
824
|
], 64)) : q("", !0)
|
|
827
825
|
])) : q("", !0),
|
|
828
|
-
l.value === 2 ? (i(), y("div",
|
|
829
|
-
e("div",
|
|
830
|
-
e("h3",
|
|
826
|
+
l.value === 2 ? (i(), y("div", cs, [
|
|
827
|
+
e("div", ds, [
|
|
828
|
+
e("h3", ms, p(j.value), 1)
|
|
831
829
|
]),
|
|
832
|
-
(i(),
|
|
830
|
+
(i(), pe(vn, {
|
|
833
831
|
ref_key: "formRef",
|
|
834
|
-
ref:
|
|
832
|
+
ref: Le,
|
|
835
833
|
class: "w-full",
|
|
836
|
-
"onForm:ready": a[7] || (a[7] = () =>
|
|
834
|
+
"onForm:ready": a[7] || (a[7] = () => Ue.value = !0),
|
|
837
835
|
"onForm:dataChange": st,
|
|
838
|
-
onValidationSuccess:
|
|
836
|
+
onValidationSuccess: jt,
|
|
839
837
|
modelValue: Y.value,
|
|
840
838
|
"onUpdate:modelValue": a[8] || (a[8] = (v) => Y.value = v),
|
|
841
839
|
disabled: ne.value,
|
|
842
840
|
"locked-supplier": Y.value.supplier,
|
|
843
|
-
suppliers: n(
|
|
844
|
-
skus: n(
|
|
845
|
-
key:
|
|
841
|
+
suppliers: n(V).suppliers,
|
|
842
|
+
skus: n(Ce).skus,
|
|
843
|
+
key: K.value,
|
|
846
844
|
"last-closing-date": t.lastClosingDate,
|
|
847
|
-
"sku-balance-map":
|
|
848
|
-
"is-balance-loading":
|
|
845
|
+
"sku-balance-map": Je.value,
|
|
846
|
+
"is-balance-loading": Ve.value
|
|
849
847
|
}, null, 8, ["modelValue", "disabled", "locked-supplier", "suppliers", "skus", "last-closing-date", "sku-balance-map", "is-balance-loading"]))
|
|
850
848
|
])) : q("", !0)
|
|
851
849
|
]),
|
|
852
|
-
e("div",
|
|
853
|
-
e("div",
|
|
854
|
-
e("div",
|
|
855
|
-
e("div",
|
|
856
|
-
e("div",
|
|
850
|
+
e("div", fs, [
|
|
851
|
+
e("div", ps, [
|
|
852
|
+
e("div", vs, [
|
|
853
|
+
e("div", ys, [
|
|
854
|
+
e("div", bs, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.summaryTitle")), 1)
|
|
857
855
|
]),
|
|
858
|
-
e("div",
|
|
859
|
-
e("span",
|
|
856
|
+
e("div", hs, [
|
|
857
|
+
e("span", gs, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.summaryDestination")), 1),
|
|
860
858
|
e("span", {
|
|
861
|
-
class:
|
|
862
|
-
}, p(
|
|
863
|
-
|
|
859
|
+
class: Q(["text-[15px] leading-[20px] font-semibold transition-colors duration-200", T.value ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
|
|
860
|
+
}, p(g.value), 3),
|
|
861
|
+
re.value ? (i(), y("span", _s, p(re.value), 1)) : q("", !0)
|
|
864
862
|
]),
|
|
865
|
-
e("div",
|
|
866
|
-
e("span",
|
|
863
|
+
e("div", xs, [
|
|
864
|
+
e("span", ws, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.summaryMethod")), 1),
|
|
867
865
|
e("span", {
|
|
868
|
-
class:
|
|
869
|
-
}, p(
|
|
866
|
+
class: Q(["text-[15px] leading-[20px] font-semibold transition-colors duration-200", R.value ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
|
|
867
|
+
}, p(O.value), 3)
|
|
870
868
|
]),
|
|
871
|
-
e("div",
|
|
872
|
-
e("span",
|
|
869
|
+
e("div", ks, [
|
|
870
|
+
e("span", Cs, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.summarySource")), 1),
|
|
873
871
|
e("span", {
|
|
874
|
-
class:
|
|
872
|
+
class: Q([
|
|
875
873
|
"text-[15px] leading-[20px] font-semibold transition-colors duration-200",
|
|
876
|
-
|
|
874
|
+
J.value || I.value ? "text-[#1C1C1E]" : "text-[#B2B3B6]"
|
|
877
875
|
])
|
|
878
876
|
}, p(M.value), 3),
|
|
879
|
-
te.value ? (i(), y("span",
|
|
877
|
+
te.value ? (i(), y("span", Fs, p(te.value), 1)) : q("", !0)
|
|
880
878
|
]),
|
|
881
|
-
e("div",
|
|
882
|
-
e("span",
|
|
879
|
+
e("div", Ss, [
|
|
880
|
+
e("span", Rs, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.summaryItems")), 1),
|
|
883
881
|
e("span", {
|
|
884
|
-
class:
|
|
885
|
-
}, p(
|
|
882
|
+
class: Q(["text-[15px] leading-[20px] font-medium transition-colors duration-200", z.value ? "text-[#1C1C1E]" : "text-[#6B6C70]"])
|
|
883
|
+
}, p(fe.value), 3)
|
|
886
884
|
])
|
|
887
885
|
])
|
|
888
886
|
])
|
|
@@ -894,55 +892,55 @@ const ta = {
|
|
|
894
892
|
_: 1
|
|
895
893
|
})
|
|
896
894
|
])),
|
|
897
|
-
E(n(
|
|
898
|
-
modelValue:
|
|
899
|
-
"onUpdate:modelValue": a[10] || (a[10] = (S) =>
|
|
895
|
+
E(n(B), {
|
|
896
|
+
modelValue: Fe.value,
|
|
897
|
+
"onUpdate:modelValue": a[10] || (a[10] = (S) => Fe.value = S),
|
|
900
898
|
overlay: !0
|
|
901
899
|
}, {
|
|
902
|
-
"dialog-header":
|
|
903
|
-
e("div",
|
|
900
|
+
"dialog-header": Ae(() => [
|
|
901
|
+
e("div", Ps, p(n(o)("inventory.transfer.template.zeroQuantity.title")), 1)
|
|
904
902
|
]),
|
|
905
|
-
"dialog-footer":
|
|
906
|
-
e("div",
|
|
903
|
+
"dialog-footer": Ae(() => [
|
|
904
|
+
e("div", Bs, [
|
|
907
905
|
E(n(x), {
|
|
908
906
|
label: n(o)("common.cancel"),
|
|
909
907
|
variant: "tertiary",
|
|
910
908
|
size: "md",
|
|
911
|
-
onClick: a[9] || (a[9] = (S) =>
|
|
909
|
+
onClick: a[9] || (a[9] = (S) => Fe.value = !1)
|
|
912
910
|
}, null, 8, ["label"]),
|
|
913
911
|
E(n(x), {
|
|
914
912
|
label: n(o)("inventory.transfer.template.zeroQuantity.removeAll"),
|
|
915
913
|
variant: "primary",
|
|
916
914
|
size: "md",
|
|
917
915
|
"prepend-icon": "delete",
|
|
918
|
-
onClick:
|
|
916
|
+
onClick: Vt
|
|
919
917
|
}, null, 8, ["label"])
|
|
920
918
|
])
|
|
921
919
|
]),
|
|
922
|
-
default:
|
|
923
|
-
e("div",
|
|
924
|
-
e("div",
|
|
925
|
-
count:
|
|
920
|
+
default: Ae(() => [
|
|
921
|
+
e("div", Ds, [
|
|
922
|
+
e("div", qs, p(n(o)("inventory.transfer.template.zeroQuantity.message", {
|
|
923
|
+
count: we.value.length
|
|
926
924
|
})), 1),
|
|
927
|
-
e("div",
|
|
928
|
-
e("ul",
|
|
929
|
-
(i(!0), y(
|
|
925
|
+
e("div", Es, [
|
|
926
|
+
e("ul", Ns, [
|
|
927
|
+
(i(!0), y(Se, null, tt(we.value, (S) => (i(), y("li", {
|
|
930
928
|
key: S.sku._id,
|
|
931
929
|
class: "fm-typo-en-body-md-400"
|
|
932
930
|
}, p(S.sku.name) + " (" + p(S.sku.code) + ") ", 1))), 128))
|
|
933
931
|
])
|
|
934
932
|
]),
|
|
935
|
-
e("div",
|
|
933
|
+
e("div", $s, p(n(o)("inventory.transfer.template.zeroQuantity.prompt")), 1)
|
|
936
934
|
])
|
|
937
935
|
]),
|
|
938
936
|
_: 1
|
|
939
937
|
}, 8, ["modelValue"])
|
|
940
938
|
], 64));
|
|
941
939
|
}
|
|
942
|
-
}),
|
|
940
|
+
}), As = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-2xl overflow-hidden" }, Ts = { class: "flex justify-between items-center px-16 py-3 border-b border-gray-200 bg-gray-50" }, Is = { class: "flex gap-2 items-center" }, Ls = ["disabled"], zs = { class: "flex-1 overflow-auto bg-gray-100 flex items-center justify-center" }, Ms = {
|
|
943
941
|
key: 0,
|
|
944
942
|
class: "flex flex-col items-center gap-3 text-gray-500"
|
|
945
|
-
},
|
|
943
|
+
}, Us = ["src"], Vs = /* @__PURE__ */ at({
|
|
946
944
|
__name: "PdfPreviewDialog",
|
|
947
945
|
props: {
|
|
948
946
|
modelValue: { type: Boolean },
|
|
@@ -951,43 +949,43 @@ const ta = {
|
|
|
951
949
|
},
|
|
952
950
|
emits: ["update:modelValue"],
|
|
953
951
|
setup(C, { emit: _ }) {
|
|
954
|
-
const x = C,
|
|
952
|
+
const x = C, B = _, $ = P(null);
|
|
955
953
|
function L() {
|
|
956
|
-
|
|
954
|
+
B("update:modelValue", !1);
|
|
957
955
|
}
|
|
958
|
-
function
|
|
959
|
-
var
|
|
956
|
+
function G() {
|
|
957
|
+
var U, o;
|
|
960
958
|
if (x.blobUrl)
|
|
961
959
|
try {
|
|
962
|
-
(o = (
|
|
960
|
+
(o = (U = $.value) == null ? void 0 : U.contentWindow) == null || o.print();
|
|
963
961
|
} catch {
|
|
964
962
|
const s = document.createElement("a");
|
|
965
963
|
s.href = x.blobUrl, s.download = "purchase-order.pdf", document.body.appendChild(s), s.click(), document.body.removeChild(s);
|
|
966
964
|
}
|
|
967
965
|
}
|
|
968
|
-
return (
|
|
969
|
-
|
|
966
|
+
return (U, o) => (i(), pe(dt, { to: "body" }, [
|
|
967
|
+
U.modelValue ? (i(), y("div", {
|
|
970
968
|
key: 0,
|
|
971
969
|
class: "fixed inset-0 z-[9999] bg-black/50 flex justify-center items-center",
|
|
972
|
-
onClick:
|
|
970
|
+
onClick: Qt(L, ["self"])
|
|
973
971
|
}, [
|
|
974
|
-
e("div",
|
|
975
|
-
e("div",
|
|
972
|
+
e("div", As, [
|
|
973
|
+
e("div", Ts, [
|
|
976
974
|
o[0] || (o[0] = e("span", { class: "text-base font-semibold text-gray-700" }, "Print Preview", -1)),
|
|
977
|
-
e("div",
|
|
975
|
+
e("div", Is, [
|
|
978
976
|
e("button", {
|
|
979
|
-
disabled:
|
|
977
|
+
disabled: U.loading || !U.blobUrl,
|
|
980
978
|
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",
|
|
981
|
-
onClick:
|
|
982
|
-
}, " Print ", 8,
|
|
979
|
+
onClick: G
|
|
980
|
+
}, " Print ", 8, Ls),
|
|
983
981
|
e("button", {
|
|
984
982
|
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",
|
|
985
983
|
onClick: L
|
|
986
984
|
}, " × ")
|
|
987
985
|
])
|
|
988
986
|
]),
|
|
989
|
-
e("div",
|
|
990
|
-
|
|
987
|
+
e("div", zs, [
|
|
988
|
+
U.loading ? (i(), y("div", Ms, o[1] || (o[1] = [
|
|
991
989
|
e("svg", {
|
|
992
990
|
class: "animate-spin h-10 w-10 text-blue-500",
|
|
993
991
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1009,19 +1007,19 @@ const ta = {
|
|
|
1009
1007
|
})
|
|
1010
1008
|
], -1),
|
|
1011
1009
|
e("span", { class: "text-sm" }, "Generating PDF…", -1)
|
|
1012
|
-
]))) :
|
|
1010
|
+
]))) : U.blobUrl ? (i(), y("iframe", {
|
|
1013
1011
|
key: 1,
|
|
1014
1012
|
ref_key: "iframeRef",
|
|
1015
|
-
ref:
|
|
1016
|
-
src:
|
|
1013
|
+
ref: $,
|
|
1014
|
+
src: U.blobUrl,
|
|
1017
1015
|
class: "w-full h-full border-none"
|
|
1018
|
-
}, null, 8,
|
|
1016
|
+
}, null, 8, Us)) : q("", !0)
|
|
1019
1017
|
])
|
|
1020
1018
|
])
|
|
1021
1019
|
])) : q("", !0)
|
|
1022
1020
|
]));
|
|
1023
1021
|
}
|
|
1024
|
-
}),
|
|
1022
|
+
}), Js = /* @__PURE__ */ at({
|
|
1025
1023
|
__name: "MultiLocationSelector",
|
|
1026
1024
|
props: /* @__PURE__ */ Gt({
|
|
1027
1025
|
locations: {}
|
|
@@ -1031,59 +1029,59 @@ const ta = {
|
|
|
1031
1029
|
}),
|
|
1032
1030
|
emits: ["update:modelValue"],
|
|
1033
1031
|
setup(C) {
|
|
1034
|
-
const { t: _ } = it(), x = C,
|
|
1032
|
+
const { t: _ } = it(), x = C, B = Kt(C, "modelValue"), $ = P(!1), L = P(""), G = A(() => {
|
|
1035
1033
|
const d = L.value.trim().toLowerCase();
|
|
1036
1034
|
return d ? x.locations.filter(
|
|
1037
|
-
(
|
|
1035
|
+
(b) => b.name.toLowerCase().includes(d) || (b.doc.profile.code ?? "").toLowerCase().includes(d)
|
|
1038
1036
|
) : x.locations;
|
|
1039
|
-
}),
|
|
1040
|
-
() =>
|
|
1041
|
-
), s =
|
|
1042
|
-
() =>
|
|
1043
|
-
),
|
|
1044
|
-
if (
|
|
1045
|
-
if (
|
|
1046
|
-
const d = x.locations.find((
|
|
1047
|
-
return d ? `${d.name} (${d.doc.profile.code ?? "--"})` :
|
|
1037
|
+
}), U = A(() => B.value.length), o = A(
|
|
1038
|
+
() => G.value.length > 0 && G.value.every((d) => B.value.includes(d.dbName))
|
|
1039
|
+
), s = A(
|
|
1040
|
+
() => G.value.some((d) => B.value.includes(d.dbName)) && !o.value
|
|
1041
|
+
), h = A(() => {
|
|
1042
|
+
if (U.value === 0) return _("inventory.transfer.receiveRequest.bulk.noLocationsSelected");
|
|
1043
|
+
if (U.value === 1) {
|
|
1044
|
+
const d = x.locations.find((b) => b.dbName === B.value[0]);
|
|
1045
|
+
return d ? `${d.name} (${d.doc.profile.code ?? "--"})` : B.value[0];
|
|
1048
1046
|
}
|
|
1049
|
-
return _("inventory.transfer.receiveRequest.bulk.locationsSelected", [
|
|
1047
|
+
return _("inventory.transfer.receiveRequest.bulk.locationsSelected", [U.value]);
|
|
1050
1048
|
});
|
|
1051
|
-
function
|
|
1052
|
-
const d =
|
|
1053
|
-
o.value ?
|
|
1049
|
+
function V() {
|
|
1050
|
+
const d = G.value.map((b) => b.dbName);
|
|
1051
|
+
o.value ? B.value = B.value.filter((b) => !d.includes(b)) : B.value = [.../* @__PURE__ */ new Set([...B.value, ...d])];
|
|
1054
1052
|
}
|
|
1055
|
-
function
|
|
1056
|
-
|
|
1053
|
+
function Ce(d) {
|
|
1054
|
+
B.value.includes(d) ? B.value = B.value.filter((b) => b !== d) : B.value = [...B.value, d];
|
|
1057
1055
|
}
|
|
1058
1056
|
function m(d) {
|
|
1059
|
-
return
|
|
1057
|
+
return B.value.includes(d);
|
|
1060
1058
|
}
|
|
1061
|
-
return (d,
|
|
1062
|
-
const c =
|
|
1063
|
-
return i(),
|
|
1064
|
-
"model-value":
|
|
1059
|
+
return (d, b) => {
|
|
1060
|
+
const c = Oe("FmIcon"), w = Oe("FmChip"), l = Oe("FmTextField"), f = Oe("FmMenuItem"), T = Oe("FmMenu");
|
|
1061
|
+
return i(), pe(T, {
|
|
1062
|
+
"model-value": $.value,
|
|
1065
1063
|
placement: "bottom-end",
|
|
1066
1064
|
"close-on-click": !1,
|
|
1067
|
-
onMenuChanged:
|
|
1068
|
-
|
|
1065
|
+
onMenuChanged: b[1] || (b[1] = (W) => {
|
|
1066
|
+
$.value = W, W || (L.value = "");
|
|
1069
1067
|
})
|
|
1070
1068
|
}, {
|
|
1071
|
-
"menu-button":
|
|
1069
|
+
"menu-button": Ae(() => [
|
|
1072
1070
|
E(w, {
|
|
1073
|
-
label:
|
|
1071
|
+
label: h.value,
|
|
1074
1072
|
class: "text-fm-color-neutral-gray-400 cursor-pointer"
|
|
1075
1073
|
}, {
|
|
1076
|
-
default:
|
|
1074
|
+
default: Ae(() => [
|
|
1077
1075
|
E(c, {
|
|
1078
1076
|
name: "storefront",
|
|
1079
1077
|
outline: "",
|
|
1080
1078
|
size: "sm"
|
|
1081
1079
|
}),
|
|
1082
1080
|
e("div", {
|
|
1083
|
-
class:
|
|
1084
|
-
}, p(
|
|
1081
|
+
class: Q(["fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap max-w-[200px]", { "text-fm-color-typo-primary": U.value > 0 }])
|
|
1082
|
+
}, p(h.value), 3),
|
|
1085
1083
|
E(c, {
|
|
1086
|
-
name:
|
|
1084
|
+
name: $.value ? "keyboard_arrow_up" : "keyboard_arrow_down",
|
|
1087
1085
|
outline: "",
|
|
1088
1086
|
size: "sm"
|
|
1089
1087
|
}, null, 8, ["name"])
|
|
@@ -1091,10 +1089,10 @@ const ta = {
|
|
|
1091
1089
|
_: 1
|
|
1092
1090
|
}, 8, ["label"])
|
|
1093
1091
|
]),
|
|
1094
|
-
default:
|
|
1092
|
+
default: Ae(() => [
|
|
1095
1093
|
E(l, {
|
|
1096
1094
|
"model-value": L.value,
|
|
1097
|
-
"onUpdate:modelValue":
|
|
1095
|
+
"onUpdate:modelValue": b[0] || (b[0] = (W) => L.value = W),
|
|
1098
1096
|
placeholder: n(_)("inventory.common.table.toolbar.filterItems"),
|
|
1099
1097
|
class: "my-8"
|
|
1100
1098
|
}, null, 8, ["model-value", "placeholder"]),
|
|
@@ -1103,17 +1101,17 @@ const ta = {
|
|
|
1103
1101
|
label: n(_)("inventory.common.selectAll"),
|
|
1104
1102
|
"has-checkbox": !0,
|
|
1105
1103
|
indeterminate: s.value,
|
|
1106
|
-
onClick:
|
|
1104
|
+
onClick: V
|
|
1107
1105
|
}, null, 8, ["model-value", "label", "indeterminate"]),
|
|
1108
|
-
(i(!0), y(
|
|
1106
|
+
(i(!0), y(Se, null, tt(G.value, (W) => (i(), pe(f, {
|
|
1109
1107
|
key: W.dbName,
|
|
1110
1108
|
"model-value": m(W.dbName),
|
|
1111
1109
|
label: `${W.name} (${W.doc.profile.code ?? "--"})`,
|
|
1112
1110
|
sublabel: W.type === "restaurant" ? n(_)("inventory.common.restaurant") : n(_)("inventory.common.warehouse"),
|
|
1113
1111
|
"has-checkbox": !0,
|
|
1114
|
-
onClick: (R) =>
|
|
1112
|
+
onClick: (R) => Ce(W.dbName)
|
|
1115
1113
|
}, null, 8, ["model-value", "label", "sublabel", "onClick"]))), 128)),
|
|
1116
|
-
|
|
1114
|
+
G.value.length === 0 ? (i(), pe(f, {
|
|
1117
1115
|
key: 0,
|
|
1118
1116
|
disabled: "",
|
|
1119
1117
|
label: n(_)("inventory.common.noResultFound")
|
|
@@ -1123,40 +1121,40 @@ const ta = {
|
|
|
1123
1121
|
}, 8, ["model-value"]);
|
|
1124
1122
|
};
|
|
1125
1123
|
}
|
|
1126
|
-
}),
|
|
1127
|
-
function
|
|
1124
|
+
}), Lt = "bulk-jobs-v1";
|
|
1125
|
+
function js() {
|
|
1128
1126
|
try {
|
|
1129
|
-
const C = localStorage.getItem(
|
|
1127
|
+
const C = localStorage.getItem(Lt);
|
|
1130
1128
|
return C ? JSON.parse(C) : [];
|
|
1131
1129
|
} catch {
|
|
1132
1130
|
return [];
|
|
1133
1131
|
}
|
|
1134
1132
|
}
|
|
1135
|
-
function
|
|
1133
|
+
function Ws(C) {
|
|
1136
1134
|
try {
|
|
1137
|
-
localStorage.setItem(
|
|
1135
|
+
localStorage.setItem(Lt, JSON.stringify(C));
|
|
1138
1136
|
} catch {
|
|
1139
1137
|
}
|
|
1140
1138
|
}
|
|
1141
|
-
const
|
|
1142
|
-
function
|
|
1139
|
+
const Nt = 5e3, $t = 3e3, Ys = 300, et = ["completed", "failed", "cancelled"];
|
|
1140
|
+
function Hs(C, _) {
|
|
1143
1141
|
var x;
|
|
1144
1142
|
return C.cancelled ? "cancelled" : C.message === "completed" ? "completed" : C.message === "error" || (x = C.message) != null && x.startsWith("error:") ? "failed" : C.message === "processing" ? "active" : "waiting";
|
|
1145
1143
|
}
|
|
1146
|
-
const wt =
|
|
1147
|
-
const C = P(
|
|
1144
|
+
const wt = Yn("bulkJob", () => {
|
|
1145
|
+
const C = P(js()), _ = /* @__PURE__ */ new Map();
|
|
1148
1146
|
let x = null;
|
|
1149
|
-
|
|
1150
|
-
x && clearTimeout(x), x = setTimeout(() =>
|
|
1147
|
+
Qe(C, (m) => {
|
|
1148
|
+
x && clearTimeout(x), x = setTimeout(() => Ws(m), Ys);
|
|
1151
1149
|
}, { deep: !0 });
|
|
1152
|
-
function
|
|
1150
|
+
function B(m, d) {
|
|
1153
1151
|
var R;
|
|
1154
|
-
const
|
|
1155
|
-
let c =
|
|
1152
|
+
const b = C.value.find((J) => J.jobId === m);
|
|
1153
|
+
let c = Hs(d, b == null ? void 0 : b.type);
|
|
1156
1154
|
const w = d.errorCount ?? 0;
|
|
1157
|
-
c === "completed" && w > 0 && (
|
|
1158
|
-
const l = d.total ?? 0, f = d.current ?? 0, T = c === "failed" || c === "completed" && w > 0, W = (
|
|
1159
|
-
|
|
1155
|
+
c === "completed" && w > 0 && (b == null ? void 0 : b.type) === "download" && (c = "failed");
|
|
1156
|
+
const l = d.total ?? 0, f = d.current ?? 0, T = c === "failed" || c === "completed" && w > 0, W = (b == null ? void 0 : b.hidden) && T;
|
|
1157
|
+
U(m, {
|
|
1160
1158
|
status: c,
|
|
1161
1159
|
progress: l > 0 ? Math.round(f / l * 100) : 0,
|
|
1162
1160
|
current: f,
|
|
@@ -1168,57 +1166,57 @@ const wt = Kn("bulkJob", () => {
|
|
|
1168
1166
|
zipSizeBytes: d.zipSizeBytes ?? void 0,
|
|
1169
1167
|
stalePoIds: (R = d.stalePoIds) != null && R.length ? d.stalePoIds : void 0,
|
|
1170
1168
|
...W ? { hidden: !1 } : {}
|
|
1171
|
-
}), et.includes(c) && (L(m),
|
|
1169
|
+
}), et.includes(c) && (L(m), b != null && b.hidden && !W && o(m));
|
|
1172
1170
|
}
|
|
1173
|
-
function
|
|
1171
|
+
function $(m) {
|
|
1174
1172
|
if (_.has(m) || !C.value.find((I) => I.jobId === m)) return;
|
|
1175
|
-
const
|
|
1173
|
+
const b = nt();
|
|
1176
1174
|
let c = !1, w = null, l = !1;
|
|
1177
1175
|
async function f() {
|
|
1178
1176
|
if (l || c) return;
|
|
1179
|
-
const I = C.value.find((
|
|
1177
|
+
const I = C.value.find((ae) => ae.jobId === m);
|
|
1180
1178
|
if (!(!I || et.includes(I.status)))
|
|
1181
1179
|
try {
|
|
1182
|
-
const
|
|
1183
|
-
if (
|
|
1184
|
-
|
|
1185
|
-
const
|
|
1186
|
-
|
|
1180
|
+
const ae = await b.getBulkJobStatus(I.dbName, m);
|
|
1181
|
+
if (ae && !l && !c) {
|
|
1182
|
+
B(m, ae);
|
|
1183
|
+
const ue = C.value.find((ce) => ce.jobId === m);
|
|
1184
|
+
ue && !et.includes(ue.status) && (w = setTimeout(f, $t));
|
|
1187
1185
|
}
|
|
1188
1186
|
} catch {
|
|
1189
1187
|
!l && !c && (w = setTimeout(f, $t));
|
|
1190
1188
|
}
|
|
1191
1189
|
}
|
|
1192
|
-
const T =
|
|
1190
|
+
const T = Hn(), { unsubscribe: W, initialState: R } = T.subscribe(
|
|
1193
1191
|
{ type: "bulkPo", params: { jobId: m } },
|
|
1194
1192
|
(I) => {
|
|
1195
|
-
c = !0, w && (clearTimeout(w), w = null),
|
|
1193
|
+
c = !0, w && (clearTimeout(w), w = null), B(m, I);
|
|
1196
1194
|
}
|
|
1197
|
-
),
|
|
1195
|
+
), J = () => {
|
|
1198
1196
|
l = !0, W(), w && (clearTimeout(w), w = null);
|
|
1199
1197
|
};
|
|
1200
|
-
_.set(m,
|
|
1201
|
-
const
|
|
1202
|
-
|
|
1198
|
+
_.set(m, J), R.then((I) => {
|
|
1199
|
+
const ae = I == null ? void 0 : I.initialState;
|
|
1200
|
+
ae && B(m, ae);
|
|
1203
1201
|
}).catch(() => {
|
|
1204
1202
|
}), setTimeout(() => {
|
|
1205
|
-
!c && !l && (console.warn(`[bulkJob] SSE silent for job ${m} after ${
|
|
1206
|
-
},
|
|
1203
|
+
!c && !l && (console.warn(`[bulkJob] SSE silent for job ${m} after ${Nt}ms — starting polling fallback`), f());
|
|
1204
|
+
}, Nt);
|
|
1207
1205
|
}
|
|
1208
1206
|
function L(m) {
|
|
1209
1207
|
const d = _.get(m);
|
|
1210
1208
|
d !== void 0 && (d(), _.delete(m));
|
|
1211
1209
|
}
|
|
1212
|
-
function
|
|
1213
|
-
C.value = [m, ...C.value],
|
|
1210
|
+
function G(m) {
|
|
1211
|
+
C.value = [m, ...C.value], $(m.jobId);
|
|
1214
1212
|
}
|
|
1215
1213
|
for (const m of C.value)
|
|
1216
|
-
et.includes(m.status) ||
|
|
1217
|
-
function
|
|
1218
|
-
const
|
|
1219
|
-
if (
|
|
1220
|
-
const c = C.value[
|
|
1221
|
-
C.value[
|
|
1214
|
+
et.includes(m.status) || $(m.jobId);
|
|
1215
|
+
function U(m, d) {
|
|
1216
|
+
const b = C.value.findIndex((c) => c.jobId === m);
|
|
1217
|
+
if (b !== -1) {
|
|
1218
|
+
const c = C.value[b], w = d.status ?? c.status, l = et.includes(w) && !et.includes(c.status) && !c.completedAt;
|
|
1219
|
+
C.value[b] = {
|
|
1222
1220
|
...c,
|
|
1223
1221
|
...d,
|
|
1224
1222
|
...l ? { completedAt: Date.now() } : {}
|
|
@@ -1229,16 +1227,16 @@ const wt = Kn("bulkJob", () => {
|
|
|
1229
1227
|
L(m), C.value = C.value.filter((d) => d.jobId !== m);
|
|
1230
1228
|
}
|
|
1231
1229
|
async function s(m) {
|
|
1232
|
-
const d = C.value.find((
|
|
1230
|
+
const d = C.value.find((b) => b.jobId === m);
|
|
1233
1231
|
if (d)
|
|
1234
1232
|
try {
|
|
1235
1233
|
await nt().cancelBulkJob(d.dbName, m);
|
|
1236
|
-
} catch (
|
|
1237
|
-
console.warn("[cancelJob] cancel API call failed for job", m,
|
|
1234
|
+
} catch (b) {
|
|
1235
|
+
console.warn("[cancelJob] cancel API call failed for job", m, b);
|
|
1238
1236
|
}
|
|
1239
1237
|
}
|
|
1240
|
-
function
|
|
1241
|
-
return C.value.find((
|
|
1238
|
+
function h(m, d) {
|
|
1239
|
+
return C.value.find((b) => b.jobId === m) || G({
|
|
1242
1240
|
jobId: m,
|
|
1243
1241
|
type: "download",
|
|
1244
1242
|
dbName: d,
|
|
@@ -1250,8 +1248,8 @@ const wt = Kn("bulkJob", () => {
|
|
|
1250
1248
|
errorCount: 0,
|
|
1251
1249
|
startedAt: Date.now(),
|
|
1252
1250
|
hidden: !0
|
|
1253
|
-
}), new Promise((
|
|
1254
|
-
const w =
|
|
1251
|
+
}), new Promise((b, c) => {
|
|
1252
|
+
const w = Qe(
|
|
1255
1253
|
() => C.value.find((l) => l.jobId === m),
|
|
1256
1254
|
(l) => {
|
|
1257
1255
|
if (!l) {
|
|
@@ -1267,7 +1265,7 @@ const wt = Kn("bulkJob", () => {
|
|
|
1267
1265
|
return;
|
|
1268
1266
|
}
|
|
1269
1267
|
if (l.downloadReady) {
|
|
1270
|
-
w(),
|
|
1268
|
+
w(), b();
|
|
1271
1269
|
return;
|
|
1272
1270
|
}
|
|
1273
1271
|
},
|
|
@@ -1275,109 +1273,109 @@ const wt = Kn("bulkJob", () => {
|
|
|
1275
1273
|
);
|
|
1276
1274
|
});
|
|
1277
1275
|
}
|
|
1278
|
-
const
|
|
1276
|
+
const V = A(
|
|
1279
1277
|
() => C.value.filter((m) => !m.hidden && (m.status === "waiting" || m.status === "active"))
|
|
1280
|
-
),
|
|
1281
|
-
return { jobs: C, addJob:
|
|
1278
|
+
), Ce = A(() => V.value.length > 0);
|
|
1279
|
+
return { jobs: C, addJob: G, updateJob: U, removeJob: o, cancelJob: s, waitForPdfJob: h, activeJobs: V, hasActiveJobs: Ce };
|
|
1282
1280
|
}), lt = P(), Be = P();
|
|
1283
1281
|
let bt = 0;
|
|
1284
1282
|
const ht = P();
|
|
1285
|
-
function
|
|
1286
|
-
const _ =
|
|
1283
|
+
function Qs(C) {
|
|
1284
|
+
const _ = Fn(), x = mt(), B = xt(), $ = At(), L = Ot(), G = En(), U = Tt(), o = P(!1), s = ft(), { t: h } = it(), V = nt(), Ce = Nn(), m = wt(), d = P([]), b = P([]), c = P(new Array()), w = P(
|
|
1287
1285
|
new Array()
|
|
1288
1286
|
), l = P(
|
|
1289
1287
|
C != null && C.startDate && (C != null && C.endDate) ? C : _t()
|
|
1290
|
-
), f =
|
|
1288
|
+
), f = A(() => {
|
|
1291
1289
|
const r = new Date(l.value.startDate), u = new Date(l.value.endDate);
|
|
1292
1290
|
return {
|
|
1293
|
-
start:
|
|
1294
|
-
end:
|
|
1291
|
+
start: jn(r).toISOString(),
|
|
1292
|
+
end: Jn(u).toISOString()
|
|
1295
1293
|
};
|
|
1296
|
-
}), T =
|
|
1297
|
-
let
|
|
1298
|
-
function
|
|
1299
|
-
|
|
1294
|
+
}), T = un(), W = P(null), R = P([]), J = P(), I = P(!1), ae = P(null);
|
|
1295
|
+
let ue = null;
|
|
1296
|
+
function ce() {
|
|
1297
|
+
ue && (ue.abort(), ue = null, o.value = !1, I.value = !1, ae.value = null);
|
|
1300
1298
|
}
|
|
1301
|
-
let
|
|
1302
|
-
|
|
1303
|
-
|
|
1299
|
+
let de = null;
|
|
1300
|
+
Xt() && Zt(() => {
|
|
1301
|
+
ce(), de == null || de.abort();
|
|
1304
1302
|
});
|
|
1305
|
-
function
|
|
1306
|
-
const u = x.locations.find((
|
|
1303
|
+
function Ue(r) {
|
|
1304
|
+
const u = x.locations.find((g) => g.dbName === r._locationDbName);
|
|
1307
1305
|
if (!u) return null;
|
|
1308
1306
|
if (u.type === "restaurant") {
|
|
1309
|
-
const
|
|
1310
|
-
if (
|
|
1311
|
-
return { ...u, doc:
|
|
1307
|
+
const g = x.locationRestaurantFromCore(u.doc._id);
|
|
1308
|
+
if (g !== null)
|
|
1309
|
+
return { ...u, doc: g };
|
|
1312
1310
|
}
|
|
1313
1311
|
return u;
|
|
1314
1312
|
}
|
|
1315
|
-
function
|
|
1316
|
-
const u = x.locations.find((
|
|
1313
|
+
function Fe(r) {
|
|
1314
|
+
const u = x.locations.find((g) => g.dbName === r._locationDbName);
|
|
1317
1315
|
u && (x._currentLocation = u);
|
|
1318
1316
|
}
|
|
1319
|
-
async function
|
|
1320
|
-
const
|
|
1321
|
-
|
|
1322
|
-
let F = u.cursor,
|
|
1323
|
-
for (; Z && !
|
|
1324
|
-
const ee = await
|
|
1317
|
+
async function Ve(r, u, g) {
|
|
1318
|
+
const O = d.value.map((ee) => ({ dbName: ee })), M = O.length;
|
|
1319
|
+
ae.value = { done: 0, total: M };
|
|
1320
|
+
let F = u.cursor, H = u.retryFailed, Z = !0;
|
|
1321
|
+
for (; Z && !g.aborted; ) {
|
|
1322
|
+
const ee = await V.getBulkPaginatedPurchaseOrders(
|
|
1325
1323
|
{
|
|
1326
|
-
locations:
|
|
1324
|
+
locations: O,
|
|
1327
1325
|
...f.value,
|
|
1328
1326
|
pageSize: 100,
|
|
1329
1327
|
cursor: F,
|
|
1330
|
-
retryFailed:
|
|
1328
|
+
retryFailed: H
|
|
1331
1329
|
},
|
|
1332
|
-
|
|
1330
|
+
g
|
|
1333
1331
|
);
|
|
1334
|
-
if (
|
|
1335
|
-
|
|
1332
|
+
if (g.aborted) return;
|
|
1333
|
+
H = void 0, ae.value = {
|
|
1336
1334
|
done: Math.max(0, M - ee.pendingLocations),
|
|
1337
1335
|
total: M
|
|
1338
1336
|
}, r.push(
|
|
1339
1337
|
...ee.data.map(
|
|
1340
|
-
({ locationDbName:
|
|
1338
|
+
({ locationDbName: re, ...te }) => ({ ...te, _locationDbName: re })
|
|
1341
1339
|
)
|
|
1342
|
-
),
|
|
1340
|
+
), b.value = [...r].sort((re, te) => te._id.localeCompare(re._id)), R.value = ee.failed, J.value = ee.cursor, Z = ee.hasNext, F = ee.cursor;
|
|
1343
1341
|
}
|
|
1344
1342
|
}
|
|
1345
|
-
async function
|
|
1346
|
-
const r =
|
|
1347
|
-
c.value = r.length > 0 ? await
|
|
1343
|
+
async function Je() {
|
|
1344
|
+
const r = b.value.flatMap((u) => u.shipmentIds || []).filter(Boolean);
|
|
1345
|
+
c.value = r.length > 0 ? await Ce.getShipmentsByIds(r) : [];
|
|
1348
1346
|
}
|
|
1349
|
-
async function
|
|
1350
|
-
const u = r.map((
|
|
1351
|
-
var
|
|
1352
|
-
return ((
|
|
1353
|
-
}).filter((
|
|
1354
|
-
w.value = u.length > 0 ? await
|
|
1347
|
+
async function Le(r) {
|
|
1348
|
+
const u = r.map((g) => {
|
|
1349
|
+
var O;
|
|
1350
|
+
return ((O = g.request) == null ? void 0 : O.id) ?? "";
|
|
1351
|
+
}).filter((g) => g);
|
|
1352
|
+
w.value = u.length > 0 ? await V.readRequestByIds(u) : [];
|
|
1355
1353
|
}
|
|
1356
|
-
const
|
|
1357
|
-
async function
|
|
1354
|
+
const oe = 25;
|
|
1355
|
+
async function se() {
|
|
1358
1356
|
var u;
|
|
1359
|
-
if (
|
|
1357
|
+
if (b.value = [], c.value = [], R.value = [], J.value = void 0, d.value.length === 0)
|
|
1360
1358
|
return;
|
|
1361
|
-
if (d.value.length >
|
|
1359
|
+
if (d.value.length > oe) {
|
|
1362
1360
|
s.open({
|
|
1363
1361
|
title: "Too many locations selected",
|
|
1364
|
-
message: `Select at most ${
|
|
1362
|
+
message: `Select at most ${oe} locations`,
|
|
1365
1363
|
type: "warning"
|
|
1366
1364
|
});
|
|
1367
1365
|
return;
|
|
1368
1366
|
}
|
|
1369
|
-
|
|
1367
|
+
ce();
|
|
1370
1368
|
const r = new AbortController();
|
|
1371
|
-
|
|
1369
|
+
ue = r, o.value = !0;
|
|
1372
1370
|
try {
|
|
1373
|
-
await
|
|
1371
|
+
await Ve([], {}, r.signal), R.value.length > 0 && s.open({
|
|
1374
1372
|
title: "Some locations failed to load",
|
|
1375
1373
|
message: `Purchase orders could not be loaded for ${R.value.length} location(s)`,
|
|
1376
1374
|
type: "error"
|
|
1377
|
-
}), await
|
|
1378
|
-
const
|
|
1379
|
-
M && (W.value =
|
|
1380
|
-
const F = await
|
|
1375
|
+
}), await Je();
|
|
1376
|
+
const O = await T.readCurrentLocationLastClosing(!0), M = O == null ? void 0 : O._id;
|
|
1377
|
+
M && (W.value = Wn(M));
|
|
1378
|
+
const F = await B.awaitLocationFeatures(
|
|
1381
1379
|
(u = x._currentLocation) == null ? void 0 : u.dbName,
|
|
1382
1380
|
{ signal: r.signal, retryOnError: !0 }
|
|
1383
1381
|
);
|
|
@@ -1386,28 +1384,28 @@ function Xs(C) {
|
|
|
1386
1384
|
title: "Outlet settings couldn’t load",
|
|
1387
1385
|
message: "Transfer template requirements are unconfirmed. Refresh to try again.",
|
|
1388
1386
|
type: "warning"
|
|
1389
|
-
}), F === "ready" &&
|
|
1390
|
-
} catch (
|
|
1387
|
+
}), F === "ready" && B.warehouseRequestRequiresTemplate && await U.fetchTemplates();
|
|
1388
|
+
} catch (g) {
|
|
1391
1389
|
if (r.signal.aborted) return;
|
|
1392
1390
|
s.open({
|
|
1393
1391
|
title: "Something went wrong",
|
|
1394
1392
|
// the API client surfaces the server's message (e.g. the location cap)
|
|
1395
|
-
message: (
|
|
1393
|
+
message: (g == null ? void 0 : g.message) || "Error at fetching purchase orders",
|
|
1396
1394
|
type: "error"
|
|
1397
1395
|
});
|
|
1398
1396
|
} finally {
|
|
1399
|
-
|
|
1397
|
+
ue === r && (ue = null, o.value = !1, ae.value = null);
|
|
1400
1398
|
}
|
|
1401
1399
|
}
|
|
1402
|
-
async function
|
|
1403
|
-
if (!
|
|
1404
|
-
|
|
1400
|
+
async function ke() {
|
|
1401
|
+
if (!J.value || !R.value.some((u) => u.retryable)) return;
|
|
1402
|
+
ce();
|
|
1405
1403
|
const r = new AbortController();
|
|
1406
|
-
|
|
1404
|
+
ue = r, I.value = !0;
|
|
1407
1405
|
try {
|
|
1408
|
-
const u = [...
|
|
1409
|
-
if (await
|
|
1410
|
-
await
|
|
1406
|
+
const u = [...b.value];
|
|
1407
|
+
if (await Ve(u, { cursor: J.value, retryFailed: !0 }, r.signal), r.signal.aborted) return;
|
|
1408
|
+
await Je();
|
|
1411
1409
|
} catch (u) {
|
|
1412
1410
|
if (r.signal.aborted) return;
|
|
1413
1411
|
s.open({
|
|
@@ -1416,28 +1414,28 @@ function Xs(C) {
|
|
|
1416
1414
|
type: "error"
|
|
1417
1415
|
});
|
|
1418
1416
|
} finally {
|
|
1419
|
-
|
|
1417
|
+
ue === r && (ue = null, I.value = !1, ae.value = null);
|
|
1420
1418
|
}
|
|
1421
1419
|
}
|
|
1422
|
-
function
|
|
1423
|
-
l.value = { startDate: r, endDate: u },
|
|
1420
|
+
function _e(r, u) {
|
|
1421
|
+
l.value = { startDate: r, endDate: u }, se();
|
|
1424
1422
|
}
|
|
1425
|
-
const
|
|
1423
|
+
const Ee = P();
|
|
1426
1424
|
async function Ze(r) {
|
|
1427
|
-
var Z, ee,
|
|
1425
|
+
var Z, ee, re;
|
|
1428
1426
|
const u = d.value[0];
|
|
1429
1427
|
if (u) {
|
|
1430
|
-
const te = x.locations.find((
|
|
1428
|
+
const te = x.locations.find((fe) => fe.dbName === u);
|
|
1431
1429
|
te && (x._currentLocation = te);
|
|
1432
1430
|
}
|
|
1433
|
-
|
|
1434
|
-
const
|
|
1435
|
-
|
|
1436
|
-
const
|
|
1437
|
-
signal:
|
|
1431
|
+
de == null || de.abort();
|
|
1432
|
+
const g = new AbortController();
|
|
1433
|
+
de = g;
|
|
1434
|
+
const O = (Z = x._currentLocation) == null ? void 0 : Z.dbName, M = await B.awaitLocationFeatures(O, {
|
|
1435
|
+
signal: g.signal,
|
|
1438
1436
|
retryOnError: !0
|
|
1439
1437
|
});
|
|
1440
|
-
if (
|
|
1438
|
+
if (g.signal.aborted || ((ee = x._currentLocation) == null ? void 0 : ee.dbName) !== O) return;
|
|
1441
1439
|
if (M !== "ready") {
|
|
1442
1440
|
M === "error" && s.open({
|
|
1443
1441
|
title: "Outlet settings couldn’t load",
|
|
@@ -1447,96 +1445,96 @@ function Xs(C) {
|
|
|
1447
1445
|
return;
|
|
1448
1446
|
}
|
|
1449
1447
|
function F(te) {
|
|
1450
|
-
var
|
|
1451
|
-
if (
|
|
1452
|
-
const
|
|
1453
|
-
mode:
|
|
1448
|
+
var ve;
|
|
1449
|
+
if (g.signal.aborted || ((ve = x._currentLocation) == null ? void 0 : ve.dbName) !== O) return;
|
|
1450
|
+
const fe = {
|
|
1451
|
+
mode: Et.CREATE,
|
|
1454
1452
|
modelValue: r || void 0,
|
|
1455
1453
|
show: !0,
|
|
1456
|
-
"onUpdate:show"(
|
|
1457
|
-
lt.value.show =
|
|
1454
|
+
"onUpdate:show"(Re) {
|
|
1455
|
+
lt.value.show = Re;
|
|
1458
1456
|
},
|
|
1459
1457
|
templateId: te,
|
|
1460
1458
|
lastClosingDate: W.value
|
|
1461
1459
|
};
|
|
1462
|
-
lt.value =
|
|
1460
|
+
lt.value = fe;
|
|
1463
1461
|
}
|
|
1464
|
-
let
|
|
1465
|
-
if (
|
|
1466
|
-
if (await
|
|
1462
|
+
let H;
|
|
1463
|
+
if (B.warehouseRequestRequiresTemplate && !(r != null && r.template)) {
|
|
1464
|
+
if (await U.fetchTemplates(), g.signal.aborted || ((re = x._currentLocation) == null ? void 0 : re.dbName) !== O) return;
|
|
1467
1465
|
_.open({
|
|
1468
1466
|
title: "Create transfer",
|
|
1469
1467
|
message: "",
|
|
1470
1468
|
primaryActions: { text: "Select a template", close: !0 },
|
|
1471
1469
|
secondaryActions: { text: "Outlet to Outlet", variant: "secondary", close: !0 }
|
|
1472
1470
|
}).onPrimary(async () => {
|
|
1473
|
-
|
|
1471
|
+
H = await G.getTemplateId(), H && F(H);
|
|
1474
1472
|
}).onSecondary(() => {
|
|
1475
1473
|
F(void 0);
|
|
1476
1474
|
});
|
|
1477
1475
|
} else
|
|
1478
|
-
F(
|
|
1476
|
+
F(H);
|
|
1479
1477
|
}
|
|
1480
|
-
const
|
|
1481
|
-
async function
|
|
1482
|
-
return r.items != null ? r : await
|
|
1478
|
+
const Ne = Qn();
|
|
1479
|
+
async function je(r, u) {
|
|
1480
|
+
return r.items != null ? r : await V.getPurchaseOrderById(r._id, void 0, u);
|
|
1483
1481
|
}
|
|
1484
1482
|
async function N(r) {
|
|
1485
|
-
await
|
|
1486
|
-
|
|
1487
|
-
const
|
|
1488
|
-
mode:
|
|
1489
|
-
modelValue:
|
|
1483
|
+
await Ne.run(async (u) => {
|
|
1484
|
+
Fe(r);
|
|
1485
|
+
const g = await je(r, u), O = {
|
|
1486
|
+
mode: Et.UPDATE,
|
|
1487
|
+
modelValue: mn(g),
|
|
1490
1488
|
show: !0,
|
|
1491
1489
|
"onUpdate:show"(M) {
|
|
1492
1490
|
lt.value.show = M;
|
|
1493
1491
|
},
|
|
1494
1492
|
lastClosingDate: W.value
|
|
1495
1493
|
};
|
|
1496
|
-
lt.value =
|
|
1494
|
+
lt.value = O;
|
|
1497
1495
|
});
|
|
1498
1496
|
}
|
|
1499
1497
|
async function k(r) {
|
|
1500
|
-
var
|
|
1501
|
-
if (
|
|
1502
|
-
const u = r,
|
|
1498
|
+
var Re, $e, be, Y;
|
|
1499
|
+
if (Fe(r), !L.currentBusiness.value) return;
|
|
1500
|
+
const u = r, g = $.supplierById[r.supplier._id], O = (g == null ? void 0 : g.name) ?? r.supplier.name, M = (g == null ? void 0 : g.email) ?? ((Re = r.supplier) == null ? void 0 : Re.email) ?? "";
|
|
1503
1501
|
if (!M) {
|
|
1504
1502
|
s.open({
|
|
1505
|
-
title:
|
|
1506
|
-
message:
|
|
1503
|
+
title: h("inventory.transfer.receiveRequest.bulk.emailSendError"),
|
|
1504
|
+
message: h("inventory.transfer.receiveRequest.bulk.singleEmailNoSupplierEmail"),
|
|
1507
1505
|
type: "warning"
|
|
1508
1506
|
});
|
|
1509
1507
|
return;
|
|
1510
1508
|
}
|
|
1511
|
-
const F = u._locationDbName,
|
|
1512
|
-
let
|
|
1509
|
+
const F = u._locationDbName, H = r._rev, ee = ((($e = x.locations.find((K) => K.dbName === F)) == null ? void 0 : $e.name) || F).replace(/[/\\?%*:|"<>]/g, "-").trim().slice(0, 50), re = `PO_${r.seqNumber ?? r._id}`.replace(/[/\\?%*:|"<>]/g, "-").slice(0, 50), te = `${ee}/${re}`, fe = ++bt;
|
|
1510
|
+
let ve = null;
|
|
1513
1511
|
Be.value = {
|
|
1514
|
-
recipientName:
|
|
1512
|
+
recipientName: O,
|
|
1515
1513
|
email: M,
|
|
1516
1514
|
business: L.currentBusiness.value,
|
|
1517
1515
|
pdfLoading: !0,
|
|
1518
1516
|
show: !0,
|
|
1519
|
-
"onUpdate:show"(
|
|
1520
|
-
!
|
|
1517
|
+
"onUpdate:show"(K) {
|
|
1518
|
+
!K && ve && (URL.revokeObjectURL(ve), ve = null), Be.value && (Be.value = { ...Be.value, show: K });
|
|
1521
1519
|
},
|
|
1522
|
-
async onDispatch({ sender:
|
|
1523
|
-
var
|
|
1520
|
+
async onDispatch({ sender: K, message: we }) {
|
|
1521
|
+
var Pe;
|
|
1524
1522
|
try {
|
|
1525
|
-
const { jobId:
|
|
1526
|
-
senderEmail:
|
|
1527
|
-
senderName:
|
|
1523
|
+
const { jobId: De } = await V.enqueueBulkEmail(F, {
|
|
1524
|
+
senderEmail: K.emailAddress,
|
|
1525
|
+
senderName: K.name || ((Pe = L.currentBusiness.value) == null ? void 0 : Pe.name) || "FeedMe Inventory",
|
|
1528
1526
|
items: [
|
|
1529
1527
|
{
|
|
1530
1528
|
subject: `Purchase Order #${r.seqNumber ?? r._id}`,
|
|
1531
|
-
recipientName:
|
|
1529
|
+
recipientName: O,
|
|
1532
1530
|
recipientEmail: M,
|
|
1533
|
-
message:
|
|
1531
|
+
message: we.trim() || void 0,
|
|
1534
1532
|
pos: [{ poId: r._id, dbName: F, filename: te }]
|
|
1535
1533
|
}
|
|
1536
1534
|
]
|
|
1537
1535
|
});
|
|
1538
1536
|
m.addJob({
|
|
1539
|
-
jobId:
|
|
1537
|
+
jobId: De,
|
|
1540
1538
|
type: "email",
|
|
1541
1539
|
dbName: F,
|
|
1542
1540
|
title: `Email PO #${r.seqNumber ?? r._id}`,
|
|
@@ -1548,146 +1546,146 @@ function Xs(C) {
|
|
|
1548
1546
|
startedAt: Date.now(),
|
|
1549
1547
|
hidden: !0
|
|
1550
1548
|
}), s.open({
|
|
1551
|
-
title:
|
|
1552
|
-
message:
|
|
1549
|
+
title: h("inventory.transfer.receiveRequest.bulk.emailSuccess"),
|
|
1550
|
+
message: h("inventory.transfer.receiveRequest.bulk.emailQueued"),
|
|
1553
1551
|
type: "success"
|
|
1554
1552
|
});
|
|
1555
|
-
} catch (
|
|
1556
|
-
throw console.error("Single email enqueue failed",
|
|
1557
|
-
title:
|
|
1558
|
-
message:
|
|
1553
|
+
} catch (De) {
|
|
1554
|
+
throw console.error("Single email enqueue failed", De), s.open({
|
|
1555
|
+
title: h("inventory.transfer.receiveRequest.bulk.emailSendError"),
|
|
1556
|
+
message: h("inventory.transfer.receiveRequest.bulk.emailErrorMsg"),
|
|
1559
1557
|
type: "error"
|
|
1560
|
-
}),
|
|
1558
|
+
}), De;
|
|
1561
1559
|
}
|
|
1562
1560
|
}
|
|
1563
1561
|
};
|
|
1564
1562
|
try {
|
|
1565
|
-
let
|
|
1566
|
-
"pending" in
|
|
1567
|
-
const
|
|
1568
|
-
|
|
1563
|
+
let K = await V.getPurchaseOrderPdf(r._id, F, H);
|
|
1564
|
+
"pending" in K && (await m.waitForPdfJob(K.jobId, F), K = await V.getPurchaseOrderPdf(r._id, F, H));
|
|
1565
|
+
const we = URL.createObjectURL(K);
|
|
1566
|
+
fe === bt && ((be = Be.value) != null && be.show) ? (ve = we, Be.value = {
|
|
1569
1567
|
...Be.value,
|
|
1570
|
-
pdfBlobUrl:
|
|
1568
|
+
pdfBlobUrl: we,
|
|
1571
1569
|
pdfLoading: !1
|
|
1572
|
-
}) : URL.revokeObjectURL(
|
|
1573
|
-
} catch (
|
|
1574
|
-
console.error("[promptEmailDialog] PDF preview fetch failed:",
|
|
1570
|
+
}) : URL.revokeObjectURL(we);
|
|
1571
|
+
} catch (K) {
|
|
1572
|
+
console.error("[promptEmailDialog] PDF preview fetch failed:", K), fe === bt && ((Y = Be.value) != null && Y.show) && (Be.value = { ...Be.value, pdfLoading: !1 });
|
|
1575
1573
|
}
|
|
1576
1574
|
}
|
|
1577
1575
|
async function z(r) {
|
|
1578
|
-
if (
|
|
1576
|
+
if (Fe(r), r.items != null)
|
|
1579
1577
|
return r;
|
|
1580
1578
|
try {
|
|
1581
|
-
return { ...await
|
|
1579
|
+
return { ...await V.getPurchaseOrderById(r._id), _locationDbName: r._locationDbName };
|
|
1582
1580
|
} catch (u) {
|
|
1583
1581
|
throw console.error(`Failed to hydrate PO ${r._id} for action`, u), u;
|
|
1584
1582
|
}
|
|
1585
1583
|
}
|
|
1586
1584
|
async function ne(r, u) {
|
|
1587
|
-
var
|
|
1588
|
-
|
|
1589
|
-
const
|
|
1590
|
-
if (!
|
|
1591
|
-
if (u === void 0 && ((
|
|
1585
|
+
var H;
|
|
1586
|
+
Fe(r);
|
|
1587
|
+
const g = await Ne.run((Z) => je(r, Z));
|
|
1588
|
+
if (!g) return;
|
|
1589
|
+
if (u === void 0 && ((H = r.request) != null && H.id))
|
|
1592
1590
|
try {
|
|
1593
|
-
u = await
|
|
1591
|
+
u = await V.getLatestPurchaseOrderRequest(r._id);
|
|
1594
1592
|
} catch (Z) {
|
|
1595
1593
|
console.warn("[transfer-details] POR fetch failed for", r._id, Z);
|
|
1596
1594
|
}
|
|
1597
|
-
const M =
|
|
1595
|
+
const M = Ue(r), F = {
|
|
1598
1596
|
poRequest: u,
|
|
1599
|
-
purchaseOrder:
|
|
1597
|
+
purchaseOrder: g,
|
|
1600
1598
|
transferTo: M == null ? void 0 : M.name,
|
|
1601
1599
|
transferToDbName: M == null ? void 0 : M.dbName,
|
|
1602
1600
|
show: !0,
|
|
1603
1601
|
canResubmit: !1,
|
|
1604
1602
|
canApprove: !1,
|
|
1605
1603
|
"onUpdate:show"(Z) {
|
|
1606
|
-
|
|
1604
|
+
Ee.value && (Ee.value = { ...Ee.value, show: Z });
|
|
1607
1605
|
},
|
|
1608
|
-
scope:
|
|
1609
|
-
receivedMap:
|
|
1606
|
+
scope: It.RECEIVE_REQUEST,
|
|
1607
|
+
receivedMap: An(g) ?? {},
|
|
1610
1608
|
shipments: c.value
|
|
1611
1609
|
};
|
|
1612
|
-
|
|
1610
|
+
Ee.value = F;
|
|
1613
1611
|
}
|
|
1614
|
-
async function
|
|
1615
|
-
const F =
|
|
1612
|
+
async function me(r, u, g, O, M) {
|
|
1613
|
+
const F = Tn();
|
|
1616
1614
|
o.value = !0;
|
|
1617
1615
|
try {
|
|
1618
1616
|
await F({
|
|
1619
1617
|
operate: {
|
|
1620
1618
|
operation: u,
|
|
1621
1619
|
doc: r,
|
|
1622
|
-
options: (u ===
|
|
1620
|
+
options: (u === Ke.enum.confirmDraft || u === Ke.enum.completeReceive) && B.autoReceiveWarehouse ? { autoReceive: !0 } : void 0
|
|
1623
1621
|
},
|
|
1624
1622
|
operateV2: {
|
|
1625
1623
|
_id: r._id,
|
|
1626
1624
|
_rev: r._rev ?? "",
|
|
1627
|
-
action: u ===
|
|
1625
|
+
action: u === Ke.enum.submitRequest ? Ke.enum.confirmDraft : u,
|
|
1628
1626
|
payloads: M ?? []
|
|
1629
1627
|
},
|
|
1630
|
-
transferTo:
|
|
1631
|
-
}), await new Promise((
|
|
1632
|
-
} catch (
|
|
1628
|
+
transferTo: O
|
|
1629
|
+
}), await new Promise((H) => setTimeout(H, 1e3)), s.open({ title: "Success", message: g, type: "success" });
|
|
1630
|
+
} catch (H) {
|
|
1633
1631
|
s.open({
|
|
1634
1632
|
title: "Something went wrong",
|
|
1635
1633
|
message: "Please try again.",
|
|
1636
1634
|
type: "error"
|
|
1637
|
-
}), console.error("Error when submitting PO operation", u, r,
|
|
1635
|
+
}), console.error("Error when submitting PO operation", u, r, H);
|
|
1638
1636
|
} finally {
|
|
1639
|
-
o.value = !1,
|
|
1637
|
+
o.value = !1, se();
|
|
1640
1638
|
}
|
|
1641
1639
|
}
|
|
1642
|
-
async function
|
|
1643
|
-
|
|
1644
|
-
const
|
|
1645
|
-
if (!
|
|
1640
|
+
async function Te(r, u, g) {
|
|
1641
|
+
Fe(r);
|
|
1642
|
+
const O = $n[u];
|
|
1643
|
+
if (!O) {
|
|
1646
1644
|
s.open({
|
|
1647
1645
|
title: "Something went wrong",
|
|
1648
|
-
message: `Cannot process order: ${
|
|
1646
|
+
message: `Cannot process order: ${cn(u)}`,
|
|
1649
1647
|
type: "error"
|
|
1650
1648
|
});
|
|
1651
1649
|
return;
|
|
1652
1650
|
}
|
|
1653
|
-
const { successMessage: M, ...F } =
|
|
1654
|
-
if (u ===
|
|
1651
|
+
const { successMessage: M, ...F } = O;
|
|
1652
|
+
if (u === Ke.enum.rejectDraft) {
|
|
1655
1653
|
let ee = "";
|
|
1656
1654
|
_.open({
|
|
1657
1655
|
title: F.title,
|
|
1658
1656
|
message: F.message,
|
|
1659
1657
|
primaryActions: F.primaryActions,
|
|
1660
|
-
contentComponent:
|
|
1658
|
+
contentComponent: Bn,
|
|
1661
1659
|
contentComponentProps: {
|
|
1662
1660
|
message: F.message,
|
|
1663
|
-
onChange: (
|
|
1661
|
+
onChange: (re) => ee = re
|
|
1664
1662
|
}
|
|
1665
1663
|
}).onPrimary(() => {
|
|
1666
|
-
|
|
1664
|
+
me(r, u, M, g, [
|
|
1667
1665
|
{ action: "rejectDraft", payload: { rejectReason: ee } }
|
|
1668
1666
|
]);
|
|
1669
1667
|
});
|
|
1670
1668
|
return;
|
|
1671
1669
|
}
|
|
1672
|
-
const
|
|
1673
|
-
Z.init(r), (u ===
|
|
1670
|
+
const H = [], Z = On();
|
|
1671
|
+
Z.init(r), (u === Ke.enum.confirmDraft || u === Ke.enum.submitRequest) && H.push({
|
|
1674
1672
|
action: "confirmDraft",
|
|
1675
|
-
payload: Z.controller.value.toConfirmDraftData(
|
|
1673
|
+
payload: Z.controller.value.toConfirmDraftData(dn())
|
|
1676
1674
|
}), _.open({
|
|
1677
1675
|
title: F.title,
|
|
1678
1676
|
message: F.message,
|
|
1679
1677
|
primaryActions: F.primaryActions
|
|
1680
1678
|
}).onPrimary(() => {
|
|
1681
|
-
|
|
1679
|
+
me(
|
|
1682
1680
|
r,
|
|
1683
1681
|
u,
|
|
1684
1682
|
M,
|
|
1685
|
-
|
|
1686
|
-
|
|
1683
|
+
g,
|
|
1684
|
+
H
|
|
1687
1685
|
);
|
|
1688
1686
|
});
|
|
1689
1687
|
}
|
|
1690
|
-
async function
|
|
1688
|
+
async function We() {
|
|
1691
1689
|
_.open({
|
|
1692
1690
|
title: "Upload Transfer",
|
|
1693
1691
|
primaryActions: { text: "Xilnex transfer note", close: !0 },
|
|
@@ -1702,48 +1700,48 @@ function Xs(C) {
|
|
|
1702
1700
|
ht.value = r;
|
|
1703
1701
|
});
|
|
1704
1702
|
}
|
|
1705
|
-
async function
|
|
1703
|
+
async function ze() {
|
|
1706
1704
|
const { start: r, end: u } = f.value;
|
|
1707
1705
|
return (await Promise.allSettled(
|
|
1708
|
-
d.value.map(async (
|
|
1709
|
-
)).flatMap((
|
|
1706
|
+
d.value.map(async (O) => (await V.getPurchaseOrders({ start: r, end: u, dbName: O })).map((F) => ({ ...F, _locationDbName: O })))
|
|
1707
|
+
)).flatMap((O) => O.status === "fulfilled" ? O.value : []);
|
|
1710
1708
|
}
|
|
1711
|
-
async function
|
|
1712
|
-
return m.activeJobs.find((
|
|
1709
|
+
async function j(r) {
|
|
1710
|
+
return m.activeJobs.find((g) => g.type === r) ? new Promise((g) => {
|
|
1713
1711
|
_.open({
|
|
1714
|
-
title:
|
|
1715
|
-
message:
|
|
1716
|
-
primaryActions: { text:
|
|
1717
|
-
secondaryActions: { text:
|
|
1718
|
-
}).onPrimary(() =>
|
|
1712
|
+
title: h("inventory.transfer.receiveRequest.bulk.activeJobWarningTitle"),
|
|
1713
|
+
message: h("inventory.transfer.receiveRequest.bulk.activeJobWarningMsg", [r]),
|
|
1714
|
+
primaryActions: { text: h("inventory.transfer.receiveRequest.bulk.activeJobWarningConfirm"), close: !0 },
|
|
1715
|
+
secondaryActions: { text: h("inventory.common.cancel"), close: !0 }
|
|
1716
|
+
}).onPrimary(() => g(!0)).onSecondary(() => g(!1));
|
|
1719
1717
|
}) : !0;
|
|
1720
1718
|
}
|
|
1721
|
-
async function
|
|
1722
|
-
if (!await
|
|
1723
|
-
const { startDate: u, endDate:
|
|
1724
|
-
if (Xe(
|
|
1719
|
+
async function xe(r) {
|
|
1720
|
+
if (!await j("download")) return;
|
|
1721
|
+
const { startDate: u, endDate: g } = l.value;
|
|
1722
|
+
if (Xe(g).diff(Xe(u), "month", !0) > 2) {
|
|
1725
1723
|
s.open({
|
|
1726
|
-
title:
|
|
1727
|
-
message:
|
|
1724
|
+
title: h("inventory.transfer.receiveRequest.bulk.downloadError"),
|
|
1725
|
+
message: h("inventory.transfer.receiveRequest.bulk.downloadLimitExceeded"),
|
|
1728
1726
|
type: "error"
|
|
1729
1727
|
});
|
|
1730
1728
|
return;
|
|
1731
1729
|
}
|
|
1732
1730
|
if (r.length === 0) {
|
|
1733
1731
|
s.open({
|
|
1734
|
-
title:
|
|
1735
|
-
message:
|
|
1732
|
+
title: h("inventory.transfer.receiveRequest.bulk.downloadError"),
|
|
1733
|
+
message: h("inventory.transfer.receiveRequest.bulk.noOrdersToDownload"),
|
|
1736
1734
|
type: "warning"
|
|
1737
1735
|
});
|
|
1738
1736
|
return;
|
|
1739
1737
|
}
|
|
1740
|
-
const
|
|
1738
|
+
const O = r.map((F) => {
|
|
1741
1739
|
var te;
|
|
1742
|
-
const Z = (((te = x.locations.find((
|
|
1743
|
-
return { poId: F._id, dbName: F._locationDbName, filename:
|
|
1740
|
+
const Z = (((te = x.locations.find((fe) => fe.dbName === F._locationDbName)) == null ? void 0 : te.name) || F._locationDbName).replace(/[/\\?%*:|"<>]/g, "-").trim().slice(0, 50), ee = `PO_${F.seqNumber || F._id}`.replace(/[/\\?%*:|"<>]/g, "-").slice(0, 50), re = `${Z}/${ee}`;
|
|
1741
|
+
return { poId: F._id, dbName: F._locationDbName, filename: re, rev: F._rev };
|
|
1744
1742
|
}), M = d.value[0];
|
|
1745
1743
|
try {
|
|
1746
|
-
const { jobId: F, fromCache:
|
|
1744
|
+
const { jobId: F, fromCache: H } = await V.enqueueBulkDownload(M, { items: O });
|
|
1747
1745
|
m.addJob({
|
|
1748
1746
|
jobId: F,
|
|
1749
1747
|
type: "download",
|
|
@@ -1755,199 +1753,199 @@ function Xs(C) {
|
|
|
1755
1753
|
total: r.length,
|
|
1756
1754
|
errorCount: 0,
|
|
1757
1755
|
startedAt: Date.now()
|
|
1758
|
-
}),
|
|
1759
|
-
title:
|
|
1760
|
-
message:
|
|
1756
|
+
}), H ? s.open({
|
|
1757
|
+
title: h("inventory.transfer.receiveRequest.bulk.downloadCachedTitle"),
|
|
1758
|
+
message: h("inventory.transfer.receiveRequest.bulk.downloadCachedMsg"),
|
|
1761
1759
|
type: "info"
|
|
1762
1760
|
}) : s.open({
|
|
1763
|
-
title:
|
|
1764
|
-
message:
|
|
1761
|
+
title: h("inventory.transfer.receiveRequest.bulk.downloadSuccess"),
|
|
1762
|
+
message: h("inventory.transfer.receiveRequest.bulk.downloadQueued"),
|
|
1765
1763
|
type: "success"
|
|
1766
1764
|
});
|
|
1767
1765
|
} catch (F) {
|
|
1768
1766
|
console.error("Bulk download enqueue failed", F), s.open({
|
|
1769
|
-
title:
|
|
1770
|
-
message:
|
|
1767
|
+
title: h("inventory.transfer.receiveRequest.bulk.downloadError"),
|
|
1768
|
+
message: h("inventory.transfer.receiveRequest.bulk.downloadErrorMsg"),
|
|
1771
1769
|
type: "error"
|
|
1772
1770
|
});
|
|
1773
1771
|
}
|
|
1774
1772
|
}
|
|
1775
|
-
async function
|
|
1776
|
-
var
|
|
1777
|
-
if (!await
|
|
1773
|
+
async function Ge(r) {
|
|
1774
|
+
var we, Pe, De;
|
|
1775
|
+
if (!await j("email")) return;
|
|
1778
1776
|
const u = [
|
|
1779
1777
|
Dt.enum.RECEIVING,
|
|
1780
1778
|
Dt.enum.PROCESSING
|
|
1781
1779
|
// PARTIAL_RECEIVED display status maps from PROCESSING
|
|
1782
|
-
],
|
|
1783
|
-
if (
|
|
1780
|
+
], g = r.filter((D) => u.includes(D.status));
|
|
1781
|
+
if (g.length === 0) {
|
|
1784
1782
|
s.open({
|
|
1785
|
-
title:
|
|
1786
|
-
message:
|
|
1783
|
+
title: h("inventory.transfer.receiveRequest.bulk.emailSendError"),
|
|
1784
|
+
message: h("inventory.transfer.receiveRequest.bulk.noOrdersToEmail"),
|
|
1787
1785
|
type: "warning"
|
|
1788
1786
|
});
|
|
1789
1787
|
return;
|
|
1790
1788
|
}
|
|
1791
|
-
if (!((
|
|
1792
|
-
await
|
|
1793
|
-
const
|
|
1789
|
+
if (!((we = L.currentBusiness.value) != null && we._id)) return;
|
|
1790
|
+
await Le(g);
|
|
1791
|
+
const O = yn(), M = Rn(), F = /* @__PURE__ */ new Map(), H = x.locations.map((D) => D.dbName), Z = `business_${L.currentBusiness.value._id}`, ee = [.../* @__PURE__ */ new Set([...H, Z])];
|
|
1794
1792
|
await Promise.allSettled(
|
|
1795
1793
|
ee.map(async (D) => {
|
|
1796
1794
|
try {
|
|
1797
|
-
(await M.readSuppliersByDbName(D)).forEach((
|
|
1798
|
-
const
|
|
1799
|
-
(!
|
|
1795
|
+
(await M.readSuppliersByDbName(D)).forEach((ye) => {
|
|
1796
|
+
const he = F.get(ye._id);
|
|
1797
|
+
(!he || !he.email && ye.email) && F.set(ye._id, ye);
|
|
1800
1798
|
});
|
|
1801
|
-
} catch (
|
|
1802
|
-
console.warn("[emailAll] fetch failed for", D,
|
|
1799
|
+
} catch (le) {
|
|
1800
|
+
console.warn("[emailAll] fetch failed for", D, le);
|
|
1803
1801
|
}
|
|
1804
1802
|
})
|
|
1805
1803
|
);
|
|
1806
|
-
function
|
|
1807
|
-
var
|
|
1808
|
-
const
|
|
1809
|
-
return (
|
|
1810
|
-
}
|
|
1811
|
-
const te = [],
|
|
1812
|
-
for (const D of
|
|
1813
|
-
|
|
1814
|
-
const
|
|
1804
|
+
function re(D) {
|
|
1805
|
+
var ye;
|
|
1806
|
+
const le = F.get(D.supplier._id);
|
|
1807
|
+
return (le == null ? void 0 : le.email) || ((ye = D.supplier) == null ? void 0 : ye.email);
|
|
1808
|
+
}
|
|
1809
|
+
const te = [], fe = [];
|
|
1810
|
+
for (const D of g)
|
|
1811
|
+
re(D) ? te.push(D) : fe.push(D);
|
|
1812
|
+
const ve = qe(
|
|
1815
1813
|
"p",
|
|
1816
1814
|
{ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
|
|
1817
|
-
|
|
1815
|
+
h("inventory.transfer.receiveRequest.bulk.emailAllowedStatusInfo")
|
|
1818
1816
|
);
|
|
1819
|
-
if (
|
|
1817
|
+
if (fe.length > 0) {
|
|
1820
1818
|
const D = /* @__PURE__ */ new Map();
|
|
1821
|
-
for (const
|
|
1822
|
-
const
|
|
1823
|
-
D.has(
|
|
1819
|
+
for (const he of fe) {
|
|
1820
|
+
const Me = he.supplier._id;
|
|
1821
|
+
D.has(Me) || D.set(Me, { supplierName: he.supplier.name, pos: [] }), D.get(Me).pos.push(he);
|
|
1824
1822
|
}
|
|
1825
|
-
const
|
|
1826
|
-
|
|
1827
|
-
|
|
1823
|
+
const le = qe("div", { class: "flex flex-col gap-12" }, [
|
|
1824
|
+
ve,
|
|
1825
|
+
qe(
|
|
1828
1826
|
"p",
|
|
1829
1827
|
{ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
1830
|
-
|
|
1828
|
+
h("inventory.transfer.receiveRequest.bulk.missingEmailMsg", [fe.length])
|
|
1831
1829
|
),
|
|
1832
|
-
|
|
1830
|
+
qe(
|
|
1833
1831
|
"div",
|
|
1834
1832
|
{ class: "flex flex-col gap-4 max-h-[320px] overflow-y-auto rounded-md border border-fm-color-neutral-gray-100 p-8" },
|
|
1835
1833
|
[...D.values()].map(
|
|
1836
|
-
({ supplierName:
|
|
1837
|
-
|
|
1838
|
-
|
|
1834
|
+
({ supplierName: he, pos: Me }) => qe("div", { class: "flex flex-col gap-2 py-6 border-b border-fm-color-neutral-gray-100 last:border-0" }, [
|
|
1835
|
+
qe("div", { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" }, he),
|
|
1836
|
+
qe(
|
|
1839
1837
|
"div",
|
|
1840
1838
|
{ class: "flex flex-wrap gap-4" },
|
|
1841
|
-
|
|
1842
|
-
(
|
|
1839
|
+
Me.map(
|
|
1840
|
+
(Ye) => qe("span", {
|
|
1843
1841
|
class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100 rounded px-6 py-2"
|
|
1844
|
-
}, `PO #${
|
|
1842
|
+
}, `PO #${Ye.seqNumber ?? Ye._id}`)
|
|
1845
1843
|
)
|
|
1846
1844
|
)
|
|
1847
1845
|
])
|
|
1848
1846
|
)
|
|
1849
1847
|
),
|
|
1850
|
-
|
|
1848
|
+
qe(
|
|
1851
1849
|
"p",
|
|
1852
1850
|
{ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
|
|
1853
|
-
|
|
1851
|
+
h("inventory.transfer.receiveRequest.bulk.emailWillSendCount", [te.length, g.length])
|
|
1854
1852
|
),
|
|
1855
|
-
|
|
1853
|
+
qe(
|
|
1856
1854
|
"p",
|
|
1857
1855
|
{ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
|
|
1858
|
-
|
|
1856
|
+
h("inventory.transfer.receiveRequest.bulk.missingEmailConfirm")
|
|
1859
1857
|
)
|
|
1860
1858
|
]);
|
|
1861
|
-
if (!await new Promise((
|
|
1859
|
+
if (!await new Promise((he) => {
|
|
1862
1860
|
_.open({
|
|
1863
|
-
title:
|
|
1864
|
-
contentComponent:
|
|
1861
|
+
title: h("inventory.transfer.receiveRequest.bulk.missingEmailTitle"),
|
|
1862
|
+
contentComponent: le,
|
|
1865
1863
|
contentComponentProps: {},
|
|
1866
1864
|
primaryActions: {
|
|
1867
|
-
text:
|
|
1865
|
+
text: h("inventory.transfer.receiveRequest.bulk.skipAndContinue"),
|
|
1868
1866
|
close: !0
|
|
1869
1867
|
},
|
|
1870
|
-
secondaryActions: { text:
|
|
1871
|
-
}).onPrimary(() =>
|
|
1868
|
+
secondaryActions: { text: h("inventory.common.cancel"), close: !0 }
|
|
1869
|
+
}).onPrimary(() => he(!0)).onSecondary(() => he(!1));
|
|
1872
1870
|
})) return;
|
|
1873
1871
|
} else {
|
|
1874
|
-
const D =
|
|
1875
|
-
|
|
1876
|
-
|
|
1872
|
+
const D = qe("div", { class: "flex flex-col gap-12" }, [
|
|
1873
|
+
ve,
|
|
1874
|
+
qe(
|
|
1877
1875
|
"p",
|
|
1878
1876
|
{ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
1879
|
-
|
|
1877
|
+
h("inventory.transfer.receiveRequest.bulk.emailAllConfirmMsg", [te.length])
|
|
1880
1878
|
)
|
|
1881
1879
|
]);
|
|
1882
|
-
if (!await new Promise((
|
|
1880
|
+
if (!await new Promise((ye) => {
|
|
1883
1881
|
_.open({
|
|
1884
|
-
title:
|
|
1882
|
+
title: h("inventory.transfer.receiveRequest.bulk.missingEmailTitle"),
|
|
1885
1883
|
contentComponent: D,
|
|
1886
1884
|
contentComponentProps: {},
|
|
1887
1885
|
primaryActions: {
|
|
1888
|
-
text:
|
|
1886
|
+
text: h("inventory.transfer.receiveRequest.bulk.emailConfirm"),
|
|
1889
1887
|
close: !0
|
|
1890
1888
|
},
|
|
1891
|
-
secondaryActions: { text:
|
|
1892
|
-
}).onPrimary(() =>
|
|
1889
|
+
secondaryActions: { text: h("inventory.common.cancel"), close: !0 }
|
|
1890
|
+
}).onPrimary(() => ye(!0)).onSecondary(() => ye(!1));
|
|
1893
1891
|
})) return;
|
|
1894
1892
|
}
|
|
1895
1893
|
if (te.length === 0) {
|
|
1896
1894
|
s.open({
|
|
1897
|
-
title:
|
|
1898
|
-
message:
|
|
1895
|
+
title: h("inventory.transfer.receiveRequest.bulk.emailSendError"),
|
|
1896
|
+
message: h("inventory.transfer.receiveRequest.bulk.noEmailsToSend"),
|
|
1899
1897
|
type: "warning"
|
|
1900
1898
|
});
|
|
1901
1899
|
return;
|
|
1902
1900
|
}
|
|
1903
|
-
let
|
|
1901
|
+
let Re = [];
|
|
1904
1902
|
try {
|
|
1905
|
-
|
|
1903
|
+
Re = await O.getEmailList(L.currentBusiness.value._id);
|
|
1906
1904
|
} catch {
|
|
1907
1905
|
s.open({
|
|
1908
|
-
title:
|
|
1909
|
-
message:
|
|
1906
|
+
title: h("inventory.transfer.receiveRequest.bulk.emailSendError"),
|
|
1907
|
+
message: h("inventory.transfer.receiveRequest.bulk.noEmailSender"),
|
|
1910
1908
|
type: "error"
|
|
1911
1909
|
});
|
|
1912
1910
|
return;
|
|
1913
1911
|
}
|
|
1914
|
-
const
|
|
1915
|
-
if (
|
|
1912
|
+
const $e = Re.find((D) => D.verified);
|
|
1913
|
+
if (!$e) {
|
|
1916
1914
|
s.open({
|
|
1917
|
-
title:
|
|
1918
|
-
message:
|
|
1915
|
+
title: h("inventory.transfer.receiveRequest.bulk.emailSendError"),
|
|
1916
|
+
message: h("inventory.transfer.receiveRequest.bulk.noEmailSender"),
|
|
1919
1917
|
type: "error"
|
|
1920
1918
|
});
|
|
1921
1919
|
return;
|
|
1922
1920
|
}
|
|
1923
|
-
const
|
|
1921
|
+
const be = /* @__PURE__ */ new Map();
|
|
1924
1922
|
for (const D of te) {
|
|
1925
|
-
const
|
|
1926
|
-
if (!
|
|
1927
|
-
const
|
|
1928
|
-
st ? (st.pos.push(
|
|
1923
|
+
const le = re(D);
|
|
1924
|
+
if (!le) continue;
|
|
1925
|
+
const he = (((Pe = x.locations.find((pt) => pt.dbName === D._locationDbName)) == null ? void 0 : Pe.name) || D._locationDbName).replace(/[/\\?%*:|"<>]/g, "-").trim().slice(0, 50), Me = `PO_${D.seqNumber || D._id}`.replace(/[/\\?%*:|"<>]/g, "-").slice(0, 50), Ye = { poId: D._id, dbName: D._locationDbName, filename: `${he}/${Me}` }, st = be.get(le);
|
|
1926
|
+
st ? (st.pos.push(Ye), st.seqNumbers.push(D.seqNumber ?? D._id)) : be.set(le, {
|
|
1929
1927
|
recipientName: D.supplier.name,
|
|
1930
|
-
recipientEmail:
|
|
1931
|
-
pos: [
|
|
1928
|
+
recipientEmail: le,
|
|
1929
|
+
pos: [Ye],
|
|
1932
1930
|
seqNumbers: [D.seqNumber ?? D._id]
|
|
1933
1931
|
});
|
|
1934
1932
|
}
|
|
1935
|
-
const Y = [...
|
|
1933
|
+
const Y = [...be.values()].map((D) => ({
|
|
1936
1934
|
subject: D.pos.length > 1 ? `Purchase Orders (${D.pos.length})` : `Purchase Order #${D.seqNumbers[0]}`,
|
|
1937
1935
|
recipientName: D.recipientName,
|
|
1938
1936
|
recipientEmail: D.recipientEmail,
|
|
1939
1937
|
pos: D.pos
|
|
1940
|
-
})),
|
|
1938
|
+
})), K = d.value[0];
|
|
1941
1939
|
try {
|
|
1942
|
-
const { jobId: D } = await
|
|
1943
|
-
senderEmail:
|
|
1944
|
-
senderName:
|
|
1940
|
+
const { jobId: D } = await V.enqueueBulkEmail(K, {
|
|
1941
|
+
senderEmail: $e.emailAddress,
|
|
1942
|
+
senderName: $e.name || ((De = L.currentBusiness.value) == null ? void 0 : De.name) || "FeedMe Inventory",
|
|
1945
1943
|
items: Y
|
|
1946
1944
|
});
|
|
1947
1945
|
m.addJob({
|
|
1948
1946
|
jobId: D,
|
|
1949
1947
|
type: "email",
|
|
1950
|
-
dbName:
|
|
1948
|
+
dbName: K,
|
|
1951
1949
|
title: `Email All (${Y.length} supplier${Y.length === 1 ? "" : "s"}, ${te.length} POs)`,
|
|
1952
1950
|
status: "waiting",
|
|
1953
1951
|
progress: 0,
|
|
@@ -1956,76 +1954,76 @@ function Xs(C) {
|
|
|
1956
1954
|
errorCount: 0,
|
|
1957
1955
|
startedAt: Date.now()
|
|
1958
1956
|
}), s.open({
|
|
1959
|
-
title:
|
|
1960
|
-
message:
|
|
1957
|
+
title: h("inventory.transfer.receiveRequest.bulk.emailSuccess"),
|
|
1958
|
+
message: h("inventory.transfer.receiveRequest.bulk.emailQueued"),
|
|
1961
1959
|
type: "success"
|
|
1962
1960
|
});
|
|
1963
1961
|
} catch (D) {
|
|
1964
1962
|
console.error("Bulk email enqueue failed", D), s.open({
|
|
1965
|
-
title:
|
|
1966
|
-
message:
|
|
1963
|
+
title: h("inventory.transfer.receiveRequest.bulk.emailSendError"),
|
|
1964
|
+
message: h("inventory.transfer.receiveRequest.bulk.emailErrorMsg"),
|
|
1967
1965
|
type: "error"
|
|
1968
1966
|
});
|
|
1969
1967
|
}
|
|
1970
1968
|
}
|
|
1971
1969
|
return {
|
|
1972
1970
|
selectedLocationDbNames: d,
|
|
1973
|
-
purchaseOrders:
|
|
1971
|
+
purchaseOrders: b,
|
|
1974
1972
|
shipments: c,
|
|
1975
1973
|
purchaseRequests: w,
|
|
1976
|
-
rowAction:
|
|
1977
|
-
updateDateRange:
|
|
1978
|
-
fetchData:
|
|
1974
|
+
rowAction: Ne,
|
|
1975
|
+
updateDateRange: _e,
|
|
1976
|
+
fetchData: se,
|
|
1979
1977
|
failedLocations: R,
|
|
1980
|
-
retryFailedLocations:
|
|
1978
|
+
retryFailedLocations: ke,
|
|
1981
1979
|
retryingFailed: I,
|
|
1982
|
-
fetchProgress:
|
|
1983
|
-
abortOngoingBrowse:
|
|
1984
|
-
fetchFullPurchaseOrders:
|
|
1980
|
+
fetchProgress: ae,
|
|
1981
|
+
abortOngoingBrowse: ce,
|
|
1982
|
+
fetchFullPurchaseOrders: ze,
|
|
1985
1983
|
loading: o,
|
|
1986
1984
|
transferDialogProps: lt,
|
|
1987
1985
|
promptCreateTransferDialog: Ze,
|
|
1988
1986
|
promptUpdateTransferDialog: N,
|
|
1989
|
-
transferDetailsProps:
|
|
1987
|
+
transferDetailsProps: Ee,
|
|
1990
1988
|
promptShowTransferDetails: ne,
|
|
1991
1989
|
resolvePO: z,
|
|
1992
|
-
submitAction:
|
|
1990
|
+
submitAction: Te,
|
|
1993
1991
|
xilnexImportDialogProps: ht,
|
|
1994
|
-
promptUploadTransferDialog:
|
|
1992
|
+
promptUploadTransferDialog: We,
|
|
1995
1993
|
emailDialogProps: Be,
|
|
1996
1994
|
promptEmailDialog: k,
|
|
1997
|
-
downloadAll:
|
|
1998
|
-
emailAll:
|
|
1995
|
+
downloadAll: xe,
|
|
1996
|
+
emailAll: Ge,
|
|
1999
1997
|
lastClosingDate: W
|
|
2000
1998
|
};
|
|
2001
1999
|
}
|
|
2002
|
-
function
|
|
2003
|
-
const
|
|
2000
|
+
function Gs(C, _, x) {
|
|
2001
|
+
const B = C._locationDbName;
|
|
2002
|
+
if (!B) return null;
|
|
2003
|
+
const $ = _.find((L) => L.dbName === B);
|
|
2004
2004
|
if (!$) return null;
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
const L = x(O.doc._id);
|
|
2009
|
-
if (L !== null) return { ...O, doc: L };
|
|
2005
|
+
if ($.type === "restaurant") {
|
|
2006
|
+
const L = x($.doc._id);
|
|
2007
|
+
if (L !== null) return { ...$, doc: L };
|
|
2010
2008
|
}
|
|
2011
|
-
return
|
|
2009
|
+
return $;
|
|
2012
2010
|
}
|
|
2013
|
-
function
|
|
2011
|
+
function Ks(C, _) {
|
|
2014
2012
|
return _.find((x) => x.purchaseOrderId === C._id);
|
|
2015
2013
|
}
|
|
2016
|
-
function
|
|
2017
|
-
const x = mt(), { t:
|
|
2018
|
-
async function
|
|
2014
|
+
function Xs(C, _) {
|
|
2015
|
+
const x = mt(), { t: B } = it(), $ = nt(), L = ft(), G = wt(), U = P(!1), o = P(!1), s = P(null);
|
|
2016
|
+
async function h(m, d) {
|
|
2019
2017
|
if (m !== ct.PrintPdf) return !1;
|
|
2020
2018
|
const c = d._locationDbName, w = d._rev;
|
|
2021
|
-
s.value && (URL.revokeObjectURL(s.value), s.value = null), o.value = !0,
|
|
2019
|
+
s.value && (URL.revokeObjectURL(s.value), s.value = null), o.value = !0, U.value = !0;
|
|
2022
2020
|
try {
|
|
2023
|
-
let l = await
|
|
2024
|
-
"pending" in l && (await
|
|
2021
|
+
let l = await $.getPurchaseOrderPdf(d._id, c, w);
|
|
2022
|
+
"pending" in l && (await G.waitForPdfJob(l.jobId, c), l = await $.getPurchaseOrderPdf(d._id, c, w)), s.value = URL.createObjectURL(l);
|
|
2025
2023
|
} catch {
|
|
2026
|
-
|
|
2027
|
-
title:
|
|
2028
|
-
message:
|
|
2024
|
+
U.value = !1, L.open({
|
|
2025
|
+
title: B("inventory.common.somethingWentWrong"),
|
|
2026
|
+
message: B("inventory.transfer.receiveRequest.bulk.pdfUnavailableMsg"),
|
|
2029
2027
|
type: "error"
|
|
2030
2028
|
});
|
|
2031
2029
|
} finally {
|
|
@@ -2033,8 +2031,8 @@ function tr(C, _) {
|
|
|
2033
2031
|
}
|
|
2034
2032
|
return !0;
|
|
2035
2033
|
}
|
|
2036
|
-
const
|
|
2037
|
-
|
|
2034
|
+
const V = In(
|
|
2035
|
+
It.RECEIVE_REQUEST,
|
|
2038
2036
|
C,
|
|
2039
2037
|
_,
|
|
2040
2038
|
{
|
|
@@ -2045,88 +2043,88 @@ function tr(C, _) {
|
|
|
2045
2043
|
fetchFullPo: async (m) => {
|
|
2046
2044
|
const d = m._locationDbName;
|
|
2047
2045
|
return await C.rowAction.run(
|
|
2048
|
-
(c) =>
|
|
2046
|
+
(c) => $.getPurchaseOrderById(m._id, d, c)
|
|
2049
2047
|
) ?? null;
|
|
2050
2048
|
},
|
|
2051
|
-
resolveLocation: (m) =>
|
|
2049
|
+
resolveLocation: (m) => Gs(
|
|
2052
2050
|
m,
|
|
2053
2051
|
x.locations,
|
|
2054
2052
|
x.locationRestaurantFromCore
|
|
2055
2053
|
),
|
|
2056
|
-
resolvePurchaseRequest: (m) =>
|
|
2054
|
+
resolvePurchaseRequest: (m) => Ks(m, C.purchaseRequests.value),
|
|
2057
2055
|
// Exclude both legacy Print and Print (Beta) — the bulk listing uses
|
|
2058
2056
|
// Lambda-generated PDF via PrintPdf instead.
|
|
2059
2057
|
excludeRowActions: [ct.Print, ct.PrintCustom],
|
|
2060
2058
|
// Inject the Lambda PDF print action into every row's context menu.
|
|
2061
|
-
appendRowActions: () => [
|
|
2059
|
+
appendRowActions: () => [Gn[ct.PrintPdf]],
|
|
2062
2060
|
// Handle the PrintPdf action before the default handler runs.
|
|
2063
|
-
onCustomAction: (m, d) =>
|
|
2061
|
+
onCustomAction: (m, d) => h(m, d)
|
|
2064
2062
|
}
|
|
2065
2063
|
);
|
|
2066
2064
|
return {
|
|
2067
|
-
columnDefs:
|
|
2068
|
-
const m =
|
|
2065
|
+
columnDefs: A(() => {
|
|
2066
|
+
const m = V.columnDefs.value, d = {
|
|
2069
2067
|
id: "location",
|
|
2070
|
-
header: () =>
|
|
2068
|
+
header: () => B("inventory.transfer.receiveRequest.bulk.locationColumn"),
|
|
2071
2069
|
cell(c) {
|
|
2072
2070
|
const w = c.row.original._locationDbName, l = x.locations.find((f) => f.dbName === w);
|
|
2073
2071
|
return l ? `${l.name} (${l.doc.profile.code ?? "--"})` : w;
|
|
2074
2072
|
},
|
|
2075
2073
|
enableSorting: !1,
|
|
2076
2074
|
size: 160
|
|
2077
|
-
},
|
|
2078
|
-
return
|
|
2075
|
+
}, b = [...m];
|
|
2076
|
+
return b.splice(1, 0, d), b;
|
|
2079
2077
|
}),
|
|
2080
|
-
showPdfDialog:
|
|
2078
|
+
showPdfDialog: U,
|
|
2081
2079
|
pdfPreviewLoading: o,
|
|
2082
2080
|
pdfPreviewBlobUrl: s
|
|
2083
2081
|
};
|
|
2084
2082
|
}
|
|
2085
|
-
const
|
|
2083
|
+
const Zs = {
|
|
2086
2084
|
key: 0,
|
|
2087
2085
|
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"
|
|
2088
|
-
},
|
|
2086
|
+
}, er = {
|
|
2089
2087
|
key: 1,
|
|
2090
2088
|
class: "bg-white rounded-lg shadow-xl border border-fm-color-neutral-gray-100 w-[360px] max-h-[480px] flex flex-col overflow-hidden"
|
|
2091
|
-
},
|
|
2089
|
+
}, tr = { class: "flex items-center justify-between px-16 py-12 border-b border-fm-color-neutral-gray-100" }, nr = { class: "fm-typo-en-title-sm-600" }, ar = { class: "overflow-y-auto flex-1 divide-y divide-fm-color-neutral-gray-100" }, sr = { class: "flex items-start justify-between gap-8" }, rr = { class: "flex flex-col gap-2" }, or = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-primary line-clamp-1" }, lr = { class: "fm-typo-en-body-xs-400 text-fm-color-typo-secondary capitalize" }, ir = { class: "flex items-center gap-4" }, ur = ["disabled", "onClick"], cr = ["disabled", "onClick"], dr = ["onClick"], mr = {
|
|
2092
2090
|
key: 0,
|
|
2093
2091
|
class: "flex flex-col gap-4"
|
|
2094
|
-
},
|
|
2092
|
+
}, fr = { class: "w-full bg-fm-color-neutral-gray-200 rounded-full h-[3px]" }, pr = { class: "flex justify-between fm-typo-en-body-xs-400 text-fm-color-typo-secondary" }, vr = {
|
|
2095
2093
|
key: 0,
|
|
2096
2094
|
class: "truncate max-w-[200px]"
|
|
2097
|
-
},
|
|
2095
|
+
}, yr = { class: "ml-auto" }, br = {
|
|
2098
2096
|
key: 1,
|
|
2099
2097
|
class: "flex items-center gap-4 fm-typo-en-body-xs-400 text-fm-color-typo-success"
|
|
2100
|
-
},
|
|
2098
|
+
}, hr = {
|
|
2101
2099
|
key: 2,
|
|
2102
2100
|
class: "flex items-center gap-4 fm-typo-en-body-xs-400 text-fm-color-typo-warning"
|
|
2103
|
-
},
|
|
2101
|
+
}, gr = {
|
|
2104
2102
|
key: 3,
|
|
2105
2103
|
class: "flex items-center gap-4 fm-typo-en-body-xs-400 text-fm-color-typo-secondary"
|
|
2106
|
-
},
|
|
2104
|
+
}, _r = {
|
|
2107
2105
|
key: 4,
|
|
2108
2106
|
class: "flex items-center gap-4 fm-typo-en-body-xs-400 text-fm-color-typo-error"
|
|
2109
|
-
},
|
|
2107
|
+
}, xr = { key: 0 }, wr = { key: 1 }, kr = {
|
|
2110
2108
|
key: 5,
|
|
2111
2109
|
class: "flex items-center gap-[5px] text-[11px] leading-none text-fm-color-typo-secondary"
|
|
2112
|
-
},
|
|
2110
|
+
}, Cr = /* @__PURE__ */ at({
|
|
2113
2111
|
__name: "BulkJobProgressPanel",
|
|
2114
2112
|
setup(C) {
|
|
2115
|
-
const { t: _ } =
|
|
2116
|
-
function
|
|
2117
|
-
L.value &&
|
|
2118
|
-
}
|
|
2119
|
-
|
|
2120
|
-
document.addEventListener("click",
|
|
2121
|
-
}),
|
|
2122
|
-
document.removeEventListener("click",
|
|
2113
|
+
const { t: _ } = Kn(), x = wt(), B = A(() => x.jobs.filter((c) => !c.hidden)), $ = nt(), L = P(!1), G = P(null);
|
|
2114
|
+
function U(c) {
|
|
2115
|
+
L.value && G.value && !G.value.contains(c.target) && (L.value = !1);
|
|
2116
|
+
}
|
|
2117
|
+
en(() => {
|
|
2118
|
+
document.addEventListener("click", U, !0);
|
|
2119
|
+
}), tn(() => {
|
|
2120
|
+
document.removeEventListener("click", U, !0);
|
|
2123
2121
|
});
|
|
2124
2122
|
const o = P(/* @__PURE__ */ new Set()), s = P(/* @__PURE__ */ new Set());
|
|
2125
|
-
async function
|
|
2123
|
+
async function h(c) {
|
|
2126
2124
|
if (!o.value.has(c.jobId)) {
|
|
2127
2125
|
o.value = /* @__PURE__ */ new Set([...o.value, c.jobId]);
|
|
2128
2126
|
try {
|
|
2129
|
-
const w = await
|
|
2127
|
+
const w = await $.downloadBulkJob(c.dbName, c.jobId), l = URL.createObjectURL(w), f = document.createElement("a");
|
|
2130
2128
|
f.href = l, f.download = "purchase-orders.zip", document.body.appendChild(f), f.click(), document.body.removeChild(f), setTimeout(() => URL.revokeObjectURL(l), 1e3);
|
|
2131
2129
|
} finally {
|
|
2132
2130
|
const w = new Set(o.value);
|
|
@@ -2134,7 +2132,7 @@ const nr = {
|
|
|
2134
2132
|
}
|
|
2135
2133
|
}
|
|
2136
2134
|
}
|
|
2137
|
-
async function
|
|
2135
|
+
async function V(c) {
|
|
2138
2136
|
if (!s.value.has(c.jobId)) {
|
|
2139
2137
|
s.value = /* @__PURE__ */ new Set([...s.value, c.jobId]);
|
|
2140
2138
|
try {
|
|
@@ -2145,7 +2143,7 @@ const nr = {
|
|
|
2145
2143
|
}
|
|
2146
2144
|
}
|
|
2147
2145
|
}
|
|
2148
|
-
function
|
|
2146
|
+
function Ce(c) {
|
|
2149
2147
|
x.removeJob(c);
|
|
2150
2148
|
}
|
|
2151
2149
|
function m(c) {
|
|
@@ -2155,16 +2153,16 @@ const nr = {
|
|
|
2155
2153
|
const w = Math.round(c / 1e3), l = Math.floor(w / 60), f = w % 60;
|
|
2156
2154
|
return l > 0 ? `${l}m ${f}s` : `${f}s`;
|
|
2157
2155
|
}
|
|
2158
|
-
function
|
|
2156
|
+
function b(c) {
|
|
2159
2157
|
return c < 1024 ? `${c} B` : c < 1024 * 1024 ? `${(c / 1024).toFixed(1)} KB` : `${(c / (1024 * 1024)).toFixed(1)} MB`;
|
|
2160
2158
|
}
|
|
2161
2159
|
return (c, w) => {
|
|
2162
|
-
const l =
|
|
2163
|
-
return i(),
|
|
2164
|
-
|
|
2160
|
+
const l = Oe("FmIcon");
|
|
2161
|
+
return i(), pe(dt, { to: "body" }, [
|
|
2162
|
+
B.value.length > 0 ? (i(), y("div", {
|
|
2165
2163
|
key: 0,
|
|
2166
2164
|
ref_key: "panelRef",
|
|
2167
|
-
ref:
|
|
2165
|
+
ref: G,
|
|
2168
2166
|
class: "fixed bottom-24 right-24 z-[9998] flex flex-col items-end gap-8"
|
|
2169
2167
|
}, [
|
|
2170
2168
|
L.value ? q("", !0) : (i(), y("button", {
|
|
@@ -2177,11 +2175,11 @@ const nr = {
|
|
|
2177
2175
|
size: "sm"
|
|
2178
2176
|
}),
|
|
2179
2177
|
e("span", null, p(n(_)("inventory.transfer.receiveRequest.bulk.backgroundJobsTitle")), 1),
|
|
2180
|
-
n(x).activeJobs.length > 0 ? (i(), y("span",
|
|
2178
|
+
n(x).activeJobs.length > 0 ? (i(), y("span", Zs, p(n(x).activeJobs.length), 1)) : q("", !0)
|
|
2181
2179
|
])),
|
|
2182
|
-
L.value ? (i(), y("div",
|
|
2183
|
-
e("div",
|
|
2184
|
-
e("span",
|
|
2180
|
+
L.value ? (i(), y("div", er, [
|
|
2181
|
+
e("div", tr, [
|
|
2182
|
+
e("span", nr, p(n(_)("inventory.transfer.receiveRequest.bulk.backgroundJobsTitle")), 1),
|
|
2185
2183
|
e("button", {
|
|
2186
2184
|
"aria-label": "Collapse",
|
|
2187
2185
|
onClick: w[1] || (w[1] = (f) => L.value = !1),
|
|
@@ -2193,104 +2191,104 @@ const nr = {
|
|
|
2193
2191
|
})
|
|
2194
2192
|
])
|
|
2195
2193
|
]),
|
|
2196
|
-
e("div",
|
|
2197
|
-
(i(!0), y(
|
|
2194
|
+
e("div", ar, [
|
|
2195
|
+
(i(!0), y(Se, null, tt(B.value, (f) => {
|
|
2198
2196
|
var T;
|
|
2199
2197
|
return i(), y("div", {
|
|
2200
2198
|
key: f.jobId,
|
|
2201
2199
|
class: "px-16 py-12 flex flex-col gap-8"
|
|
2202
2200
|
}, [
|
|
2203
|
-
e("div",
|
|
2204
|
-
e("div",
|
|
2205
|
-
e("span",
|
|
2206
|
-
e("span",
|
|
2201
|
+
e("div", sr, [
|
|
2202
|
+
e("div", rr, [
|
|
2203
|
+
e("span", or, p(f.title), 1),
|
|
2204
|
+
e("span", lr, p(f.status), 1)
|
|
2207
2205
|
]),
|
|
2208
|
-
e("div",
|
|
2206
|
+
e("div", ir, [
|
|
2209
2207
|
f.downloadReady ? (i(), y("button", {
|
|
2210
2208
|
key: 0,
|
|
2211
2209
|
class: "text-fm-color-primary hover:opacity-80 disabled:opacity-40",
|
|
2212
2210
|
disabled: o.value.has(f.jobId),
|
|
2213
2211
|
title: "Download",
|
|
2214
2212
|
"aria-label": "Download",
|
|
2215
|
-
onClick: (W) =>
|
|
2213
|
+
onClick: (W) => h(f)
|
|
2216
2214
|
}, [
|
|
2217
2215
|
E(l, {
|
|
2218
2216
|
name: o.value.has(f.jobId) ? "progress_activity" : "download",
|
|
2219
2217
|
size: "sm"
|
|
2220
2218
|
}, null, 8, ["name"])
|
|
2221
|
-
], 8,
|
|
2219
|
+
], 8, ur)) : q("", !0),
|
|
2222
2220
|
f.status === "waiting" || f.status === "active" ? (i(), y("button", {
|
|
2223
2221
|
key: 1,
|
|
2224
2222
|
class: "text-fm-color-semantic-error-500 hover:opacity-80 disabled:opacity-40",
|
|
2225
2223
|
disabled: s.value.has(f.jobId),
|
|
2226
2224
|
title: "Cancel",
|
|
2227
2225
|
"aria-label": "Cancel",
|
|
2228
|
-
onClick: (W) =>
|
|
2226
|
+
onClick: (W) => V(f)
|
|
2229
2227
|
}, [
|
|
2230
2228
|
E(l, {
|
|
2231
2229
|
name: s.value.has(f.jobId) ? "progress_activity" : "cancel",
|
|
2232
2230
|
size: "sm"
|
|
2233
2231
|
}, null, 8, ["name"])
|
|
2234
|
-
], 8,
|
|
2232
|
+
], 8, cr)) : q("", !0),
|
|
2235
2233
|
m(f.status) ? (i(), y("button", {
|
|
2236
2234
|
key: 2,
|
|
2237
2235
|
class: "text-fm-color-typo-secondary hover:text-fm-color-typo-primary",
|
|
2238
2236
|
title: "Dismiss",
|
|
2239
2237
|
"aria-label": "Dismiss",
|
|
2240
|
-
onClick: (W) =>
|
|
2238
|
+
onClick: (W) => Ce(f.jobId)
|
|
2241
2239
|
}, [
|
|
2242
2240
|
E(l, {
|
|
2243
2241
|
name: "close",
|
|
2244
2242
|
size: "sm"
|
|
2245
2243
|
})
|
|
2246
|
-
], 8,
|
|
2244
|
+
], 8, dr)) : q("", !0)
|
|
2247
2245
|
])
|
|
2248
2246
|
]),
|
|
2249
|
-
f.status === "active" || f.status === "waiting" ? (i(), y("div",
|
|
2250
|
-
e("div",
|
|
2247
|
+
f.status === "active" || f.status === "waiting" ? (i(), y("div", mr, [
|
|
2248
|
+
e("div", fr, [
|
|
2251
2249
|
e("div", {
|
|
2252
2250
|
class: "bg-fm-color-primary h-[3px] rounded-full transition-all duration-300",
|
|
2253
2251
|
style: gt({ width: `${f.progress}%` })
|
|
2254
2252
|
}, null, 4)
|
|
2255
2253
|
]),
|
|
2256
|
-
e("div",
|
|
2257
|
-
f.currentItem ? (i(), y("span",
|
|
2258
|
-
e("span",
|
|
2254
|
+
e("div", pr, [
|
|
2255
|
+
f.currentItem ? (i(), y("span", vr, p(f.currentItem), 1)) : q("", !0),
|
|
2256
|
+
e("span", yr, p(f.current) + " / " + p(f.total), 1)
|
|
2259
2257
|
])
|
|
2260
2258
|
])) : q("", !0),
|
|
2261
|
-
f.status === "completed" && f.errorCount === 0 ? (i(), y("div",
|
|
2259
|
+
f.status === "completed" && f.errorCount === 0 ? (i(), y("div", br, [
|
|
2262
2260
|
E(l, {
|
|
2263
2261
|
name: "check_circle",
|
|
2264
2262
|
size: "sm"
|
|
2265
2263
|
}),
|
|
2266
2264
|
e("span", null, p(n(_)("inventory.transfer.receiveRequest.bulk.jobDone")), 1)
|
|
2267
2265
|
])) : q("", !0),
|
|
2268
|
-
f.status === "completed" && (((T = f.stalePoIds) == null ? void 0 : T.length) ?? 0) > 0 ? (i(), y("div",
|
|
2266
|
+
f.status === "completed" && (((T = f.stalePoIds) == null ? void 0 : T.length) ?? 0) > 0 ? (i(), y("div", hr, [
|
|
2269
2267
|
E(l, {
|
|
2270
2268
|
name: "warning",
|
|
2271
2269
|
size: "sm"
|
|
2272
2270
|
}),
|
|
2273
2271
|
e("span", null, p(n(_)("inventory.transfer.receiveRequest.bulk.jobStalePos", [f.stalePoIds.length])), 1)
|
|
2274
2272
|
])) : q("", !0),
|
|
2275
|
-
f.status === "cancelled" ? (i(), y("div",
|
|
2273
|
+
f.status === "cancelled" ? (i(), y("div", gr, [
|
|
2276
2274
|
E(l, {
|
|
2277
2275
|
name: "do_not_disturb_on",
|
|
2278
2276
|
size: "sm"
|
|
2279
2277
|
}),
|
|
2280
2278
|
e("span", null, p(n(_)("inventory.transfer.receiveRequest.bulk.jobCancelled")), 1)
|
|
2281
2279
|
])) : q("", !0),
|
|
2282
|
-
f.status === "failed" ? (i(), y("div",
|
|
2280
|
+
f.status === "failed" ? (i(), y("div", _r, [
|
|
2283
2281
|
E(l, {
|
|
2284
2282
|
name: "cancel",
|
|
2285
2283
|
size: "sm"
|
|
2286
2284
|
}),
|
|
2287
|
-
f.errorCount > 0 ? (i(), y("span",
|
|
2285
|
+
f.errorCount > 0 ? (i(), y("span", xr, p(n(_)("inventory.transfer.receiveRequest.bulk.jobDoneWithErrors", [f.errorCount])), 1)) : (i(), y("span", wr, p(n(_)("inventory.transfer.receiveRequest.bulk.jobFailed")), 1))
|
|
2288
2286
|
])) : q("", !0),
|
|
2289
|
-
m(f.status) && f.completedAt ? (i(), y("div",
|
|
2287
|
+
m(f.status) && f.completedAt ? (i(), y("div", kr, [
|
|
2290
2288
|
e("span", null, p(n(_)("inventory.transfer.receiveRequest.bulk.jobCompletedIn", [d(f.completedAt - f.startedAt)])), 1),
|
|
2291
|
-
f.zipSizeBytes ? (i(), y(
|
|
2289
|
+
f.zipSizeBytes ? (i(), y(Se, { key: 0 }, [
|
|
2292
2290
|
w[2] || (w[2] = e("span", null, "·", -1)),
|
|
2293
|
-
e("span", null, p(
|
|
2291
|
+
e("span", null, p(b(f.zipSizeBytes)), 1)
|
|
2294
2292
|
], 64)) : q("", !0)
|
|
2295
2293
|
])) : q("", !0)
|
|
2296
2294
|
]);
|
|
@@ -2301,31 +2299,31 @@ const nr = {
|
|
|
2301
2299
|
]);
|
|
2302
2300
|
};
|
|
2303
2301
|
}
|
|
2304
|
-
}),
|
|
2302
|
+
}), Fr = {
|
|
2305
2303
|
key: 0,
|
|
2306
2304
|
class: "flex flex-col items-center justify-center py-48 gap-8 text-fm-color-typo-secondary"
|
|
2307
|
-
},
|
|
2305
|
+
}, Sr = { class: "flex-1 w-full flex items-center gap-4 xs:flex-col-reverse sm:flex-col-reverse" }, Rr = { class: "flex-1 xs:w-full sm:w-full" }, Pr = {
|
|
2308
2306
|
key: 0,
|
|
2309
2307
|
class: "flex-1"
|
|
2310
|
-
},
|
|
2308
|
+
}, Dr = { class: "w-full max-w-[343px] xs:max-w-[unset] sm:max-w-[unset]" }, qr = {
|
|
2311
2309
|
key: 0,
|
|
2312
2310
|
class: "flex flex-col items-center justify-center py-48 gap-8 text-fm-color-typo-secondary"
|
|
2313
|
-
},
|
|
2311
|
+
}, Er = { class: "fm-typo-en-body-md-400" }, Nr = {
|
|
2314
2312
|
key: 1,
|
|
2315
2313
|
class: "relative"
|
|
2316
|
-
},
|
|
2314
|
+
}, $r = {
|
|
2317
2315
|
key: 0,
|
|
2318
2316
|
class: "flex items-center gap-12 mb-8"
|
|
2319
|
-
},
|
|
2317
|
+
}, Br = { class: "flex-1 h-4 rounded-full bg-fm-color-neutral-gray-200 overflow-hidden" }, Or = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary whitespace-nowrap" }, Ar = {
|
|
2320
2318
|
key: 1,
|
|
2321
2319
|
class: "flex items-center justify-between gap-12 rounded-md border border-red-200 bg-red-50 px-16 py-8 mb-8"
|
|
2322
|
-
},
|
|
2320
|
+
}, Tr = { class: "fm-typo-en-body-md-400 text-red-800" }, Ir = { class: "flex flex-col py-8" }, Lr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, zr = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Mr = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, Ur = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1" }, Vr = {
|
|
2323
2321
|
key: 0,
|
|
2324
2322
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1"
|
|
2325
|
-
},
|
|
2323
|
+
}, Jr = { class: "pt-8" }, jr = {
|
|
2326
2324
|
key: 0,
|
|
2327
2325
|
class: "absolute inset-0 z-10 flex items-center justify-center bg-fm-color-opacity-sm"
|
|
2328
|
-
},
|
|
2326
|
+
}, Wr = { class: "flex items-center gap-12 rounded-md bg-white px-16 py-8 shadow-lg" }, Yr = { class: "fm-typo-en-body-md-400" }, Bt = "BulkReceiveRequestViewSearchCriteria", Hr = /* @__PURE__ */ at({
|
|
2329
2327
|
__name: "BulkReceiveRequestView",
|
|
2330
2328
|
setup(C) {
|
|
2331
2329
|
const { t: _ } = it(), x = ft();
|
|
@@ -2334,12 +2332,12 @@ const nr = {
|
|
|
2334
2332
|
startDate: ut.string().optional().nullable(),
|
|
2335
2333
|
endDate: ut.string().optional().nullable()
|
|
2336
2334
|
});
|
|
2337
|
-
const
|
|
2338
|
-
function
|
|
2335
|
+
const B = wn(), $ = xt(), L = rn();
|
|
2336
|
+
function G() {
|
|
2339
2337
|
const N = {
|
|
2340
2338
|
name: "",
|
|
2341
2339
|
..._t()
|
|
2342
|
-
}, k =
|
|
2340
|
+
}, k = B.getItem(Bt);
|
|
2343
2341
|
if (!k) return N;
|
|
2344
2342
|
try {
|
|
2345
2343
|
return JSON.parse(k);
|
|
@@ -2347,16 +2345,16 @@ const nr = {
|
|
|
2347
2345
|
return N;
|
|
2348
2346
|
}
|
|
2349
2347
|
}
|
|
2350
|
-
function
|
|
2351
|
-
|
|
2348
|
+
function U() {
|
|
2349
|
+
B.setItem(Bt, JSON.stringify(o.value));
|
|
2352
2350
|
}
|
|
2353
|
-
const o = P(
|
|
2351
|
+
const o = P(G()), s = Qs(o.value), h = P(!1), { selectedLocationDbNames: V } = s, Ce = A(() => T.value.filter((N) => V.value.includes(N.dbName)).map((N) => N.doc._id)), {
|
|
2354
2352
|
columnDefs: m,
|
|
2355
2353
|
showPdfDialog: d,
|
|
2356
|
-
pdfPreviewLoading:
|
|
2354
|
+
pdfPreviewLoading: b,
|
|
2357
2355
|
pdfPreviewBlobUrl: c
|
|
2358
|
-
} =
|
|
2359
|
-
|
|
2356
|
+
} = Xs(s, s.shipments), w = mt(), l = fn(), f = Ot(), T = P([]);
|
|
2357
|
+
nn(() => {
|
|
2360
2358
|
const N = w.locations;
|
|
2361
2359
|
N.length > 0 && (T.value = N);
|
|
2362
2360
|
});
|
|
@@ -2369,26 +2367,26 @@ const nr = {
|
|
|
2369
2367
|
} catch {
|
|
2370
2368
|
}
|
|
2371
2369
|
}
|
|
2372
|
-
|
|
2370
|
+
Qe(
|
|
2373
2371
|
[() => f.sessionUser.value, () => f.currentBusiness.value],
|
|
2374
2372
|
([N, k]) => {
|
|
2375
2373
|
N && k && W();
|
|
2376
2374
|
},
|
|
2377
2375
|
{ immediate: !0 }
|
|
2378
2376
|
);
|
|
2379
|
-
const R =
|
|
2377
|
+
const R = A(() => s.loading.value), J = A(
|
|
2380
2378
|
() => s.failedLocations.value.map((N) => {
|
|
2381
2379
|
var k;
|
|
2382
2380
|
return ((k = w.locations.find((z) => z.dbName === N.dbName)) == null ? void 0 : k.name) ?? N.dbName;
|
|
2383
2381
|
}).join(", ")
|
|
2384
|
-
), I =
|
|
2382
|
+
), I = A(
|
|
2385
2383
|
() => s.failedLocations.value.some((N) => N.retryable)
|
|
2386
2384
|
);
|
|
2387
|
-
function
|
|
2385
|
+
function ae(N) {
|
|
2388
2386
|
var k;
|
|
2389
2387
|
return N.itemCount ?? ((k = N.items) == null ? void 0 : k.length) ?? 0;
|
|
2390
2388
|
}
|
|
2391
|
-
async function
|
|
2389
|
+
async function ue() {
|
|
2392
2390
|
const N = `inventory-record_${Xe(o.value.startDate).format("DD-MM-YYYY_HH-mm")}-${Xe(o.value.endDate).format("DD-MM-YYYY_HH-mm")}.xlsx`;
|
|
2393
2391
|
let k = [];
|
|
2394
2392
|
try {
|
|
@@ -2401,77 +2399,54 @@ const nr = {
|
|
|
2401
2399
|
});
|
|
2402
2400
|
return;
|
|
2403
2401
|
}
|
|
2404
|
-
const z =
|
|
2405
|
-
|
|
2406
|
-
var
|
|
2407
|
-
const Le = new Date(Sn(ae._id) ?? ""), $e = ae.effectiveAt ? new Date(ae.effectiveAt) : void 0, U = qt(
|
|
2408
|
-
Fn(fe.sku, ae.deliveryOrder || [])
|
|
2409
|
-
), ye = qt(fe.quantity), Ue = ((u = fe == null ? void 0 : fe.measurement) == null ? void 0 : u.abbrev) || fe.sku.unit.abbrev;
|
|
2402
|
+
const z = _n(
|
|
2403
|
+
k.map((ne) => {
|
|
2404
|
+
var me;
|
|
2410
2405
|
return {
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
"SKU name": fe.name,
|
|
2414
|
-
"PO #": ae.seqNumber,
|
|
2415
|
-
"Effective at": $e,
|
|
2416
|
-
Date: Le,
|
|
2417
|
-
Status: ae.status,
|
|
2418
|
-
Reference: ae.ref ?? "",
|
|
2419
|
-
"Received quantity": U,
|
|
2420
|
-
"Ordered quantity": ye,
|
|
2421
|
-
Unit: Ue,
|
|
2422
|
-
"Total cost": fe.totalCost ? yn(fe.totalCost) : null
|
|
2406
|
+
po: ne,
|
|
2407
|
+
destination: ((me = w.locations.find((Te) => Te.dbName === ne._locationDbName)) == null ? void 0 : me.name) ?? ""
|
|
2423
2408
|
};
|
|
2424
|
-
})
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
"SKU name",
|
|
2429
|
-
"PO #",
|
|
2430
|
-
"Date",
|
|
2431
|
-
"Status",
|
|
2432
|
-
"Reference",
|
|
2433
|
-
"Received quantity",
|
|
2434
|
-
"Ordered quantity",
|
|
2435
|
-
"Unit"
|
|
2436
|
-
];
|
|
2437
|
-
O.enableBackdatePo && ne.insert("Effective at", 5), O.enableTotalCost && ne.push("Total cost"), await Rn([{ name: "purchases", data: z, columns: ne }], N), x.open({
|
|
2409
|
+
}),
|
|
2410
|
+
{ backdate: $.enableBackdatePo, totalCost: $.enableTotalCost }
|
|
2411
|
+
);
|
|
2412
|
+
await xn([z], N), x.open({
|
|
2438
2413
|
title: _("inventory.transfer.receiveRequest.export.success"),
|
|
2439
2414
|
message: _("inventory.transfer.receiveRequest.export.message", [N]),
|
|
2440
2415
|
type: "success"
|
|
2441
2416
|
});
|
|
2442
2417
|
}
|
|
2443
|
-
const
|
|
2444
|
-
|
|
2418
|
+
const ce = P(_t()), de = P("");
|
|
2419
|
+
Qe([() => ce.value], ([N]) => {
|
|
2445
2420
|
if (!N.startDate || !N.endDate) return;
|
|
2446
2421
|
if (Xe(N.endDate).diff(Xe(N.startDate), "day") > 60) {
|
|
2447
2422
|
x.open({
|
|
2448
2423
|
title: _("inventory.transfer.receiveRequest.bulk.dateRangeLimitTitle"),
|
|
2449
2424
|
message: _("inventory.transfer.receiveRequest.bulk.dateRangeLimitMsg"),
|
|
2450
2425
|
type: "warning"
|
|
2451
|
-
}),
|
|
2426
|
+
}), ce.value = {
|
|
2452
2427
|
startDate: N.startDate,
|
|
2453
2428
|
endDate: Xe(N.startDate).add(60, "day").format("YYYY-MM-DD")
|
|
2454
2429
|
};
|
|
2455
2430
|
return;
|
|
2456
2431
|
}
|
|
2457
|
-
o.value.startDate = N.startDate, o.value.endDate = N.endDate, s.updateDateRange(o.value.startDate, o.value.endDate),
|
|
2458
|
-
}),
|
|
2459
|
-
|
|
2432
|
+
o.value.startDate = N.startDate, o.value.endDate = N.endDate, s.updateDateRange(o.value.startDate, o.value.endDate), U();
|
|
2433
|
+
}), Qe([() => de.value], () => {
|
|
2434
|
+
U();
|
|
2460
2435
|
});
|
|
2461
|
-
const
|
|
2462
|
-
|
|
2463
|
-
() =>
|
|
2436
|
+
const Ue = on.debounce(() => s.fetchData(), 1500);
|
|
2437
|
+
Qe(
|
|
2438
|
+
() => V.value,
|
|
2464
2439
|
() => {
|
|
2465
|
-
s.abortOngoingBrowse(),
|
|
2440
|
+
s.abortOngoingBrowse(), Ue();
|
|
2466
2441
|
}
|
|
2467
2442
|
);
|
|
2468
|
-
function
|
|
2443
|
+
function Fe(N) {
|
|
2469
2444
|
if (N === "create") {
|
|
2470
2445
|
if (R.value) {
|
|
2471
2446
|
x.open({ title: "Loading data...", message: "Please wait.", type: "info" });
|
|
2472
2447
|
return;
|
|
2473
2448
|
}
|
|
2474
|
-
if (
|
|
2449
|
+
if (V.value.length === 0) {
|
|
2475
2450
|
x.open({
|
|
2476
2451
|
title: "No outlets selected",
|
|
2477
2452
|
message: "Please select at least one outlet to create a transfer.",
|
|
@@ -2479,18 +2454,18 @@ const nr = {
|
|
|
2479
2454
|
});
|
|
2480
2455
|
return;
|
|
2481
2456
|
}
|
|
2482
|
-
|
|
2457
|
+
h.value = !0;
|
|
2483
2458
|
return;
|
|
2484
2459
|
}
|
|
2485
|
-
if (N === "upload" &&
|
|
2460
|
+
if (N === "upload" && $.enableXilnexTransferNote)
|
|
2486
2461
|
return s.promptUploadTransferDialog();
|
|
2487
2462
|
if (N === "refresh") return s.fetchData();
|
|
2488
|
-
if (N === "export") return
|
|
2489
|
-
if (N === "downloadAll") return
|
|
2490
|
-
if (N === "emailAll") return
|
|
2463
|
+
if (N === "export") return ue();
|
|
2464
|
+
if (N === "downloadAll") return Ve();
|
|
2465
|
+
if (N === "emailAll") return Je();
|
|
2491
2466
|
}
|
|
2492
|
-
async function
|
|
2493
|
-
if (
|
|
2467
|
+
async function Ve() {
|
|
2468
|
+
if (V.value.length === 0) {
|
|
2494
2469
|
x.open({
|
|
2495
2470
|
title: _("inventory.transfer.receiveRequest.bulk.noLocationsSelected"),
|
|
2496
2471
|
message: "",
|
|
@@ -2498,11 +2473,11 @@ const nr = {
|
|
|
2498
2473
|
});
|
|
2499
2474
|
return;
|
|
2500
2475
|
}
|
|
2501
|
-
await s.downloadAll(
|
|
2476
|
+
await s.downloadAll(je.value);
|
|
2502
2477
|
}
|
|
2503
|
-
async function
|
|
2504
|
-
if (
|
|
2505
|
-
if (
|
|
2478
|
+
async function Je() {
|
|
2479
|
+
if ($.enablePurchaseOrderEmail) {
|
|
2480
|
+
if (V.value.length === 0) {
|
|
2506
2481
|
x.open({
|
|
2507
2482
|
title: _("inventory.transfer.receiveRequest.bulk.noLocationsSelected"),
|
|
2508
2483
|
message: "",
|
|
@@ -2510,34 +2485,34 @@ const nr = {
|
|
|
2510
2485
|
});
|
|
2511
2486
|
return;
|
|
2512
2487
|
}
|
|
2513
|
-
await s.emailAll(
|
|
2488
|
+
await s.emailAll(je.value);
|
|
2514
2489
|
}
|
|
2515
2490
|
}
|
|
2516
|
-
const { breakpoints:
|
|
2491
|
+
const { breakpoints: Le } = Sn(), oe = A(() => Le.value.xs || Le.value.sm), se = A(() => oe.value ? 10 : 20), ke = qt(), _e = qt(), Ee = A(() => $.enableReceiveRequestBeta ? [
|
|
2517
2492
|
{
|
|
2518
2493
|
label: _("inventory.transfer.receiveRequest.actions.create"),
|
|
2519
2494
|
value: "create",
|
|
2520
2495
|
isPrimary: !0,
|
|
2521
2496
|
prependIcon: "add"
|
|
2522
2497
|
},
|
|
2523
|
-
|
|
2498
|
+
...$.enableXilnexTransferNote ? [{ label: _("inventory.common.upload"), value: "upload" }] : [],
|
|
2524
2499
|
{ label: _("inventory.common.refresh"), value: "refresh" },
|
|
2525
2500
|
{ label: _("inventory.common.export"), value: "export" },
|
|
2526
|
-
|
|
2501
|
+
...$.enablePrintTemplate && !R.value ? [
|
|
2527
2502
|
{
|
|
2528
2503
|
label: _("inventory.transfer.receiveRequest.bulk.downloadAll"),
|
|
2529
2504
|
value: "downloadAll",
|
|
2530
2505
|
prependIcon: "download"
|
|
2531
2506
|
}
|
|
2532
2507
|
] : [],
|
|
2533
|
-
|
|
2508
|
+
...$.enablePurchaseOrderEmail && !R.value ? [
|
|
2534
2509
|
{
|
|
2535
2510
|
label: _("inventory.transfer.receiveRequest.bulk.emailAll"),
|
|
2536
2511
|
value: "emailAll",
|
|
2537
2512
|
prependIcon: "email"
|
|
2538
2513
|
}
|
|
2539
2514
|
] : []
|
|
2540
|
-
] : []), Ze =
|
|
2515
|
+
] : []), Ze = A(() => {
|
|
2541
2516
|
const N = [
|
|
2542
2517
|
{
|
|
2543
2518
|
type: "string",
|
|
@@ -2558,7 +2533,7 @@ const nr = {
|
|
|
2558
2533
|
values: Array.from(
|
|
2559
2534
|
new Set(
|
|
2560
2535
|
s.purchaseOrders.value.map((z) => {
|
|
2561
|
-
const ne = w.locations.find((
|
|
2536
|
+
const ne = w.locations.find((me) => me.dbName === z._locationDbName);
|
|
2562
2537
|
return (ne == null ? void 0 : ne.name) ?? z._locationDbName;
|
|
2563
2538
|
})
|
|
2564
2539
|
)
|
|
@@ -2570,8 +2545,8 @@ const nr = {
|
|
|
2570
2545
|
key: "netsuiteTransactionNumber",
|
|
2571
2546
|
entity: "purchaseOrder",
|
|
2572
2547
|
values: s.purchaseOrders.value.map((z) => {
|
|
2573
|
-
var ne,
|
|
2574
|
-
return (
|
|
2548
|
+
var ne, me;
|
|
2549
|
+
return (me = (ne = z.netSuite) == null ? void 0 : ne.additionalInfo) == null ? void 0 : me.transactionnumber;
|
|
2575
2550
|
}).filter((z) => z != null)
|
|
2576
2551
|
},
|
|
2577
2552
|
{
|
|
@@ -2594,17 +2569,17 @@ const nr = {
|
|
|
2594
2569
|
}
|
|
2595
2570
|
];
|
|
2596
2571
|
return [...N, ...L.isEnabled ? k : []];
|
|
2597
|
-
}),
|
|
2598
|
-
if (!
|
|
2599
|
-
const N =
|
|
2572
|
+
}), Ne = P(null), je = A(() => {
|
|
2573
|
+
if (!Ne.value) return s.purchaseOrders.value;
|
|
2574
|
+
const N = Mn.build(Ne.value);
|
|
2600
2575
|
return s.purchaseOrders.value.filter((k) => {
|
|
2601
|
-
var ne,
|
|
2602
|
-
const z = ((ne = w.locations.find((
|
|
2603
|
-
return
|
|
2576
|
+
var ne, me, Te, We, ze;
|
|
2577
|
+
const z = ((ne = w.locations.find((j) => j.dbName === k._locationDbName)) == null ? void 0 : ne.name) ?? k._locationDbName;
|
|
2578
|
+
return Un(
|
|
2604
2579
|
{
|
|
2605
|
-
netsuiteTransactionNumber: (
|
|
2606
|
-
netsuiteOrderNo: (
|
|
2607
|
-
netsuiteOrderId: (
|
|
2580
|
+
netsuiteTransactionNumber: (Te = (me = k.netSuite) == null ? void 0 : me.additionalInfo) == null ? void 0 : Te.transactionnumber,
|
|
2581
|
+
netsuiteOrderNo: (We = k.netSuite) == null ? void 0 : We.refNo,
|
|
2582
|
+
netsuiteOrderId: (ze = k.netSuite) == null ? void 0 : ze.id,
|
|
2608
2583
|
status: k.status,
|
|
2609
2584
|
transferFrom: k.supplier.name,
|
|
2610
2585
|
location: z
|
|
@@ -2614,64 +2589,64 @@ const nr = {
|
|
|
2614
2589
|
});
|
|
2615
2590
|
});
|
|
2616
2591
|
return (N, k) => {
|
|
2617
|
-
const z =
|
|
2618
|
-
return i(),
|
|
2592
|
+
const z = Oe("FmIcon"), ne = Oe("FmTextField"), me = Oe("FmButton"), Te = Oe("FmTable"), We = Oe("FmCircularProgress");
|
|
2593
|
+
return i(), pe(kn, {
|
|
2619
2594
|
title: n(_)("inventory.transfer.receiveRequest.bulk.title"),
|
|
2620
|
-
actions:
|
|
2621
|
-
"onClick:action":
|
|
2595
|
+
actions: Ee.value,
|
|
2596
|
+
"onClick:action": Fe
|
|
2622
2597
|
}, {
|
|
2623
|
-
default:
|
|
2624
|
-
var
|
|
2598
|
+
default: Ae(() => {
|
|
2599
|
+
var ze;
|
|
2625
2600
|
return [
|
|
2626
|
-
n(
|
|
2601
|
+
n($).isLoaded && !n($).enableReceiveRequestBeta ? (i(), y("div", Fr, [
|
|
2627
2602
|
E(z, {
|
|
2628
2603
|
name: "block",
|
|
2629
2604
|
size: "xl"
|
|
2630
2605
|
}),
|
|
2631
2606
|
k[11] || (k[11] = e("p", { class: "fm-typo-en-body-md-400" }, "Not available", -1))
|
|
2632
|
-
])) : n(
|
|
2607
|
+
])) : n($).enableReceiveRequestBeta ? (i(), y(Se, { key: 1 }, [
|
|
2633
2608
|
e("div", {
|
|
2634
|
-
class:
|
|
2609
|
+
class: Q(["flex flex-col gap-8 max-h-full", { "p-0": oe.value, "px-24": !oe.value }])
|
|
2635
2610
|
}, [
|
|
2636
2611
|
e("div", {
|
|
2637
2612
|
class: "flex flex-col gap-8",
|
|
2638
2613
|
onVnodeMounted: k[4] || (k[4] = //@ts-ignore
|
|
2639
|
-
(...
|
|
2614
|
+
(...j) => n(ke).onMounted && n(ke).onMounted(...j)),
|
|
2640
2615
|
onVnodeUnmounted: k[5] || (k[5] = //@ts-ignore
|
|
2641
|
-
(...
|
|
2616
|
+
(...j) => n(ke).onUnmounted && n(ke).onUnmounted(...j))
|
|
2642
2617
|
}, [
|
|
2643
2618
|
e("div", {
|
|
2644
|
-
class:
|
|
2619
|
+
class: Q([
|
|
2645
2620
|
"flex gap-8 items-center",
|
|
2646
|
-
{ "px-8 flex-col-reverse h-[unset]":
|
|
2621
|
+
{ "px-8 flex-col-reverse h-[unset]": oe.value, "h-48": !oe.value }
|
|
2647
2622
|
])
|
|
2648
2623
|
}, [
|
|
2649
2624
|
e("div", {
|
|
2650
|
-
class:
|
|
2625
|
+
class: Q(["flex gap-8 items-center", { "w-full overflow-x-auto": oe.value }])
|
|
2651
2626
|
}, [
|
|
2652
|
-
E(
|
|
2653
|
-
modelValue: n(
|
|
2654
|
-
"onUpdate:modelValue": k[0] || (k[0] = (
|
|
2627
|
+
E(Js, {
|
|
2628
|
+
modelValue: n(V),
|
|
2629
|
+
"onUpdate:modelValue": k[0] || (k[0] = (j) => Rt(V) ? V.value = j : null),
|
|
2655
2630
|
locations: T.value
|
|
2656
2631
|
}, null, 8, ["modelValue", "locations"]),
|
|
2657
|
-
E(
|
|
2658
|
-
"model-value":
|
|
2659
|
-
"onUpdate:modelValue": k[1] || (k[1] = (
|
|
2632
|
+
E(pn, {
|
|
2633
|
+
"model-value": ce.value,
|
|
2634
|
+
"onUpdate:modelValue": k[1] || (k[1] = (j) => ce.value = j)
|
|
2660
2635
|
}, null, 8, ["model-value"])
|
|
2661
2636
|
], 2),
|
|
2662
|
-
e("div",
|
|
2663
|
-
e("div",
|
|
2664
|
-
E(n(
|
|
2665
|
-
modelValue:
|
|
2666
|
-
"onUpdate:modelValue": k[2] || (k[2] = (
|
|
2637
|
+
e("div", Sr, [
|
|
2638
|
+
e("div", Rr, [
|
|
2639
|
+
E(n(Vn), {
|
|
2640
|
+
modelValue: Ne.value,
|
|
2641
|
+
"onUpdate:modelValue": k[2] || (k[2] = (j) => Ne.value = j),
|
|
2667
2642
|
attributes: Ze.value
|
|
2668
2643
|
}, null, 8, ["modelValue", "attributes"])
|
|
2669
2644
|
]),
|
|
2670
|
-
|
|
2671
|
-
e("div",
|
|
2645
|
+
oe.value ? q("", !0) : (i(), y("div", Pr)),
|
|
2646
|
+
e("div", Dr, [
|
|
2672
2647
|
E(ne, {
|
|
2673
|
-
"model-value":
|
|
2674
|
-
"onUpdate:modelValue": k[3] || (k[3] = (
|
|
2648
|
+
"model-value": de.value,
|
|
2649
|
+
"onUpdate:modelValue": k[3] || (k[3] = (j) => de.value = j),
|
|
2675
2650
|
"prepend-icon": "search",
|
|
2676
2651
|
placeholder: n(_)("inventory.common.table.toolbar.filterItems"),
|
|
2677
2652
|
class: "w-full"
|
|
@@ -2680,21 +2655,21 @@ const nr = {
|
|
|
2680
2655
|
])
|
|
2681
2656
|
], 2)
|
|
2682
2657
|
], 512),
|
|
2683
|
-
n(
|
|
2658
|
+
n(V).length === 0 && !R.value ? (i(), y("div", qr, [
|
|
2684
2659
|
E(z, {
|
|
2685
2660
|
name: "storefront",
|
|
2686
2661
|
size: "xl"
|
|
2687
2662
|
}),
|
|
2688
|
-
e("p",
|
|
2689
|
-
])) : (i(), y("div",
|
|
2663
|
+
e("p", Er, p(n(_)("inventory.transfer.receiveRequest.bulk.selectLocationsHint")), 1)
|
|
2664
|
+
])) : (i(), y("div", Nr, [
|
|
2690
2665
|
e("div", {
|
|
2691
2666
|
onVnodeMounted: k[6] || (k[6] = //@ts-ignore
|
|
2692
|
-
(...
|
|
2667
|
+
(...j) => n(_e).onMounted && n(_e).onMounted(...j)),
|
|
2693
2668
|
onVnodeUnmounted: k[7] || (k[7] = //@ts-ignore
|
|
2694
|
-
(...
|
|
2669
|
+
(...j) => n(_e).onUnmounted && n(_e).onUnmounted(...j))
|
|
2695
2670
|
}, [
|
|
2696
|
-
(R.value || n(s).retryingFailed.value) && n(s).fetchProgress.value ? (i(), y("div",
|
|
2697
|
-
e("div",
|
|
2671
|
+
(R.value || n(s).retryingFailed.value) && n(s).fetchProgress.value ? (i(), y("div", $r, [
|
|
2672
|
+
e("div", Br, [
|
|
2698
2673
|
e("div", {
|
|
2699
2674
|
class: "h-full rounded-full bg-fm-color-primary transition-all duration-300",
|
|
2700
2675
|
style: gt({
|
|
@@ -2702,11 +2677,11 @@ const nr = {
|
|
|
2702
2677
|
})
|
|
2703
2678
|
}, null, 4)
|
|
2704
2679
|
]),
|
|
2705
|
-
e("span",
|
|
2680
|
+
e("span", Or, p(n(s).fetchProgress.value.done) + "/" + p(n(s).fetchProgress.value.total) + " locations ", 1)
|
|
2706
2681
|
])) : q("", !0),
|
|
2707
|
-
n(s).failedLocations.value.length > 0 ? (i(), y("div",
|
|
2708
|
-
e("span",
|
|
2709
|
-
I.value ? (i(),
|
|
2682
|
+
n(s).failedLocations.value.length > 0 ? (i(), y("div", Ar, [
|
|
2683
|
+
e("span", Tr, " Failed to load: " + p(J.value), 1),
|
|
2684
|
+
I.value ? (i(), pe(me, {
|
|
2710
2685
|
key: 0,
|
|
2711
2686
|
variant: "secondary",
|
|
2712
2687
|
disabled: n(s).retryingFailed.value || R.value,
|
|
@@ -2715,53 +2690,53 @@ const nr = {
|
|
|
2715
2690
|
}, null, 8, ["disabled", "label", "onClick"])) : q("", !0)
|
|
2716
2691
|
])) : q("", !0)
|
|
2717
2692
|
], 512),
|
|
2718
|
-
E(
|
|
2719
|
-
style: gt(n(
|
|
2693
|
+
E(Te, {
|
|
2694
|
+
style: gt(n(ke).tableHeight),
|
|
2720
2695
|
"column-defs": n(m),
|
|
2721
|
-
"row-data":
|
|
2722
|
-
"search-value":
|
|
2696
|
+
"row-data": je.value,
|
|
2697
|
+
"search-value": de.value,
|
|
2723
2698
|
loading: R.value,
|
|
2724
|
-
onRowClick: k[8] || (k[8] = (
|
|
2725
|
-
"page-size":
|
|
2699
|
+
onRowClick: k[8] || (k[8] = (j) => n(s).promptShowTransferDetails(j.original)),
|
|
2700
|
+
"page-size": se.value
|
|
2726
2701
|
}, {
|
|
2727
|
-
"list-row":
|
|
2728
|
-
E(
|
|
2729
|
-
row:
|
|
2702
|
+
"list-row": Ae((j) => [
|
|
2703
|
+
E(zn, {
|
|
2704
|
+
row: j,
|
|
2730
2705
|
onRowClick: n(s).promptShowTransferDetails
|
|
2731
2706
|
}, {
|
|
2732
|
-
default:
|
|
2733
|
-
var
|
|
2707
|
+
default: Ae((xe) => {
|
|
2708
|
+
var Ge, r, u, g, O, M, F, H, Z, ee, re, te, fe, ve, Re, $e, be, Y, K, we, Pe, De, D, le, ye;
|
|
2734
2709
|
return [
|
|
2735
|
-
e("div",
|
|
2736
|
-
e("div",
|
|
2710
|
+
e("div", Ir, [
|
|
2711
|
+
e("div", Lr, [
|
|
2737
2712
|
E(n(ot), {
|
|
2738
|
-
render: (u = (r = (
|
|
2739
|
-
props: (
|
|
2713
|
+
render: (u = (r = (Ge = xe._id) == null ? void 0 : Ge.column) == null ? void 0 : r.columnDef) == null ? void 0 : u.cell,
|
|
2714
|
+
props: (O = (g = xe._id) == null ? void 0 : g.getContext) == null ? void 0 : O.call(g)
|
|
2740
2715
|
}, null, 8, ["render", "props"])
|
|
2741
2716
|
]),
|
|
2742
|
-
e("div",
|
|
2717
|
+
e("div", zr, [
|
|
2743
2718
|
E(n(ot), {
|
|
2744
|
-
render: (
|
|
2745
|
-
props: (ee = (Z =
|
|
2719
|
+
render: (H = (F = (M = xe.location) == null ? void 0 : M.column) == null ? void 0 : F.columnDef) == null ? void 0 : H.cell,
|
|
2720
|
+
props: (ee = (Z = xe.location) == null ? void 0 : Z.getContext) == null ? void 0 : ee.call(Z)
|
|
2746
2721
|
}, null, 8, ["render", "props"])
|
|
2747
2722
|
]),
|
|
2748
|
-
e("div",
|
|
2723
|
+
e("div", Mr, [
|
|
2749
2724
|
E(n(ot), {
|
|
2750
|
-
render: (
|
|
2751
|
-
props: (
|
|
2725
|
+
render: (fe = (te = (re = xe.supplier_name) == null ? void 0 : re.column) == null ? void 0 : te.columnDef) == null ? void 0 : fe.cell,
|
|
2726
|
+
props: (Re = (ve = xe.supplier_name) == null ? void 0 : ve.getContext) == null ? void 0 : Re.call(ve)
|
|
2752
2727
|
}, null, 8, ["render", "props"])
|
|
2753
2728
|
]),
|
|
2754
|
-
e("div",
|
|
2755
|
-
|
|
2729
|
+
e("div", Ur, p(n(_)("inventory.transfer.table.noOfItems")) + ": " + p(ae(j.original)), 1),
|
|
2730
|
+
j.original.ref ? (i(), y("div", Vr, [
|
|
2756
2731
|
E(n(ot), {
|
|
2757
|
-
render: (Y = (
|
|
2758
|
-
props: (
|
|
2732
|
+
render: (Y = (be = ($e = xe.ref) == null ? void 0 : $e.column) == null ? void 0 : be.columnDef) == null ? void 0 : Y.cell,
|
|
2733
|
+
props: (we = (K = xe.ref) == null ? void 0 : K.getContext) == null ? void 0 : we.call(K)
|
|
2759
2734
|
}, null, 8, ["render", "props"])
|
|
2760
2735
|
])) : q("", !0),
|
|
2761
|
-
e("div",
|
|
2736
|
+
e("div", Jr, [
|
|
2762
2737
|
E(n(ot), {
|
|
2763
|
-
render: (D = (
|
|
2764
|
-
props: (
|
|
2738
|
+
render: (D = (De = (Pe = xe.status) == null ? void 0 : Pe.column) == null ? void 0 : De.columnDef) == null ? void 0 : D.cell,
|
|
2739
|
+
props: (ye = (le = xe.status) == null ? void 0 : le.getContext) == null ? void 0 : ye.call(le)
|
|
2765
2740
|
}, null, 8, ["render", "props"])
|
|
2766
2741
|
])
|
|
2767
2742
|
])
|
|
@@ -2772,11 +2747,11 @@ const nr = {
|
|
|
2772
2747
|
]),
|
|
2773
2748
|
_: 1
|
|
2774
2749
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]),
|
|
2775
|
-
n(s).rowAction.pending.value ? (i(), y("div",
|
|
2776
|
-
e("div",
|
|
2777
|
-
E(
|
|
2778
|
-
e("span",
|
|
2779
|
-
E(
|
|
2750
|
+
n(s).rowAction.pending.value ? (i(), y("div", jr, [
|
|
2751
|
+
e("div", Wr, [
|
|
2752
|
+
E(We, { size: "md" }),
|
|
2753
|
+
e("span", Yr, p(n(_)("inventory.common.loading")), 1),
|
|
2754
|
+
E(me, {
|
|
2780
2755
|
variant: "secondary",
|
|
2781
2756
|
label: n(_)("inventory.common.cancel"),
|
|
2782
2757
|
onClick: n(s).rowAction.cancel
|
|
@@ -2785,31 +2760,31 @@ const nr = {
|
|
|
2785
2760
|
])) : q("", !0)
|
|
2786
2761
|
]))
|
|
2787
2762
|
], 2),
|
|
2788
|
-
(i(),
|
|
2789
|
-
E(
|
|
2790
|
-
n(
|
|
2791
|
-
E(
|
|
2792
|
-
show:
|
|
2793
|
-
"onUpdate:show": k[9] || (k[9] = (
|
|
2763
|
+
(i(), pe(dt, { to: "body" }, [
|
|
2764
|
+
E(Cr),
|
|
2765
|
+
n($).enablePurchaseOrderEmail ? (i(), pe(bn, Pt(yt({ key: 0 }, n(s).emailDialogProps.value)), null, 16)) : q("", !0),
|
|
2766
|
+
E(Os, {
|
|
2767
|
+
show: h.value,
|
|
2768
|
+
"onUpdate:show": k[9] || (k[9] = (j) => h.value = j),
|
|
2794
2769
|
"last-closing-date": n(s).lastClosingDate.value,
|
|
2795
|
-
"selected-outlet-ids":
|
|
2770
|
+
"selected-outlet-ids": Ce.value,
|
|
2796
2771
|
onSubmitted: n(s).fetchData
|
|
2797
2772
|
}, null, 8, ["show", "last-closing-date", "selected-outlet-ids", "onSubmitted"]),
|
|
2798
|
-
E(
|
|
2773
|
+
E(hn, yt(n(s).transferDialogProps.value, {
|
|
2799
2774
|
onSubmitted: n(s).fetchData
|
|
2800
2775
|
}), null, 16, ["onSubmitted"]),
|
|
2801
|
-
n(s).transferDetailsProps.value != null ? (i(),
|
|
2776
|
+
n(s).transferDetailsProps.value != null ? (i(), pe(Ln, yt({ key: 1 }, {
|
|
2802
2777
|
...n(s).transferDetailsProps.value,
|
|
2803
|
-
receivedMap: ((
|
|
2778
|
+
receivedMap: ((ze = n(s).transferDetailsProps.value) == null ? void 0 : ze.receivedMap) ?? {},
|
|
2804
2779
|
shipments: n(s).shipments.value ?? []
|
|
2805
2780
|
}, {
|
|
2806
2781
|
onSubmitted: n(s).fetchData
|
|
2807
2782
|
}), null, 16, ["onSubmitted"])) : q("", !0),
|
|
2808
|
-
E(
|
|
2809
|
-
E(
|
|
2783
|
+
E(gn, Pt(an(n(s).xilnexImportDialogProps.value)), null, 16),
|
|
2784
|
+
E(Vs, {
|
|
2810
2785
|
modelValue: n(d),
|
|
2811
|
-
"onUpdate:modelValue": k[10] || (k[10] = (
|
|
2812
|
-
loading: n(
|
|
2786
|
+
"onUpdate:modelValue": k[10] || (k[10] = (j) => Rt(d) ? d.value = j : null),
|
|
2787
|
+
loading: n(b),
|
|
2813
2788
|
"blob-url": n(c)
|
|
2814
2789
|
}, null, 8, ["modelValue", "loading", "blob-url"])
|
|
2815
2790
|
]))
|
|
@@ -2820,20 +2795,20 @@ const nr = {
|
|
|
2820
2795
|
}, 8, ["title", "actions"]);
|
|
2821
2796
|
};
|
|
2822
2797
|
}
|
|
2823
|
-
}),
|
|
2798
|
+
}), Ro = /* @__PURE__ */ at({
|
|
2824
2799
|
__name: "BulkReceiveRequestPage",
|
|
2825
2800
|
setup(C) {
|
|
2826
|
-
return (_, x) => (i(),
|
|
2801
|
+
return (_, x) => (i(), pe(sn, {
|
|
2827
2802
|
"feature-key": "bulk-receive-transfer",
|
|
2828
2803
|
"keep-across-locations": ""
|
|
2829
2804
|
}, {
|
|
2830
|
-
default:
|
|
2831
|
-
E(
|
|
2805
|
+
default: Ae(() => [
|
|
2806
|
+
E(Hr)
|
|
2832
2807
|
]),
|
|
2833
2808
|
_: 1
|
|
2834
2809
|
}));
|
|
2835
2810
|
}
|
|
2836
2811
|
});
|
|
2837
2812
|
export {
|
|
2838
|
-
|
|
2813
|
+
Ro as default
|
|
2839
2814
|
};
|