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