@feedmepos/mf-inventory-portal 1.7.9-dev.2 → 1.7.9-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-Bte0vWY7.js +1434 -0
- package/dist/{ApprovalView-pmI_SFo7.js → ApprovalView-B0MC_Gv4.js} +9 -9
- package/dist/{BindingsDialog-D902flPr.js → BindingsDialog-CUyLeRvh.js} +2 -2
- package/dist/{BindingsPicker-JEKsY59b.js → BindingsPicker-UkwLozYB.js} +2 -2
- package/dist/{BindingsTable-DqlzOIxF.js → BindingsTable-4WbqclQu.js} +4 -4
- package/dist/{BulkReceiveRequestView-Chw7ma2k.js → BulkReceiveRequestView-Bt_Kz7Pw.js} +894 -883
- package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-Cct8Ko19.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-aHOlyDp1.js} +1 -1
- package/dist/{ClosingDraftView-D1ymRsd2.js → ClosingDraftView-BZChpOPr.js} +19 -19
- package/dist/{ClosingHistoryView-5yr_itIV.js → ClosingHistoryView-B8kE6kDk.js} +5 -5
- package/dist/{ClosingTemplateView-MDl5Zq-g.js → ClosingTemplateView-cJuk2ph0.js} +16 -16
- package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-BcG0gWV4.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-CraIMmym.js} +1 -1
- package/dist/{DefaultView-dOfbL3iF.js → DefaultView-2P-3baXd.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-BfVgQOx8.js → DeliveryOrderPrintPreview-JrmelmiW.js} +2 -2
- package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-DHspOJQW.js → EmailDialog.vue_vue_type_script_setup_true_lang-DK8FWZde.js} +2250 -2250
- package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-B7NLu0us.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-DSO8GPQh.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C0nunKjx.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BX4lkn8x.js} +2 -2
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CMst9tkA.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-D4ASSJTr.js} +2 -2
- package/dist/{FmMultiselectDialog-Dt54hvqw.js → FmMultiselectDialog-C3KVaJ4n.js} +2 -2
- package/dist/{FmMultiselectDialog-BjBx94pY.js → FmMultiselectDialog-Cf2O3ZGm.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DtG9Ieo_.js → FmUnitInput.vue_vue_type_script_setup_true_lang-B8Iz9egz.js} +6 -6
- package/dist/{ImportView-CdZN8k_Y.js → ImportView-BpcbGOsq.js} +499 -496
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-iCpYEneM.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-CPqxv23A.js} +1 -1
- package/dist/{IngredientGroupView-BBVS1mKn.js → IngredientGroupView-DGiHqjGP.js} +5 -5
- package/dist/{IngredientsView-BGOaAUzR.js → IngredientsView-CymfMlp3.js} +15 -15
- package/dist/{IntegrationExplorerView-UUBCmqdR.js → IntegrationExplorerView-B4ihljuB.js} +4 -4
- package/dist/{IntegrationView-B2YowH-i.js → IntegrationView-DBC5-V2I.js} +14 -14
- package/dist/{InventoryBindingForm-kDx6Mvhn.js → InventoryBindingForm-BrC9MQI_.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-C8bktmYH.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CHTlQULY.js} +5 -5
- package/dist/{InventoryBindingSummary-DJrBTa8_.js → InventoryBindingSummary-DJnyHxXU.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DHk9uEAP.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Cu7JdR_i.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-Dx1VktdW.js → PremiumBadge.vue_vue_type_script_setup_true_lang-D29jHwzz.js} +1 -1
- package/dist/{ProductionView-CxUcsRBP.js → ProductionView-BFXAINYn.js} +7 -7
- package/dist/{PublishView-DtP-Ms7q.js → PublishView-C2ZKNjV0.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-C_qC2KF5.js → PurchaseOrderPrintPreview-DUaNv22q.js} +2 -2
- package/dist/{ReceiveRequestView-Dy3BpqsP.js → ReceiveRequestView-B0bHSidO.js} +14 -14
- package/dist/{RecipeView-DeR7pqj8.js → RecipeView-D8lfLSJW.js} +17 -17
- package/dist/{SettingsView-C7ZXmatO.js → SettingsView-GU0zqJPQ.js} +4 -4
- package/dist/{StockView-wFLnNSRr.js → StockView-KEXdcwRV.js} +21 -21
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Fxh3-Nqi.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CrF431ux.js} +1 -1
- package/dist/{SupplierView-CeTDNDDK.js → SupplierView-J5XPtBtn.js} +12 -12
- package/dist/{SurchargeView-BQJnCdPA.js → SurchargeView-vbWzu1yC.js} +6 -6
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-D1zxuH66.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-DO3XuHWt.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BFkh3Ubb.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CnATZ2gf.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CZVDhXNz.js → TransferDetails.vue_vue_type_script_setup_true_lang-BekwCPEW.js} +1639 -1575
- package/dist/{TransferTemplateView-XaI2T5fa.js → TransferTemplateView-V4XgaVtH.js} +20 -20
- package/dist/{UnitCostHistoryView-DTNW7-mk.js → UnitCostHistoryView-CLC3Bk51.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-vRsEjVJc.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-QfJddUKl.js} +4 -4
- package/dist/{UnitView-DXnyzkj3.js → UnitView-zdd28Okm.js} +7 -7
- package/dist/{WarehouseView-iEHFgIqh.js → WarehouseView-80yYhx0q.js} +5 -5
- package/dist/{WastageTemplateView-CGDUCPbr.js → WastageTemplateView-BdkoxGXU.js} +14 -14
- package/dist/api/changelog.d.ts +1 -1
- package/dist/{app-BIXJtvvD.js → app-BNb3mgP7.js} +19 -15
- package/dist/app.d.ts +4 -0
- package/dist/app.js +1 -1
- package/dist/{closing-template-CLY-r6Cf.js → closing-template-B0OnLwK4.js} +1 -1
- package/dist/{date2-DbYQycSa.js → date2-CEZilXJj.js} +1 -1
- package/dist/{dayjs.min-Dv7-fEed.js → dayjs.min-CM9pMep8.js} +1 -1
- package/dist/{decimal-B8YR17QC.js → decimal-C7T3duiU.js} +2 -2
- package/dist/{defineDeepModel-C5ncgNxj.js → defineDeepModel-BqXFlLTg.js} +1 -1
- package/dist/{duplicate-template-CAlG1nzV.js → duplicate-template-DNNNayq0.js} +1 -1
- package/dist/{feature-BLSNLI5y.js → feature-TVuArq91.js} +2 -2
- package/dist/{format-time-from-id-D5DcWpHS.js → format-time-from-id-BnKJ6XGj.js} +1 -1
- package/dist/{format-unit-display-Ch97dVXx.js → format-unit-display-CXPWPWDC.js} +12 -12
- package/dist/{import-export.helper-CvUFSOa1.js → import-export.helper-BD5ZmNlI.js} +6 -6
- package/dist/{index-rRPErzP4.js → index-B6exMf0H.js} +1 -1
- package/dist/{index-Bk8DOv4n.js → index-DB5lmTJv.js} +1 -1
- package/dist/{index-CXzVUrJS.js → index-HB5HxMo3.js} +3 -3
- package/dist/{inventory-core-dart.default-Cj7CxnpK.js → inventory-core-dart.default-DIZjn9Qf.js} +1 -1
- package/dist/{lz-string-DWkGPESZ.js → lz-string-Ba7A8pQ9.js} +1 -1
- package/dist/{netsuite-Cn0y1rH3.js → netsuite-DfDg_rIm.js} +3 -2
- package/dist/{number-CxbQxQwj.js → number-Da0xDyut.js} +3 -3
- package/dist/{predefined-templates-CrSoG3R9.js → predefined-templates-6OB7_XaD.js} +1 -1
- package/dist/{purchase-order-template-BmQQnrEl.js → purchase-order-template-B5tBswYT.js} +1 -1
- package/dist/{recalculationUtils-CSnowXma.js → recalculationUtils-De3fjfMb.js} +1 -1
- package/dist/{rules-CurdOAcA.js → rules-CEMsIT_O.js} +2 -2
- package/dist/{stock-BiqEgcgU.js → stock-B8Es7Hve.js} +3 -3
- package/dist/{stock-BdDR_L8p.js → stock-v1xKxzUF.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{supplier-CsjbmP_P.js → supplier-CutnfZkn.js} +2 -2
- package/dist/{surcharge--kBjIIst.js → surcharge-B_J4MXnT.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-D8UPS06O.js → uom-rules-iPENmQml.js} +1 -1
- package/dist/{use-ingredient-select-dialog-BZdrpLOE.js → use-ingredient-select-dialog-pf4BGGJC.js} +2 -2
- package/dist/{use-inventory-binding-dialog-CkNxixT2.js → use-inventory-binding-dialog-EQZqHiBh.js} +2 -2
- package/dist/{use-template-enabled-locations-Dkl1_1F-.js → use-template-enabled-locations-BBWgOLck.js} +2 -2
- package/dist/{use-transfer-locations-Bmj4zTJj.js → use-transfer-locations-BN_jm_Uj.js} +2 -2
- package/dist/{useHrmPermission-DcBe_-Q6.js → useHrmPermission-C0Uv8j0R.js} +1 -1
- package/dist/{useNavigationMenu-CsRbtAc7.js → useNavigationMenu-DK7Fgr5l.js} +2 -2
- package/dist/{useSseClient-hl2SQF5b.js → useSseClient-EppRU129.js} +1 -1
- package/dist/views/changelog/composables/use-changelog.d.ts +2 -0
- package/dist/views/changelog/composables/use-changelog.spec.d.ts +1 -0
- package/dist/views/import/helper/submit-rows.d.ts +13 -0
- package/dist/views/import/helper/submit-rows.spec.d.ts +1 -0
- package/dist/{vue-i18n-yL99yI4f.js → vue-i18n-CKFIvxhf.js} +154 -154
- package/dist/{xlsx.util-B8azJxkS.js → xlsx.util-DIO7WN8q.js} +2 -2
- package/package.json +5 -5
- package/dist/App-BYCW0L94.js +0 -1403
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { defineComponent as nt, ref as
|
|
2
|
-
import { u as
|
|
3
|
-
import { u as it, a as
|
|
4
|
-
import { i as pt, _ as
|
|
5
|
-
import { a as xt, d as
|
|
6
|
-
import { b as
|
|
7
|
-
import { i as
|
|
8
|
-
import { d as
|
|
9
|
-
import { e as
|
|
10
|
-
import { u as
|
|
11
|
-
import { u as
|
|
1
|
+
import { defineComponent as nt, ref as S, computed as L, watch as Ve, createElementBlock as h, openBlock as c, Fragment as we, createBlock as de, createVNode as N, Teleport as lt, Transition as $t, withCtx as Be, createCommentVNode as E, createElementVNode as e, toDisplayString as v, unref as t, normalizeClass as j, renderList as Ke, createTextVNode as ot, withModifiers as Ot, mergeModels as At, useModel as Bt, resolveComponent as $e, h as De, onMounted as Tt, onUnmounted as It, normalizeStyle as ft, watchEffect as Lt, isRef as ht, normalizeProps as gt, mergeProps as ct, guardReactiveProps as zt } from "vue";
|
|
2
|
+
import { u as Mt, l as Ut } from "./netsuite-DfDg_rIm.js";
|
|
3
|
+
import { u as it, a as Vt, G as Jt, T as _t, s as jt, U as We, q as Wt, c as Yt, D as at, x as Qt } from "./app-BNb3mgP7.js";
|
|
4
|
+
import { i as pt, _ as Ht } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-DSO8GPQh.js";
|
|
5
|
+
import { a as xt, d as Kt } from "./number-Da0xDyut.js";
|
|
6
|
+
import { b as Gt, d as Xt, c as Zt, e as en, f as tn, P as Rt, h as nn, a as sn, _ as on, g as an } from "./TransferDetails.vue_vue_type_script_setup_true_lang-BekwCPEW.js";
|
|
7
|
+
import { i as rn } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-D29jHwzz.js";
|
|
8
|
+
import { d as Ye } from "./dayjs.min-CM9pMep8.js";
|
|
9
|
+
import { e as ln } from "./UnitDisplayControl.vue_vue_type_script_setup_true_lang-QfJddUKl.js";
|
|
10
|
+
import { u as un } from "./useTabStorage-BkIVScW_.js";
|
|
11
|
+
import { u as wt, _ as cn } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DwrLsWX_.js";
|
|
12
12
|
import { components as dn, useSnackbar as ut, useDialog as mn, useBreakpoints as fn } from "@feedmepos/ui-library";
|
|
13
|
-
import { c as pn, u as vn, _ as yn, a as bn, b as hn } from "./EmailDialog.vue_vue_type_script_setup_true_lang-
|
|
14
|
-
import { useI18n as st, useCoreStore as
|
|
15
|
-
import { u as
|
|
16
|
-
import { u as _n } from "./stock-
|
|
17
|
-
import { u as Ge } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-
|
|
18
|
-
import { b as
|
|
19
|
-
import { P as wn } from "./inventory-core-dart.default-
|
|
13
|
+
import { c as pn, u as vn, _ as yn, a as bn, b as hn } from "./EmailDialog.vue_vue_type_script_setup_true_lang-DK8FWZde.js";
|
|
14
|
+
import { useI18n as st, useCoreStore as Pt } from "@feedmepos/mf-common";
|
|
15
|
+
import { u as Dt, a as gn } from "./supplier-CutnfZkn.js";
|
|
16
|
+
import { u as _n } from "./stock-v1xKxzUF.js";
|
|
17
|
+
import { u as Ge } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-DO3XuHWt.js";
|
|
18
|
+
import { b as Et, a as xn } from "./format-unit-display-CXPWPWDC.js";
|
|
19
|
+
import { P as wn } from "./inventory-core-dart.default-DIZjn9Qf.js";
|
|
20
20
|
import { _ as kn, F as et } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js";
|
|
21
|
-
import { u as
|
|
21
|
+
import { u as qt } from "./feature-TVuArq91.js";
|
|
22
22
|
import { P as Cn, J as Fn, D as Sn } from "./app-C39bYJmq.js";
|
|
23
|
-
import { a as Rn, t as Pn } from "./date2-
|
|
24
|
-
import { F as
|
|
25
|
-
import { p as Dn } from "./format-time-from-id-
|
|
23
|
+
import { a as Rn, t as Pn } from "./date2-CEZilXJj.js";
|
|
24
|
+
import { F as kt } from "./form-mode.enum-BKiNVH6A.js";
|
|
25
|
+
import { p as Dn } from "./format-time-from-id-BnKJ6XGj.js";
|
|
26
26
|
import { defineStore as En } from "pinia";
|
|
27
|
-
import { u as qn } from "./useSseClient-
|
|
27
|
+
import { u as qn } from "./useSseClient-EppRU129.js";
|
|
28
28
|
import { u as Nn } from "./use-row-action-Cvq6VO38.js";
|
|
29
29
|
import { R as rt, D as $n } from "./row-action.enum-ncgDYAjP.js";
|
|
30
|
-
import { u as
|
|
31
|
-
const
|
|
30
|
+
import { u as On } from "./vue-i18n-CKFIvxhf.js";
|
|
31
|
+
const An = {
|
|
32
32
|
key: 0,
|
|
33
33
|
class: "fixed inset-0 z-[200] bg-white flex flex-col overflow-hidden",
|
|
34
34
|
style: { "font-family": "Inter, sans-serif" }
|
|
@@ -59,10 +59,10 @@ const On = {
|
|
|
59
59
|
}, qs = {
|
|
60
60
|
key: 0,
|
|
61
61
|
class: "py-32 text-center text-[#B2B3B6] fm-typo-en-body-md-400"
|
|
62
|
-
}, Ns = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-12" }, $s = { class: "mb-12" },
|
|
62
|
+
}, Ns = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-12" }, $s = { class: "mb-12" }, Os = {
|
|
63
63
|
key: 0,
|
|
64
64
|
class: "py-32 flex justify-center"
|
|
65
|
-
},
|
|
65
|
+
}, As = {
|
|
66
66
|
key: 1,
|
|
67
67
|
class: "py-32 text-center text-[#B2B3B6] fm-typo-en-body-md-400"
|
|
68
68
|
}, Bs = {
|
|
@@ -88,91 +88,91 @@ const On = {
|
|
|
88
88
|
selectedOutletIds: {}
|
|
89
89
|
},
|
|
90
90
|
emits: ["update:show", "submitted"],
|
|
91
|
-
setup(
|
|
92
|
-
const { FmButton: C, FmDialog:
|
|
93
|
-
() =>
|
|
94
|
-
),
|
|
91
|
+
setup(k, { emit: _ }) {
|
|
92
|
+
const { FmButton: C, FmDialog: B, FmIcon: $, FmTextField: z } = dn, W = k, V = _, { t: i } = st(), a = ut(), b = it(), U = Dt(), he = Vt(), f = _n(), d = Ge(), y = Et(), s = S(0), x = S(!1), p = S(null), m = S(""), q = S(null), D = S(null), T = S(null), me = S(""), K = S(""), Z = S(!1), oe = S(!1), pe = S(!1), ke = S(!1), Ee = S(!1), ze = S(/* @__PURE__ */ new Map()), Te = S(), ge = S([]), Je = L(() => !!p.value), ve = L(() => q.value === "transfer" ? !!D.value : q.value === "template" ? !!T.value : !1), Qe = L(() => (ge.value.length ? ge.value : A.value.items ?? []).some((l) => l.quantity.amount > 0)), Ie = L(() => Z.value), Ce = L(
|
|
93
|
+
() => Qe.value && oe.value && pe.value && !Z.value
|
|
94
|
+
), Xe = L(() => s.value === 0 ? Je.value : s.value === 1 ? ve.value : s.value === 2 ? Ce.value : !1), je = L(
|
|
95
95
|
() => s.value === 2 ? i("inventory.transfer.receiveRequest.bulk.wizard.createTransferBtn") : i("inventory.transfer.receiveRequest.bulk.wizard.continueBtn")
|
|
96
|
-
),
|
|
97
|
-
() =>
|
|
98
|
-
),
|
|
99
|
-
() =>
|
|
100
|
-
),
|
|
96
|
+
), Le = L(
|
|
97
|
+
() => Y.value === "Purchase" ? "Purchase method" : "Transfer method"
|
|
98
|
+
), Me = L(
|
|
99
|
+
() => Y.value === "Purchase" ? "Purchase details" : "Transfer details"
|
|
100
|
+
), P = L(() => {
|
|
101
101
|
const n = m.value.trim().toLowerCase();
|
|
102
102
|
let l = b.locations;
|
|
103
|
-
return
|
|
103
|
+
return W.selectedOutletIds && W.selectedOutletIds.length > 0 && (l = l.filter((r) => W.selectedOutletIds.includes(r.doc._id))), n ? l.filter(
|
|
104
104
|
(r) => r.name.toLowerCase().includes(n) || (r.doc.profile.code ?? "").toLowerCase().includes(n)
|
|
105
105
|
) : l;
|
|
106
|
-
}),
|
|
107
|
-
var
|
|
108
|
-
const n = (
|
|
109
|
-
doc:
|
|
110
|
-
name:
|
|
106
|
+
}), w = L(() => {
|
|
107
|
+
var be;
|
|
108
|
+
const n = (be = p.value) == null ? void 0 : be.doc._id, l = U.suppliers.map((re) => ({
|
|
109
|
+
doc: re,
|
|
110
|
+
name: re.name,
|
|
111
111
|
dbName: "",
|
|
112
112
|
type: "supplier",
|
|
113
113
|
acceptRequest: !0
|
|
114
114
|
})), X = [
|
|
115
115
|
...b.allLocations ?? b.locations,
|
|
116
116
|
...l
|
|
117
|
-
].filter((
|
|
118
|
-
return
|
|
117
|
+
].filter((re) => re.doc._id !== n), se = me.value.trim().toLowerCase();
|
|
118
|
+
return se ? X.filter((re) => {
|
|
119
119
|
var Ze;
|
|
120
|
-
const
|
|
121
|
-
return
|
|
120
|
+
const Ue = re.type === "supplier" ? "" : ((Ze = re.doc.profile) == null ? void 0 : Ze.code) ?? "";
|
|
121
|
+
return re.name.toLowerCase().includes(se) || Ue.toLowerCase().includes(se);
|
|
122
122
|
}) : X;
|
|
123
|
-
}),
|
|
124
|
-
const n =
|
|
123
|
+
}), M = L(() => {
|
|
124
|
+
const n = K.value.trim().toLowerCase(), l = y.templates;
|
|
125
125
|
return n ? l.filter((r) => r.name.toLowerCase().includes(n)) : l;
|
|
126
|
-
}),
|
|
126
|
+
}), Y = L(() => {
|
|
127
127
|
var n;
|
|
128
|
-
if (
|
|
129
|
-
return typeof
|
|
130
|
-
if (
|
|
131
|
-
return
|
|
132
|
-
if (
|
|
128
|
+
if (A.value.supplier)
|
|
129
|
+
return typeof A.value.supplier.internal == "string" ? "Transfer" : "Purchase";
|
|
130
|
+
if (q.value === "transfer" && D.value)
|
|
131
|
+
return D.value.type === "supplier" ? "Purchase" : "Transfer";
|
|
132
|
+
if (q.value === "template" && T.value) {
|
|
133
133
|
const l = y.templates.find(
|
|
134
|
-
(r) => r._id ===
|
|
134
|
+
(r) => r._id === T.value
|
|
135
135
|
);
|
|
136
136
|
if ((n = l == null ? void 0 : l.purchaseOrder) != null && n.supplier)
|
|
137
137
|
return typeof l.purchaseOrder.supplier.internal == "string" ? "Transfer" : "Purchase";
|
|
138
138
|
}
|
|
139
139
|
return "Transfer";
|
|
140
|
-
}),
|
|
140
|
+
}), G = L(() => p.value ? p.value.name : i("inventory.transfer.receiveRequest.bulk.wizard.notSelected")), le = L(() => q.value === "transfer" ? Y.value === "Purchase" ? "Purchase from Supplier" : i("inventory.transfer.receiveRequest.bulk.wizard.outletToOutletMethod") : q.value === "template" ? i("inventory.transfer.receiveRequest.bulk.wizard.fromTemplateMethod") : i("inventory.transfer.receiveRequest.bulk.wizard.notChosen")), Oe = L(() => {
|
|
141
141
|
var n;
|
|
142
|
-
if (
|
|
143
|
-
return
|
|
144
|
-
if (
|
|
145
|
-
const l = y.templates.find((r) => r._id ===
|
|
146
|
-
return (n = l == null ? void 0 : l.purchaseOrder) != null && n.supplier ? l.purchaseOrder.supplier.name ||
|
|
142
|
+
if (q.value === "transfer" && D.value)
|
|
143
|
+
return D.value.name;
|
|
144
|
+
if (q.value === "template" && T.value) {
|
|
145
|
+
const l = y.templates.find((r) => r._id === T.value);
|
|
146
|
+
return (n = l == null ? void 0 : l.purchaseOrder) != null && n.supplier ? l.purchaseOrder.supplier.name || T.value : (l == null ? void 0 : l.name) ?? T.value;
|
|
147
147
|
}
|
|
148
148
|
return i("inventory.transfer.receiveRequest.bulk.wizard.noneYet");
|
|
149
149
|
});
|
|
150
|
-
function
|
|
151
|
-
var X,
|
|
152
|
-
const l = (X = n.doc.profile) != null && X.code ? `#${n.doc.profile.code}` : "", r = [(
|
|
150
|
+
function _e(n) {
|
|
151
|
+
var X, se, be, re, Ue;
|
|
152
|
+
const l = (X = n.doc.profile) != null && X.code ? `#${n.doc.profile.code}` : "", r = [(be = (se = n.doc.profile) == null ? void 0 : se.address) == null ? void 0 : be.line1, (Ue = (re = n.doc.profile) == null ? void 0 : re.address) == null ? void 0 : Ue.city].filter(Boolean).join(" · ");
|
|
153
153
|
return [l, r].filter(Boolean).join(" · ");
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function J(n) {
|
|
156
156
|
var r, X;
|
|
157
157
|
return [(r = n.doc.address) == null ? void 0 : r.line1, (X = n.doc.address) == null ? void 0 : X.city].filter(Boolean).join(" · ");
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function ce(n) {
|
|
160
160
|
var l;
|
|
161
161
|
return n.type === "supplier" ? "" : ((l = n.doc.profile) == null ? void 0 : l.code) ?? "";
|
|
162
162
|
}
|
|
163
163
|
function o(n) {
|
|
164
|
-
var l, r, X,
|
|
165
|
-
return n.type === "supplier" ? [(l = n.doc.address) == null ? void 0 : l.line1, (r = n.doc.address) == null ? void 0 : r.city].filter(Boolean).join(" · ") : [(
|
|
166
|
-
}
|
|
167
|
-
const u =
|
|
168
|
-
() => p.value ?
|
|
169
|
-
), g =
|
|
170
|
-
() =>
|
|
171
|
-
),
|
|
172
|
-
const l = (
|
|
164
|
+
var l, r, X, se, be, re;
|
|
165
|
+
return n.type === "supplier" ? [(l = n.doc.address) == null ? void 0 : l.line1, (r = n.doc.address) == null ? void 0 : r.city].filter(Boolean).join(" · ") : [(se = (X = n.doc.profile) == null ? void 0 : X.address) == null ? void 0 : se.line1, (re = (be = n.doc.profile) == null ? void 0 : be.address) == null ? void 0 : re.city].filter(Boolean).join(" · ");
|
|
166
|
+
}
|
|
167
|
+
const u = L(
|
|
168
|
+
() => p.value ? _e(p.value) : ""
|
|
169
|
+
), g = L(
|
|
170
|
+
() => q.value === "transfer" && D.value ? D.value.type === "supplier" ? J(D.value) : _e(D.value) : ""
|
|
171
|
+
), O = L(() => {
|
|
172
|
+
const l = (ge.value.length ? ge.value : A.value.items ?? []).filter((r) => r.quantity.amount > 0).length;
|
|
173
173
|
return l === 0 ? i("inventory.transfer.receiveRequest.bulk.wizard.noneYet") : `${l} ${l === 1 ? "item" : "items"}`;
|
|
174
174
|
});
|
|
175
|
-
function
|
|
175
|
+
function I(n) {
|
|
176
176
|
var r;
|
|
177
177
|
const l = (r = n.purchaseOrder) == null ? void 0 : r.supplier;
|
|
178
178
|
return l ? l.internal === "warehouse" ? `Transfer from ${l.name}` : l.internal === "restaurant" ? `Transfer from ${l.name}` : `Purchase from ${l.name}` : "";
|
|
@@ -195,7 +195,7 @@ const On = {
|
|
|
195
195
|
}
|
|
196
196
|
};
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function Q(n) {
|
|
199
199
|
return {
|
|
200
200
|
_id: n._id,
|
|
201
201
|
internal: void 0,
|
|
@@ -216,9 +216,9 @@ const On = {
|
|
|
216
216
|
}
|
|
217
217
|
};
|
|
218
218
|
}
|
|
219
|
-
function
|
|
219
|
+
function H() {
|
|
220
220
|
var X;
|
|
221
|
-
const n =
|
|
221
|
+
const n = T.value ? y.templates.find((se) => se._id === T.value) : void 0, l = {
|
|
222
222
|
_rev: void 0,
|
|
223
223
|
email: void 0,
|
|
224
224
|
internal: void 0,
|
|
@@ -229,75 +229,75 @@ const On = {
|
|
|
229
229
|
_id: "",
|
|
230
230
|
name: "",
|
|
231
231
|
address: { line2: void 0, line1: "", state: "", city: "", postcode: "", country: "" }
|
|
232
|
-
}, r =
|
|
232
|
+
}, r = q.value === "transfer" && D.value ? D.value.type === "supplier" ? Q(D.value.doc) : R(D.value) : q.value === "template" && (n != null && n.purchaseOrder.supplier) ? n.purchaseOrder.supplier : l;
|
|
233
233
|
return {
|
|
234
234
|
remark: void 0,
|
|
235
235
|
ref: void 0,
|
|
236
236
|
stockSnapshotId: void 0,
|
|
237
237
|
effectiveAt: void 0,
|
|
238
|
-
items:
|
|
238
|
+
items: q.value === "template" && ((X = n == null ? void 0 : n.purchaseOrder) != null && X.items) ? n.purchaseOrder.items : [],
|
|
239
239
|
supplier: r,
|
|
240
240
|
status: "DRAFT",
|
|
241
241
|
_id: "",
|
|
242
242
|
seqNumber: 0,
|
|
243
243
|
deliveryOrder: [],
|
|
244
|
-
template:
|
|
244
|
+
template: T.value ?? void 0,
|
|
245
245
|
templateDoc: n
|
|
246
246
|
};
|
|
247
247
|
}
|
|
248
|
-
const
|
|
248
|
+
const A = S(H()), te = S(`${Math.random()}`), ne = L(
|
|
249
249
|
() => {
|
|
250
250
|
var n;
|
|
251
|
-
return ((n =
|
|
251
|
+
return ((n = A.value.items) == null ? void 0 : n.filter((l) => l.quantity.amount === 0)) ?? [];
|
|
252
252
|
}
|
|
253
253
|
);
|
|
254
|
-
|
|
255
|
-
() =>
|
|
254
|
+
Ve(
|
|
255
|
+
() => W.show,
|
|
256
256
|
(n) => {
|
|
257
|
-
if (n && (s.value = 0, x.value = !1, p.value = null,
|
|
257
|
+
if (n && (s.value = 0, x.value = !1, p.value = null, q.value = null, D.value = null, T.value = null, m.value = "", me.value = "", K.value = "", oe.value = !1, pe.value = !1, ge.value = [], A.value = H(), te.value = `${Math.random()}`, y.fetchTemplates(), W.selectedOutletIds && W.selectedOutletIds.length === 1)) {
|
|
258
258
|
const l = b.locations.find(
|
|
259
|
-
(r) => r.doc._id ===
|
|
259
|
+
(r) => r.doc._id === W.selectedOutletIds[0]
|
|
260
260
|
);
|
|
261
|
-
l && (p.value = l, b._currentLocation = l,
|
|
261
|
+
l && (p.value = l, b._currentLocation = l, ee(), fe(), s.value = 1);
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
);
|
|
265
|
-
function
|
|
265
|
+
function ye() {
|
|
266
266
|
if (s.value === 0) {
|
|
267
267
|
if (!p.value) return;
|
|
268
|
-
b._currentLocation = p.value,
|
|
268
|
+
b._currentLocation = p.value, ee(), fe(), s.value = 1;
|
|
269
269
|
} else if (s.value === 1) {
|
|
270
|
-
if (!
|
|
271
|
-
|
|
272
|
-
} else s.value === 2 &&
|
|
270
|
+
if (!ve.value) return;
|
|
271
|
+
A.value = H(), te.value = `${Math.random()}`, ge.value = [], s.value = 2;
|
|
272
|
+
} else s.value === 2 && Pe();
|
|
273
273
|
}
|
|
274
|
-
function
|
|
274
|
+
function Fe() {
|
|
275
275
|
s.value > 0 && s.value--;
|
|
276
276
|
}
|
|
277
|
-
function
|
|
277
|
+
function xe(n) {
|
|
278
278
|
n < s.value && (s.value = n);
|
|
279
279
|
}
|
|
280
|
-
function
|
|
280
|
+
function qe() {
|
|
281
281
|
V("update:show", !1);
|
|
282
282
|
}
|
|
283
|
-
function
|
|
284
|
-
|
|
285
|
-
...
|
|
283
|
+
function Se(n) {
|
|
284
|
+
q.value !== n && (q.value = n, D.value = null, T.value = null, ge.value = [], A.value = {
|
|
285
|
+
...A.value,
|
|
286
286
|
items: [],
|
|
287
287
|
template: void 0,
|
|
288
288
|
templateDoc: void 0
|
|
289
289
|
});
|
|
290
290
|
}
|
|
291
|
-
function
|
|
292
|
-
|
|
291
|
+
function Re(n) {
|
|
292
|
+
ge.value = n ?? [];
|
|
293
293
|
}
|
|
294
|
-
|
|
295
|
-
|
|
294
|
+
Ve(T, (n) => {
|
|
295
|
+
q.value === "template" && n && (A.value = H(), te.value = `${Math.random()}`);
|
|
296
296
|
});
|
|
297
|
-
async function
|
|
298
|
-
|
|
297
|
+
async function ee() {
|
|
298
|
+
oe.value = !1;
|
|
299
299
|
try {
|
|
300
|
-
await U.readSuppliers(),
|
|
300
|
+
await U.readSuppliers(), oe.value = !0;
|
|
301
301
|
} catch {
|
|
302
302
|
a.open({
|
|
303
303
|
title: i("inventory.transfer.form.unableToFetchListOfSuppliers.title"),
|
|
@@ -306,8 +306,8 @@ const On = {
|
|
|
306
306
|
});
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
|
-
async function
|
|
310
|
-
|
|
309
|
+
async function fe() {
|
|
310
|
+
Ee.value = !0, ze.value = /* @__PURE__ */ new Map();
|
|
311
311
|
try {
|
|
312
312
|
const n = await f.readStockBalance(), l = /* @__PURE__ */ new Map();
|
|
313
313
|
for (const r of n.skus ?? [])
|
|
@@ -315,43 +315,43 @@ const On = {
|
|
|
315
315
|
ze.value = l;
|
|
316
316
|
} catch {
|
|
317
317
|
} finally {
|
|
318
|
-
|
|
318
|
+
Ee.value = !1;
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
321
|
function Ae() {
|
|
322
322
|
var n;
|
|
323
|
-
(n = Te.value) != null && n.getFormData && (
|
|
323
|
+
(n = Te.value) != null && n.getFormData && (A.value = { ...A.value, ...Te.value.getFormData() });
|
|
324
324
|
}
|
|
325
|
-
function
|
|
326
|
-
if (Ae(),
|
|
327
|
-
|
|
325
|
+
function Pe() {
|
|
326
|
+
if (Ae(), ne.value.length > 0) {
|
|
327
|
+
ke.value = !0;
|
|
328
328
|
return;
|
|
329
329
|
}
|
|
330
|
-
|
|
330
|
+
ae();
|
|
331
331
|
}
|
|
332
|
-
function
|
|
332
|
+
function F() {
|
|
333
333
|
var n;
|
|
334
|
-
|
|
334
|
+
A.value.items = ((n = A.value.items) == null ? void 0 : n.filter((l) => l.quantity.amount > 0)) ?? [], ke.value = !1, ae();
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function ae() {
|
|
337
337
|
var r, X;
|
|
338
338
|
const n = wn.validatePurchaseOrderItems({
|
|
339
|
-
skusById:
|
|
340
|
-
items:
|
|
339
|
+
skusById: he.skuById ?? {},
|
|
340
|
+
items: A.value.items ?? []
|
|
341
341
|
}), l = Object.values(n).flat();
|
|
342
342
|
if (l.length > 0) {
|
|
343
|
-
const
|
|
343
|
+
const se = l[0];
|
|
344
344
|
a.open({
|
|
345
|
-
title: `[Row ${
|
|
346
|
-
message: `${
|
|
345
|
+
title: `[Row ${se.index + 1}] "${se.poItem.sku.name}"`,
|
|
346
|
+
message: `${se.message}`,
|
|
347
347
|
type: "error"
|
|
348
348
|
});
|
|
349
349
|
return;
|
|
350
350
|
}
|
|
351
351
|
(X = (r = Te.value) == null ? void 0 : r.validateInputs) == null || X.call(r);
|
|
352
352
|
}
|
|
353
|
-
async function
|
|
354
|
-
const n =
|
|
353
|
+
async function ie() {
|
|
354
|
+
const n = A.value;
|
|
355
355
|
if (Z.value = !0, n.items = n.items.filter((l) => l.quantity.amount > 0), !n.items.length) {
|
|
356
356
|
a.open({
|
|
357
357
|
title: "Cannot create order",
|
|
@@ -366,7 +366,7 @@ const On = {
|
|
|
366
366
|
title: i("inventory.transfer.receiveRequest.create.success"),
|
|
367
367
|
message: i("inventory.transfer.receiveRequest.create.successMessage"),
|
|
368
368
|
type: "success"
|
|
369
|
-
}), V("submitted"), V("update:show", !1),
|
|
369
|
+
}), V("submitted"), V("update:show", !1), ue();
|
|
370
370
|
} catch (l) {
|
|
371
371
|
a.open({
|
|
372
372
|
title: i("inventory.transfer.receiveRequest.create.error.title"),
|
|
@@ -377,12 +377,12 @@ const On = {
|
|
|
377
377
|
Z.value = !1;
|
|
378
378
|
}
|
|
379
379
|
}
|
|
380
|
-
function
|
|
381
|
-
s.value = 0, x.value = !1, p.value = null,
|
|
380
|
+
function ue() {
|
|
381
|
+
s.value = 0, x.value = !1, p.value = null, q.value = null, D.value = null, T.value = null, m.value = "", me.value = "", K.value = "", oe.value = !1, pe.value = !1, ge.value = [], A.value = H(), te.value = `${Math.random()}`;
|
|
382
382
|
}
|
|
383
|
-
return (n, l) => (c(), h(
|
|
384
|
-
(c(),
|
|
385
|
-
N(
|
|
383
|
+
return (n, l) => (c(), h(we, null, [
|
|
384
|
+
(c(), de(lt, { to: "body" }, [
|
|
385
|
+
N($t, {
|
|
386
386
|
"enter-active-class": "transition-opacity duration-150 ease-out",
|
|
387
387
|
"enter-from-class": "opacity-0",
|
|
388
388
|
"enter-to-class": "opacity-100",
|
|
@@ -390,87 +390,87 @@ const On = {
|
|
|
390
390
|
"leave-from-class": "opacity-100",
|
|
391
391
|
"leave-to-class": "opacity-0"
|
|
392
392
|
}, {
|
|
393
|
-
default:
|
|
394
|
-
n.show ? (c(), h("div",
|
|
395
|
-
x.value ?
|
|
393
|
+
default: Be(() => [
|
|
394
|
+
n.show ? (c(), h("div", An, [
|
|
395
|
+
x.value ? E("", !0) : (c(), h("div", Bn, [
|
|
396
396
|
e("span", Tn, v(t(i)("inventory.transfer.receiveRequest.bulk.wizard.title")), 1),
|
|
397
397
|
e("div", In, [
|
|
398
398
|
N(t(C), {
|
|
399
399
|
variant: "tertiary",
|
|
400
400
|
size: "md",
|
|
401
401
|
label: t(i)("inventory.transfer.receiveRequest.bulk.wizard.cancelBtn"),
|
|
402
|
-
onClick:
|
|
402
|
+
onClick: qe
|
|
403
403
|
}, null, 8, ["label"]),
|
|
404
|
-
s.value > 0 ? (c(),
|
|
404
|
+
s.value > 0 ? (c(), de(t(C), {
|
|
405
405
|
key: 0,
|
|
406
406
|
variant: "secondary",
|
|
407
407
|
size: "md",
|
|
408
408
|
"prepend-icon": "arrow_back",
|
|
409
409
|
label: t(i)("inventory.transfer.receiveRequest.bulk.wizard.backBtn"),
|
|
410
|
-
onClick:
|
|
411
|
-
}, null, 8, ["label"])) :
|
|
410
|
+
onClick: Fe
|
|
411
|
+
}, null, 8, ["label"])) : E("", !0),
|
|
412
412
|
N(t(C), {
|
|
413
413
|
size: "md",
|
|
414
|
-
disabled: !
|
|
414
|
+
disabled: !Xe.value,
|
|
415
415
|
loading: Z.value,
|
|
416
|
-
label:
|
|
417
|
-
onClick:
|
|
416
|
+
label: je.value,
|
|
417
|
+
onClick: ye
|
|
418
418
|
}, null, 8, ["disabled", "loading", "label"])
|
|
419
419
|
])
|
|
420
420
|
])),
|
|
421
|
-
x.value ?
|
|
421
|
+
x.value ? E("", !0) : (c(), h("div", Ln, [
|
|
422
422
|
e("div", zn, [
|
|
423
423
|
e("button", {
|
|
424
424
|
class: "flex flex-col items-center gap-4 min-w-0 group",
|
|
425
425
|
disabled: s.value <= 0,
|
|
426
|
-
onClick: l[0] || (l[0] = (r) =>
|
|
426
|
+
onClick: l[0] || (l[0] = (r) => xe(0))
|
|
427
427
|
}, [
|
|
428
428
|
e("div", {
|
|
429
|
-
class:
|
|
429
|
+
class: j([
|
|
430
430
|
"w-32 h-32 rounded-full flex items-center justify-center text-sm font-semibold transition-colors duration-150",
|
|
431
431
|
s.value > 0 || s.value === 0 ? "bg-[#FF7823] text-white" : "bg-[#F0F0F0] text-[#6B6C70]"
|
|
432
432
|
])
|
|
433
433
|
}, [
|
|
434
|
-
s.value > 0 ? (c(),
|
|
434
|
+
s.value > 0 ? (c(), de(t($), {
|
|
435
435
|
key: 0,
|
|
436
436
|
name: "check",
|
|
437
437
|
size: "sm"
|
|
438
438
|
})) : (c(), h("span", Un, "1"))
|
|
439
439
|
], 2),
|
|
440
440
|
e("span", {
|
|
441
|
-
class:
|
|
441
|
+
class: j(["fm-typo-en-body-xs-500 whitespace-nowrap transition-colors duration-150", s.value >= 0 ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
|
|
442
442
|
}, " Select destination ", 2)
|
|
443
443
|
], 8, Mn),
|
|
444
444
|
e("div", {
|
|
445
|
-
class:
|
|
445
|
+
class: j(["flex-1 h-1 mx-8 transition-colors duration-200", s.value > 0 ? "bg-[#FF7823]" : "bg-[#E0E0E0]"])
|
|
446
446
|
}, null, 2),
|
|
447
447
|
e("button", {
|
|
448
448
|
class: "flex flex-col items-center gap-4 min-w-0 group",
|
|
449
449
|
disabled: s.value <= 1,
|
|
450
|
-
onClick: l[1] || (l[1] = (r) =>
|
|
450
|
+
onClick: l[1] || (l[1] = (r) => xe(1))
|
|
451
451
|
}, [
|
|
452
452
|
e("div", {
|
|
453
|
-
class:
|
|
453
|
+
class: j([
|
|
454
454
|
"w-32 h-32 rounded-full flex items-center justify-center text-sm font-semibold transition-colors duration-150",
|
|
455
455
|
s.value > 1 || s.value === 1 ? "bg-[#FF7823] text-white" : "bg-[#F0F0F0] text-[#6B6C70]"
|
|
456
456
|
])
|
|
457
457
|
}, [
|
|
458
|
-
s.value > 1 ? (c(),
|
|
458
|
+
s.value > 1 ? (c(), de(t($), {
|
|
459
459
|
key: 0,
|
|
460
460
|
name: "check",
|
|
461
461
|
size: "sm"
|
|
462
462
|
})) : (c(), h("span", Jn, "2"))
|
|
463
463
|
], 2),
|
|
464
464
|
e("span", {
|
|
465
|
-
class:
|
|
466
|
-
}, v(
|
|
465
|
+
class: j(["fm-typo-en-body-xs-500 whitespace-nowrap transition-colors duration-150", s.value >= 1 ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
|
|
466
|
+
}, v(Le.value), 3)
|
|
467
467
|
], 8, Vn),
|
|
468
468
|
e("div", {
|
|
469
|
-
class:
|
|
469
|
+
class: j(["flex-1 h-1 mx-8 transition-colors duration-200", s.value > 1 ? "bg-[#FF7823]" : "bg-[#E0E0E0]"])
|
|
470
470
|
}, null, 2),
|
|
471
471
|
e("button", jn, [
|
|
472
472
|
e("div", {
|
|
473
|
-
class:
|
|
473
|
+
class: j([
|
|
474
474
|
"w-32 h-32 rounded-full flex items-center justify-center text-sm font-semibold transition-colors duration-150",
|
|
475
475
|
s.value === 2 ? "bg-[#FF7823] text-white" : "bg-[#F0F0F0] text-[#6B6C70]"
|
|
476
476
|
])
|
|
@@ -478,8 +478,8 @@ const On = {
|
|
|
478
478
|
e("span", null, "3", -1)
|
|
479
479
|
]), 2),
|
|
480
480
|
e("span", {
|
|
481
|
-
class:
|
|
482
|
-
}, v(
|
|
481
|
+
class: j(["fm-typo-en-body-xs-500 whitespace-nowrap transition-colors duration-150", s.value >= 2 ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
|
|
482
|
+
}, v(Me.value), 3)
|
|
483
483
|
])
|
|
484
484
|
])
|
|
485
485
|
])),
|
|
@@ -491,7 +491,7 @@ const On = {
|
|
|
491
491
|
e("p", Gn, v(t(i)("inventory.transfer.receiveRequest.bulk.wizard.step1Desc")), 1)
|
|
492
492
|
]),
|
|
493
493
|
e("div", Xn, [
|
|
494
|
-
N(t(
|
|
494
|
+
N(t(z), {
|
|
495
495
|
"model-value": m.value,
|
|
496
496
|
"onUpdate:modelValue": l[2] || (l[2] = (r) => m.value = r),
|
|
497
497
|
"prepend-icon": "search",
|
|
@@ -499,12 +499,12 @@ const On = {
|
|
|
499
499
|
}, null, 8, ["model-value", "placeholder"])
|
|
500
500
|
]),
|
|
501
501
|
e("div", Zn, [
|
|
502
|
-
(c(!0), h(
|
|
503
|
-
var
|
|
502
|
+
(c(!0), h(we, null, Ke(P.value, (r, X) => {
|
|
503
|
+
var se, be, re, Ue, Ze, yt, bt;
|
|
504
504
|
return c(), h("div", {
|
|
505
505
|
key: r.dbName,
|
|
506
|
-
class:
|
|
507
|
-
((
|
|
506
|
+
class: j(["flex items-center gap-8 px-12 h-[67px] cursor-pointer transition-colors duration-150", [
|
|
507
|
+
((se = p.value) == null ? void 0 : se.dbName) === r.dbName ? "bg-[#FFF5EE]" : "hover:bg-[#FAFAFA]",
|
|
508
508
|
X > 0 ? "border-t border-[#F0F0F0]" : ""
|
|
509
509
|
]]),
|
|
510
510
|
onClick: (Ra) => p.value = r
|
|
@@ -516,25 +516,25 @@ const On = {
|
|
|
516
516
|
e("div", os, v(r.name), 1),
|
|
517
517
|
e("div", as, [
|
|
518
518
|
ot(v(r.doc.profile.code ? `#${r.doc.profile.code}` : t(i)("inventory.transfer.receiveRequest.bulk.wizard.noCode")) + " ", 1),
|
|
519
|
-
(
|
|
520
|
-
ot(" · " + v([(
|
|
521
|
-
], 64)) :
|
|
519
|
+
(be = r.doc.profile.address) != null && be.line1 || (re = r.doc.profile.address) != null && re.city ? (c(), h(we, { key: 0 }, [
|
|
520
|
+
ot(" · " + v([(Ue = r.doc.profile.address) == null ? void 0 : Ue.line1, (Ze = r.doc.profile.address) == null ? void 0 : Ze.city].filter(Boolean).join(" · ")), 1)
|
|
521
|
+
], 64)) : E("", !0)
|
|
522
522
|
])
|
|
523
523
|
]),
|
|
524
524
|
e("span", rs, v(r.type === "warehouse" ? "Warehouse" : "Restaurant"), 1),
|
|
525
525
|
e("div", {
|
|
526
|
-
class:
|
|
526
|
+
class: j([
|
|
527
527
|
"w-[18px] h-[18px] rounded-full border flex items-center justify-center shrink-0 transition-colors duration-150",
|
|
528
528
|
((yt = p.value) == null ? void 0 : yt.dbName) === r.dbName ? "border-[#FF7823]" : "border-[#CCCCCC]"
|
|
529
529
|
])
|
|
530
530
|
}, [
|
|
531
|
-
((bt = p.value) == null ? void 0 : bt.dbName) === r.dbName ? (c(), h("div", ls)) :
|
|
531
|
+
((bt = p.value) == null ? void 0 : bt.dbName) === r.dbName ? (c(), h("div", ls)) : E("", !0)
|
|
532
532
|
], 2)
|
|
533
533
|
], 10, es);
|
|
534
534
|
}), 128)),
|
|
535
|
-
|
|
535
|
+
P.value.length === 0 ? (c(), h("div", is, v(t(i)("inventory.transfer.receiveRequest.bulk.wizard.noOutletsAvailable")), 1)) : E("", !0)
|
|
536
536
|
])
|
|
537
|
-
])) :
|
|
537
|
+
])) : E("", !0),
|
|
538
538
|
s.value === 1 ? (c(), h("div", us, [
|
|
539
539
|
e("div", cs, [
|
|
540
540
|
e("h3", ds, v(t(i)("inventory.transfer.receiveRequest.bulk.wizard.step2Heading")), 1),
|
|
@@ -542,74 +542,74 @@ const On = {
|
|
|
542
542
|
]),
|
|
543
543
|
e("div", fs, [
|
|
544
544
|
e("div", {
|
|
545
|
-
class:
|
|
545
|
+
class: j([
|
|
546
546
|
"border rounded-xl p-16 cursor-pointer transition-all duration-150 flex flex-col",
|
|
547
|
-
|
|
547
|
+
q.value === "transfer" ? "border-[#FF7823] bg-[#FFF5EE]" : "border-[#E0E0E0] bg-white hover:bg-[#FAFAFA]"
|
|
548
548
|
]),
|
|
549
|
-
onClick: l[3] || (l[3] = (r) =>
|
|
549
|
+
onClick: l[3] || (l[3] = (r) => Se("transfer"))
|
|
550
550
|
}, [
|
|
551
551
|
e("div", ps, [
|
|
552
552
|
e("div", {
|
|
553
|
-
class:
|
|
553
|
+
class: j(["w-36 h-36 rounded-xl flex items-center justify-center shrink-0", q.value === "transfer" ? "bg-[#FF7823]" : "bg-[#F0F0F0]"])
|
|
554
554
|
}, [
|
|
555
555
|
N(t($), {
|
|
556
556
|
name: "swap_horiz",
|
|
557
557
|
size: "md",
|
|
558
|
-
class:
|
|
558
|
+
class: j(q.value === "transfer" ? "text-white" : "text-[#6B6C70]")
|
|
559
559
|
}, null, 8, ["class"])
|
|
560
560
|
], 2),
|
|
561
561
|
e("div", {
|
|
562
|
-
class:
|
|
562
|
+
class: j(["w-16 h-16 rounded-full flex items-center justify-center shrink-0", q.value === "transfer" ? "bg-[#FF7823]" : "border border-[#CCCCCC]"])
|
|
563
563
|
}, [
|
|
564
|
-
|
|
564
|
+
q.value === "transfer" ? (c(), de(t($), {
|
|
565
565
|
key: 0,
|
|
566
566
|
name: "check",
|
|
567
567
|
size: "sm",
|
|
568
568
|
class: "text-white"
|
|
569
|
-
})) :
|
|
569
|
+
})) : E("", !0)
|
|
570
570
|
], 2)
|
|
571
571
|
]),
|
|
572
572
|
e("div", vs, v(t(i)("inventory.transfer.receiveRequest.bulk.wizard.outletToOutlet")), 1),
|
|
573
573
|
e("div", ys, v(t(i)("inventory.transfer.receiveRequest.bulk.wizard.outletToOutletDesc")), 1)
|
|
574
574
|
], 2),
|
|
575
575
|
e("div", {
|
|
576
|
-
class:
|
|
576
|
+
class: j([
|
|
577
577
|
"border rounded-xl p-16 cursor-pointer transition-all duration-150 flex flex-col",
|
|
578
|
-
|
|
578
|
+
q.value === "template" ? "border-[#FF7823] bg-[#FFF5EE]" : "border-[#E0E0E0] bg-white hover:bg-[#FAFAFA]"
|
|
579
579
|
]),
|
|
580
|
-
onClick: l[4] || (l[4] = (r) =>
|
|
580
|
+
onClick: l[4] || (l[4] = (r) => Se("template"))
|
|
581
581
|
}, [
|
|
582
582
|
e("div", bs, [
|
|
583
583
|
e("div", {
|
|
584
|
-
class:
|
|
584
|
+
class: j(["w-36 h-36 rounded-xl flex items-center justify-center shrink-0", q.value === "template" ? "bg-[#FF7823]" : "bg-[#F0F0F0]"])
|
|
585
585
|
}, [
|
|
586
586
|
N(t($), {
|
|
587
587
|
name: "description",
|
|
588
588
|
size: "md",
|
|
589
|
-
class:
|
|
589
|
+
class: j(q.value === "template" ? "text-white" : "text-[#6B6C70]")
|
|
590
590
|
}, null, 8, ["class"])
|
|
591
591
|
], 2),
|
|
592
592
|
e("div", {
|
|
593
|
-
class:
|
|
593
|
+
class: j(["w-16 h-16 rounded-full flex items-center justify-center shrink-0", q.value === "template" ? "bg-[#FF7823]" : "border border-[#CCCCCC]"])
|
|
594
594
|
}, [
|
|
595
|
-
|
|
595
|
+
q.value === "template" ? (c(), de(t($), {
|
|
596
596
|
key: 0,
|
|
597
597
|
name: "check",
|
|
598
598
|
size: "sm",
|
|
599
599
|
class: "text-white"
|
|
600
|
-
})) :
|
|
600
|
+
})) : E("", !0)
|
|
601
601
|
], 2)
|
|
602
602
|
]),
|
|
603
603
|
e("div", hs, v(t(i)("inventory.transfer.receiveRequest.bulk.wizard.fromTemplate")), 1),
|
|
604
604
|
e("div", gs, v(t(i)("inventory.transfer.receiveRequest.bulk.wizard.fromTemplateDesc")), 1)
|
|
605
605
|
], 2)
|
|
606
606
|
]),
|
|
607
|
-
|
|
607
|
+
q.value === "transfer" ? (c(), h(we, { key: 0 }, [
|
|
608
608
|
e("div", _s, v(t(i)("inventory.transfer.receiveRequest.bulk.wizard.step2SourceHeading")), 1),
|
|
609
609
|
e("div", xs, [
|
|
610
|
-
N(t(
|
|
611
|
-
"model-value":
|
|
612
|
-
"onUpdate:modelValue": l[5] || (l[5] = (r) =>
|
|
610
|
+
N(t(z), {
|
|
611
|
+
"model-value": me.value,
|
|
612
|
+
"onUpdate:modelValue": l[5] || (l[5] = (r) => me.value = r),
|
|
613
613
|
"prepend-icon": "search",
|
|
614
614
|
placeholder: t(i)(
|
|
615
615
|
"inventory.transfer.receiveRequest.bulk.wizard.step2SearchSourcePlaceholder"
|
|
@@ -617,15 +617,15 @@ const On = {
|
|
|
617
617
|
}, null, 8, ["model-value", "placeholder"])
|
|
618
618
|
]),
|
|
619
619
|
e("div", ws, [
|
|
620
|
-
(c(!0), h(
|
|
621
|
-
var
|
|
620
|
+
(c(!0), h(we, null, Ke(w.value, (r, X) => {
|
|
621
|
+
var se, be, re;
|
|
622
622
|
return c(), h("div", {
|
|
623
623
|
key: r.dbName,
|
|
624
|
-
class:
|
|
625
|
-
((
|
|
624
|
+
class: j(["flex items-center gap-8 px-12 h-[67px] cursor-pointer transition-colors duration-150", [
|
|
625
|
+
((se = D.value) == null ? void 0 : se.doc._id) === r.doc._id ? "bg-[#FFF5EE]" : "hover:bg-[#FAFAFA]",
|
|
626
626
|
X > 0 ? "border-t border-[#F0F0F0]" : ""
|
|
627
627
|
]]),
|
|
628
|
-
onClick: (
|
|
628
|
+
onClick: (Ue) => D.value = r
|
|
629
629
|
}, [
|
|
630
630
|
e("div", Cs, [
|
|
631
631
|
e("span", Fs, v(r.name.slice(0, 2).toUpperCase()), 1)
|
|
@@ -633,91 +633,91 @@ const On = {
|
|
|
633
633
|
e("div", Ss, [
|
|
634
634
|
e("div", Rs, v(r.name), 1),
|
|
635
635
|
e("div", Ps, [
|
|
636
|
-
ot(v(
|
|
637
|
-
o(r) ? (c(), h(
|
|
636
|
+
ot(v(ce(r) ? `#${ce(r)}` : t(i)("inventory.transfer.receiveRequest.bulk.wizard.noCode")) + " ", 1),
|
|
637
|
+
o(r) ? (c(), h(we, { key: 0 }, [
|
|
638
638
|
ot(" · " + v(o(r)), 1)
|
|
639
|
-
], 64)) :
|
|
639
|
+
], 64)) : E("", !0)
|
|
640
640
|
])
|
|
641
641
|
]),
|
|
642
642
|
e("span", Ds, v(r.type === "warehouse" ? "Warehouse" : r.type === "supplier" ? "Supplier" : "Restaurant"), 1),
|
|
643
643
|
e("div", {
|
|
644
|
-
class:
|
|
644
|
+
class: j([
|
|
645
645
|
"w-[18px] h-[18px] rounded-full border flex items-center justify-center shrink-0 transition-colors duration-150",
|
|
646
|
-
((
|
|
646
|
+
((be = D.value) == null ? void 0 : be.doc._id) === r.doc._id ? "border-[#FF7823]" : "border-[#CCCCCC]"
|
|
647
647
|
])
|
|
648
648
|
}, [
|
|
649
|
-
((
|
|
649
|
+
((re = D.value) == null ? void 0 : re.doc._id) === r.doc._id ? (c(), h("div", Es)) : E("", !0)
|
|
650
650
|
], 2)
|
|
651
651
|
], 10, ks);
|
|
652
652
|
}), 128)),
|
|
653
|
-
|
|
653
|
+
w.value.length === 0 ? (c(), h("div", qs, v(t(i)("inventory.transfer.receiveRequest.bulk.wizard.noOutletsAvailable")), 1)) : E("", !0)
|
|
654
654
|
])
|
|
655
|
-
], 64)) :
|
|
656
|
-
|
|
655
|
+
], 64)) : E("", !0),
|
|
656
|
+
q.value === "template" ? (c(), h(we, { key: 1 }, [
|
|
657
657
|
e("div", Ns, v(t(i)("inventory.transfer.receiveRequest.bulk.wizard.step2TemplateHeading")), 1),
|
|
658
658
|
e("div", $s, [
|
|
659
|
-
N(t(
|
|
660
|
-
"model-value":
|
|
661
|
-
"onUpdate:modelValue": l[6] || (l[6] = (r) =>
|
|
659
|
+
N(t(z), {
|
|
660
|
+
"model-value": K.value,
|
|
661
|
+
"onUpdate:modelValue": l[6] || (l[6] = (r) => K.value = r),
|
|
662
662
|
"prepend-icon": "search",
|
|
663
663
|
placeholder: t(i)(
|
|
664
664
|
"inventory.transfer.receiveRequest.bulk.wizard.step2SearchTemplatePlaceholder"
|
|
665
665
|
)
|
|
666
666
|
}, null, 8, ["model-value", "placeholder"])
|
|
667
667
|
]),
|
|
668
|
-
t(y).loading ? (c(), h("div",
|
|
668
|
+
t(y).loading ? (c(), h("div", Os, [
|
|
669
669
|
N(t($), {
|
|
670
670
|
name: "progress_activity",
|
|
671
671
|
class: "text-[#FF7823] animate-spin"
|
|
672
672
|
})
|
|
673
|
-
])) :
|
|
674
|
-
(c(!0), h(
|
|
673
|
+
])) : M.value.length === 0 ? (c(), h("div", As, v(t(i)("inventory.transfer.receiveRequest.bulk.wizard.noTemplatesAvailable")), 1)) : (c(), h("div", Bs, [
|
|
674
|
+
(c(!0), h(we, null, Ke(M.value, (r) => (c(), h("div", {
|
|
675
675
|
key: r._id,
|
|
676
|
-
class:
|
|
676
|
+
class: j([
|
|
677
677
|
"border rounded-lg px-16 py-12 cursor-pointer transition-all duration-150 flex items-center gap-12",
|
|
678
|
-
|
|
678
|
+
T.value === r._id ? "border-[#FF7823] bg-[#FFF5EE]" : "border-[#E0E0E0] bg-white hover:bg-[#FAFAFA]"
|
|
679
679
|
]),
|
|
680
|
-
onClick: (X) =>
|
|
680
|
+
onClick: (X) => T.value = r._id
|
|
681
681
|
}, [
|
|
682
682
|
e("div", Is, [
|
|
683
683
|
e("div", Ls, v(r.name), 1),
|
|
684
|
-
e("div", zs, v(
|
|
684
|
+
e("div", zs, v(I(r)) + " · " + v(r.purchaseOrder.items.length) + " items ", 1)
|
|
685
685
|
]),
|
|
686
686
|
e("div", {
|
|
687
|
-
class:
|
|
687
|
+
class: j([
|
|
688
688
|
"w-[18px] h-[18px] rounded-full border flex items-center justify-center shrink-0 transition-colors duration-150",
|
|
689
|
-
|
|
689
|
+
T.value === r._id ? "border-[#FF7823]" : "border-[#CCCCCC]"
|
|
690
690
|
])
|
|
691
691
|
}, [
|
|
692
|
-
|
|
692
|
+
T.value === r._id ? (c(), h("div", Ms)) : E("", !0)
|
|
693
693
|
], 2)
|
|
694
694
|
], 10, Ts))), 128))
|
|
695
695
|
]))
|
|
696
|
-
], 64)) :
|
|
697
|
-
])) :
|
|
696
|
+
], 64)) : E("", !0)
|
|
697
|
+
])) : E("", !0),
|
|
698
698
|
s.value === 2 ? (c(), h("div", Us, [
|
|
699
699
|
e("div", Vs, [
|
|
700
|
-
e("h3", Js, v(
|
|
700
|
+
e("h3", Js, v(Me.value), 1)
|
|
701
701
|
]),
|
|
702
|
-
(c(),
|
|
702
|
+
(c(), de(pn, {
|
|
703
703
|
ref_key: "formRef",
|
|
704
704
|
ref: Te,
|
|
705
705
|
class: "w-full",
|
|
706
|
-
"onForm:ready": l[7] || (l[7] = () =>
|
|
707
|
-
"onForm:dataChange":
|
|
708
|
-
onValidationSuccess:
|
|
709
|
-
modelValue:
|
|
710
|
-
"onUpdate:modelValue": l[8] || (l[8] = (r) =>
|
|
711
|
-
disabled:
|
|
712
|
-
"locked-supplier":
|
|
706
|
+
"onForm:ready": l[7] || (l[7] = () => pe.value = !0),
|
|
707
|
+
"onForm:dataChange": Re,
|
|
708
|
+
onValidationSuccess: ie,
|
|
709
|
+
modelValue: A.value,
|
|
710
|
+
"onUpdate:modelValue": l[8] || (l[8] = (r) => A.value = r),
|
|
711
|
+
disabled: Ie.value,
|
|
712
|
+
"locked-supplier": A.value.supplier,
|
|
713
713
|
suppliers: t(U).suppliers,
|
|
714
|
-
skus: t(
|
|
715
|
-
key:
|
|
714
|
+
skus: t(he).skus,
|
|
715
|
+
key: te.value,
|
|
716
716
|
"last-closing-date": n.lastClosingDate,
|
|
717
717
|
"sku-balance-map": ze.value,
|
|
718
|
-
"is-balance-loading":
|
|
718
|
+
"is-balance-loading": Ee.value
|
|
719
719
|
}, null, 8, ["modelValue", "disabled", "locked-supplier", "suppliers", "skus", "last-closing-date", "sku-balance-map", "is-balance-loading"]))
|
|
720
|
-
])) :
|
|
720
|
+
])) : E("", !0)
|
|
721
721
|
]),
|
|
722
722
|
e("div", js, [
|
|
723
723
|
e("div", Ws, [
|
|
@@ -728,74 +728,74 @@ const On = {
|
|
|
728
728
|
e("div", Ks, [
|
|
729
729
|
e("span", Gs, v(t(i)("inventory.transfer.receiveRequest.bulk.wizard.summaryDestination")), 1),
|
|
730
730
|
e("span", {
|
|
731
|
-
class:
|
|
732
|
-
}, v(
|
|
733
|
-
u.value ? (c(), h("span", Xs, v(u.value), 1)) :
|
|
731
|
+
class: j(["text-[15px] leading-[20px] font-semibold transition-colors duration-200", p.value ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
|
|
732
|
+
}, v(G.value), 3),
|
|
733
|
+
u.value ? (c(), h("span", Xs, v(u.value), 1)) : E("", !0)
|
|
734
734
|
]),
|
|
735
735
|
e("div", Zs, [
|
|
736
736
|
e("span", eo, v(t(i)("inventory.transfer.receiveRequest.bulk.wizard.summaryMethod")), 1),
|
|
737
737
|
e("span", {
|
|
738
|
-
class:
|
|
739
|
-
}, v(
|
|
738
|
+
class: j(["text-[15px] leading-[20px] font-semibold transition-colors duration-200", q.value ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
|
|
739
|
+
}, v(le.value), 3)
|
|
740
740
|
]),
|
|
741
741
|
e("div", to, [
|
|
742
742
|
e("span", no, v(t(i)("inventory.transfer.receiveRequest.bulk.wizard.summarySource")), 1),
|
|
743
743
|
e("span", {
|
|
744
|
-
class:
|
|
744
|
+
class: j([
|
|
745
745
|
"text-[15px] leading-[20px] font-semibold transition-colors duration-200",
|
|
746
|
-
|
|
746
|
+
D.value || T.value ? "text-[#1C1C1E]" : "text-[#B2B3B6]"
|
|
747
747
|
])
|
|
748
|
-
}, v(
|
|
749
|
-
g.value ? (c(), h("span", so, v(g.value), 1)) :
|
|
748
|
+
}, v(Oe.value), 3),
|
|
749
|
+
g.value ? (c(), h("span", so, v(g.value), 1)) : E("", !0)
|
|
750
750
|
]),
|
|
751
751
|
e("div", oo, [
|
|
752
752
|
e("span", ao, v(t(i)("inventory.transfer.receiveRequest.bulk.wizard.summaryItems")), 1),
|
|
753
753
|
e("span", {
|
|
754
|
-
class:
|
|
755
|
-
}, v(
|
|
754
|
+
class: j(["text-[15px] leading-[20px] font-medium transition-colors duration-200", Qe.value ? "text-[#1C1C1E]" : "text-[#6B6C70]"])
|
|
755
|
+
}, v(O.value), 3)
|
|
756
756
|
])
|
|
757
757
|
])
|
|
758
758
|
])
|
|
759
759
|
])
|
|
760
760
|
])
|
|
761
|
-
])) :
|
|
761
|
+
])) : E("", !0)
|
|
762
762
|
]),
|
|
763
763
|
_: 1
|
|
764
764
|
})
|
|
765
765
|
])),
|
|
766
|
-
N(t(
|
|
767
|
-
modelValue:
|
|
768
|
-
"onUpdate:modelValue": l[10] || (l[10] = (r) =>
|
|
766
|
+
N(t(B), {
|
|
767
|
+
modelValue: ke.value,
|
|
768
|
+
"onUpdate:modelValue": l[10] || (l[10] = (r) => ke.value = r),
|
|
769
769
|
overlay: !0
|
|
770
770
|
}, {
|
|
771
|
-
"dialog-header":
|
|
771
|
+
"dialog-header": Be(() => [
|
|
772
772
|
e("div", ro, v(t(i)("inventory.transfer.template.zeroQuantity.title")), 1)
|
|
773
773
|
]),
|
|
774
|
-
"dialog-footer":
|
|
774
|
+
"dialog-footer": Be(() => [
|
|
775
775
|
e("div", fo, [
|
|
776
776
|
N(t(C), {
|
|
777
777
|
label: t(i)("common.cancel"),
|
|
778
778
|
variant: "tertiary",
|
|
779
779
|
size: "md",
|
|
780
|
-
onClick: l[9] || (l[9] = (r) =>
|
|
780
|
+
onClick: l[9] || (l[9] = (r) => ke.value = !1)
|
|
781
781
|
}, null, 8, ["label"]),
|
|
782
782
|
N(t(C), {
|
|
783
783
|
label: t(i)("inventory.transfer.template.zeroQuantity.removeAll"),
|
|
784
784
|
variant: "primary",
|
|
785
785
|
size: "md",
|
|
786
786
|
"prepend-icon": "delete",
|
|
787
|
-
onClick:
|
|
787
|
+
onClick: F
|
|
788
788
|
}, null, 8, ["label"])
|
|
789
789
|
])
|
|
790
790
|
]),
|
|
791
|
-
default:
|
|
791
|
+
default: Be(() => [
|
|
792
792
|
e("div", lo, [
|
|
793
793
|
e("div", io, v(t(i)("inventory.transfer.template.zeroQuantity.message", {
|
|
794
|
-
count:
|
|
794
|
+
count: ne.value.length
|
|
795
795
|
})), 1),
|
|
796
796
|
e("div", uo, [
|
|
797
797
|
e("ul", co, [
|
|
798
|
-
(c(!0), h(
|
|
798
|
+
(c(!0), h(we, null, Ke(ne.value, (r) => (c(), h("li", {
|
|
799
799
|
key: r.sku._id,
|
|
800
800
|
class: "fm-typo-en-body-md-400"
|
|
801
801
|
}, v(r.sku.name) + " (" + v(r.sku.code) + ") ", 1))), 128))
|
|
@@ -819,12 +819,12 @@ const On = {
|
|
|
819
819
|
blobUrl: {}
|
|
820
820
|
},
|
|
821
821
|
emits: ["update:modelValue"],
|
|
822
|
-
setup(
|
|
823
|
-
const C =
|
|
824
|
-
function
|
|
825
|
-
|
|
822
|
+
setup(k, { emit: _ }) {
|
|
823
|
+
const C = k, B = _, $ = S(null);
|
|
824
|
+
function z() {
|
|
825
|
+
B("update:modelValue", !1);
|
|
826
826
|
}
|
|
827
|
-
function
|
|
827
|
+
function W() {
|
|
828
828
|
var V, i;
|
|
829
829
|
if (C.blobUrl)
|
|
830
830
|
try {
|
|
@@ -834,11 +834,11 @@ const On = {
|
|
|
834
834
|
a.href = C.blobUrl, a.download = "purchase-order.pdf", document.body.appendChild(a), a.click(), document.body.removeChild(a);
|
|
835
835
|
}
|
|
836
836
|
}
|
|
837
|
-
return (V, i) => (c(),
|
|
837
|
+
return (V, i) => (c(), de(lt, { to: "body" }, [
|
|
838
838
|
V.modelValue ? (c(), h("div", {
|
|
839
839
|
key: 0,
|
|
840
840
|
class: "fixed inset-0 z-[9999] bg-black/50 flex justify-center items-center",
|
|
841
|
-
onClick:
|
|
841
|
+
onClick: Ot(z, ["self"])
|
|
842
842
|
}, [
|
|
843
843
|
e("div", vo, [
|
|
844
844
|
e("div", yo, [
|
|
@@ -847,11 +847,11 @@ const On = {
|
|
|
847
847
|
e("button", {
|
|
848
848
|
disabled: V.loading || !V.blobUrl,
|
|
849
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",
|
|
850
|
-
onClick:
|
|
850
|
+
onClick: W
|
|
851
851
|
}, " Print ", 8, ho),
|
|
852
852
|
e("button", {
|
|
853
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",
|
|
854
|
-
onClick:
|
|
854
|
+
onClick: z
|
|
855
855
|
}, " × ")
|
|
856
856
|
])
|
|
857
857
|
]),
|
|
@@ -884,10 +884,10 @@ const On = {
|
|
|
884
884
|
ref: $,
|
|
885
885
|
src: V.blobUrl,
|
|
886
886
|
class: "w-full h-full border-none"
|
|
887
|
-
}, null, 8, xo)) :
|
|
887
|
+
}, null, 8, xo)) : E("", !0)
|
|
888
888
|
])
|
|
889
889
|
])
|
|
890
|
-
])) :
|
|
890
|
+
])) : E("", !0)
|
|
891
891
|
]));
|
|
892
892
|
}
|
|
893
893
|
}), ko = /* @__PURE__ */ nt({
|
|
@@ -899,57 +899,57 @@ const On = {
|
|
|
899
899
|
modelModifiers: {}
|
|
900
900
|
}),
|
|
901
901
|
emits: ["update:modelValue"],
|
|
902
|
-
setup(
|
|
903
|
-
const { t: _ } = st(), C =
|
|
904
|
-
const d =
|
|
902
|
+
setup(k) {
|
|
903
|
+
const { t: _ } = st(), C = k, B = Bt(k, "modelValue"), $ = S(!1), z = S(""), W = L(() => {
|
|
904
|
+
const d = z.value.trim().toLowerCase();
|
|
905
905
|
return d ? C.locations.filter(
|
|
906
906
|
(y) => y.name.toLowerCase().includes(d) || (y.doc.profile.code ?? "").toLowerCase().includes(d)
|
|
907
907
|
) : C.locations;
|
|
908
|
-
}), V =
|
|
909
|
-
() =>
|
|
910
|
-
), a =
|
|
911
|
-
() =>
|
|
912
|
-
), b =
|
|
908
|
+
}), V = L(() => B.value.length), i = L(
|
|
909
|
+
() => W.value.length > 0 && W.value.every((d) => B.value.includes(d.dbName))
|
|
910
|
+
), a = L(
|
|
911
|
+
() => W.value.some((d) => B.value.includes(d.dbName)) && !i.value
|
|
912
|
+
), b = L(() => {
|
|
913
913
|
if (V.value === 0) return _("inventory.transfer.receiveRequest.bulk.noLocationsSelected");
|
|
914
914
|
if (V.value === 1) {
|
|
915
|
-
const d = C.locations.find((y) => y.dbName ===
|
|
916
|
-
return d ? `${d.name} (${d.doc.profile.code ?? "--"})` :
|
|
915
|
+
const d = C.locations.find((y) => y.dbName === B.value[0]);
|
|
916
|
+
return d ? `${d.name} (${d.doc.profile.code ?? "--"})` : B.value[0];
|
|
917
917
|
}
|
|
918
918
|
return _("inventory.transfer.receiveRequest.bulk.locationsSelected", [V.value]);
|
|
919
919
|
});
|
|
920
920
|
function U() {
|
|
921
|
-
const d =
|
|
922
|
-
i.value ?
|
|
921
|
+
const d = W.value.map((y) => y.dbName);
|
|
922
|
+
i.value ? B.value = B.value.filter((y) => !d.includes(y)) : B.value = [.../* @__PURE__ */ new Set([...B.value, ...d])];
|
|
923
923
|
}
|
|
924
|
-
function
|
|
925
|
-
|
|
924
|
+
function he(d) {
|
|
925
|
+
B.value.includes(d) ? B.value = B.value.filter((y) => y !== d) : B.value = [...B.value, d];
|
|
926
926
|
}
|
|
927
927
|
function f(d) {
|
|
928
|
-
return
|
|
928
|
+
return B.value.includes(d);
|
|
929
929
|
}
|
|
930
930
|
return (d, y) => {
|
|
931
|
-
const s =
|
|
932
|
-
return c(),
|
|
931
|
+
const s = $e("FmIcon"), x = $e("FmChip"), p = $e("FmTextField"), m = $e("FmMenuItem"), q = $e("FmMenu");
|
|
932
|
+
return c(), de(q, {
|
|
933
933
|
"model-value": $.value,
|
|
934
934
|
placement: "bottom-end",
|
|
935
935
|
"close-on-click": !1,
|
|
936
|
-
onMenuChanged: y[1] || (y[1] = (
|
|
937
|
-
$.value =
|
|
936
|
+
onMenuChanged: y[1] || (y[1] = (D) => {
|
|
937
|
+
$.value = D, D || (z.value = "");
|
|
938
938
|
})
|
|
939
939
|
}, {
|
|
940
|
-
"menu-button":
|
|
940
|
+
"menu-button": Be(() => [
|
|
941
941
|
N(x, {
|
|
942
942
|
label: b.value,
|
|
943
943
|
class: "text-fm-color-neutral-gray-400 cursor-pointer"
|
|
944
944
|
}, {
|
|
945
|
-
default:
|
|
945
|
+
default: Be(() => [
|
|
946
946
|
N(s, {
|
|
947
947
|
name: "storefront",
|
|
948
948
|
outline: "",
|
|
949
949
|
size: "sm"
|
|
950
950
|
}),
|
|
951
951
|
e("div", {
|
|
952
|
-
class:
|
|
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": V.value > 0 }])
|
|
953
953
|
}, v(b.value), 3),
|
|
954
954
|
N(s, {
|
|
955
955
|
name: $.value ? "keyboard_arrow_up" : "keyboard_arrow_down",
|
|
@@ -960,10 +960,10 @@ const On = {
|
|
|
960
960
|
_: 1
|
|
961
961
|
}, 8, ["label"])
|
|
962
962
|
]),
|
|
963
|
-
default:
|
|
963
|
+
default: Be(() => [
|
|
964
964
|
N(p, {
|
|
965
|
-
"model-value":
|
|
966
|
-
"onUpdate:modelValue": y[0] || (y[0] = (
|
|
965
|
+
"model-value": z.value,
|
|
966
|
+
"onUpdate:modelValue": y[0] || (y[0] = (D) => z.value = D),
|
|
967
967
|
placeholder: t(_)("inventory.common.table.toolbar.filterItems"),
|
|
968
968
|
class: "my-8"
|
|
969
969
|
}, null, 8, ["model-value", "placeholder"]),
|
|
@@ -974,57 +974,57 @@ const On = {
|
|
|
974
974
|
indeterminate: a.value,
|
|
975
975
|
onClick: U
|
|
976
976
|
}, null, 8, ["model-value", "label", "indeterminate"]),
|
|
977
|
-
(c(!0), h(
|
|
978
|
-
key:
|
|
979
|
-
"model-value": f(
|
|
980
|
-
label: `${
|
|
981
|
-
sublabel:
|
|
977
|
+
(c(!0), h(we, null, Ke(W.value, (D) => (c(), de(m, {
|
|
978
|
+
key: D.dbName,
|
|
979
|
+
"model-value": f(D.dbName),
|
|
980
|
+
label: `${D.name} (${D.doc.profile.code ?? "--"})`,
|
|
981
|
+
sublabel: D.type === "restaurant" ? t(_)("inventory.common.restaurant") : t(_)("inventory.common.warehouse"),
|
|
982
982
|
"has-checkbox": !0,
|
|
983
|
-
onClick: (
|
|
983
|
+
onClick: (T) => he(D.dbName)
|
|
984
984
|
}, null, 8, ["model-value", "label", "sublabel", "onClick"]))), 128)),
|
|
985
|
-
|
|
985
|
+
W.value.length === 0 ? (c(), de(m, {
|
|
986
986
|
key: 0,
|
|
987
987
|
disabled: "",
|
|
988
988
|
label: t(_)("inventory.common.noResultFound")
|
|
989
|
-
}, null, 8, ["label"])) :
|
|
989
|
+
}, null, 8, ["label"])) : E("", !0)
|
|
990
990
|
]),
|
|
991
991
|
_: 1
|
|
992
992
|
}, 8, ["model-value"]);
|
|
993
993
|
};
|
|
994
994
|
}
|
|
995
|
-
}),
|
|
995
|
+
}), Nt = "bulk-jobs-v1";
|
|
996
996
|
function Co() {
|
|
997
997
|
try {
|
|
998
|
-
const
|
|
999
|
-
return
|
|
998
|
+
const k = localStorage.getItem(Nt);
|
|
999
|
+
return k ? JSON.parse(k) : [];
|
|
1000
1000
|
} catch {
|
|
1001
1001
|
return [];
|
|
1002
1002
|
}
|
|
1003
1003
|
}
|
|
1004
|
-
function Fo(
|
|
1004
|
+
function Fo(k) {
|
|
1005
1005
|
try {
|
|
1006
|
-
localStorage.setItem(
|
|
1006
|
+
localStorage.setItem(Nt, JSON.stringify(k));
|
|
1007
1007
|
} catch {
|
|
1008
1008
|
}
|
|
1009
1009
|
}
|
|
1010
|
-
const
|
|
1011
|
-
function Ro(
|
|
1010
|
+
const Ct = 5e3, Ft = 3e3, So = 300, He = ["completed", "failed", "cancelled"];
|
|
1011
|
+
function Ro(k, _) {
|
|
1012
1012
|
var C;
|
|
1013
|
-
return
|
|
1013
|
+
return k.cancelled ? "cancelled" : k.message === "completed" ? "completed" : k.message === "error" || (C = k.message) != null && C.startsWith("error:") ? "failed" : k.message === "processing" ? "active" : "waiting";
|
|
1014
1014
|
}
|
|
1015
1015
|
const vt = En("bulkJob", () => {
|
|
1016
|
-
const
|
|
1016
|
+
const k = S(Co()), _ = /* @__PURE__ */ new Map();
|
|
1017
1017
|
let C = null;
|
|
1018
|
-
|
|
1018
|
+
Ve(k, (f) => {
|
|
1019
1019
|
C && clearTimeout(C), C = setTimeout(() => Fo(f), So);
|
|
1020
1020
|
}, { deep: !0 });
|
|
1021
|
-
function
|
|
1022
|
-
var
|
|
1023
|
-
const y =
|
|
1021
|
+
function B(f, d) {
|
|
1022
|
+
var T;
|
|
1023
|
+
const y = k.value.find((me) => me.jobId === f);
|
|
1024
1024
|
let s = Ro(d, y == null ? void 0 : y.type);
|
|
1025
1025
|
const x = d.errorCount ?? 0;
|
|
1026
1026
|
s === "completed" && x > 0 && (y == null ? void 0 : y.type) === "download" && (s = "failed");
|
|
1027
|
-
const p = d.total ?? 0, m = d.current ?? 0,
|
|
1027
|
+
const p = d.total ?? 0, m = d.current ?? 0, q = s === "failed" || s === "completed" && x > 0, D = (y == null ? void 0 : y.hidden) && q;
|
|
1028
1028
|
V(f, {
|
|
1029
1029
|
status: s,
|
|
1030
1030
|
progress: p > 0 ? Math.round(m / p * 100) : 0,
|
|
@@ -1035,59 +1035,59 @@ const vt = En("bulkJob", () => {
|
|
|
1035
1035
|
// Only expose the download button when the job fully succeeded.
|
|
1036
1036
|
downloadReady: s === "completed" ? d.downloadReady : !1,
|
|
1037
1037
|
zipSizeBytes: d.zipSizeBytes ?? void 0,
|
|
1038
|
-
stalePoIds: (
|
|
1039
|
-
...
|
|
1040
|
-
}), He.includes(s) && (
|
|
1038
|
+
stalePoIds: (T = d.stalePoIds) != null && T.length ? d.stalePoIds : void 0,
|
|
1039
|
+
...D ? { hidden: !1 } : {}
|
|
1040
|
+
}), He.includes(s) && (z(f), y != null && y.hidden && !D && i(f));
|
|
1041
1041
|
}
|
|
1042
1042
|
function $(f) {
|
|
1043
|
-
if (_.has(f) || !
|
|
1043
|
+
if (_.has(f) || !k.value.find((K) => K.jobId === f)) return;
|
|
1044
1044
|
const y = Ge();
|
|
1045
1045
|
let s = !1, x = null, p = !1;
|
|
1046
1046
|
async function m() {
|
|
1047
1047
|
if (p || s) return;
|
|
1048
|
-
const
|
|
1049
|
-
if (!(!
|
|
1048
|
+
const K = k.value.find((Z) => Z.jobId === f);
|
|
1049
|
+
if (!(!K || He.includes(K.status)))
|
|
1050
1050
|
try {
|
|
1051
|
-
const Z = await y.getBulkJobStatus(
|
|
1051
|
+
const Z = await y.getBulkJobStatus(K.dbName, f);
|
|
1052
1052
|
if (Z && !p && !s) {
|
|
1053
|
-
|
|
1054
|
-
const
|
|
1055
|
-
|
|
1053
|
+
B(f, Z);
|
|
1054
|
+
const oe = k.value.find((pe) => pe.jobId === f);
|
|
1055
|
+
oe && !He.includes(oe.status) && (x = setTimeout(m, Ft));
|
|
1056
1056
|
}
|
|
1057
1057
|
} catch {
|
|
1058
|
-
!p && !s && (x = setTimeout(m,
|
|
1058
|
+
!p && !s && (x = setTimeout(m, Ft));
|
|
1059
1059
|
}
|
|
1060
1060
|
}
|
|
1061
|
-
const
|
|
1061
|
+
const q = qn(), { unsubscribe: D, initialState: T } = q.subscribe(
|
|
1062
1062
|
{ type: "bulkPo", params: { jobId: f } },
|
|
1063
|
-
(
|
|
1064
|
-
s = !0, x && (clearTimeout(x), x = null),
|
|
1063
|
+
(K) => {
|
|
1064
|
+
s = !0, x && (clearTimeout(x), x = null), B(f, K);
|
|
1065
1065
|
}
|
|
1066
|
-
),
|
|
1067
|
-
p = !0,
|
|
1066
|
+
), me = () => {
|
|
1067
|
+
p = !0, D(), x && (clearTimeout(x), x = null);
|
|
1068
1068
|
};
|
|
1069
|
-
_.set(f,
|
|
1070
|
-
const Z =
|
|
1071
|
-
Z &&
|
|
1069
|
+
_.set(f, me), T.then((K) => {
|
|
1070
|
+
const Z = K == null ? void 0 : K.initialState;
|
|
1071
|
+
Z && B(f, Z);
|
|
1072
1072
|
}).catch(() => {
|
|
1073
1073
|
}), setTimeout(() => {
|
|
1074
|
-
!s && !p && (console.warn(`[bulkJob] SSE silent for job ${f} after ${
|
|
1075
|
-
},
|
|
1074
|
+
!s && !p && (console.warn(`[bulkJob] SSE silent for job ${f} after ${Ct}ms — starting polling fallback`), m());
|
|
1075
|
+
}, Ct);
|
|
1076
1076
|
}
|
|
1077
|
-
function
|
|
1077
|
+
function z(f) {
|
|
1078
1078
|
const d = _.get(f);
|
|
1079
1079
|
d !== void 0 && (d(), _.delete(f));
|
|
1080
1080
|
}
|
|
1081
|
-
function
|
|
1082
|
-
|
|
1081
|
+
function W(f) {
|
|
1082
|
+
k.value = [f, ...k.value], $(f.jobId);
|
|
1083
1083
|
}
|
|
1084
|
-
for (const f of
|
|
1084
|
+
for (const f of k.value)
|
|
1085
1085
|
He.includes(f.status) || $(f.jobId);
|
|
1086
1086
|
function V(f, d) {
|
|
1087
|
-
const y =
|
|
1087
|
+
const y = k.value.findIndex((s) => s.jobId === f);
|
|
1088
1088
|
if (y !== -1) {
|
|
1089
|
-
const s =
|
|
1090
|
-
|
|
1089
|
+
const s = k.value[y], x = d.status ?? s.status, p = He.includes(x) && !He.includes(s.status) && !s.completedAt;
|
|
1090
|
+
k.value[y] = {
|
|
1091
1091
|
...s,
|
|
1092
1092
|
...d,
|
|
1093
1093
|
...p ? { completedAt: Date.now() } : {}
|
|
@@ -1095,10 +1095,10 @@ const vt = En("bulkJob", () => {
|
|
|
1095
1095
|
}
|
|
1096
1096
|
}
|
|
1097
1097
|
function i(f) {
|
|
1098
|
-
|
|
1098
|
+
z(f), k.value = k.value.filter((d) => d.jobId !== f);
|
|
1099
1099
|
}
|
|
1100
1100
|
async function a(f) {
|
|
1101
|
-
const d =
|
|
1101
|
+
const d = k.value.find((y) => y.jobId === f);
|
|
1102
1102
|
if (d)
|
|
1103
1103
|
try {
|
|
1104
1104
|
await Ge().cancelBulkJob(d.dbName, f);
|
|
@@ -1107,7 +1107,7 @@ const vt = En("bulkJob", () => {
|
|
|
1107
1107
|
}
|
|
1108
1108
|
}
|
|
1109
1109
|
function b(f, d) {
|
|
1110
|
-
return
|
|
1110
|
+
return k.value.find((y) => y.jobId === f) || W({
|
|
1111
1111
|
jobId: f,
|
|
1112
1112
|
type: "download",
|
|
1113
1113
|
dbName: d,
|
|
@@ -1120,8 +1120,8 @@ const vt = En("bulkJob", () => {
|
|
|
1120
1120
|
startedAt: Date.now(),
|
|
1121
1121
|
hidden: !0
|
|
1122
1122
|
}), new Promise((y, s) => {
|
|
1123
|
-
const x =
|
|
1124
|
-
() =>
|
|
1123
|
+
const x = Ve(
|
|
1124
|
+
() => k.value.find((p) => p.jobId === f),
|
|
1125
1125
|
(p) => {
|
|
1126
1126
|
if (!p) {
|
|
1127
1127
|
x(), s(new Error("PDF generation job not found"));
|
|
@@ -1144,30 +1144,30 @@ const vt = En("bulkJob", () => {
|
|
|
1144
1144
|
);
|
|
1145
1145
|
});
|
|
1146
1146
|
}
|
|
1147
|
-
const U =
|
|
1148
|
-
() =>
|
|
1149
|
-
),
|
|
1150
|
-
return { jobs:
|
|
1151
|
-
}), tt =
|
|
1147
|
+
const U = L(
|
|
1148
|
+
() => k.value.filter((f) => !f.hidden && (f.status === "waiting" || f.status === "active"))
|
|
1149
|
+
), he = L(() => U.value.length > 0);
|
|
1150
|
+
return { jobs: k, addJob: W, updateJob: V, removeJob: i, cancelJob: a, waitForPdfJob: b, activeJobs: U, hasActiveJobs: he };
|
|
1151
|
+
}), tt = S(), Ne = S();
|
|
1152
1152
|
let dt = 0;
|
|
1153
|
-
const mt =
|
|
1154
|
-
function Po(
|
|
1155
|
-
const _ = mn(), C = it(),
|
|
1153
|
+
const mt = S();
|
|
1154
|
+
function Po(k) {
|
|
1155
|
+
const _ = mn(), C = it(), B = qt(), $ = Dt(), z = Pt(), W = xn(), V = Et(), i = S(!1), a = ut(), { t: b } = st(), U = Ge(), he = Gt(), f = vt(), d = S([]), y = S([]), s = S(new Array()), x = S(
|
|
1156
1156
|
new Array()
|
|
1157
|
-
), p =
|
|
1158
|
-
|
|
1159
|
-
), m =
|
|
1157
|
+
), p = S(
|
|
1158
|
+
k != null && k.startDate && (k != null && k.endDate) ? k : pt()
|
|
1159
|
+
), m = L(() => {
|
|
1160
1160
|
const o = new Date(p.value.startDate), u = new Date(p.value.endDate);
|
|
1161
1161
|
return {
|
|
1162
1162
|
start: Pn(o).toISOString(),
|
|
1163
1163
|
end: Rn(u).toISOString()
|
|
1164
1164
|
};
|
|
1165
|
-
}),
|
|
1166
|
-
let
|
|
1167
|
-
function
|
|
1168
|
-
|
|
1165
|
+
}), q = Jt(), D = S(null), T = S([]), me = S(), K = S(!1), Z = S(null);
|
|
1166
|
+
let oe = null;
|
|
1167
|
+
function pe() {
|
|
1168
|
+
oe && (oe.abort(), oe = null, i.value = !1, K.value = !1, Z.value = null);
|
|
1169
1169
|
}
|
|
1170
|
-
function
|
|
1170
|
+
function ke(o) {
|
|
1171
1171
|
const u = C.locations.find((g) => g.dbName === o._locationDbName);
|
|
1172
1172
|
if (!u) return null;
|
|
1173
1173
|
if (u.type === "restaurant") {
|
|
@@ -1177,70 +1177,70 @@ function Po(w) {
|
|
|
1177
1177
|
}
|
|
1178
1178
|
return u;
|
|
1179
1179
|
}
|
|
1180
|
-
function
|
|
1180
|
+
function Ee(o) {
|
|
1181
1181
|
const u = C.locations.find((g) => g.dbName === o._locationDbName);
|
|
1182
1182
|
u && (C._currentLocation = u);
|
|
1183
1183
|
}
|
|
1184
1184
|
async function ze(o, u, g) {
|
|
1185
|
-
const
|
|
1186
|
-
Z.value = { done: 0, total:
|
|
1187
|
-
let R = u.cursor,
|
|
1188
|
-
for (;
|
|
1189
|
-
const
|
|
1185
|
+
const O = d.value.map((A) => ({ dbName: A })), I = O.length;
|
|
1186
|
+
Z.value = { done: 0, total: I };
|
|
1187
|
+
let R = u.cursor, Q = u.retryFailed, H = !0;
|
|
1188
|
+
for (; H && !g.aborted; ) {
|
|
1189
|
+
const A = await U.getBulkPaginatedPurchaseOrders(
|
|
1190
1190
|
{
|
|
1191
|
-
locations:
|
|
1191
|
+
locations: O,
|
|
1192
1192
|
...m.value,
|
|
1193
1193
|
pageSize: 100,
|
|
1194
1194
|
cursor: R,
|
|
1195
|
-
retryFailed:
|
|
1195
|
+
retryFailed: Q
|
|
1196
1196
|
},
|
|
1197
1197
|
g
|
|
1198
1198
|
);
|
|
1199
1199
|
if (g.aborted) return;
|
|
1200
|
-
|
|
1201
|
-
done: Math.max(0,
|
|
1202
|
-
total:
|
|
1200
|
+
Q = void 0, Z.value = {
|
|
1201
|
+
done: Math.max(0, I - A.pendingLocations),
|
|
1202
|
+
total: I
|
|
1203
1203
|
}, o.push(
|
|
1204
|
-
...
|
|
1205
|
-
({ locationDbName:
|
|
1204
|
+
...A.data.map(
|
|
1205
|
+
({ locationDbName: te, ...ne }) => ({ ...ne, _locationDbName: te })
|
|
1206
1206
|
)
|
|
1207
|
-
), y.value = [...o].sort((
|
|
1207
|
+
), y.value = [...o].sort((te, ne) => ne._id.localeCompare(te._id)), T.value = A.failed, me.value = A.cursor, H = A.hasNext, R = A.cursor;
|
|
1208
1208
|
}
|
|
1209
1209
|
}
|
|
1210
1210
|
async function Te() {
|
|
1211
1211
|
const o = y.value.flatMap((u) => u.shipmentIds || []).filter(Boolean);
|
|
1212
|
-
s.value = o.length > 0 ? await
|
|
1212
|
+
s.value = o.length > 0 ? await he.getShipmentsByIds(o) : [];
|
|
1213
1213
|
}
|
|
1214
|
-
async function
|
|
1214
|
+
async function ge(o) {
|
|
1215
1215
|
const u = o.map((g) => {
|
|
1216
|
-
var
|
|
1217
|
-
return ((
|
|
1216
|
+
var O;
|
|
1217
|
+
return ((O = g.request) == null ? void 0 : O.id) ?? "";
|
|
1218
1218
|
}).filter((g) => g);
|
|
1219
1219
|
x.value = u.length > 0 ? await U.readRequestByIds(u) : [];
|
|
1220
1220
|
}
|
|
1221
|
-
const
|
|
1222
|
-
async function
|
|
1223
|
-
if (y.value = [], s.value = [],
|
|
1221
|
+
const Je = 25;
|
|
1222
|
+
async function ve() {
|
|
1223
|
+
if (y.value = [], s.value = [], T.value = [], me.value = void 0, d.value.length === 0)
|
|
1224
1224
|
return;
|
|
1225
|
-
if (d.value.length >
|
|
1225
|
+
if (d.value.length > Je) {
|
|
1226
1226
|
a.open({
|
|
1227
1227
|
title: "Too many locations selected",
|
|
1228
|
-
message: `Select at most ${
|
|
1228
|
+
message: `Select at most ${Je} locations`,
|
|
1229
1229
|
type: "warning"
|
|
1230
1230
|
});
|
|
1231
1231
|
return;
|
|
1232
1232
|
}
|
|
1233
|
-
|
|
1233
|
+
pe();
|
|
1234
1234
|
const o = new AbortController();
|
|
1235
|
-
|
|
1235
|
+
oe = o, i.value = !0;
|
|
1236
1236
|
try {
|
|
1237
|
-
await ze([], {}, o.signal),
|
|
1237
|
+
await ze([], {}, o.signal), T.value.length > 0 && a.open({
|
|
1238
1238
|
title: "Some locations failed to load",
|
|
1239
|
-
message: `Purchase orders could not be loaded for ${
|
|
1239
|
+
message: `Purchase orders could not be loaded for ${T.value.length} location(s)`,
|
|
1240
1240
|
type: "error"
|
|
1241
1241
|
}), await Te();
|
|
1242
|
-
const g = await
|
|
1243
|
-
|
|
1242
|
+
const g = await q.readCurrentLocationLastClosing(!0), O = g == null ? void 0 : g._id;
|
|
1243
|
+
O && (D.value = Dn(O)), await B.awaitFeatureLoaded(() => B.mustUsePoTemplate) && await V.fetchTemplates();
|
|
1244
1244
|
} catch (u) {
|
|
1245
1245
|
if (o.signal.aborted) return;
|
|
1246
1246
|
a.open({
|
|
@@ -1250,17 +1250,17 @@ function Po(w) {
|
|
|
1250
1250
|
type: "error"
|
|
1251
1251
|
});
|
|
1252
1252
|
} finally {
|
|
1253
|
-
|
|
1253
|
+
oe === o && (oe = null, i.value = !1, Z.value = null);
|
|
1254
1254
|
}
|
|
1255
1255
|
}
|
|
1256
|
-
async function
|
|
1257
|
-
if (!
|
|
1258
|
-
|
|
1256
|
+
async function Qe() {
|
|
1257
|
+
if (!me.value || !T.value.some((u) => u.retryable)) return;
|
|
1258
|
+
pe();
|
|
1259
1259
|
const o = new AbortController();
|
|
1260
|
-
|
|
1260
|
+
oe = o, K.value = !0;
|
|
1261
1261
|
try {
|
|
1262
1262
|
const u = [...y.value];
|
|
1263
|
-
if (await ze(u, { cursor:
|
|
1263
|
+
if (await ze(u, { cursor: me.value, retryFailed: !0 }, o.signal), o.signal.aborted) return;
|
|
1264
1264
|
await Te();
|
|
1265
1265
|
} catch (u) {
|
|
1266
1266
|
if (o.signal.aborted) return;
|
|
@@ -1270,68 +1270,68 @@ function Po(w) {
|
|
|
1270
1270
|
type: "error"
|
|
1271
1271
|
});
|
|
1272
1272
|
} finally {
|
|
1273
|
-
|
|
1273
|
+
oe === o && (oe = null, K.value = !1, Z.value = null);
|
|
1274
1274
|
}
|
|
1275
1275
|
}
|
|
1276
|
-
function
|
|
1277
|
-
p.value = { startDate: o, endDate: u },
|
|
1276
|
+
function Ie(o, u) {
|
|
1277
|
+
p.value = { startDate: o, endDate: u }, ve();
|
|
1278
1278
|
}
|
|
1279
|
-
const
|
|
1280
|
-
async function
|
|
1279
|
+
const Ce = S();
|
|
1280
|
+
async function Xe(o) {
|
|
1281
1281
|
const u = d.value[0];
|
|
1282
1282
|
if (u) {
|
|
1283
|
-
const
|
|
1284
|
-
|
|
1283
|
+
const I = C.locations.find((R) => R.dbName === u);
|
|
1284
|
+
I && (C._currentLocation = I);
|
|
1285
1285
|
}
|
|
1286
|
-
function g(
|
|
1286
|
+
function g(I) {
|
|
1287
1287
|
const R = {
|
|
1288
|
-
mode:
|
|
1288
|
+
mode: kt.CREATE,
|
|
1289
1289
|
modelValue: o || void 0,
|
|
1290
1290
|
show: !0,
|
|
1291
|
-
"onUpdate:show"(
|
|
1292
|
-
tt.value.show =
|
|
1291
|
+
"onUpdate:show"(Q) {
|
|
1292
|
+
tt.value.show = Q;
|
|
1293
1293
|
},
|
|
1294
|
-
templateId:
|
|
1295
|
-
lastClosingDate:
|
|
1294
|
+
templateId: I,
|
|
1295
|
+
lastClosingDate: D.value
|
|
1296
1296
|
};
|
|
1297
1297
|
tt.value = R;
|
|
1298
1298
|
}
|
|
1299
|
-
let
|
|
1300
|
-
|
|
1299
|
+
let O;
|
|
1300
|
+
B.mustUsePoTemplate && !(o != null && o.template) ? _.open({
|
|
1301
1301
|
title: "Create transfer",
|
|
1302
1302
|
message: "",
|
|
1303
1303
|
primaryActions: { text: "Select a template", close: !0 },
|
|
1304
1304
|
secondaryActions: { text: "Outlet to Outlet", variant: "secondary", close: !0 }
|
|
1305
1305
|
}).onPrimary(async () => {
|
|
1306
|
-
|
|
1306
|
+
O = await W.getTemplateId(), O && g(O);
|
|
1307
1307
|
}).onSecondary(() => {
|
|
1308
1308
|
g(void 0);
|
|
1309
|
-
}) : g(
|
|
1309
|
+
}) : g(O);
|
|
1310
1310
|
}
|
|
1311
|
-
const
|
|
1312
|
-
async function
|
|
1311
|
+
const je = Nn();
|
|
1312
|
+
async function Le(o, u) {
|
|
1313
1313
|
return o.items != null ? o : await U.getPurchaseOrderById(o._id, void 0, u);
|
|
1314
1314
|
}
|
|
1315
|
-
async function
|
|
1316
|
-
await
|
|
1317
|
-
|
|
1318
|
-
const g = await
|
|
1319
|
-
mode:
|
|
1320
|
-
modelValue:
|
|
1315
|
+
async function Me(o) {
|
|
1316
|
+
await je.run(async (u) => {
|
|
1317
|
+
Ee(o);
|
|
1318
|
+
const g = await Le(o, u), O = {
|
|
1319
|
+
mode: kt.UPDATE,
|
|
1320
|
+
modelValue: Yt(g),
|
|
1321
1321
|
show: !0,
|
|
1322
|
-
"onUpdate:show"(
|
|
1323
|
-
tt.value.show =
|
|
1322
|
+
"onUpdate:show"(I) {
|
|
1323
|
+
tt.value.show = I;
|
|
1324
1324
|
},
|
|
1325
|
-
lastClosingDate:
|
|
1325
|
+
lastClosingDate: D.value
|
|
1326
1326
|
};
|
|
1327
|
-
tt.value =
|
|
1327
|
+
tt.value = O;
|
|
1328
1328
|
});
|
|
1329
1329
|
}
|
|
1330
|
-
async function
|
|
1331
|
-
var
|
|
1332
|
-
if (
|
|
1333
|
-
const u = o, g = $.supplierById[o.supplier._id],
|
|
1334
|
-
if (!
|
|
1330
|
+
async function P(o) {
|
|
1331
|
+
var xe, qe, Se, Re;
|
|
1332
|
+
if (Ee(o), !z.currentBusiness.value) return;
|
|
1333
|
+
const u = o, g = $.supplierById[o.supplier._id], O = (g == null ? void 0 : g.name) ?? o.supplier.name, I = (g == null ? void 0 : g.email) ?? ((xe = o.supplier) == null ? void 0 : xe.email) ?? "";
|
|
1334
|
+
if (!I) {
|
|
1335
1335
|
a.open({
|
|
1336
1336
|
title: b("inventory.transfer.receiveRequest.bulk.emailSendError"),
|
|
1337
1337
|
message: b("inventory.transfer.receiveRequest.bulk.singleEmailNoSupplierEmail"),
|
|
@@ -1339,35 +1339,35 @@ function Po(w) {
|
|
|
1339
1339
|
});
|
|
1340
1340
|
return;
|
|
1341
1341
|
}
|
|
1342
|
-
const R = u._locationDbName,
|
|
1343
|
-
let
|
|
1344
|
-
|
|
1345
|
-
recipientName:
|
|
1346
|
-
email:
|
|
1347
|
-
business:
|
|
1342
|
+
const R = u._locationDbName, Q = o._rev, A = (((qe = C.locations.find((ee) => ee.dbName === R)) == null ? void 0 : qe.name) || R).replace(/[/\\?%*:|"<>]/g, "-").trim().slice(0, 50), te = `PO_${o.seqNumber ?? o._id}`.replace(/[/\\?%*:|"<>]/g, "-").slice(0, 50), ne = `${A}/${te}`, ye = ++dt;
|
|
1343
|
+
let Fe = null;
|
|
1344
|
+
Ne.value = {
|
|
1345
|
+
recipientName: O,
|
|
1346
|
+
email: I,
|
|
1347
|
+
business: z.currentBusiness.value,
|
|
1348
1348
|
pdfLoading: !0,
|
|
1349
1349
|
show: !0,
|
|
1350
|
-
"onUpdate:show"(
|
|
1351
|
-
!
|
|
1350
|
+
"onUpdate:show"(ee) {
|
|
1351
|
+
!ee && Fe && (URL.revokeObjectURL(Fe), Fe = null), Ne.value && (Ne.value = { ...Ne.value, show: ee });
|
|
1352
1352
|
},
|
|
1353
|
-
async onDispatch({ sender:
|
|
1353
|
+
async onDispatch({ sender: ee, message: fe }) {
|
|
1354
1354
|
var Ae;
|
|
1355
1355
|
try {
|
|
1356
|
-
const { jobId:
|
|
1357
|
-
senderEmail:
|
|
1358
|
-
senderName:
|
|
1356
|
+
const { jobId: Pe } = await U.enqueueBulkEmail(R, {
|
|
1357
|
+
senderEmail: ee.emailAddress,
|
|
1358
|
+
senderName: ee.name || ((Ae = z.currentBusiness.value) == null ? void 0 : Ae.name) || "FeedMe Inventory",
|
|
1359
1359
|
items: [
|
|
1360
1360
|
{
|
|
1361
1361
|
subject: `Purchase Order #${o.seqNumber ?? o._id}`,
|
|
1362
|
-
recipientName:
|
|
1363
|
-
recipientEmail:
|
|
1364
|
-
message:
|
|
1365
|
-
pos: [{ poId: o._id, dbName: R, filename:
|
|
1362
|
+
recipientName: O,
|
|
1363
|
+
recipientEmail: I,
|
|
1364
|
+
message: fe.trim() || void 0,
|
|
1365
|
+
pos: [{ poId: o._id, dbName: R, filename: ne }]
|
|
1366
1366
|
}
|
|
1367
1367
|
]
|
|
1368
1368
|
});
|
|
1369
1369
|
f.addJob({
|
|
1370
|
-
jobId:
|
|
1370
|
+
jobId: Pe,
|
|
1371
1371
|
type: "email",
|
|
1372
1372
|
dbName: R,
|
|
1373
1373
|
title: `Email PO #${o.seqNumber ?? o._id}`,
|
|
@@ -1383,30 +1383,30 @@ function Po(w) {
|
|
|
1383
1383
|
message: b("inventory.transfer.receiveRequest.bulk.emailQueued"),
|
|
1384
1384
|
type: "success"
|
|
1385
1385
|
});
|
|
1386
|
-
} catch (
|
|
1387
|
-
throw console.error("Single email enqueue failed",
|
|
1386
|
+
} catch (Pe) {
|
|
1387
|
+
throw console.error("Single email enqueue failed", Pe), a.open({
|
|
1388
1388
|
title: b("inventory.transfer.receiveRequest.bulk.emailSendError"),
|
|
1389
1389
|
message: b("inventory.transfer.receiveRequest.bulk.emailErrorMsg"),
|
|
1390
1390
|
type: "error"
|
|
1391
|
-
}),
|
|
1391
|
+
}), Pe;
|
|
1392
1392
|
}
|
|
1393
1393
|
}
|
|
1394
1394
|
};
|
|
1395
1395
|
try {
|
|
1396
|
-
let
|
|
1397
|
-
"pending" in
|
|
1398
|
-
const
|
|
1399
|
-
|
|
1400
|
-
...
|
|
1401
|
-
pdfBlobUrl:
|
|
1396
|
+
let ee = await U.getPurchaseOrderPdf(o._id, R, Q);
|
|
1397
|
+
"pending" in ee && (await f.waitForPdfJob(ee.jobId, R), ee = await U.getPurchaseOrderPdf(o._id, R, Q));
|
|
1398
|
+
const fe = URL.createObjectURL(ee);
|
|
1399
|
+
ye === dt && ((Se = Ne.value) != null && Se.show) ? (Fe = fe, Ne.value = {
|
|
1400
|
+
...Ne.value,
|
|
1401
|
+
pdfBlobUrl: fe,
|
|
1402
1402
|
pdfLoading: !1
|
|
1403
|
-
}) : URL.revokeObjectURL(
|
|
1404
|
-
} catch (
|
|
1405
|
-
console.error("[promptEmailDialog] PDF preview fetch failed:",
|
|
1403
|
+
}) : URL.revokeObjectURL(fe);
|
|
1404
|
+
} catch (ee) {
|
|
1405
|
+
console.error("[promptEmailDialog] PDF preview fetch failed:", ee), ye === dt && ((Re = Ne.value) != null && Re.show) && (Ne.value = { ...Ne.value, pdfLoading: !1 });
|
|
1406
1406
|
}
|
|
1407
1407
|
}
|
|
1408
|
-
async function
|
|
1409
|
-
if (
|
|
1408
|
+
async function w(o) {
|
|
1409
|
+
if (Ee(o), o.items != null)
|
|
1410
1410
|
return o;
|
|
1411
1411
|
try {
|
|
1412
1412
|
return { ...await U.getPurchaseOrderById(o._id), _locationDbName: o._locationDbName };
|
|
@@ -1414,111 +1414,111 @@ function Po(w) {
|
|
|
1414
1414
|
throw console.error(`Failed to hydrate PO ${o._id} for action`, u), u;
|
|
1415
1415
|
}
|
|
1416
1416
|
}
|
|
1417
|
-
async function
|
|
1418
|
-
var
|
|
1419
|
-
|
|
1420
|
-
const g = await
|
|
1417
|
+
async function M(o, u) {
|
|
1418
|
+
var Q;
|
|
1419
|
+
Ee(o);
|
|
1420
|
+
const g = await je.run((H) => Le(o, H));
|
|
1421
1421
|
if (!g) return;
|
|
1422
|
-
if (u === void 0 && ((
|
|
1422
|
+
if (u === void 0 && ((Q = o.request) != null && Q.id))
|
|
1423
1423
|
try {
|
|
1424
1424
|
u = await U.getLatestPurchaseOrderRequest(o._id);
|
|
1425
|
-
} catch (
|
|
1426
|
-
console.warn("[transfer-details] POR fetch failed for", o._id,
|
|
1425
|
+
} catch (H) {
|
|
1426
|
+
console.warn("[transfer-details] POR fetch failed for", o._id, H);
|
|
1427
1427
|
}
|
|
1428
|
-
const
|
|
1428
|
+
const I = ke(o), R = {
|
|
1429
1429
|
poRequest: u,
|
|
1430
1430
|
purchaseOrder: g,
|
|
1431
|
-
transferTo:
|
|
1432
|
-
transferToDbName:
|
|
1431
|
+
transferTo: I == null ? void 0 : I.name,
|
|
1432
|
+
transferToDbName: I == null ? void 0 : I.dbName,
|
|
1433
1433
|
show: !0,
|
|
1434
1434
|
canResubmit: !1,
|
|
1435
1435
|
canApprove: !1,
|
|
1436
|
-
"onUpdate:show"(
|
|
1437
|
-
|
|
1436
|
+
"onUpdate:show"(H) {
|
|
1437
|
+
Ce.value && (Ce.value = { ...Ce.value, show: H });
|
|
1438
1438
|
},
|
|
1439
|
-
scope:
|
|
1440
|
-
receivedMap:
|
|
1439
|
+
scope: Rt.RECEIVE_REQUEST,
|
|
1440
|
+
receivedMap: tn(g) ?? {},
|
|
1441
1441
|
shipments: s.value
|
|
1442
1442
|
};
|
|
1443
|
-
|
|
1443
|
+
Ce.value = R;
|
|
1444
1444
|
}
|
|
1445
|
-
async function
|
|
1446
|
-
const R =
|
|
1445
|
+
async function Y(o, u, g, O, I) {
|
|
1446
|
+
const R = nn();
|
|
1447
1447
|
i.value = !0;
|
|
1448
1448
|
try {
|
|
1449
1449
|
await R({
|
|
1450
1450
|
operate: {
|
|
1451
1451
|
operation: u,
|
|
1452
1452
|
doc: o,
|
|
1453
|
-
options: (u ===
|
|
1453
|
+
options: (u === We.enum.confirmDraft || u === We.enum.completeReceive) && B.autoReceiveWarehouse ? { autoReceive: !0 } : void 0
|
|
1454
1454
|
},
|
|
1455
1455
|
operateV2: {
|
|
1456
1456
|
_id: o._id,
|
|
1457
1457
|
_rev: o._rev ?? "",
|
|
1458
|
-
action: u ===
|
|
1459
|
-
payloads:
|
|
1458
|
+
action: u === We.enum.submitRequest ? We.enum.confirmDraft : u,
|
|
1459
|
+
payloads: I ?? []
|
|
1460
1460
|
},
|
|
1461
|
-
transferTo:
|
|
1462
|
-
}), await new Promise((
|
|
1463
|
-
} catch (
|
|
1461
|
+
transferTo: O
|
|
1462
|
+
}), await new Promise((Q) => setTimeout(Q, 1e3)), a.open({ title: "Success", message: g, type: "success" });
|
|
1463
|
+
} catch (Q) {
|
|
1464
1464
|
a.open({
|
|
1465
1465
|
title: "Something went wrong",
|
|
1466
1466
|
message: "Please try again.",
|
|
1467
1467
|
type: "error"
|
|
1468
|
-
}), console.error("Error when submitting PO operation", u, o,
|
|
1468
|
+
}), console.error("Error when submitting PO operation", u, o, Q);
|
|
1469
1469
|
} finally {
|
|
1470
|
-
i.value = !1,
|
|
1470
|
+
i.value = !1, ve();
|
|
1471
1471
|
}
|
|
1472
1472
|
}
|
|
1473
|
-
async function
|
|
1474
|
-
|
|
1475
|
-
const
|
|
1476
|
-
if (!
|
|
1473
|
+
async function G(o, u, g) {
|
|
1474
|
+
Ee(o);
|
|
1475
|
+
const O = Xt[u];
|
|
1476
|
+
if (!O) {
|
|
1477
1477
|
a.open({
|
|
1478
1478
|
title: "Something went wrong",
|
|
1479
|
-
message: `Cannot process order: ${
|
|
1479
|
+
message: `Cannot process order: ${jt(u)}`,
|
|
1480
1480
|
type: "error"
|
|
1481
1481
|
});
|
|
1482
1482
|
return;
|
|
1483
1483
|
}
|
|
1484
|
-
const { successMessage:
|
|
1485
|
-
if (u ===
|
|
1486
|
-
let
|
|
1484
|
+
const { successMessage: I, ...R } = O;
|
|
1485
|
+
if (u === We.enum.rejectDraft) {
|
|
1486
|
+
let A = "";
|
|
1487
1487
|
_.open({
|
|
1488
1488
|
title: R.title,
|
|
1489
1489
|
message: R.message,
|
|
1490
1490
|
primaryActions: R.primaryActions,
|
|
1491
|
-
contentComponent:
|
|
1491
|
+
contentComponent: Zt,
|
|
1492
1492
|
contentComponentProps: {
|
|
1493
1493
|
message: R.message,
|
|
1494
|
-
onChange: (
|
|
1494
|
+
onChange: (te) => A = te
|
|
1495
1495
|
}
|
|
1496
1496
|
}).onPrimary(() => {
|
|
1497
|
-
|
|
1498
|
-
{ action: "rejectDraft", payload: { rejectReason:
|
|
1497
|
+
Y(o, u, I, g, [
|
|
1498
|
+
{ action: "rejectDraft", payload: { rejectReason: A } }
|
|
1499
1499
|
]);
|
|
1500
1500
|
});
|
|
1501
1501
|
return;
|
|
1502
1502
|
}
|
|
1503
|
-
const
|
|
1504
|
-
|
|
1503
|
+
const Q = [], H = en();
|
|
1504
|
+
H.init(o), (u === We.enum.confirmDraft || u === We.enum.submitRequest) && Q.push({
|
|
1505
1505
|
action: "confirmDraft",
|
|
1506
|
-
payload:
|
|
1506
|
+
payload: H.controller.value.toConfirmDraftData(Wt())
|
|
1507
1507
|
}), _.open({
|
|
1508
1508
|
title: R.title,
|
|
1509
1509
|
message: R.message,
|
|
1510
1510
|
primaryActions: R.primaryActions
|
|
1511
1511
|
}).onPrimary(() => {
|
|
1512
|
-
|
|
1512
|
+
Y(
|
|
1513
1513
|
o,
|
|
1514
1514
|
u,
|
|
1515
|
-
|
|
1515
|
+
I,
|
|
1516
1516
|
g,
|
|
1517
|
-
|
|
1517
|
+
Q
|
|
1518
1518
|
);
|
|
1519
1519
|
});
|
|
1520
1520
|
}
|
|
1521
|
-
async function
|
|
1521
|
+
async function le() {
|
|
1522
1522
|
_.open({
|
|
1523
1523
|
title: "Upload Transfer",
|
|
1524
1524
|
primaryActions: { text: "Xilnex transfer note", close: !0 },
|
|
@@ -1533,13 +1533,13 @@ function Po(w) {
|
|
|
1533
1533
|
mt.value = o;
|
|
1534
1534
|
});
|
|
1535
1535
|
}
|
|
1536
|
-
async function
|
|
1536
|
+
async function Oe() {
|
|
1537
1537
|
const { start: o, end: u } = m.value;
|
|
1538
1538
|
return (await Promise.allSettled(
|
|
1539
|
-
d.value.map(async (
|
|
1540
|
-
)).flatMap((
|
|
1539
|
+
d.value.map(async (O) => (await U.getPurchaseOrders({ start: o, end: u, dbName: O })).map((R) => ({ ...R, _locationDbName: O })))
|
|
1540
|
+
)).flatMap((O) => O.status === "fulfilled" ? O.value : []);
|
|
1541
1541
|
}
|
|
1542
|
-
async function
|
|
1542
|
+
async function _e(o) {
|
|
1543
1543
|
return f.activeJobs.find((g) => g.type === o) ? new Promise((g) => {
|
|
1544
1544
|
_.open({
|
|
1545
1545
|
title: b("inventory.transfer.receiveRequest.bulk.activeJobWarningTitle"),
|
|
@@ -1549,10 +1549,10 @@ function Po(w) {
|
|
|
1549
1549
|
}).onPrimary(() => g(!0)).onSecondary(() => g(!1));
|
|
1550
1550
|
}) : !0;
|
|
1551
1551
|
}
|
|
1552
|
-
async function
|
|
1553
|
-
if (!await
|
|
1552
|
+
async function J(o) {
|
|
1553
|
+
if (!await _e("download")) return;
|
|
1554
1554
|
const { startDate: u, endDate: g } = p.value;
|
|
1555
|
-
if (
|
|
1555
|
+
if (Ye(g).diff(Ye(u), "month", !0) > 2) {
|
|
1556
1556
|
a.open({
|
|
1557
1557
|
title: b("inventory.transfer.receiveRequest.bulk.downloadError"),
|
|
1558
1558
|
message: b("inventory.transfer.receiveRequest.bulk.downloadLimitExceeded"),
|
|
@@ -1568,17 +1568,17 @@ function Po(w) {
|
|
|
1568
1568
|
});
|
|
1569
1569
|
return;
|
|
1570
1570
|
}
|
|
1571
|
-
const
|
|
1572
|
-
var
|
|
1573
|
-
const
|
|
1574
|
-
return { poId: R._id, dbName: R._locationDbName, filename:
|
|
1575
|
-
}),
|
|
1571
|
+
const O = o.map((R) => {
|
|
1572
|
+
var ne;
|
|
1573
|
+
const H = (((ne = C.locations.find((ye) => ye.dbName === R._locationDbName)) == null ? void 0 : ne.name) || R._locationDbName).replace(/[/\\?%*:|"<>]/g, "-").trim().slice(0, 50), A = `PO_${R.seqNumber || R._id}`.replace(/[/\\?%*:|"<>]/g, "-").slice(0, 50), te = `${H}/${A}`;
|
|
1574
|
+
return { poId: R._id, dbName: R._locationDbName, filename: te, rev: R._rev };
|
|
1575
|
+
}), I = d.value[0];
|
|
1576
1576
|
try {
|
|
1577
|
-
const { jobId: R, fromCache:
|
|
1577
|
+
const { jobId: R, fromCache: Q } = await U.enqueueBulkDownload(I, { items: O });
|
|
1578
1578
|
f.addJob({
|
|
1579
1579
|
jobId: R,
|
|
1580
1580
|
type: "download",
|
|
1581
|
-
dbName:
|
|
1581
|
+
dbName: I,
|
|
1582
1582
|
title: `Download All (${o.length} POs)`,
|
|
1583
1583
|
status: "waiting",
|
|
1584
1584
|
progress: 0,
|
|
@@ -1586,7 +1586,7 @@ function Po(w) {
|
|
|
1586
1586
|
total: o.length,
|
|
1587
1587
|
errorCount: 0,
|
|
1588
1588
|
startedAt: Date.now()
|
|
1589
|
-
}),
|
|
1589
|
+
}), Q ? a.open({
|
|
1590
1590
|
title: b("inventory.transfer.receiveRequest.bulk.downloadCachedTitle"),
|
|
1591
1591
|
message: b("inventory.transfer.receiveRequest.bulk.downloadCachedMsg"),
|
|
1592
1592
|
type: "info"
|
|
@@ -1603,14 +1603,14 @@ function Po(w) {
|
|
|
1603
1603
|
});
|
|
1604
1604
|
}
|
|
1605
1605
|
}
|
|
1606
|
-
async function
|
|
1607
|
-
var
|
|
1608
|
-
if (!await
|
|
1606
|
+
async function ce(o) {
|
|
1607
|
+
var fe, Ae, Pe;
|
|
1608
|
+
if (!await _e("email")) return;
|
|
1609
1609
|
const u = [
|
|
1610
1610
|
_t.enum.RECEIVING,
|
|
1611
1611
|
_t.enum.PROCESSING
|
|
1612
1612
|
// PARTIAL_RECEIVED display status maps from PROCESSING
|
|
1613
|
-
], g = o.filter((
|
|
1613
|
+
], g = o.filter((F) => u.includes(F.status));
|
|
1614
1614
|
if (g.length === 0) {
|
|
1615
1615
|
a.open({
|
|
1616
1616
|
title: b("inventory.transfer.receiveRequest.bulk.emailSendError"),
|
|
@@ -1619,58 +1619,58 @@ function Po(w) {
|
|
|
1619
1619
|
});
|
|
1620
1620
|
return;
|
|
1621
1621
|
}
|
|
1622
|
-
if (!((
|
|
1623
|
-
await
|
|
1624
|
-
const
|
|
1622
|
+
if (!((fe = z.currentBusiness.value) != null && fe._id)) return;
|
|
1623
|
+
await ge(g);
|
|
1624
|
+
const O = vn(), I = gn(), R = /* @__PURE__ */ new Map(), Q = C.locations.map((F) => F.dbName), H = `business_${z.currentBusiness.value._id}`, A = [.../* @__PURE__ */ new Set([...Q, H])];
|
|
1625
1625
|
await Promise.allSettled(
|
|
1626
|
-
|
|
1626
|
+
A.map(async (F) => {
|
|
1627
1627
|
try {
|
|
1628
|
-
(await
|
|
1629
|
-
const
|
|
1630
|
-
(!
|
|
1628
|
+
(await I.readSuppliersByDbName(F)).forEach((ie) => {
|
|
1629
|
+
const ue = R.get(ie._id);
|
|
1630
|
+
(!ue || !ue.email && ie.email) && R.set(ie._id, ie);
|
|
1631
1631
|
});
|
|
1632
|
-
} catch (
|
|
1633
|
-
console.warn("[emailAll] fetch failed for",
|
|
1632
|
+
} catch (ae) {
|
|
1633
|
+
console.warn("[emailAll] fetch failed for", F, ae);
|
|
1634
1634
|
}
|
|
1635
1635
|
})
|
|
1636
1636
|
);
|
|
1637
|
-
function
|
|
1638
|
-
var
|
|
1639
|
-
const
|
|
1640
|
-
return (
|
|
1641
|
-
}
|
|
1642
|
-
const
|
|
1643
|
-
for (const
|
|
1644
|
-
|
|
1645
|
-
const
|
|
1637
|
+
function te(F) {
|
|
1638
|
+
var ie;
|
|
1639
|
+
const ae = R.get(F.supplier._id);
|
|
1640
|
+
return (ae == null ? void 0 : ae.email) || ((ie = F.supplier) == null ? void 0 : ie.email);
|
|
1641
|
+
}
|
|
1642
|
+
const ne = [], ye = [];
|
|
1643
|
+
for (const F of g)
|
|
1644
|
+
te(F) ? ne.push(F) : ye.push(F);
|
|
1645
|
+
const Fe = De(
|
|
1646
1646
|
"p",
|
|
1647
1647
|
{ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
|
|
1648
1648
|
b("inventory.transfer.receiveRequest.bulk.emailAllowedStatusInfo")
|
|
1649
1649
|
);
|
|
1650
|
-
if (
|
|
1651
|
-
const
|
|
1652
|
-
for (const
|
|
1653
|
-
const n =
|
|
1654
|
-
|
|
1650
|
+
if (ye.length > 0) {
|
|
1651
|
+
const F = /* @__PURE__ */ new Map();
|
|
1652
|
+
for (const ue of ye) {
|
|
1653
|
+
const n = ue.supplier._id;
|
|
1654
|
+
F.has(n) || F.set(n, { supplierName: ue.supplier.name, pos: [] }), F.get(n).pos.push(ue);
|
|
1655
1655
|
}
|
|
1656
|
-
const
|
|
1657
|
-
|
|
1658
|
-
|
|
1656
|
+
const ae = De("div", { class: "flex flex-col gap-12" }, [
|
|
1657
|
+
Fe,
|
|
1658
|
+
De(
|
|
1659
1659
|
"p",
|
|
1660
1660
|
{ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
1661
|
-
b("inventory.transfer.receiveRequest.bulk.missingEmailMsg", [
|
|
1661
|
+
b("inventory.transfer.receiveRequest.bulk.missingEmailMsg", [ye.length])
|
|
1662
1662
|
),
|
|
1663
|
-
|
|
1663
|
+
De(
|
|
1664
1664
|
"div",
|
|
1665
1665
|
{ class: "flex flex-col gap-4 max-h-[320px] overflow-y-auto rounded-md border border-fm-color-neutral-gray-100 p-8" },
|
|
1666
|
-
[...
|
|
1667
|
-
({ supplierName:
|
|
1668
|
-
|
|
1669
|
-
|
|
1666
|
+
[...F.values()].map(
|
|
1667
|
+
({ supplierName: ue, pos: n }) => De("div", { class: "flex flex-col gap-2 py-6 border-b border-fm-color-neutral-gray-100 last:border-0" }, [
|
|
1668
|
+
De("div", { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" }, ue),
|
|
1669
|
+
De(
|
|
1670
1670
|
"div",
|
|
1671
1671
|
{ class: "flex flex-wrap gap-4" },
|
|
1672
1672
|
n.map(
|
|
1673
|
-
(l) =>
|
|
1673
|
+
(l) => De("span", {
|
|
1674
1674
|
class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100 rounded px-6 py-2"
|
|
1675
1675
|
}, `PO #${l.seqNumber ?? l._id}`)
|
|
1676
1676
|
)
|
|
@@ -1678,52 +1678,52 @@ function Po(w) {
|
|
|
1678
1678
|
])
|
|
1679
1679
|
)
|
|
1680
1680
|
),
|
|
1681
|
-
|
|
1681
|
+
De(
|
|
1682
1682
|
"p",
|
|
1683
1683
|
{ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
|
|
1684
|
-
b("inventory.transfer.receiveRequest.bulk.emailWillSendCount", [
|
|
1684
|
+
b("inventory.transfer.receiveRequest.bulk.emailWillSendCount", [ne.length, g.length])
|
|
1685
1685
|
),
|
|
1686
|
-
|
|
1686
|
+
De(
|
|
1687
1687
|
"p",
|
|
1688
1688
|
{ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
|
|
1689
1689
|
b("inventory.transfer.receiveRequest.bulk.missingEmailConfirm")
|
|
1690
1690
|
)
|
|
1691
1691
|
]);
|
|
1692
|
-
if (!await new Promise((
|
|
1692
|
+
if (!await new Promise((ue) => {
|
|
1693
1693
|
_.open({
|
|
1694
1694
|
title: b("inventory.transfer.receiveRequest.bulk.missingEmailTitle"),
|
|
1695
|
-
contentComponent:
|
|
1695
|
+
contentComponent: ae,
|
|
1696
1696
|
contentComponentProps: {},
|
|
1697
1697
|
primaryActions: {
|
|
1698
1698
|
text: b("inventory.transfer.receiveRequest.bulk.skipAndContinue"),
|
|
1699
1699
|
close: !0
|
|
1700
1700
|
},
|
|
1701
1701
|
secondaryActions: { text: b("inventory.common.cancel"), close: !0 }
|
|
1702
|
-
}).onPrimary(() =>
|
|
1702
|
+
}).onPrimary(() => ue(!0)).onSecondary(() => ue(!1));
|
|
1703
1703
|
})) return;
|
|
1704
1704
|
} else {
|
|
1705
|
-
const
|
|
1706
|
-
|
|
1707
|
-
|
|
1705
|
+
const F = De("div", { class: "flex flex-col gap-12" }, [
|
|
1706
|
+
Fe,
|
|
1707
|
+
De(
|
|
1708
1708
|
"p",
|
|
1709
1709
|
{ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
1710
|
-
b("inventory.transfer.receiveRequest.bulk.emailAllConfirmMsg", [
|
|
1710
|
+
b("inventory.transfer.receiveRequest.bulk.emailAllConfirmMsg", [ne.length])
|
|
1711
1711
|
)
|
|
1712
1712
|
]);
|
|
1713
|
-
if (!await new Promise((
|
|
1713
|
+
if (!await new Promise((ie) => {
|
|
1714
1714
|
_.open({
|
|
1715
1715
|
title: b("inventory.transfer.receiveRequest.bulk.missingEmailTitle"),
|
|
1716
|
-
contentComponent:
|
|
1716
|
+
contentComponent: F,
|
|
1717
1717
|
contentComponentProps: {},
|
|
1718
1718
|
primaryActions: {
|
|
1719
1719
|
text: b("inventory.transfer.receiveRequest.bulk.emailConfirm"),
|
|
1720
1720
|
close: !0
|
|
1721
1721
|
},
|
|
1722
1722
|
secondaryActions: { text: b("inventory.common.cancel"), close: !0 }
|
|
1723
|
-
}).onPrimary(() =>
|
|
1723
|
+
}).onPrimary(() => ie(!0)).onSecondary(() => ie(!1));
|
|
1724
1724
|
})) return;
|
|
1725
1725
|
}
|
|
1726
|
-
if (
|
|
1726
|
+
if (ne.length === 0) {
|
|
1727
1727
|
a.open({
|
|
1728
1728
|
title: b("inventory.transfer.receiveRequest.bulk.emailSendError"),
|
|
1729
1729
|
message: b("inventory.transfer.receiveRequest.bulk.noEmailsToSend"),
|
|
@@ -1731,9 +1731,9 @@ function Po(w) {
|
|
|
1731
1731
|
});
|
|
1732
1732
|
return;
|
|
1733
1733
|
}
|
|
1734
|
-
let
|
|
1734
|
+
let xe = [];
|
|
1735
1735
|
try {
|
|
1736
|
-
|
|
1736
|
+
xe = await O.getEmailList(z.currentBusiness.value._id);
|
|
1737
1737
|
} catch {
|
|
1738
1738
|
a.open({
|
|
1739
1739
|
title: b("inventory.transfer.receiveRequest.bulk.emailSendError"),
|
|
@@ -1742,8 +1742,8 @@ function Po(w) {
|
|
|
1742
1742
|
});
|
|
1743
1743
|
return;
|
|
1744
1744
|
}
|
|
1745
|
-
const
|
|
1746
|
-
if (!
|
|
1745
|
+
const qe = xe.find((F) => F.verified);
|
|
1746
|
+
if (!qe) {
|
|
1747
1747
|
a.open({
|
|
1748
1748
|
title: b("inventory.transfer.receiveRequest.bulk.emailSendError"),
|
|
1749
1749
|
message: b("inventory.transfer.receiveRequest.bulk.noEmailSender"),
|
|
@@ -1751,39 +1751,39 @@ function Po(w) {
|
|
|
1751
1751
|
});
|
|
1752
1752
|
return;
|
|
1753
1753
|
}
|
|
1754
|
-
const
|
|
1755
|
-
for (const
|
|
1756
|
-
const
|
|
1757
|
-
if (!
|
|
1758
|
-
const
|
|
1759
|
-
r ? (r.pos.push(l), r.seqNumbers.push(
|
|
1760
|
-
recipientName:
|
|
1761
|
-
recipientEmail:
|
|
1754
|
+
const Se = /* @__PURE__ */ new Map();
|
|
1755
|
+
for (const F of ne) {
|
|
1756
|
+
const ae = te(F);
|
|
1757
|
+
if (!ae) continue;
|
|
1758
|
+
const ue = (((Ae = C.locations.find((X) => X.dbName === F._locationDbName)) == null ? void 0 : Ae.name) || F._locationDbName).replace(/[/\\?%*:|"<>]/g, "-").trim().slice(0, 50), n = `PO_${F.seqNumber || F._id}`.replace(/[/\\?%*:|"<>]/g, "-").slice(0, 50), l = { poId: F._id, dbName: F._locationDbName, filename: `${ue}/${n}` }, r = Se.get(ae);
|
|
1759
|
+
r ? (r.pos.push(l), r.seqNumbers.push(F.seqNumber ?? F._id)) : Se.set(ae, {
|
|
1760
|
+
recipientName: F.supplier.name,
|
|
1761
|
+
recipientEmail: ae,
|
|
1762
1762
|
pos: [l],
|
|
1763
|
-
seqNumbers: [
|
|
1763
|
+
seqNumbers: [F.seqNumber ?? F._id]
|
|
1764
1764
|
});
|
|
1765
1765
|
}
|
|
1766
|
-
const
|
|
1767
|
-
subject:
|
|
1768
|
-
recipientName:
|
|
1769
|
-
recipientEmail:
|
|
1770
|
-
pos:
|
|
1771
|
-
})),
|
|
1766
|
+
const Re = [...Se.values()].map((F) => ({
|
|
1767
|
+
subject: F.pos.length > 1 ? `Purchase Orders (${F.pos.length})` : `Purchase Order #${F.seqNumbers[0]}`,
|
|
1768
|
+
recipientName: F.recipientName,
|
|
1769
|
+
recipientEmail: F.recipientEmail,
|
|
1770
|
+
pos: F.pos
|
|
1771
|
+
})), ee = d.value[0];
|
|
1772
1772
|
try {
|
|
1773
|
-
const { jobId:
|
|
1774
|
-
senderEmail:
|
|
1775
|
-
senderName:
|
|
1776
|
-
items:
|
|
1773
|
+
const { jobId: F } = await U.enqueueBulkEmail(ee, {
|
|
1774
|
+
senderEmail: qe.emailAddress,
|
|
1775
|
+
senderName: qe.name || ((Pe = z.currentBusiness.value) == null ? void 0 : Pe.name) || "FeedMe Inventory",
|
|
1776
|
+
items: Re
|
|
1777
1777
|
});
|
|
1778
1778
|
f.addJob({
|
|
1779
|
-
jobId:
|
|
1779
|
+
jobId: F,
|
|
1780
1780
|
type: "email",
|
|
1781
|
-
dbName:
|
|
1782
|
-
title: `Email All (${
|
|
1781
|
+
dbName: ee,
|
|
1782
|
+
title: `Email All (${Re.length} supplier${Re.length === 1 ? "" : "s"}, ${ne.length} POs)`,
|
|
1783
1783
|
status: "waiting",
|
|
1784
1784
|
progress: 0,
|
|
1785
1785
|
current: 0,
|
|
1786
|
-
total:
|
|
1786
|
+
total: Re.length,
|
|
1787
1787
|
errorCount: 0,
|
|
1788
1788
|
startedAt: Date.now()
|
|
1789
1789
|
}), a.open({
|
|
@@ -1791,8 +1791,8 @@ function Po(w) {
|
|
|
1791
1791
|
message: b("inventory.transfer.receiveRequest.bulk.emailQueued"),
|
|
1792
1792
|
type: "success"
|
|
1793
1793
|
});
|
|
1794
|
-
} catch (
|
|
1795
|
-
console.error("Bulk email enqueue failed",
|
|
1794
|
+
} catch (F) {
|
|
1795
|
+
console.error("Bulk email enqueue failed", F), a.open({
|
|
1796
1796
|
title: b("inventory.transfer.receiveRequest.bulk.emailSendError"),
|
|
1797
1797
|
message: b("inventory.transfer.receiveRequest.bulk.emailErrorMsg"),
|
|
1798
1798
|
type: "error"
|
|
@@ -1804,59 +1804,59 @@ function Po(w) {
|
|
|
1804
1804
|
purchaseOrders: y,
|
|
1805
1805
|
shipments: s,
|
|
1806
1806
|
purchaseRequests: x,
|
|
1807
|
-
rowAction:
|
|
1808
|
-
updateDateRange:
|
|
1809
|
-
fetchData:
|
|
1810
|
-
failedLocations:
|
|
1811
|
-
retryFailedLocations:
|
|
1812
|
-
retryingFailed:
|
|
1807
|
+
rowAction: je,
|
|
1808
|
+
updateDateRange: Ie,
|
|
1809
|
+
fetchData: ve,
|
|
1810
|
+
failedLocations: T,
|
|
1811
|
+
retryFailedLocations: Qe,
|
|
1812
|
+
retryingFailed: K,
|
|
1813
1813
|
fetchProgress: Z,
|
|
1814
|
-
abortOngoingBrowse:
|
|
1815
|
-
fetchFullPurchaseOrders:
|
|
1814
|
+
abortOngoingBrowse: pe,
|
|
1815
|
+
fetchFullPurchaseOrders: Oe,
|
|
1816
1816
|
loading: i,
|
|
1817
1817
|
transferDialogProps: tt,
|
|
1818
|
-
promptCreateTransferDialog:
|
|
1819
|
-
promptUpdateTransferDialog:
|
|
1820
|
-
transferDetailsProps:
|
|
1821
|
-
promptShowTransferDetails:
|
|
1822
|
-
resolvePO:
|
|
1823
|
-
submitAction:
|
|
1818
|
+
promptCreateTransferDialog: Xe,
|
|
1819
|
+
promptUpdateTransferDialog: Me,
|
|
1820
|
+
transferDetailsProps: Ce,
|
|
1821
|
+
promptShowTransferDetails: M,
|
|
1822
|
+
resolvePO: w,
|
|
1823
|
+
submitAction: G,
|
|
1824
1824
|
xilnexImportDialogProps: mt,
|
|
1825
|
-
promptUploadTransferDialog:
|
|
1826
|
-
emailDialogProps:
|
|
1827
|
-
promptEmailDialog:
|
|
1828
|
-
downloadAll:
|
|
1829
|
-
emailAll:
|
|
1830
|
-
lastClosingDate:
|
|
1825
|
+
promptUploadTransferDialog: le,
|
|
1826
|
+
emailDialogProps: Ne,
|
|
1827
|
+
promptEmailDialog: P,
|
|
1828
|
+
downloadAll: J,
|
|
1829
|
+
emailAll: ce,
|
|
1830
|
+
lastClosingDate: D
|
|
1831
1831
|
};
|
|
1832
1832
|
}
|
|
1833
|
-
function Do(
|
|
1834
|
-
const
|
|
1835
|
-
if (!
|
|
1836
|
-
const $ = _.find((
|
|
1833
|
+
function Do(k, _, C) {
|
|
1834
|
+
const B = k._locationDbName;
|
|
1835
|
+
if (!B) return null;
|
|
1836
|
+
const $ = _.find((z) => z.dbName === B);
|
|
1837
1837
|
if (!$) return null;
|
|
1838
1838
|
if ($.type === "restaurant") {
|
|
1839
|
-
const
|
|
1840
|
-
if (
|
|
1839
|
+
const z = C($.doc._id);
|
|
1840
|
+
if (z !== null) return { ...$, doc: z };
|
|
1841
1841
|
}
|
|
1842
1842
|
return $;
|
|
1843
1843
|
}
|
|
1844
|
-
function Eo(
|
|
1845
|
-
return _.find((C) => C.purchaseOrderId ===
|
|
1844
|
+
function Eo(k, _) {
|
|
1845
|
+
return _.find((C) => C.purchaseOrderId === k._id);
|
|
1846
1846
|
}
|
|
1847
|
-
function qo(
|
|
1848
|
-
const C = it(), { t:
|
|
1847
|
+
function qo(k, _) {
|
|
1848
|
+
const C = it(), { t: B } = st(), $ = Ge(), z = ut(), W = vt(), V = S(!1), i = S(!1), a = S(null);
|
|
1849
1849
|
async function b(f, d) {
|
|
1850
1850
|
if (f !== rt.PrintPdf) return !1;
|
|
1851
1851
|
const s = d._locationDbName, x = d._rev;
|
|
1852
1852
|
a.value && (URL.revokeObjectURL(a.value), a.value = null), i.value = !0, V.value = !0;
|
|
1853
1853
|
try {
|
|
1854
1854
|
let p = await $.getPurchaseOrderPdf(d._id, s, x);
|
|
1855
|
-
"pending" in p && (await
|
|
1855
|
+
"pending" in p && (await W.waitForPdfJob(p.jobId, s), p = await $.getPurchaseOrderPdf(d._id, s, x)), a.value = URL.createObjectURL(p);
|
|
1856
1856
|
} catch {
|
|
1857
|
-
V.value = !1,
|
|
1858
|
-
title:
|
|
1859
|
-
message:
|
|
1857
|
+
V.value = !1, z.open({
|
|
1858
|
+
title: B("inventory.common.somethingWentWrong"),
|
|
1859
|
+
message: B("inventory.transfer.receiveRequest.bulk.pdfUnavailableMsg"),
|
|
1860
1860
|
type: "error"
|
|
1861
1861
|
});
|
|
1862
1862
|
} finally {
|
|
@@ -1864,9 +1864,9 @@ function qo(w, _) {
|
|
|
1864
1864
|
}
|
|
1865
1865
|
return !0;
|
|
1866
1866
|
}
|
|
1867
|
-
const U =
|
|
1868
|
-
|
|
1869
|
-
|
|
1867
|
+
const U = sn(
|
|
1868
|
+
Rt.RECEIVE_REQUEST,
|
|
1869
|
+
k,
|
|
1870
1870
|
_,
|
|
1871
1871
|
{
|
|
1872
1872
|
// Bulk rows are summaries (no items) — print needs the full doc from the
|
|
@@ -1875,7 +1875,7 @@ function qo(w, _) {
|
|
|
1875
1875
|
// cancelled) becomes null, which aborts the print.
|
|
1876
1876
|
fetchFullPo: async (f) => {
|
|
1877
1877
|
const d = f._locationDbName;
|
|
1878
|
-
return await
|
|
1878
|
+
return await k.rowAction.run(
|
|
1879
1879
|
(s) => $.getPurchaseOrderById(f._id, d, s)
|
|
1880
1880
|
) ?? null;
|
|
1881
1881
|
},
|
|
@@ -1884,7 +1884,7 @@ function qo(w, _) {
|
|
|
1884
1884
|
C.locations,
|
|
1885
1885
|
C.locationRestaurantFromCore
|
|
1886
1886
|
),
|
|
1887
|
-
resolvePurchaseRequest: (f) => Eo(f,
|
|
1887
|
+
resolvePurchaseRequest: (f) => Eo(f, k.purchaseRequests.value),
|
|
1888
1888
|
// Exclude both legacy Print and Print (Beta) — the bulk listing uses
|
|
1889
1889
|
// Lambda-generated PDF via PrintPdf instead.
|
|
1890
1890
|
excludeRowActions: [rt.Print, rt.PrintCustom],
|
|
@@ -1895,10 +1895,10 @@ function qo(w, _) {
|
|
|
1895
1895
|
}
|
|
1896
1896
|
);
|
|
1897
1897
|
return {
|
|
1898
|
-
columnDefs:
|
|
1898
|
+
columnDefs: L(() => {
|
|
1899
1899
|
const f = U.columnDefs.value, d = {
|
|
1900
1900
|
id: "location",
|
|
1901
|
-
header: () =>
|
|
1901
|
+
header: () => B("inventory.transfer.receiveRequest.bulk.locationColumn"),
|
|
1902
1902
|
cell(s) {
|
|
1903
1903
|
const x = s.row.original._locationDbName, p = C.locations.find((m) => m.dbName === x);
|
|
1904
1904
|
return p ? `${p.name} (${p.doc.profile.code ?? "--"})` : x;
|
|
@@ -1919,7 +1919,7 @@ const No = {
|
|
|
1919
1919
|
}, $o = {
|
|
1920
1920
|
key: 1,
|
|
1921
1921
|
class: "bg-white rounded-lg shadow-xl border border-fm-color-neutral-gray-100 w-[360px] max-h-[480px] flex flex-col overflow-hidden"
|
|
1922
|
-
},
|
|
1922
|
+
}, Oo = { class: "flex items-center justify-between px-16 py-12 border-b border-fm-color-neutral-gray-100" }, Ao = { class: "fm-typo-en-title-sm-600" }, Bo = { class: "overflow-y-auto flex-1 divide-y divide-fm-color-neutral-gray-100" }, To = { class: "flex items-start justify-between gap-8" }, Io = { class: "flex flex-col gap-2" }, Lo = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-primary line-clamp-1" }, zo = { class: "fm-typo-en-body-xs-400 text-fm-color-typo-secondary capitalize" }, Mo = { class: "flex items-center gap-4" }, Uo = ["disabled", "onClick"], Vo = ["disabled", "onClick"], Jo = ["onClick"], jo = {
|
|
1923
1923
|
key: 0,
|
|
1924
1924
|
class: "flex flex-col gap-4"
|
|
1925
1925
|
}, Wo = { class: "w-full bg-fm-color-neutral-gray-200 rounded-full h-[3px]" }, Yo = { class: "flex justify-between fm-typo-en-body-xs-400 text-fm-color-typo-secondary" }, Qo = {
|
|
@@ -1942,17 +1942,17 @@ const No = {
|
|
|
1942
1942
|
class: "flex items-center gap-[5px] text-[11px] leading-none text-fm-color-typo-secondary"
|
|
1943
1943
|
}, sa = /* @__PURE__ */ nt({
|
|
1944
1944
|
__name: "BulkJobProgressPanel",
|
|
1945
|
-
setup(
|
|
1946
|
-
const { t: _ } =
|
|
1945
|
+
setup(k) {
|
|
1946
|
+
const { t: _ } = On(), C = vt(), B = L(() => C.jobs.filter((s) => !s.hidden)), $ = Ge(), z = S(!1), W = S(null);
|
|
1947
1947
|
function V(s) {
|
|
1948
|
-
|
|
1948
|
+
z.value && W.value && !W.value.contains(s.target) && (z.value = !1);
|
|
1949
1949
|
}
|
|
1950
|
-
|
|
1950
|
+
Tt(() => {
|
|
1951
1951
|
document.addEventListener("click", V, !0);
|
|
1952
|
-
}),
|
|
1952
|
+
}), It(() => {
|
|
1953
1953
|
document.removeEventListener("click", V, !0);
|
|
1954
1954
|
});
|
|
1955
|
-
const i =
|
|
1955
|
+
const i = S(/* @__PURE__ */ new Set()), a = S(/* @__PURE__ */ new Set());
|
|
1956
1956
|
async function b(s) {
|
|
1957
1957
|
if (!i.value.has(s.jobId)) {
|
|
1958
1958
|
i.value = /* @__PURE__ */ new Set([...i.value, s.jobId]);
|
|
@@ -1976,7 +1976,7 @@ const No = {
|
|
|
1976
1976
|
}
|
|
1977
1977
|
}
|
|
1978
1978
|
}
|
|
1979
|
-
function
|
|
1979
|
+
function he(s) {
|
|
1980
1980
|
C.removeJob(s);
|
|
1981
1981
|
}
|
|
1982
1982
|
function f(s) {
|
|
@@ -1990,32 +1990,32 @@ const No = {
|
|
|
1990
1990
|
return s < 1024 ? `${s} B` : s < 1024 * 1024 ? `${(s / 1024).toFixed(1)} KB` : `${(s / (1024 * 1024)).toFixed(1)} MB`;
|
|
1991
1991
|
}
|
|
1992
1992
|
return (s, x) => {
|
|
1993
|
-
const p =
|
|
1994
|
-
return c(),
|
|
1995
|
-
|
|
1993
|
+
const p = $e("FmIcon");
|
|
1994
|
+
return c(), de(lt, { to: "body" }, [
|
|
1995
|
+
B.value.length > 0 ? (c(), h("div", {
|
|
1996
1996
|
key: 0,
|
|
1997
1997
|
ref_key: "panelRef",
|
|
1998
|
-
ref:
|
|
1998
|
+
ref: W,
|
|
1999
1999
|
class: "fixed bottom-24 right-24 z-[9998] flex flex-col items-end gap-8"
|
|
2000
2000
|
}, [
|
|
2001
|
-
|
|
2001
|
+
z.value ? E("", !0) : (c(), h("button", {
|
|
2002
2002
|
key: 0,
|
|
2003
2003
|
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",
|
|
2004
|
-
onClick: x[0] || (x[0] = (m) =>
|
|
2004
|
+
onClick: x[0] || (x[0] = (m) => z.value = !0)
|
|
2005
2005
|
}, [
|
|
2006
2006
|
N(p, {
|
|
2007
2007
|
name: "cloud_upload",
|
|
2008
2008
|
size: "sm"
|
|
2009
2009
|
}),
|
|
2010
2010
|
e("span", null, v(t(_)("inventory.transfer.receiveRequest.bulk.backgroundJobsTitle")), 1),
|
|
2011
|
-
t(C).activeJobs.length > 0 ? (c(), h("span", No, v(t(C).activeJobs.length), 1)) :
|
|
2011
|
+
t(C).activeJobs.length > 0 ? (c(), h("span", No, v(t(C).activeJobs.length), 1)) : E("", !0)
|
|
2012
2012
|
])),
|
|
2013
|
-
|
|
2014
|
-
e("div",
|
|
2015
|
-
e("span",
|
|
2013
|
+
z.value ? (c(), h("div", $o, [
|
|
2014
|
+
e("div", Oo, [
|
|
2015
|
+
e("span", Ao, v(t(_)("inventory.transfer.receiveRequest.bulk.backgroundJobsTitle")), 1),
|
|
2016
2016
|
e("button", {
|
|
2017
2017
|
"aria-label": "Collapse",
|
|
2018
|
-
onClick: x[1] || (x[1] = (m) =>
|
|
2018
|
+
onClick: x[1] || (x[1] = (m) => z.value = !1),
|
|
2019
2019
|
class: "text-fm-color-typo-secondary hover:text-fm-color-typo-primary"
|
|
2020
2020
|
}, [
|
|
2021
2021
|
N(p, {
|
|
@@ -2025,8 +2025,8 @@ const No = {
|
|
|
2025
2025
|
])
|
|
2026
2026
|
]),
|
|
2027
2027
|
e("div", Bo, [
|
|
2028
|
-
(c(!0), h(
|
|
2029
|
-
var
|
|
2028
|
+
(c(!0), h(we, null, Ke(B.value, (m) => {
|
|
2029
|
+
var q;
|
|
2030
2030
|
return c(), h("div", {
|
|
2031
2031
|
key: m.jobId,
|
|
2032
2032
|
class: "px-16 py-12 flex flex-col gap-8"
|
|
@@ -2043,38 +2043,38 @@ const No = {
|
|
|
2043
2043
|
disabled: i.value.has(m.jobId),
|
|
2044
2044
|
title: "Download",
|
|
2045
2045
|
"aria-label": "Download",
|
|
2046
|
-
onClick: (
|
|
2046
|
+
onClick: (D) => b(m)
|
|
2047
2047
|
}, [
|
|
2048
2048
|
N(p, {
|
|
2049
2049
|
name: i.value.has(m.jobId) ? "progress_activity" : "download",
|
|
2050
2050
|
size: "sm"
|
|
2051
2051
|
}, null, 8, ["name"])
|
|
2052
|
-
], 8, Uo)) :
|
|
2052
|
+
], 8, Uo)) : E("", !0),
|
|
2053
2053
|
m.status === "waiting" || m.status === "active" ? (c(), h("button", {
|
|
2054
2054
|
key: 1,
|
|
2055
2055
|
class: "text-fm-color-semantic-error-500 hover:opacity-80 disabled:opacity-40",
|
|
2056
2056
|
disabled: a.value.has(m.jobId),
|
|
2057
2057
|
title: "Cancel",
|
|
2058
2058
|
"aria-label": "Cancel",
|
|
2059
|
-
onClick: (
|
|
2059
|
+
onClick: (D) => U(m)
|
|
2060
2060
|
}, [
|
|
2061
2061
|
N(p, {
|
|
2062
2062
|
name: a.value.has(m.jobId) ? "progress_activity" : "cancel",
|
|
2063
2063
|
size: "sm"
|
|
2064
2064
|
}, null, 8, ["name"])
|
|
2065
|
-
], 8, Vo)) :
|
|
2065
|
+
], 8, Vo)) : E("", !0),
|
|
2066
2066
|
f(m.status) ? (c(), h("button", {
|
|
2067
2067
|
key: 2,
|
|
2068
2068
|
class: "text-fm-color-typo-secondary hover:text-fm-color-typo-primary",
|
|
2069
2069
|
title: "Dismiss",
|
|
2070
2070
|
"aria-label": "Dismiss",
|
|
2071
|
-
onClick: (
|
|
2071
|
+
onClick: (D) => he(m.jobId)
|
|
2072
2072
|
}, [
|
|
2073
2073
|
N(p, {
|
|
2074
2074
|
name: "close",
|
|
2075
2075
|
size: "sm"
|
|
2076
2076
|
})
|
|
2077
|
-
], 8, Jo)) :
|
|
2077
|
+
], 8, Jo)) : E("", !0)
|
|
2078
2078
|
])
|
|
2079
2079
|
]),
|
|
2080
2080
|
m.status === "active" || m.status === "waiting" ? (c(), h("div", jo, [
|
|
@@ -2085,50 +2085,50 @@ const No = {
|
|
|
2085
2085
|
}, null, 4)
|
|
2086
2086
|
]),
|
|
2087
2087
|
e("div", Yo, [
|
|
2088
|
-
m.currentItem ? (c(), h("span", Qo, v(m.currentItem), 1)) :
|
|
2088
|
+
m.currentItem ? (c(), h("span", Qo, v(m.currentItem), 1)) : E("", !0),
|
|
2089
2089
|
e("span", Ho, v(m.current) + " / " + v(m.total), 1)
|
|
2090
2090
|
])
|
|
2091
|
-
])) :
|
|
2091
|
+
])) : E("", !0),
|
|
2092
2092
|
m.status === "completed" && m.errorCount === 0 ? (c(), h("div", Ko, [
|
|
2093
2093
|
N(p, {
|
|
2094
2094
|
name: "check_circle",
|
|
2095
2095
|
size: "sm"
|
|
2096
2096
|
}),
|
|
2097
2097
|
e("span", null, v(t(_)("inventory.transfer.receiveRequest.bulk.jobDone")), 1)
|
|
2098
|
-
])) :
|
|
2099
|
-
m.status === "completed" && (((
|
|
2098
|
+
])) : E("", !0),
|
|
2099
|
+
m.status === "completed" && (((q = m.stalePoIds) == null ? void 0 : q.length) ?? 0) > 0 ? (c(), h("div", Go, [
|
|
2100
2100
|
N(p, {
|
|
2101
2101
|
name: "warning",
|
|
2102
2102
|
size: "sm"
|
|
2103
2103
|
}),
|
|
2104
2104
|
e("span", null, v(t(_)("inventory.transfer.receiveRequest.bulk.jobStalePos", [m.stalePoIds.length])), 1)
|
|
2105
|
-
])) :
|
|
2105
|
+
])) : E("", !0),
|
|
2106
2106
|
m.status === "cancelled" ? (c(), h("div", Xo, [
|
|
2107
2107
|
N(p, {
|
|
2108
2108
|
name: "do_not_disturb_on",
|
|
2109
2109
|
size: "sm"
|
|
2110
2110
|
}),
|
|
2111
2111
|
e("span", null, v(t(_)("inventory.transfer.receiveRequest.bulk.jobCancelled")), 1)
|
|
2112
|
-
])) :
|
|
2112
|
+
])) : E("", !0),
|
|
2113
2113
|
m.status === "failed" ? (c(), h("div", Zo, [
|
|
2114
2114
|
N(p, {
|
|
2115
2115
|
name: "cancel",
|
|
2116
2116
|
size: "sm"
|
|
2117
2117
|
}),
|
|
2118
2118
|
m.errorCount > 0 ? (c(), h("span", ea, v(t(_)("inventory.transfer.receiveRequest.bulk.jobDoneWithErrors", [m.errorCount])), 1)) : (c(), h("span", ta, v(t(_)("inventory.transfer.receiveRequest.bulk.jobFailed")), 1))
|
|
2119
|
-
])) :
|
|
2119
|
+
])) : E("", !0),
|
|
2120
2120
|
f(m.status) && m.completedAt ? (c(), h("div", na, [
|
|
2121
2121
|
e("span", null, v(t(_)("inventory.transfer.receiveRequest.bulk.jobCompletedIn", [d(m.completedAt - m.startedAt)])), 1),
|
|
2122
|
-
m.zipSizeBytes ? (c(), h(
|
|
2122
|
+
m.zipSizeBytes ? (c(), h(we, { key: 0 }, [
|
|
2123
2123
|
x[2] || (x[2] = e("span", null, "·", -1)),
|
|
2124
2124
|
e("span", null, v(y(m.zipSizeBytes)), 1)
|
|
2125
|
-
], 64)) :
|
|
2126
|
-
])) :
|
|
2125
|
+
], 64)) : E("", !0)
|
|
2126
|
+
])) : E("", !0)
|
|
2127
2127
|
]);
|
|
2128
2128
|
}), 128))
|
|
2129
2129
|
])
|
|
2130
|
-
])) :
|
|
2131
|
-
], 512)) :
|
|
2130
|
+
])) : E("", !0)
|
|
2131
|
+
], 512)) : E("", !0)
|
|
2132
2132
|
]);
|
|
2133
2133
|
};
|
|
2134
2134
|
}
|
|
@@ -2154,72 +2154,76 @@ const No = {
|
|
|
2154
2154
|
key: 0,
|
|
2155
2155
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1"
|
|
2156
2156
|
}, ka = { class: "pt-8" }, Ca = {
|
|
2157
|
-
key:
|
|
2157
|
+
key: 0,
|
|
2158
2158
|
class: "absolute inset-0 z-10 flex items-center justify-center bg-fm-color-opacity-sm"
|
|
2159
|
-
}, Fa = { class: "flex items-center gap-12 rounded-md bg-white px-16 py-8 shadow-lg" }, Sa = { class: "fm-typo-en-body-md-400" },
|
|
2159
|
+
}, Fa = { class: "flex items-center gap-12 rounded-md bg-white px-16 py-8 shadow-lg" }, Sa = { class: "fm-typo-en-body-md-400" }, St = "BulkReceiveRequestViewSearchCriteria", or = /* @__PURE__ */ nt({
|
|
2160
2160
|
__name: "BulkReceiveRequestView",
|
|
2161
|
-
setup(
|
|
2161
|
+
setup(k) {
|
|
2162
2162
|
const { t: _ } = st(), C = ut();
|
|
2163
2163
|
at.object({
|
|
2164
2164
|
name: at.string().optional().nullable(),
|
|
2165
2165
|
startDate: at.string().optional().nullable(),
|
|
2166
2166
|
endDate: at.string().optional().nullable()
|
|
2167
2167
|
});
|
|
2168
|
-
const
|
|
2169
|
-
function
|
|
2170
|
-
const
|
|
2168
|
+
const B = un(), $ = qt(), z = Mt();
|
|
2169
|
+
function W() {
|
|
2170
|
+
const P = {
|
|
2171
2171
|
name: "",
|
|
2172
2172
|
...pt()
|
|
2173
|
-
},
|
|
2174
|
-
if (!
|
|
2173
|
+
}, w = B.getItem(St);
|
|
2174
|
+
if (!w) return P;
|
|
2175
2175
|
try {
|
|
2176
|
-
return JSON.parse(
|
|
2176
|
+
return JSON.parse(w);
|
|
2177
2177
|
} catch {
|
|
2178
|
-
return
|
|
2178
|
+
return P;
|
|
2179
2179
|
}
|
|
2180
2180
|
}
|
|
2181
2181
|
function V() {
|
|
2182
|
-
|
|
2182
|
+
B.setItem(St, JSON.stringify(i.value));
|
|
2183
2183
|
}
|
|
2184
|
-
const i =
|
|
2184
|
+
const i = S(W()), a = Po(i.value), b = S(!1), { selectedLocationDbNames: U } = a, he = L(() => q.value.filter((P) => U.value.includes(P.dbName)).map((P) => P.doc._id)), {
|
|
2185
2185
|
columnDefs: f,
|
|
2186
2186
|
showPdfDialog: d,
|
|
2187
2187
|
pdfPreviewLoading: y,
|
|
2188
2188
|
pdfPreviewBlobUrl: s
|
|
2189
|
-
} = qo(a, a.shipments), x = it(), p =
|
|
2190
|
-
|
|
2191
|
-
const
|
|
2192
|
-
|
|
2189
|
+
} = qo(a, a.shipments), x = it(), p = Qt(), m = Pt(), q = S([]);
|
|
2190
|
+
Lt(() => {
|
|
2191
|
+
const P = x.locations;
|
|
2192
|
+
P.length > 0 && (q.value = P);
|
|
2193
2193
|
});
|
|
2194
|
-
async function
|
|
2195
|
-
var
|
|
2196
|
-
if ((
|
|
2194
|
+
async function D() {
|
|
2195
|
+
var w;
|
|
2196
|
+
if ((w = m.currentBusiness.value) != null && w._id)
|
|
2197
2197
|
try {
|
|
2198
|
-
const
|
|
2199
|
-
|
|
2198
|
+
const M = await p.readAllInventoryLocations();
|
|
2199
|
+
M.length > 0 && (q.value = M);
|
|
2200
2200
|
} catch {
|
|
2201
2201
|
}
|
|
2202
2202
|
}
|
|
2203
|
-
|
|
2203
|
+
Ve(
|
|
2204
2204
|
[() => m.sessionUser.value, () => m.currentBusiness.value],
|
|
2205
|
-
([
|
|
2206
|
-
|
|
2205
|
+
([P, w]) => {
|
|
2206
|
+
P && w && D();
|
|
2207
2207
|
},
|
|
2208
2208
|
{ immediate: !0 }
|
|
2209
2209
|
);
|
|
2210
|
-
const
|
|
2211
|
-
() => a.failedLocations.value.map((
|
|
2212
|
-
var
|
|
2213
|
-
return ((
|
|
2210
|
+
const T = L(() => a.loading.value), me = L(
|
|
2211
|
+
() => a.failedLocations.value.map((P) => {
|
|
2212
|
+
var w;
|
|
2213
|
+
return ((w = x.locations.find((M) => M.dbName === P.dbName)) == null ? void 0 : w.name) ?? P.dbName;
|
|
2214
2214
|
}).join(", ")
|
|
2215
|
-
),
|
|
2216
|
-
() => a.failedLocations.value.some((
|
|
2215
|
+
), K = L(
|
|
2216
|
+
() => a.failedLocations.value.some((P) => P.retryable)
|
|
2217
2217
|
);
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2218
|
+
function Z(P) {
|
|
2219
|
+
var w;
|
|
2220
|
+
return P.itemCount ?? ((w = P.items) == null ? void 0 : w.length) ?? 0;
|
|
2221
|
+
}
|
|
2222
|
+
async function oe() {
|
|
2223
|
+
const P = `inventory-record_${Ye(i.value.startDate).format("DD-MM-YYYY_HH-mm")}-${Ye(i.value.endDate).format("DD-MM-YYYY_HH-mm")}.xlsx`;
|
|
2224
|
+
let w = [];
|
|
2221
2225
|
try {
|
|
2222
|
-
|
|
2226
|
+
w = await a.fetchFullPurchaseOrders();
|
|
2223
2227
|
} catch {
|
|
2224
2228
|
C.open({
|
|
2225
2229
|
title: _("inventory.transfer.receiveRequest.export.error"),
|
|
@@ -2228,28 +2232,28 @@ const No = {
|
|
|
2228
2232
|
});
|
|
2229
2233
|
return;
|
|
2230
2234
|
}
|
|
2231
|
-
const
|
|
2232
|
-
(
|
|
2233
|
-
var
|
|
2234
|
-
const
|
|
2235
|
-
|
|
2236
|
-
),
|
|
2235
|
+
const M = w.flatMap(
|
|
2236
|
+
(G) => G.items.map((le) => {
|
|
2237
|
+
var g, O;
|
|
2238
|
+
const Oe = new Date(rn(G._id) ?? ""), _e = G.effectiveAt ? new Date(G.effectiveAt) : void 0, J = xt(
|
|
2239
|
+
an(le.sku, G.deliveryOrder || [])
|
|
2240
|
+
), ce = xt(le.quantity), o = ((g = le == null ? void 0 : le.measurement) == null ? void 0 : g.abbrev) || le.sku.unit.abbrev;
|
|
2237
2241
|
return {
|
|
2238
|
-
Location: ((
|
|
2239
|
-
"SKU code":
|
|
2240
|
-
"SKU name":
|
|
2241
|
-
"PO #":
|
|
2242
|
-
"Effective at":
|
|
2243
|
-
Date:
|
|
2244
|
-
Status:
|
|
2245
|
-
Reference:
|
|
2246
|
-
"Received quantity":
|
|
2247
|
-
"Ordered quantity":
|
|
2248
|
-
Unit:
|
|
2249
|
-
"Total cost":
|
|
2242
|
+
Location: ((O = x.locations.find((I) => I.dbName === G._locationDbName)) == null ? void 0 : O.name) ?? "",
|
|
2243
|
+
"SKU code": le.code,
|
|
2244
|
+
"SKU name": le.name,
|
|
2245
|
+
"PO #": G.seqNumber,
|
|
2246
|
+
"Effective at": _e,
|
|
2247
|
+
Date: Oe,
|
|
2248
|
+
Status: G.status,
|
|
2249
|
+
Reference: G.ref ?? "",
|
|
2250
|
+
"Received quantity": J,
|
|
2251
|
+
"Ordered quantity": ce,
|
|
2252
|
+
Unit: o,
|
|
2253
|
+
"Total cost": le.totalCost ? Kt(le.totalCost) : null
|
|
2250
2254
|
};
|
|
2251
2255
|
})
|
|
2252
|
-
),
|
|
2256
|
+
), Y = [
|
|
2253
2257
|
"Location",
|
|
2254
2258
|
"SKU code",
|
|
2255
2259
|
"SKU name",
|
|
@@ -2261,40 +2265,40 @@ const No = {
|
|
|
2261
2265
|
"Ordered quantity",
|
|
2262
2266
|
"Unit"
|
|
2263
2267
|
];
|
|
2264
|
-
$.enableBackdatePo &&
|
|
2268
|
+
$.enableBackdatePo && Y.insert("Effective at", 5), $.enableTotalCost && Y.push("Total cost"), await ln([{ name: "purchases", data: M, columns: Y }], P), C.open({
|
|
2265
2269
|
title: _("inventory.transfer.receiveRequest.export.success"),
|
|
2266
|
-
message: _("inventory.transfer.receiveRequest.export.message", [
|
|
2270
|
+
message: _("inventory.transfer.receiveRequest.export.message", [P]),
|
|
2267
2271
|
type: "success"
|
|
2268
2272
|
});
|
|
2269
2273
|
}
|
|
2270
|
-
const
|
|
2271
|
-
|
|
2272
|
-
if (!
|
|
2273
|
-
if (
|
|
2274
|
+
const pe = S(pt()), ke = S("");
|
|
2275
|
+
Ve([() => pe.value], ([P]) => {
|
|
2276
|
+
if (!P.startDate || !P.endDate) return;
|
|
2277
|
+
if (Ye(P.endDate).diff(Ye(P.startDate), "day") > 60) {
|
|
2274
2278
|
C.open({
|
|
2275
2279
|
title: _("inventory.transfer.receiveRequest.bulk.dateRangeLimitTitle"),
|
|
2276
2280
|
message: _("inventory.transfer.receiveRequest.bulk.dateRangeLimitMsg"),
|
|
2277
2281
|
type: "warning"
|
|
2278
|
-
}),
|
|
2279
|
-
startDate:
|
|
2280
|
-
endDate:
|
|
2282
|
+
}), pe.value = {
|
|
2283
|
+
startDate: P.startDate,
|
|
2284
|
+
endDate: Ye(P.startDate).add(60, "day").format("YYYY-MM-DD")
|
|
2281
2285
|
};
|
|
2282
2286
|
return;
|
|
2283
2287
|
}
|
|
2284
|
-
i.value.startDate =
|
|
2285
|
-
}),
|
|
2288
|
+
i.value.startDate = P.startDate, i.value.endDate = P.endDate, a.updateDateRange(i.value.startDate, i.value.endDate), V();
|
|
2289
|
+
}), Ve([() => ke.value], () => {
|
|
2286
2290
|
V();
|
|
2287
2291
|
});
|
|
2288
|
-
const
|
|
2289
|
-
|
|
2292
|
+
const Ee = Ut.debounce(() => a.fetchData(), 1500);
|
|
2293
|
+
Ve(
|
|
2290
2294
|
() => U.value,
|
|
2291
2295
|
() => {
|
|
2292
|
-
a.abortOngoingBrowse(),
|
|
2296
|
+
a.abortOngoingBrowse(), Ee();
|
|
2293
2297
|
}
|
|
2294
2298
|
);
|
|
2295
|
-
function
|
|
2296
|
-
if (
|
|
2297
|
-
if (
|
|
2299
|
+
function ze(P) {
|
|
2300
|
+
if (P === "create") {
|
|
2301
|
+
if (T.value) {
|
|
2298
2302
|
C.open({ title: "Loading data...", message: "Please wait.", type: "info" });
|
|
2299
2303
|
return;
|
|
2300
2304
|
}
|
|
@@ -2309,14 +2313,14 @@ const No = {
|
|
|
2309
2313
|
b.value = !0;
|
|
2310
2314
|
return;
|
|
2311
2315
|
}
|
|
2312
|
-
if (
|
|
2316
|
+
if (P === "upload" && $.enableXilnexTransferNote)
|
|
2313
2317
|
return a.promptUploadTransferDialog();
|
|
2314
|
-
if (
|
|
2315
|
-
if (
|
|
2316
|
-
if (
|
|
2317
|
-
if (
|
|
2318
|
+
if (P === "refresh") return a.fetchData();
|
|
2319
|
+
if (P === "export") return oe();
|
|
2320
|
+
if (P === "downloadAll") return Te();
|
|
2321
|
+
if (P === "emailAll") return ge();
|
|
2318
2322
|
}
|
|
2319
|
-
async function
|
|
2323
|
+
async function Te() {
|
|
2320
2324
|
if (U.value.length === 0) {
|
|
2321
2325
|
C.open({
|
|
2322
2326
|
title: _("inventory.transfer.receiveRequest.bulk.noLocationsSelected"),
|
|
@@ -2325,9 +2329,9 @@ const No = {
|
|
|
2325
2329
|
});
|
|
2326
2330
|
return;
|
|
2327
2331
|
}
|
|
2328
|
-
await a.downloadAll(
|
|
2332
|
+
await a.downloadAll(Me.value);
|
|
2329
2333
|
}
|
|
2330
|
-
async function
|
|
2334
|
+
async function ge() {
|
|
2331
2335
|
if ($.enablePurchaseOrderEmail) {
|
|
2332
2336
|
if (U.value.length === 0) {
|
|
2333
2337
|
C.open({
|
|
@@ -2337,10 +2341,10 @@ const No = {
|
|
|
2337
2341
|
});
|
|
2338
2342
|
return;
|
|
2339
2343
|
}
|
|
2340
|
-
await a.emailAll(
|
|
2344
|
+
await a.emailAll(Me.value);
|
|
2341
2345
|
}
|
|
2342
2346
|
}
|
|
2343
|
-
const { breakpoints:
|
|
2347
|
+
const { breakpoints: Je } = fn(), ve = L(() => Je.value.xs || Je.value.sm), Qe = L(() => ve.value ? 10 : 20), Ie = wt(), Ce = wt(), Xe = L(() => $.enableReceiveRequestBeta ? [
|
|
2344
2348
|
{
|
|
2345
2349
|
label: _("inventory.transfer.receiveRequest.actions.create"),
|
|
2346
2350
|
value: "create",
|
|
@@ -2350,33 +2354,33 @@ const No = {
|
|
|
2350
2354
|
...$.enableXilnexTransferNote ? [{ label: _("inventory.common.upload"), value: "upload" }] : [],
|
|
2351
2355
|
{ label: _("inventory.common.refresh"), value: "refresh" },
|
|
2352
2356
|
{ label: _("inventory.common.export"), value: "export" },
|
|
2353
|
-
...$.enablePrintTemplate && !
|
|
2357
|
+
...$.enablePrintTemplate && !T.value ? [
|
|
2354
2358
|
{
|
|
2355
2359
|
label: _("inventory.transfer.receiveRequest.bulk.downloadAll"),
|
|
2356
2360
|
value: "downloadAll",
|
|
2357
2361
|
prependIcon: "download"
|
|
2358
2362
|
}
|
|
2359
2363
|
] : [],
|
|
2360
|
-
...$.enablePurchaseOrderEmail && !
|
|
2364
|
+
...$.enablePurchaseOrderEmail && !T.value ? [
|
|
2361
2365
|
{
|
|
2362
2366
|
label: _("inventory.transfer.receiveRequest.bulk.emailAll"),
|
|
2363
2367
|
value: "emailAll",
|
|
2364
2368
|
prependIcon: "email"
|
|
2365
2369
|
}
|
|
2366
2370
|
] : []
|
|
2367
|
-
] : []),
|
|
2368
|
-
const
|
|
2371
|
+
] : []), je = L(() => {
|
|
2372
|
+
const P = [
|
|
2369
2373
|
{
|
|
2370
2374
|
type: "string",
|
|
2371
2375
|
key: "status",
|
|
2372
2376
|
entity: "purchaseOrder",
|
|
2373
|
-
values: Array.from(new Set(a.purchaseOrders.value.map((
|
|
2377
|
+
values: Array.from(new Set(a.purchaseOrders.value.map((M) => M.status)))
|
|
2374
2378
|
},
|
|
2375
2379
|
{
|
|
2376
2380
|
type: "string",
|
|
2377
2381
|
key: "transferFrom",
|
|
2378
2382
|
entity: "purchaseOrder",
|
|
2379
|
-
values: Array.from(new Set(a.purchaseOrders.value.map((
|
|
2383
|
+
values: Array.from(new Set(a.purchaseOrders.value.map((M) => M.supplier.name)))
|
|
2380
2384
|
},
|
|
2381
2385
|
{
|
|
2382
2386
|
type: "string",
|
|
@@ -2384,121 +2388,121 @@ const No = {
|
|
|
2384
2388
|
entity: "purchaseOrder",
|
|
2385
2389
|
values: Array.from(
|
|
2386
2390
|
new Set(
|
|
2387
|
-
a.purchaseOrders.value.map((
|
|
2388
|
-
const
|
|
2389
|
-
return (
|
|
2391
|
+
a.purchaseOrders.value.map((M) => {
|
|
2392
|
+
const Y = x.locations.find((G) => G.dbName === M._locationDbName);
|
|
2393
|
+
return (Y == null ? void 0 : Y.name) ?? M._locationDbName;
|
|
2390
2394
|
})
|
|
2391
2395
|
)
|
|
2392
2396
|
)
|
|
2393
2397
|
}
|
|
2394
|
-
],
|
|
2398
|
+
], w = [
|
|
2395
2399
|
{
|
|
2396
2400
|
type: "string",
|
|
2397
2401
|
key: "netsuiteTransactionNumber",
|
|
2398
2402
|
entity: "purchaseOrder",
|
|
2399
|
-
values: a.purchaseOrders.value.map((
|
|
2400
|
-
var
|
|
2401
|
-
return (
|
|
2402
|
-
}).filter((
|
|
2403
|
+
values: a.purchaseOrders.value.map((M) => {
|
|
2404
|
+
var Y, G;
|
|
2405
|
+
return (G = (Y = M.netSuite) == null ? void 0 : Y.additionalInfo) == null ? void 0 : G.transactionnumber;
|
|
2406
|
+
}).filter((M) => M != null)
|
|
2403
2407
|
},
|
|
2404
2408
|
{
|
|
2405
2409
|
type: "string",
|
|
2406
2410
|
key: "netsuiteOrderNo",
|
|
2407
2411
|
entity: "purchaseOrder",
|
|
2408
|
-
values: a.purchaseOrders.value.map((
|
|
2409
|
-
var
|
|
2410
|
-
return (
|
|
2411
|
-
}).filter((
|
|
2412
|
+
values: a.purchaseOrders.value.map((M) => {
|
|
2413
|
+
var Y;
|
|
2414
|
+
return (Y = M.netSuite) == null ? void 0 : Y.refNo;
|
|
2415
|
+
}).filter((M) => M != null)
|
|
2412
2416
|
},
|
|
2413
2417
|
{
|
|
2414
2418
|
type: "string",
|
|
2415
2419
|
key: "netsuiteOrderId",
|
|
2416
2420
|
entity: "purchaseOrder",
|
|
2417
|
-
values: a.purchaseOrders.value.map((
|
|
2418
|
-
var
|
|
2419
|
-
return (
|
|
2420
|
-
}).filter((
|
|
2421
|
+
values: a.purchaseOrders.value.map((M) => {
|
|
2422
|
+
var Y;
|
|
2423
|
+
return (Y = M.netSuite) == null ? void 0 : Y.id;
|
|
2424
|
+
}).filter((M) => M != null)
|
|
2421
2425
|
}
|
|
2422
2426
|
];
|
|
2423
|
-
return [...
|
|
2424
|
-
}),
|
|
2425
|
-
if (!
|
|
2426
|
-
const
|
|
2427
|
-
return a.purchaseOrders.value.filter((
|
|
2428
|
-
var
|
|
2429
|
-
const
|
|
2427
|
+
return [...P, ...z.isEnabled ? w : []];
|
|
2428
|
+
}), Le = S(null), Me = L(() => {
|
|
2429
|
+
if (!Le.value) return a.purchaseOrders.value;
|
|
2430
|
+
const P = Cn.build(Le.value);
|
|
2431
|
+
return a.purchaseOrders.value.filter((w) => {
|
|
2432
|
+
var Y, G, le, Oe, _e;
|
|
2433
|
+
const M = ((Y = x.locations.find((J) => J.dbName === w._locationDbName)) == null ? void 0 : Y.name) ?? w._locationDbName;
|
|
2430
2434
|
return Fn(
|
|
2431
2435
|
{
|
|
2432
|
-
netsuiteTransactionNumber: (
|
|
2433
|
-
netsuiteOrderNo: (
|
|
2434
|
-
netsuiteOrderId: (
|
|
2435
|
-
status:
|
|
2436
|
-
transferFrom:
|
|
2437
|
-
location:
|
|
2436
|
+
netsuiteTransactionNumber: (le = (G = w.netSuite) == null ? void 0 : G.additionalInfo) == null ? void 0 : le.transactionnumber,
|
|
2437
|
+
netsuiteOrderNo: (Oe = w.netSuite) == null ? void 0 : Oe.refNo,
|
|
2438
|
+
netsuiteOrderId: (_e = w.netSuite) == null ? void 0 : _e.id,
|
|
2439
|
+
status: w.status,
|
|
2440
|
+
transferFrom: w.supplier.name,
|
|
2441
|
+
location: M
|
|
2438
2442
|
},
|
|
2439
|
-
|
|
2443
|
+
P
|
|
2440
2444
|
);
|
|
2441
2445
|
});
|
|
2442
2446
|
});
|
|
2443
|
-
return (
|
|
2444
|
-
const
|
|
2445
|
-
return c(),
|
|
2447
|
+
return (P, w) => {
|
|
2448
|
+
const M = $e("FmIcon"), Y = $e("FmTextField"), G = $e("FmButton"), le = $e("FmTable"), Oe = $e("FmCircularProgress");
|
|
2449
|
+
return c(), de(cn, {
|
|
2446
2450
|
title: t(_)("inventory.transfer.receiveRequest.bulk.title"),
|
|
2447
2451
|
actions: Xe.value,
|
|
2448
|
-
"onClick:action":
|
|
2452
|
+
"onClick:action": ze
|
|
2449
2453
|
}, {
|
|
2450
|
-
default:
|
|
2451
|
-
var
|
|
2454
|
+
default: Be(() => {
|
|
2455
|
+
var _e;
|
|
2452
2456
|
return [
|
|
2453
2457
|
t($).isLoaded && !t($).enableReceiveRequestBeta ? (c(), h("div", oa, [
|
|
2454
|
-
N(
|
|
2458
|
+
N(M, {
|
|
2455
2459
|
name: "block",
|
|
2456
2460
|
size: "xl"
|
|
2457
2461
|
}),
|
|
2458
|
-
|
|
2459
|
-
])) : t($).enableReceiveRequestBeta ? (c(), h(
|
|
2462
|
+
w[11] || (w[11] = e("p", { class: "fm-typo-en-body-md-400" }, "Not available", -1))
|
|
2463
|
+
])) : t($).enableReceiveRequestBeta ? (c(), h(we, { key: 1 }, [
|
|
2460
2464
|
e("div", {
|
|
2461
|
-
class:
|
|
2465
|
+
class: j(["flex flex-col gap-8 max-h-full", { "p-0": ve.value, "px-24": !ve.value }])
|
|
2462
2466
|
}, [
|
|
2463
2467
|
e("div", {
|
|
2464
2468
|
class: "flex flex-col gap-8",
|
|
2465
|
-
onVnodeMounted:
|
|
2466
|
-
(...
|
|
2467
|
-
onVnodeUnmounted:
|
|
2468
|
-
(...
|
|
2469
|
+
onVnodeMounted: w[4] || (w[4] = //@ts-ignore
|
|
2470
|
+
(...J) => t(Ie).onMounted && t(Ie).onMounted(...J)),
|
|
2471
|
+
onVnodeUnmounted: w[5] || (w[5] = //@ts-ignore
|
|
2472
|
+
(...J) => t(Ie).onUnmounted && t(Ie).onUnmounted(...J))
|
|
2469
2473
|
}, [
|
|
2470
2474
|
e("div", {
|
|
2471
|
-
class:
|
|
2475
|
+
class: j([
|
|
2472
2476
|
"flex gap-8 items-center",
|
|
2473
|
-
{ "px-8 flex-col-reverse h-[unset]":
|
|
2477
|
+
{ "px-8 flex-col-reverse h-[unset]": ve.value, "h-48": !ve.value }
|
|
2474
2478
|
])
|
|
2475
2479
|
}, [
|
|
2476
2480
|
e("div", {
|
|
2477
|
-
class:
|
|
2481
|
+
class: j(["flex gap-8 items-center", { "w-full overflow-x-auto": ve.value }])
|
|
2478
2482
|
}, [
|
|
2479
2483
|
N(ko, {
|
|
2480
2484
|
modelValue: t(U),
|
|
2481
|
-
"onUpdate:modelValue":
|
|
2482
|
-
locations:
|
|
2485
|
+
"onUpdate:modelValue": w[0] || (w[0] = (J) => ht(U) ? U.value = J : null),
|
|
2486
|
+
locations: q.value
|
|
2483
2487
|
}, null, 8, ["modelValue", "locations"]),
|
|
2484
|
-
N(
|
|
2485
|
-
"model-value":
|
|
2486
|
-
"onUpdate:modelValue":
|
|
2488
|
+
N(Ht, {
|
|
2489
|
+
"model-value": pe.value,
|
|
2490
|
+
"onUpdate:modelValue": w[1] || (w[1] = (J) => pe.value = J)
|
|
2487
2491
|
}, null, 8, ["model-value"])
|
|
2488
2492
|
], 2),
|
|
2489
2493
|
e("div", aa, [
|
|
2490
2494
|
e("div", ra, [
|
|
2491
2495
|
N(t(Sn), {
|
|
2492
|
-
modelValue:
|
|
2493
|
-
"onUpdate:modelValue":
|
|
2494
|
-
attributes:
|
|
2496
|
+
modelValue: Le.value,
|
|
2497
|
+
"onUpdate:modelValue": w[2] || (w[2] = (J) => Le.value = J),
|
|
2498
|
+
attributes: je.value
|
|
2495
2499
|
}, null, 8, ["modelValue", "attributes"])
|
|
2496
2500
|
]),
|
|
2497
|
-
|
|
2501
|
+
ve.value ? E("", !0) : (c(), h("div", la)),
|
|
2498
2502
|
e("div", ia, [
|
|
2499
|
-
N(
|
|
2500
|
-
"model-value":
|
|
2501
|
-
"onUpdate:modelValue":
|
|
2503
|
+
N(Y, {
|
|
2504
|
+
"model-value": ke.value,
|
|
2505
|
+
"onUpdate:modelValue": w[3] || (w[3] = (J) => ke.value = J),
|
|
2502
2506
|
"prepend-icon": "search",
|
|
2503
2507
|
placeholder: t(_)("inventory.common.table.toolbar.filterItems"),
|
|
2504
2508
|
class: "w-full"
|
|
@@ -2507,81 +2511,88 @@ const No = {
|
|
|
2507
2511
|
])
|
|
2508
2512
|
], 2)
|
|
2509
2513
|
], 512),
|
|
2510
|
-
t(U).length === 0 && !
|
|
2511
|
-
N(
|
|
2514
|
+
t(U).length === 0 && !T.value ? (c(), h("div", ua, [
|
|
2515
|
+
N(M, {
|
|
2512
2516
|
name: "storefront",
|
|
2513
2517
|
size: "xl"
|
|
2514
2518
|
}),
|
|
2515
2519
|
e("p", ca, v(t(_)("inventory.transfer.receiveRequest.bulk.selectLocationsHint")), 1)
|
|
2516
2520
|
])) : (c(), h("div", da, [
|
|
2517
|
-
(
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2521
|
+
e("div", {
|
|
2522
|
+
onVnodeMounted: w[6] || (w[6] = //@ts-ignore
|
|
2523
|
+
(...J) => t(Ce).onMounted && t(Ce).onMounted(...J)),
|
|
2524
|
+
onVnodeUnmounted: w[7] || (w[7] = //@ts-ignore
|
|
2525
|
+
(...J) => t(Ce).onUnmounted && t(Ce).onUnmounted(...J))
|
|
2526
|
+
}, [
|
|
2527
|
+
(T.value || t(a).retryingFailed.value) && t(a).fetchProgress.value ? (c(), h("div", ma, [
|
|
2528
|
+
e("div", fa, [
|
|
2529
|
+
e("div", {
|
|
2530
|
+
class: "h-full rounded-full bg-fm-color-primary transition-all duration-300",
|
|
2531
|
+
style: ft({
|
|
2532
|
+
width: `${t(a).fetchProgress.value.done / t(a).fetchProgress.value.total * 100}%`
|
|
2533
|
+
})
|
|
2534
|
+
}, null, 4)
|
|
2535
|
+
]),
|
|
2536
|
+
e("span", pa, v(t(a).fetchProgress.value.done) + "/" + v(t(a).fetchProgress.value.total) + " locations ", 1)
|
|
2537
|
+
])) : E("", !0),
|
|
2538
|
+
t(a).failedLocations.value.length > 0 ? (c(), h("div", va, [
|
|
2539
|
+
e("span", ya, " Failed to load: " + v(me.value), 1),
|
|
2540
|
+
K.value ? (c(), de(G, {
|
|
2541
|
+
key: 0,
|
|
2542
|
+
variant: "secondary",
|
|
2543
|
+
disabled: t(a).retryingFailed.value || T.value,
|
|
2544
|
+
label: t(a).retryingFailed.value ? "Retrying…" : "Retry failed locations",
|
|
2545
|
+
onClick: t(a).retryFailedLocations
|
|
2546
|
+
}, null, 8, ["disabled", "label", "onClick"])) : E("", !0)
|
|
2547
|
+
])) : E("", !0)
|
|
2548
|
+
], 512),
|
|
2549
|
+
N(le, {
|
|
2550
|
+
style: ft(t(Ie).tableHeight),
|
|
2540
2551
|
"column-defs": t(f),
|
|
2541
|
-
"row-data":
|
|
2542
|
-
"search-value":
|
|
2543
|
-
loading:
|
|
2544
|
-
onRowClick:
|
|
2545
|
-
"page-size":
|
|
2552
|
+
"row-data": Me.value,
|
|
2553
|
+
"search-value": ke.value,
|
|
2554
|
+
loading: T.value,
|
|
2555
|
+
onRowClick: w[8] || (w[8] = (J) => t(a).promptShowTransferDetails(J.original)),
|
|
2556
|
+
"page-size": Qe.value
|
|
2546
2557
|
}, {
|
|
2547
|
-
"list-row":
|
|
2558
|
+
"list-row": Be((J) => [
|
|
2548
2559
|
N(kn, {
|
|
2549
|
-
row:
|
|
2560
|
+
row: J,
|
|
2550
2561
|
onRowClick: t(a).promptShowTransferDetails
|
|
2551
2562
|
}, {
|
|
2552
|
-
default:
|
|
2553
|
-
var
|
|
2563
|
+
default: Be((ce) => {
|
|
2564
|
+
var o, u, g, O, I, R, Q, H, A, te, ne, ye, Fe, xe, qe, Se, Re, ee, fe, Ae, Pe, F, ae, ie, ue;
|
|
2554
2565
|
return [
|
|
2555
2566
|
e("div", ba, [
|
|
2556
2567
|
e("div", ha, [
|
|
2557
2568
|
N(t(et), {
|
|
2558
|
-
render: (
|
|
2559
|
-
props: (
|
|
2569
|
+
render: (g = (u = (o = ce._id) == null ? void 0 : o.column) == null ? void 0 : u.columnDef) == null ? void 0 : g.cell,
|
|
2570
|
+
props: (I = (O = ce._id) == null ? void 0 : O.getContext) == null ? void 0 : I.call(O)
|
|
2560
2571
|
}, null, 8, ["render", "props"])
|
|
2561
2572
|
]),
|
|
2562
2573
|
e("div", ga, [
|
|
2563
2574
|
N(t(et), {
|
|
2564
|
-
render: (
|
|
2565
|
-
props: (
|
|
2575
|
+
render: (H = (Q = (R = ce.location) == null ? void 0 : R.column) == null ? void 0 : Q.columnDef) == null ? void 0 : H.cell,
|
|
2576
|
+
props: (te = (A = ce.location) == null ? void 0 : A.getContext) == null ? void 0 : te.call(A)
|
|
2566
2577
|
}, null, 8, ["render", "props"])
|
|
2567
2578
|
]),
|
|
2568
2579
|
e("div", _a, [
|
|
2569
2580
|
N(t(et), {
|
|
2570
|
-
render: (
|
|
2571
|
-
props: (
|
|
2581
|
+
render: (Fe = (ye = (ne = ce.supplier_name) == null ? void 0 : ne.column) == null ? void 0 : ye.columnDef) == null ? void 0 : Fe.cell,
|
|
2582
|
+
props: (qe = (xe = ce.supplier_name) == null ? void 0 : xe.getContext) == null ? void 0 : qe.call(xe)
|
|
2572
2583
|
}, null, 8, ["render", "props"])
|
|
2573
2584
|
]),
|
|
2574
|
-
e("div", xa, v(
|
|
2575
|
-
|
|
2585
|
+
e("div", xa, v(t(_)("inventory.transfer.table.noOfItems")) + ": " + v(Z(J.original)), 1),
|
|
2586
|
+
J.original.ref ? (c(), h("div", wa, [
|
|
2576
2587
|
N(t(et), {
|
|
2577
|
-
render: (
|
|
2578
|
-
props: (
|
|
2588
|
+
render: (ee = (Re = (Se = ce.ref) == null ? void 0 : Se.column) == null ? void 0 : Re.columnDef) == null ? void 0 : ee.cell,
|
|
2589
|
+
props: (Ae = (fe = ce.ref) == null ? void 0 : fe.getContext) == null ? void 0 : Ae.call(fe)
|
|
2579
2590
|
}, null, 8, ["render", "props"])
|
|
2580
|
-
])) :
|
|
2591
|
+
])) : E("", !0),
|
|
2581
2592
|
e("div", ka, [
|
|
2582
2593
|
N(t(et), {
|
|
2583
|
-
render: (
|
|
2584
|
-
props: (
|
|
2594
|
+
render: (ae = (F = (Pe = ce.status) == null ? void 0 : Pe.column) == null ? void 0 : F.columnDef) == null ? void 0 : ae.cell,
|
|
2595
|
+
props: (ue = (ie = ce.status) == null ? void 0 : ie.getContext) == null ? void 0 : ue.call(ie)
|
|
2585
2596
|
}, null, 8, ["render", "props"])
|
|
2586
2597
|
])
|
|
2587
2598
|
])
|
|
@@ -2594,46 +2605,46 @@ const No = {
|
|
|
2594
2605
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]),
|
|
2595
2606
|
t(a).rowAction.pending.value ? (c(), h("div", Ca, [
|
|
2596
2607
|
e("div", Fa, [
|
|
2597
|
-
N(
|
|
2608
|
+
N(Oe, { size: "md" }),
|
|
2598
2609
|
e("span", Sa, v(t(_)("inventory.common.loading")), 1),
|
|
2599
|
-
N(
|
|
2610
|
+
N(G, {
|
|
2600
2611
|
variant: "secondary",
|
|
2601
2612
|
label: t(_)("inventory.common.cancel"),
|
|
2602
2613
|
onClick: t(a).rowAction.cancel
|
|
2603
2614
|
}, null, 8, ["label", "onClick"])
|
|
2604
2615
|
])
|
|
2605
|
-
])) :
|
|
2616
|
+
])) : E("", !0)
|
|
2606
2617
|
]))
|
|
2607
2618
|
], 2),
|
|
2608
|
-
(c(),
|
|
2619
|
+
(c(), de(lt, { to: "body" }, [
|
|
2609
2620
|
N(sa),
|
|
2610
|
-
t($).enablePurchaseOrderEmail ? (c(),
|
|
2621
|
+
t($).enablePurchaseOrderEmail ? (c(), de(yn, gt(ct({ key: 0 }, t(a).emailDialogProps.value)), null, 16)) : E("", !0),
|
|
2611
2622
|
N(po, {
|
|
2612
2623
|
show: b.value,
|
|
2613
|
-
"onUpdate:show":
|
|
2624
|
+
"onUpdate:show": w[9] || (w[9] = (J) => b.value = J),
|
|
2614
2625
|
"last-closing-date": t(a).lastClosingDate.value,
|
|
2615
|
-
"selected-outlet-ids":
|
|
2626
|
+
"selected-outlet-ids": he.value,
|
|
2616
2627
|
onSubmitted: t(a).fetchData
|
|
2617
2628
|
}, null, 8, ["show", "last-closing-date", "selected-outlet-ids", "onSubmitted"]),
|
|
2618
2629
|
N(bn, ct(t(a).transferDialogProps.value, {
|
|
2619
2630
|
onSubmitted: t(a).fetchData
|
|
2620
2631
|
}), null, 16, ["onSubmitted"]),
|
|
2621
|
-
t(a).transferDetailsProps.value != null ? (c(),
|
|
2632
|
+
t(a).transferDetailsProps.value != null ? (c(), de(on, ct({ key: 1 }, {
|
|
2622
2633
|
...t(a).transferDetailsProps.value,
|
|
2623
|
-
receivedMap: ((
|
|
2634
|
+
receivedMap: ((_e = t(a).transferDetailsProps.value) == null ? void 0 : _e.receivedMap) ?? {},
|
|
2624
2635
|
shipments: t(a).shipments.value ?? []
|
|
2625
2636
|
}, {
|
|
2626
2637
|
onSubmitted: t(a).fetchData
|
|
2627
|
-
}), null, 16, ["onSubmitted"])) :
|
|
2628
|
-
N(hn, gt(
|
|
2638
|
+
}), null, 16, ["onSubmitted"])) : E("", !0),
|
|
2639
|
+
N(hn, gt(zt(t(a).xilnexImportDialogProps.value)), null, 16),
|
|
2629
2640
|
N(wo, {
|
|
2630
2641
|
modelValue: t(d),
|
|
2631
|
-
"onUpdate:modelValue":
|
|
2642
|
+
"onUpdate:modelValue": w[10] || (w[10] = (J) => ht(d) ? d.value = J : null),
|
|
2632
2643
|
loading: t(y),
|
|
2633
2644
|
"blob-url": t(s)
|
|
2634
2645
|
}, null, 8, ["modelValue", "loading", "blob-url"])
|
|
2635
2646
|
]))
|
|
2636
|
-
], 64)) :
|
|
2647
|
+
], 64)) : E("", !0)
|
|
2637
2648
|
];
|
|
2638
2649
|
}),
|
|
2639
2650
|
_: 1
|