@feedmepos/mf-inventory-portal 1.2.40-dev.1 → 1.2.40
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-0DyZL1Fq.js → App-CFp4VWkn.js} +3 -3
- package/dist/{ApprovalView-BmBq5TGO.js → ApprovalView-BR-qwJZU.js} +5 -5
- package/dist/{BindingsDialog-DtBdmYMs.js → BindingsDialog-DCEb7sT8.js} +11 -11
- package/dist/{BindingsPicker-BAGxi1ZC.js → BindingsPicker-CKQ5qIsY.js} +9 -9
- package/dist/{BindingsTable-DKlb_qiS.js → BindingsTable-DkRi1hCC.js} +24 -24
- package/dist/{ClosingDraftView-CEmvLMPP.js → ClosingDraftView-C_LQUzJ8.js} +8 -8
- package/dist/{ClosingHistoryView-DOmSMiGH.js → ClosingHistoryView-BbH6v1rk.js} +22 -22
- package/dist/{ClosingTemplateView-Bd1KfJL3.js → ClosingTemplateView-CM72EBRP.js} +14 -14
- package/dist/{DeliveryOrderPrintPreview-DoE0Bmx4.js → DeliveryOrderPrintPreview-5-7-1XU5.js} +9 -9
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-20eCsiTr.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DU2xeJtz.js} +61 -60
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-B05RFZv-.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-qkS1g4m3.js} +2 -2
- package/dist/{FmMultiselectDialog-i1uk7uNx.js → FmMultiselectDialog-C3b-iSE2.js} +1 -1
- package/dist/{FmMultiselectDialog-ChsBeANW.js → FmMultiselectDialog-DJUiGIHJ.js} +2 -2
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BpT8OBQX.js → FmUnitInput.vue_vue_type_script_setup_true_lang-dnE7g0iB.js} +3 -3
- package/dist/{ImportView-CCLgSwn2.js → ImportView-C-OH0lW1.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-EHwf-vCH.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DZaO7ghp.js} +1 -1
- package/dist/{IngredientGroupView-BnEyAtcY.js → IngredientGroupView-Bz2dANo0.js} +49 -49
- package/dist/{IngredientsView-DEN_EqXP.js → IngredientsView-CwVCJ2hv.js} +14 -14
- package/dist/{IntegrationView-Cu_gMMz_.js → IntegrationView-BKfzgu3o.js} +12 -12
- package/dist/{InventoryBindingForm-COw2tcQC.js → InventoryBindingForm-CNZ1tuxg.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DIv_DrTj.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CeQbJ5M-.js} +14 -14
- package/dist/{InventoryBindingSummary-Csajkxbi.js → InventoryBindingSummary-iJD9V9f7.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BE9UFVFI.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-4u88I-eh.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-Da6ffJym.js → PremiumBadge.vue_vue_type_script_setup_true_lang-tZ7-qsUc.js} +2 -2
- package/dist/{PublishView-qCcwOaJ8.js → PublishView-DhIomByw.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-m2n6OT7Z.js → PurchaseOrderPrintPreview-1Jm8hmYB.js} +9 -9
- package/dist/ReceiveRequestView-CD-w_Cph.js +2821 -0
- package/dist/{RecipeView-Bp_59G4J.js → RecipeView-DVrcKtAa.js} +8 -8
- package/dist/{StockView-Co_sOnjs.js → StockView-BmwDyRwP.js} +15 -15
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Npu98N-x.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-crC3-G5l.js} +1 -1
- package/dist/{SupplierView-Bp4ez39s.js → SupplierView-CwTK_sYl.js} +11 -11
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-JTXbmabq.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-C8Yle9k2.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Dn2j9Xls.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CfZKi0So.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BSOi6Bbh.js → TransferDetails.vue_vue_type_script_setup_true_lang-jw2-Xg5Q.js} +374 -374
- package/dist/{TransferTemplateView-C5jzqjPy.js → TransferTemplateView-BCT6mq6u.js} +354 -354
- package/dist/{UnitView-XcXvbWUz.js → UnitView-Cuh2LX3K.js} +6 -6
- package/dist/{WarehouseView-B37E963Z.js → WarehouseView-DZ06EmIm.js} +5 -5
- package/dist/{WastageTemplateView-Dn2vSoCa.js → WastageTemplateView-CUAgAB-K.js} +14 -14
- package/dist/{app-CaXDnJ-Z.js → app-DsvKAAar.js} +334 -347
- package/dist/app.js +1 -1
- package/dist/{closing-template-CgLIA5Fw.js → closing-template-B4q3uNXW.js} +1 -1
- package/dist/{date2-Dc5sFY0E.js → date2-DPON4K9X.js} +1 -1
- package/dist/{dayjs.min-B-H7eU1F.js → dayjs.min-BUcpGcn-.js} +12 -12
- package/dist/{decimal-BEqE-6GW.js → decimal-O0r48Ccj.js} +2 -2
- package/dist/{defineDeepModel-CXxtm-xp.js → defineDeepModel-DKSKw3d8.js} +1 -1
- package/dist/{duplicate-template-BX6XhNvd.js → duplicate-template-AZR81F4P.js} +1 -1
- package/dist/feature-Chb7LGRV.js +20162 -0
- package/dist/{format-time-from-id-Dhlv9sZk.js → format-time-from-id-C0ju5W3p.js} +1 -1
- package/dist/{format-unit-display-B1WhMzNf.js → format-unit-display-CIh10egg.js} +247 -246
- package/dist/{import-export.helper-DaGtyevy.js → import-export.helper-Dz7WeOmz.js} +5 -5
- package/dist/{index-CqbsiJk1.js → index-6H1yTL5Z.js} +9 -9
- package/dist/{index-CikPk76E.js → index-BYYuUmlN.js} +3 -3
- package/dist/{index-B2ziwUTD.js → index-BiYceIQq.js} +1 -1
- package/dist/{lodash-rwAZ9bXl.js → lodash-CcF-iQsS.js} +1 -1
- package/dist/{netsuite-SdH9FL9h.js → netsuite-BSgSRRLZ.js} +3 -3
- package/dist/{purchase-order-template-Daxs7lNG.js → purchase-order-template-gLB1CO-a.js} +1 -1
- package/dist/{rules-81GqVkEm.js → rules-BRx1HG7R.js} +3 -3
- package/dist/{stock-BEmy7_Qs.js → stock-BJjMCR2I.js} +1 -1
- package/dist/{stock-CpYHrEjC.js → stock-qe8Qoouq.js} +3 -3
- package/dist/stores/inventory.d.ts +1 -1
- package/dist/{supplier-Bw4fRGiq.js → supplier-BLMn0x03.js} +2 -2
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-CGTZ9UUP.js → use-ingredient-select-dialog-Djd_7uji.js} +2 -2
- package/dist/{use-inventory-binding-dialog-CUh7aMb7.js → use-inventory-binding-dialog-DvMtdhSZ.js} +2 -2
- package/dist/{use-template-enabled-locations-2-2oPspMus.js → use-template-enabled-locations-2-C0JE_mEH.js} +2 -2
- package/dist/views/receive-request/components/netsuite/NetSuitePanel.vue.d.ts +2 -3
- package/dist/views/receive-request/components/netsuite/NetSuiteProps.d.ts +2 -3
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +2197 -490
- package/dist/views/receive-request/components/transfer-form/TransferForm2.vue.d.ts +0 -1430
- package/dist/views/receive-request/components/transfer-form/TransferFormProps.d.ts +0 -1
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +2 -3
- package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +1 -1
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +6 -6
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +7 -7
- package/dist/views/receive-request/constants/purchase-order-transaction-type.d.ts +4 -0
- package/dist/views/receive-request/helper/get-transfer-type.d.ts +2 -1
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +2 -3
- package/dist/views/transfer-template/components/transfer-template-import/TransferTemplateImportItemProps.d.ts +2 -3
- package/dist/views/transfer-template/helpers/import-export.helper.d.ts +3 -4
- package/dist/{vue-i18n-Di6nYtv0.js → vue-i18n-gFHTGAs6.js} +378 -378
- package/dist/{xlsx-DXn_bv49.js → xlsx-QHyL0Tej.js} +1 -1
- package/dist/{xlsx.util-BawfHUuI.js → xlsx.util-d5-VGpcM.js} +1 -1
- package/package.json +3 -3
- package/dist/ReceiveRequestView-fhTKkIJA.js +0 -2866
- package/dist/feature-BsDnCbpL.js +0 -25312
- package/dist/helper/reactivity.d.ts +0 -11
- package/dist/helper/reactivity.spec.d.ts +0 -1
- package/dist/views/receive-request/components/transfer-form/composables/use-purchase-order-form-controller.d.ts +0 -13974
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { defineComponent as ae, onMounted as Te, computed as
|
|
1
|
+
import { defineComponent as ae, onMounted as Te, computed as L, ref as Y, watch as Fe, inject as ot, resolveComponent as V, openBlock as $, createElementBlock as N, createElementVNode as e, createVNode as m, withCtx as U, renderSlot as xe, withDirectives as Pe, normalizeClass as re, vModelText as Be, reactive as st, h as j, toDisplayString as I, unref as t, createCommentVNode as oe, Fragment as pe, normalizeStyle as _e, renderList as je, createBlock as le, mergeProps as Qe, createTextVNode as ne, mergeModels as qe, useModel as lt, isRef as Ye, Teleport as nt, normalizeProps as at, guardReactiveProps as rt } from "vue";
|
|
2
2
|
import { u as it, _ as ut } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
|
|
3
3
|
import { useI18n as me } from "@feedmepos/mf-common";
|
|
4
|
-
import { f as dt, t as mt, u as
|
|
5
|
-
import { R as
|
|
6
|
-
import { a as We, s as Ee,
|
|
7
|
-
import { _ as ft } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-
|
|
4
|
+
import { P as X, f as dt, t as mt, u as Ne, a as pt } from "./format-unit-display-CIh10egg.js";
|
|
5
|
+
import { R as Le } from "./row-action.enum-BcW_L_nE.js";
|
|
6
|
+
import { a as We, s as Ee, u as Ge, t as ct, k as ye } from "./app-DsvKAAar.js";
|
|
7
|
+
import { _ as ft } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-qkS1g4m3.js";
|
|
8
8
|
import { components as ue, useSnackbar as yt, useProxiedModel as Ke, useBreakpoints as vt } from "@feedmepos/ui-library";
|
|
9
9
|
import { defineStore as bt, storeToRefs as ze } from "pinia";
|
|
10
10
|
import { F as de } from "./form-mode.enum-BKiNVH6A.js";
|
|
11
|
-
import { u as he, t as
|
|
12
|
-
import { d as Ze } from "./defineDeepModel-
|
|
13
|
-
import { _ as Tt, F as Ft, a as Ct, b as
|
|
14
|
-
import { u as ge } from "./feature-
|
|
15
|
-
import { c as
|
|
16
|
-
import { u as Je } from "./netsuite-
|
|
17
|
-
import { u as Ot } from "./supplier-
|
|
18
|
-
import { u as Dt } from "./use-ingredient-select-dialog-
|
|
11
|
+
import { u as he, t as He, I as gt, b as ht, n as xt, a as se, c as _t, R as ke, g as be, d as ve, A as we, M as kt, e as wt } from "./rules-BRx1HG7R.js";
|
|
12
|
+
import { d as Ze } from "./defineDeepModel-DKSKw3d8.js";
|
|
13
|
+
import { _ as Tt, F as Ft, a as Ct, b as St } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-dnE7g0iB.js";
|
|
14
|
+
import { u as ge } from "./feature-Chb7LGRV.js";
|
|
15
|
+
import { c as It, u as Mt, _ as $t } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DU2xeJtz.js";
|
|
16
|
+
import { u as Je } from "./netsuite-BSgSRRLZ.js";
|
|
17
|
+
import { u as Ot } from "./supplier-BLMn0x03.js";
|
|
18
|
+
import { u as Dt } from "./use-ingredient-select-dialog-Djd_7uji.js";
|
|
19
19
|
import { F as ee, _ as Xe } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
20
|
-
import { u as Vt } from "./use-template-enabled-locations-2-
|
|
21
|
-
import { u as
|
|
22
|
-
import { f as
|
|
23
|
-
import { f as
|
|
24
|
-
const
|
|
20
|
+
import { u as Vt } from "./use-template-enabled-locations-2-C0JE_mEH.js";
|
|
21
|
+
import { u as Rt } from "./purchase-order-template-gLB1CO-a.js";
|
|
22
|
+
import { f as At } from "./format-time-from-id-C0ju5W3p.js";
|
|
23
|
+
import { f as Ut } from "./date2-DPON4K9X.js";
|
|
24
|
+
const Pt = { class: "flex flex-col" }, Bt = { class: "flex flex-col" }, qt = { class: "flex-1" }, Nt = { class: "flex items-center" }, Lt = { class: "flex-1" }, Et = { class: "flex-1" }, zt = /* @__PURE__ */ ae({
|
|
25
25
|
__name: "FmMinMaxInput",
|
|
26
26
|
props: {
|
|
27
27
|
rules: {},
|
|
@@ -67,34 +67,34 @@ const Ut = { class: "flex flex-col" }, qt = { class: "flex flex-col" }, Pt = { c
|
|
|
67
67
|
v.min = i, v.max = g;
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
|
-
const r =
|
|
70
|
+
const r = L(() => {
|
|
71
71
|
const { min: d, max: y } = v ?? {};
|
|
72
72
|
return Math.max((d == null ? void 0 : d.precision) ?? 0, (y == null ? void 0 : y.precision) ?? 0, h.precision ?? 0);
|
|
73
73
|
}), s = (d) => {
|
|
74
74
|
if (!d) return "";
|
|
75
75
|
const y = ht(d), w = r.value, i = he(y, w);
|
|
76
|
-
return
|
|
76
|
+
return xt(
|
|
77
77
|
+se(i),
|
|
78
78
|
i.precision
|
|
79
79
|
);
|
|
80
|
-
}, u =
|
|
81
|
-
Fe([u,
|
|
80
|
+
}, u = Y(s(v.min)), x = Y(s(v.max));
|
|
81
|
+
Fe([u, x], ([d, y]) => {
|
|
82
82
|
const w = v ?? {}, i = a(d), g = a(y), O = r.value;
|
|
83
83
|
if (d !== "" && i === !0) {
|
|
84
|
-
const
|
|
85
|
-
w.min =
|
|
84
|
+
const M = He(+d, O);
|
|
85
|
+
w.min = M;
|
|
86
86
|
} else
|
|
87
87
|
w.min = null;
|
|
88
88
|
if (y !== "" && g === !0) {
|
|
89
|
-
const
|
|
90
|
-
w.max =
|
|
89
|
+
const M = He(+y, O);
|
|
90
|
+
w.max = M;
|
|
91
91
|
} else
|
|
92
92
|
w.max = null;
|
|
93
93
|
v.min = w.min, v.max = w.max;
|
|
94
94
|
});
|
|
95
|
-
const C = Symbol.for("fm:form-state"), c = ot(C, null), o =
|
|
95
|
+
const C = Symbol.for("fm:form-state"), c = ot(C, null), o = L(() => h.disabled ?? (c == null ? void 0 : c.getDisabled()) ?? !1), f = Y(), b = Y(), k = Y(!1), T = Y(!1), A = L(() => k.value || T.value), P = L(() => [...[
|
|
96
96
|
function() {
|
|
97
|
-
return typeof a(u.value) == "string" || typeof a(
|
|
97
|
+
return typeof a(u.value) == "string" || typeof a(x.value) == "string" ? "Must be a number" : !0;
|
|
98
98
|
},
|
|
99
99
|
function(w) {
|
|
100
100
|
return !w || !w.min || !w.max ? !0 : +se(w.min) > +se(w.max) ? "Min must be less than or equal to max" : !0;
|
|
@@ -102,9 +102,9 @@ const Ut = { class: "flex flex-col" }, qt = { class: "flex flex-col" }, Pt = { c
|
|
|
102
102
|
], ...h.rules ?? []]);
|
|
103
103
|
return (d, y) => {
|
|
104
104
|
const w = V("FmLabel"), i = V("FmField"), g = V("FmFormGroup");
|
|
105
|
-
return
|
|
106
|
-
e("div",
|
|
107
|
-
e("div",
|
|
105
|
+
return $(), N("div", Pt, [
|
|
106
|
+
e("div", Bt, [
|
|
107
|
+
e("div", qt, [
|
|
108
108
|
m(w, {
|
|
109
109
|
label: d.label,
|
|
110
110
|
disabled: d.disabled,
|
|
@@ -112,13 +112,13 @@ const Ut = { class: "flex flex-col" }, qt = { class: "flex flex-col" }, Pt = { c
|
|
|
112
112
|
optional: d.labelMark === "optional"
|
|
113
113
|
}, null, 8, ["label", "disabled", "required", "optional"])
|
|
114
114
|
]),
|
|
115
|
-
m(i, { focused:
|
|
116
|
-
default:
|
|
117
|
-
e("div",
|
|
118
|
-
|
|
115
|
+
m(i, { focused: A.value }, {
|
|
116
|
+
default: U(() => [
|
|
117
|
+
e("div", Nt, [
|
|
118
|
+
xe(d.$slots, "prepend"),
|
|
119
119
|
y[6] || (y[6] = e("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400 pr-4" }, "Min.", -1)),
|
|
120
|
-
e("div",
|
|
121
|
-
|
|
120
|
+
e("div", Lt, [
|
|
121
|
+
Pe(e("input", {
|
|
122
122
|
type: "text",
|
|
123
123
|
ref_key: "minInputRef",
|
|
124
124
|
ref: f,
|
|
@@ -131,29 +131,29 @@ const Ut = { class: "flex flex-col" }, qt = { class: "flex flex-col" }, Pt = { c
|
|
|
131
131
|
"text-fm-color-typo-disabled": o.value
|
|
132
132
|
})
|
|
133
133
|
}, null, 34), [
|
|
134
|
-
[
|
|
134
|
+
[Be, u.value]
|
|
135
135
|
])
|
|
136
136
|
]),
|
|
137
137
|
y[7] || (y[7] = e("div", { class: "block h-32 mx-4 w-[1px] bg-fm-color-neutral-gray-200" }, null, -1)),
|
|
138
138
|
y[8] || (y[8] = e("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400 pr-4" }, "Max.", -1)),
|
|
139
139
|
e("div", Et, [
|
|
140
|
-
|
|
140
|
+
Pe(e("input", {
|
|
141
141
|
type: "text",
|
|
142
142
|
ref_key: "maxInputRef",
|
|
143
143
|
ref: b,
|
|
144
144
|
onFocus: y[3] || (y[3] = () => T.value = !0),
|
|
145
145
|
onBlur: y[4] || (y[4] = () => T.value = !1),
|
|
146
|
-
"onUpdate:modelValue": y[5] || (y[5] = (O) =>
|
|
146
|
+
"onUpdate:modelValue": y[5] || (y[5] = (O) => x.value = O),
|
|
147
147
|
class: re({
|
|
148
148
|
"fm-text-field--input fm-typo-en-body-lg-400": !0,
|
|
149
149
|
"text-fm-color-typo-primary": !o.value,
|
|
150
150
|
"text-fm-color-typo-disabled": o.value
|
|
151
151
|
})
|
|
152
152
|
}, null, 34), [
|
|
153
|
-
[
|
|
153
|
+
[Be, x.value]
|
|
154
154
|
])
|
|
155
155
|
]),
|
|
156
|
-
|
|
156
|
+
xe(d.$slots, "append")
|
|
157
157
|
])
|
|
158
158
|
]),
|
|
159
159
|
_: 3
|
|
@@ -163,7 +163,7 @@ const Ut = { class: "flex flex-col" }, qt = { class: "flex flex-col" }, Pt = { c
|
|
|
163
163
|
class: "flex-1",
|
|
164
164
|
"model-value": d.modelValue,
|
|
165
165
|
info: d.labelInfo,
|
|
166
|
-
rules:
|
|
166
|
+
rules: P.value,
|
|
167
167
|
"helper-text": d.helperText,
|
|
168
168
|
"helper-state": d.helperState
|
|
169
169
|
}, null, 8, ["model-value", "info", "rules", "helper-text", "helper-state"])
|
|
@@ -171,18 +171,18 @@ const Ut = { class: "flex flex-col" }, qt = { class: "flex flex-col" }, Pt = { c
|
|
|
171
171
|
};
|
|
172
172
|
}
|
|
173
173
|
});
|
|
174
|
-
function
|
|
174
|
+
function Ht({ min: p, max: h } = { min: !0, max: !0 }) {
|
|
175
175
|
return function(a) {
|
|
176
176
|
return !a || !a.min && p != !1 || !a.max && h != !1 ? "Required" : !0;
|
|
177
177
|
};
|
|
178
178
|
}
|
|
179
|
-
function
|
|
179
|
+
function jt(p, h) {
|
|
180
180
|
return function(a) {
|
|
181
181
|
return !a || !a.min || !a.max ? !0 : +se(a.min) < p ? `Must be between ${p} and ${h}` : +se(a.max) > h ? `Must be between ${p} and ${h}` : !0;
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
|
-
function
|
|
185
|
-
const h =
|
|
184
|
+
function Qt(p) {
|
|
185
|
+
const h = _t(p), v = se(p);
|
|
186
186
|
return function(r) {
|
|
187
187
|
const s = !(r != null && r.min) || h(r.min) === !0, u = !(r != null && r.max) || h(r.max) === !0;
|
|
188
188
|
return !s && !u ? `Min & max must be a multiple of ${v}` : s ? u ? !0 : `Max must be a multiple of ${v}` : `Min must be a multiple of ${v}`;
|
|
@@ -196,30 +196,30 @@ const et = bt("netsuite-custom-field-helper", () => {
|
|
|
196
196
|
u == null || u("Unit is not valid");
|
|
197
197
|
return;
|
|
198
198
|
}
|
|
199
|
-
let
|
|
199
|
+
let x = v.code;
|
|
200
200
|
if (p.isEnabled) {
|
|
201
201
|
const c = p.getItemCustomCode(a, (C = r.measurement) == null ? void 0 : C.id);
|
|
202
|
-
c && (
|
|
202
|
+
c && (x = c);
|
|
203
203
|
}
|
|
204
204
|
s({
|
|
205
205
|
...v,
|
|
206
206
|
quantity: r.amount,
|
|
207
207
|
measurement: r.measurement ?? null,
|
|
208
|
-
code:
|
|
208
|
+
code: x
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
211
|
return {
|
|
212
212
|
validateUnitInput: h
|
|
213
213
|
};
|
|
214
214
|
});
|
|
215
|
-
var
|
|
216
|
-
function
|
|
215
|
+
var Q = /* @__PURE__ */ ((p) => (p.Code = "Code", p.Name = "Name", p.DefaultAmount = "DefaultAmount", p.Limit = "Limit", p.Step = "Step", p.Cost = "Cost", p.Delete = "Delete", p))(Q || {});
|
|
216
|
+
function Yt(p, h = {}) {
|
|
217
217
|
const { t: v } = me(), a = We(), r = ge(), s = st({}), u = et();
|
|
218
218
|
Te(() => {
|
|
219
219
|
for (const c of p.items) {
|
|
220
220
|
if (!c.totalCost)
|
|
221
221
|
continue;
|
|
222
|
-
const { cost: o } =
|
|
222
|
+
const { cost: o } = It(
|
|
223
223
|
c.sku,
|
|
224
224
|
c.quantity,
|
|
225
225
|
c.measurement,
|
|
@@ -230,12 +230,12 @@ function Ht(p, h = {}) {
|
|
|
230
230
|
o ? s[c.sku._id] = o.amount !== f.amount || o.precision !== f.precision : s[c.sku._id] = !0;
|
|
231
231
|
}
|
|
232
232
|
});
|
|
233
|
-
const
|
|
233
|
+
const x = [
|
|
234
234
|
{
|
|
235
235
|
id: "Code",
|
|
236
|
-
header: () =>
|
|
237
|
-
|
|
238
|
-
|
|
236
|
+
header: () => j("div", { class: "flex-col" }, [
|
|
237
|
+
j("div", v("inventory.transfer.form.items.table.Code")),
|
|
238
|
+
j(
|
|
239
239
|
"div",
|
|
240
240
|
{ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
241
241
|
"(original code)"
|
|
@@ -245,8 +245,8 @@ function Ht(p, h = {}) {
|
|
|
245
245
|
size: 180,
|
|
246
246
|
cell(c) {
|
|
247
247
|
const o = c.row.original;
|
|
248
|
-
return
|
|
249
|
-
|
|
248
|
+
return j("div", [
|
|
249
|
+
j(ue.FmTextField, {
|
|
250
250
|
modelValue: o.code,
|
|
251
251
|
"onUpdate:modelValue": (f) => {
|
|
252
252
|
p.updateItem({
|
|
@@ -265,9 +265,9 @@ function Ht(p, h = {}) {
|
|
|
265
265
|
},
|
|
266
266
|
{
|
|
267
267
|
id: "Name",
|
|
268
|
-
header: () =>
|
|
269
|
-
|
|
270
|
-
|
|
268
|
+
header: () => j("div", { class: "flex-col" }, [
|
|
269
|
+
j("div", v("inventory.transfer.form.items.table.Name")),
|
|
270
|
+
j(
|
|
271
271
|
"div",
|
|
272
272
|
{ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
273
273
|
"(original name)"
|
|
@@ -276,8 +276,8 @@ function Ht(p, h = {}) {
|
|
|
276
276
|
minSize: 300,
|
|
277
277
|
cell(c) {
|
|
278
278
|
const o = c.row.original;
|
|
279
|
-
return
|
|
280
|
-
|
|
279
|
+
return j("div", [
|
|
280
|
+
j(ue.FmTextField, {
|
|
281
281
|
modelValue: o.name,
|
|
282
282
|
"onUpdate:modelValue": (f) => {
|
|
283
283
|
p.updateItem({
|
|
@@ -299,12 +299,12 @@ function Ht(p, h = {}) {
|
|
|
299
299
|
header: () => v("inventory.transfer.form.items.table.DefaultAmount"),
|
|
300
300
|
minSize: 200,
|
|
301
301
|
cell(c) {
|
|
302
|
-
var
|
|
303
|
-
const o = c.row.original, f = a.skuById[o.sku._id], b = a.unitById[(
|
|
302
|
+
var A;
|
|
303
|
+
const o = c.row.original, f = a.skuById[o.sku._id], b = a.unitById[(A = f.unit) == null ? void 0 : A._id], k = b.measurements.find((P) => {
|
|
304
304
|
var d;
|
|
305
|
-
return ((d = o.measurement) == null ? void 0 : d.id) ===
|
|
305
|
+
return ((d = o.measurement) == null ? void 0 : d.id) === P.id;
|
|
306
306
|
}), T = o.sku.unit._id !== f.unit._id || !b || o.measurement && !k;
|
|
307
|
-
return
|
|
307
|
+
return j(Tt, {
|
|
308
308
|
style: {
|
|
309
309
|
flex: "1 1 0%"
|
|
310
310
|
},
|
|
@@ -316,11 +316,11 @@ function Ht(p, h = {}) {
|
|
|
316
316
|
disabled: p.disabled,
|
|
317
317
|
key: o.sku._id,
|
|
318
318
|
unit: b,
|
|
319
|
-
"onUpdate:modelValue": (
|
|
319
|
+
"onUpdate:modelValue": (P) => {
|
|
320
320
|
u.validateUnitInput(
|
|
321
321
|
o,
|
|
322
322
|
f,
|
|
323
|
-
|
|
323
|
+
P,
|
|
324
324
|
(d) => {
|
|
325
325
|
p.updateItem({
|
|
326
326
|
...o,
|
|
@@ -344,7 +344,7 @@ function Ht(p, h = {}) {
|
|
|
344
344
|
)
|
|
345
345
|
)
|
|
346
346
|
] : [],
|
|
347
|
-
|
|
347
|
+
St(
|
|
348
348
|
o.maximumQuantity ? +se(o.maximumQuantity) : 1 / 0
|
|
349
349
|
),
|
|
350
350
|
function(d) {
|
|
@@ -363,7 +363,7 @@ function Ht(p, h = {}) {
|
|
|
363
363
|
minSize: 280,
|
|
364
364
|
cell(c) {
|
|
365
365
|
const o = c.row.original;
|
|
366
|
-
return
|
|
366
|
+
return j(zt, {
|
|
367
367
|
style: {
|
|
368
368
|
flex: "1 1 0%"
|
|
369
369
|
},
|
|
@@ -379,9 +379,9 @@ function Ht(p, h = {}) {
|
|
|
379
379
|
f != null && f.min ? b.minimumQuantity = f.min : b.minimumQuantity = null, f != null && f.max ? b.maximumQuantity = f.max : b.maximumQuantity = null, p.updateItem(b);
|
|
380
380
|
},
|
|
381
381
|
rules: [
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
382
|
+
Ht({ max: !1 }),
|
|
383
|
+
Qt(o.quantityStep),
|
|
384
|
+
jt(
|
|
385
385
|
+se({
|
|
386
386
|
amount: 0,
|
|
387
387
|
precision: be(o.sku.unit, o.measurement)
|
|
@@ -400,7 +400,7 @@ function Ht(p, h = {}) {
|
|
|
400
400
|
minSize: 100,
|
|
401
401
|
cell(c) {
|
|
402
402
|
const o = c.row.original;
|
|
403
|
-
return
|
|
403
|
+
return j(ue.FmTextField, {
|
|
404
404
|
modelValue: se(o.quantityStep ?? Ee.reset(), !1),
|
|
405
405
|
key: o.sku._id,
|
|
406
406
|
"onUpdate:modelValue": (f) => {
|
|
@@ -425,8 +425,8 @@ function Ht(p, h = {}) {
|
|
|
425
425
|
header: "",
|
|
426
426
|
cell(c) {
|
|
427
427
|
const o = c.row.original;
|
|
428
|
-
return
|
|
429
|
-
r.usePurchaseOrderV2 ?
|
|
428
|
+
return j("div", { class: "flex items-center" }, [
|
|
429
|
+
r.usePurchaseOrderV2 ? j(
|
|
430
430
|
ue.FmTooltip,
|
|
431
431
|
{
|
|
432
432
|
zIndex: 50,
|
|
@@ -434,7 +434,7 @@ function Ht(p, h = {}) {
|
|
|
434
434
|
},
|
|
435
435
|
{
|
|
436
436
|
default() {
|
|
437
|
-
return
|
|
437
|
+
return j(ue.FmButton, {
|
|
438
438
|
key: o.sku._id,
|
|
439
439
|
type: "button",
|
|
440
440
|
icon: "add_circle",
|
|
@@ -470,7 +470,7 @@ function Ht(p, h = {}) {
|
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
472
|
) : null,
|
|
473
|
-
|
|
473
|
+
j(ue.FmButton, {
|
|
474
474
|
class: "delete-button",
|
|
475
475
|
key: o.sku._id,
|
|
476
476
|
type: "button",
|
|
@@ -493,15 +493,15 @@ function Ht(p, h = {}) {
|
|
|
493
493
|
}
|
|
494
494
|
];
|
|
495
495
|
return {
|
|
496
|
-
columnDefs:
|
|
497
|
-
const c = ge(), o = [...
|
|
496
|
+
columnDefs: L(() => {
|
|
497
|
+
const c = ge(), o = [...x];
|
|
498
498
|
if (Object.keys(h).length > 0)
|
|
499
499
|
for (const [f, b] of Object.entries(h))
|
|
500
500
|
o.splice(Number(f), 0, {
|
|
501
501
|
...b,
|
|
502
502
|
id: f
|
|
503
503
|
});
|
|
504
|
-
return c.enableTotalCost && p.transferType === X.
|
|
504
|
+
return c.enableTotalCost && p.transferType === X.PURCHASE ? o : o.filter((f) => f.id !== "Cost");
|
|
505
505
|
})
|
|
506
506
|
};
|
|
507
507
|
}
|
|
@@ -520,17 +520,17 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
520
520
|
return a;
|
|
521
521
|
}
|
|
522
522
|
return (a, r) => {
|
|
523
|
-
var u,
|
|
523
|
+
var u, x, C, c, o, f, b, k, T, A, P, d, y, w, i, g, O, M, _, W, te, E, B, Z, l, n, F, q, z, G;
|
|
524
524
|
const s = V("FmLabel");
|
|
525
|
-
return
|
|
525
|
+
return $(), N("div", Wt, [
|
|
526
526
|
e("div", Gt, [
|
|
527
527
|
e("div", Kt, [
|
|
528
|
-
e("span", Zt, " (" +
|
|
529
|
-
e("span", Jt,
|
|
528
|
+
e("span", Zt, " (" + I(a.row.original.sku.code) + ") ", 1),
|
|
529
|
+
e("span", Jt, I(a.row.original.sku.name), 1)
|
|
530
530
|
]),
|
|
531
531
|
e("div", null, [
|
|
532
532
|
m(t(ee), {
|
|
533
|
-
render: (C = (
|
|
533
|
+
render: (C = (x = (u = a.cellByColId.Delete) == null ? void 0 : u.column) == null ? void 0 : x.columnDef) == null ? void 0 : C.cell,
|
|
534
534
|
props: (o = (c = a.cellByColId.Delete) == null ? void 0 : c.getContext) == null ? void 0 : o.call(c)
|
|
535
535
|
}, null, 8, ["render", "props"])
|
|
536
536
|
])
|
|
@@ -538,43 +538,43 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
538
538
|
e("div", Xt, [
|
|
539
539
|
e("div", eo, [
|
|
540
540
|
m(s, {
|
|
541
|
-
label: t(h)(`inventory.transfer.form.items.table.${t(
|
|
541
|
+
label: t(h)(`inventory.transfer.form.items.table.${t(Q).Code}`)
|
|
542
542
|
}, null, 8, ["label"]),
|
|
543
543
|
m(t(ee), {
|
|
544
|
-
render: (k = (b = (f = a.cellByColId[t(
|
|
545
|
-
props: (
|
|
544
|
+
render: (k = (b = (f = a.cellByColId[t(Q).Code]) == null ? void 0 : f.column) == null ? void 0 : b.columnDef) == null ? void 0 : k.cell,
|
|
545
|
+
props: (A = (T = a.cellByColId[t(Q).Code]) == null ? void 0 : T.getContext) == null ? void 0 : A.call(T)
|
|
546
546
|
}, null, 8, ["render", "props"]),
|
|
547
547
|
r[0] || (r[0] = e("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
548
548
|
]),
|
|
549
549
|
e("div", to, [
|
|
550
550
|
m(s, {
|
|
551
|
-
label: t(h)(`inventory.transfer.form.items.table.${t(
|
|
551
|
+
label: t(h)(`inventory.transfer.form.items.table.${t(Q).Name}`)
|
|
552
552
|
}, null, 8, ["label"]),
|
|
553
553
|
m(t(ee), {
|
|
554
|
-
render: (y = (d = (
|
|
555
|
-
props: (i = (w = a.cellByColId[t(
|
|
554
|
+
render: (y = (d = (P = a.cellByColId[t(Q).Name]) == null ? void 0 : P.column) == null ? void 0 : d.columnDef) == null ? void 0 : y.cell,
|
|
555
|
+
props: (i = (w = a.cellByColId[t(Q).Name]) == null ? void 0 : w.getContext) == null ? void 0 : i.call(w)
|
|
556
556
|
}, null, 8, ["render", "props"]),
|
|
557
557
|
r[1] || (r[1] = e("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
558
558
|
])
|
|
559
559
|
]),
|
|
560
|
-
a.row.original ? (
|
|
560
|
+
a.row.original ? ($(), N("div", oo, [
|
|
561
561
|
e("div", so, [
|
|
562
562
|
m(s, {
|
|
563
|
-
label: t(h)(`inventory.transfer.form.items.table.${t(
|
|
563
|
+
label: t(h)(`inventory.transfer.form.items.table.${t(Q).DefaultAmount}`)
|
|
564
564
|
}, null, 8, ["label"]),
|
|
565
565
|
m(t(ee), {
|
|
566
|
-
render: (
|
|
567
|
-
props: (W = (
|
|
566
|
+
render: (M = (O = (g = a.cellByColId[t(Q).DefaultAmount]) == null ? void 0 : g.column) == null ? void 0 : O.columnDef) == null ? void 0 : M.cell,
|
|
567
|
+
props: (W = (_ = a.cellByColId[t(Q).DefaultAmount]) == null ? void 0 : _.getContext) == null ? void 0 : W.call(_)
|
|
568
568
|
}, null, 8, ["render", "props"]),
|
|
569
569
|
r[2] || (r[2] = e("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
570
570
|
]),
|
|
571
571
|
e("div", lo, [
|
|
572
572
|
m(s, {
|
|
573
|
-
label: t(h)(`inventory.transfer.form.items.table.${t(
|
|
573
|
+
label: t(h)(`inventory.transfer.form.items.table.${t(Q).Step}`)
|
|
574
574
|
}, null, 8, ["label"]),
|
|
575
575
|
m(t(ee), {
|
|
576
|
-
render: (
|
|
577
|
-
props: (l = (Z = a.cellByColId[t(
|
|
576
|
+
render: (B = (E = (te = a.cellByColId[t(Q).Step]) == null ? void 0 : te.column) == null ? void 0 : E.columnDef) == null ? void 0 : B.cell,
|
|
577
|
+
props: (l = (Z = a.cellByColId[t(Q).Step]) == null ? void 0 : Z.getContext) == null ? void 0 : l.call(Z)
|
|
578
578
|
}, null, 8, ["render", "props"]),
|
|
579
579
|
r[3] || (r[3] = e("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
580
580
|
])
|
|
@@ -582,11 +582,11 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
582
582
|
e("div", no, [
|
|
583
583
|
e("div", ao, [
|
|
584
584
|
m(s, {
|
|
585
|
-
label: t(h)(`inventory.transfer.form.items.table.${t(
|
|
585
|
+
label: t(h)(`inventory.transfer.form.items.table.${t(Q).Limit}`)
|
|
586
586
|
}, null, 8, ["label"]),
|
|
587
587
|
m(t(ee), {
|
|
588
|
-
render: (
|
|
589
|
-
props: (G = (z = a.cellByColId[t(
|
|
588
|
+
render: (q = (F = (n = a.cellByColId[t(Q).Limit]) == null ? void 0 : n.column) == null ? void 0 : F.columnDef) == null ? void 0 : q.cell,
|
|
589
|
+
props: (G = (z = a.cellByColId[t(Q).Limit]) == null ? void 0 : z.getContext) == null ? void 0 : G.call(z)
|
|
590
590
|
}, null, 8, ["render", "props"]),
|
|
591
591
|
r[4] || (r[4] = e("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
592
592
|
])
|
|
@@ -606,18 +606,18 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
606
606
|
function h(v) {
|
|
607
607
|
return v.column.columnDef.meta;
|
|
608
608
|
}
|
|
609
|
-
return (v, a) => (
|
|
609
|
+
return (v, a) => ($(), N(pe, null, [
|
|
610
610
|
e("tr", {
|
|
611
611
|
class: "hover:bg-fm-color-opacity-sm border-b border-fm-color-neutral-gray-100",
|
|
612
|
-
style:
|
|
612
|
+
style: _e({ backgroundColor: v.errorMessage ? "#ffd6d6" : void 0 })
|
|
613
613
|
}, [
|
|
614
|
-
(
|
|
615
|
-
var s, u,
|
|
616
|
-
return
|
|
614
|
+
($(!0), N(pe, null, je(v.row.getVisibleCells(), (r) => {
|
|
615
|
+
var s, u, x, C, c;
|
|
616
|
+
return $(), N("td", {
|
|
617
617
|
key: r.id,
|
|
618
618
|
class: re(["text-fm-color-typo-primary", ((s = h(r)) == null ? void 0 : s.cellClass) ?? "px-16", "py-2"]),
|
|
619
|
-
style:
|
|
620
|
-
width: (u = h(r)) != null && u.width ? (
|
|
619
|
+
style: _e({
|
|
620
|
+
width: (u = h(r)) != null && u.width ? (x = h(r)) == null ? void 0 : x.width : r.column.getSize() !== 0 ? `${r.column.getSize()}px` : void 0,
|
|
621
621
|
maxWidth: (C = h(r)) == null ? void 0 : C.maxWidth,
|
|
622
622
|
textAlign: ((c = h(r)) == null ? void 0 : c.textAlign) ?? "left"
|
|
623
623
|
})
|
|
@@ -631,15 +631,15 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
631
631
|
], 6);
|
|
632
632
|
}), 128))
|
|
633
633
|
], 4),
|
|
634
|
-
v.errorMessage ? (
|
|
634
|
+
v.errorMessage ? ($(), N("tr", uo, [
|
|
635
635
|
e("td", {
|
|
636
636
|
colspan: v.row.getVisibleCells().length,
|
|
637
637
|
class: "text-red-600 px-16 py-2"
|
|
638
|
-
},
|
|
638
|
+
}, I(v.errorMessage), 9, mo)
|
|
639
639
|
])) : oe("", !0)
|
|
640
640
|
], 64));
|
|
641
641
|
}
|
|
642
|
-
}), co = { class: "flex flex-col gap-16" }, fo = { class: "flex flex-col gap-24" }, yo = { class: "flex flex-col gap-16" }, vo = { class: "flex items-center" }, bo = { class: "flex flex-col" }, go = { class: "flex flex-col gap-16" }, ho = { class: "flex gap-3" },
|
|
642
|
+
}), co = { class: "flex flex-col gap-16" }, fo = { class: "flex flex-col gap-24" }, yo = { class: "flex flex-col gap-16" }, vo = { class: "flex items-center" }, bo = { class: "flex flex-col" }, go = { class: "flex flex-col gap-16" }, ho = { class: "flex gap-3" }, xo = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, _o = {
|
|
643
643
|
key: 0,
|
|
644
644
|
class: "border rounded-sm px-8 py-2 bg-fm-color-system-warning-100 fm-typo-en-body-lg-400"
|
|
645
645
|
}, ko = { class: "border rounded-sm px-8 py-2 bg-fm-color-system-info-100 fm-typo-en-body-lg-400" }, wo = { class: "mb-2" }, To = /* @__PURE__ */ ae({
|
|
@@ -650,16 +650,16 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
650
650
|
},
|
|
651
651
|
emits: ["update:disabled"],
|
|
652
652
|
setup(p, { expose: h, emit: v }) {
|
|
653
|
-
const a = p, r = v, s = Ze(), { t: u } = me(),
|
|
653
|
+
const a = p, r = v, s = Ze(), { t: u } = me(), x = Y({}), C = Ge(), c = We(), o = Ot(), f = ge(), b = Je(), k = et();
|
|
654
654
|
Fe(
|
|
655
655
|
() => s.purchaseOrder.items.length,
|
|
656
656
|
() => {
|
|
657
|
-
|
|
657
|
+
x.value = {};
|
|
658
658
|
}
|
|
659
659
|
), C.watchLocation(async () => {
|
|
660
660
|
location && (s.purchaseOrder.supplier || (s.purchaseOrder.supplier = o.suppliers.find((l) => l) ?? s.purchaseOrder.supplier));
|
|
661
661
|
});
|
|
662
|
-
const T =
|
|
662
|
+
const T = Mt(
|
|
663
663
|
() => s.purchaseOrder,
|
|
664
664
|
(l) => {
|
|
665
665
|
s.purchaseOrder = {
|
|
@@ -667,17 +667,17 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
667
667
|
supplier: l.supplier ?? (s == null ? void 0 : s.purchaseOrder.supplier)
|
|
668
668
|
};
|
|
669
669
|
}
|
|
670
|
-
),
|
|
670
|
+
), A = L({
|
|
671
671
|
get() {
|
|
672
672
|
var l, n;
|
|
673
|
-
return typeof ((n = (l = s.purchaseOrder) == null ? void 0 : l.supplier) == null ? void 0 : n.internal) == "string" ? X.
|
|
673
|
+
return typeof ((n = (l = s.purchaseOrder) == null ? void 0 : l.supplier) == null ? void 0 : n.internal) == "string" ? X.TRANSFER : X.PURCHASE;
|
|
674
674
|
},
|
|
675
675
|
set(l) {
|
|
676
|
-
var F,
|
|
677
|
-
const n = typeof ((
|
|
678
|
-
l !== n && (s.purchaseOrder.supplier = l === X.
|
|
676
|
+
var F, q;
|
|
677
|
+
const n = typeof ((q = (F = s.purchaseOrder) == null ? void 0 : F.supplier) == null ? void 0 : q.internal) == "string" ? X.TRANSFER : X.PURCHASE;
|
|
678
|
+
l !== n && (s.purchaseOrder.supplier = l === X.PURCHASE ? T.locationOptionsTypePurchase.value[0] : T.locationOptionsTypeTransfer.value[0]);
|
|
679
679
|
}
|
|
680
|
-
}),
|
|
680
|
+
}), P = L(() => T.transferLocationOptions.value), d = L({
|
|
681
681
|
get() {
|
|
682
682
|
var l;
|
|
683
683
|
return (l = s.purchaseOrder.supplier) == null ? void 0 : l._id;
|
|
@@ -693,7 +693,7 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
693
693
|
},
|
|
694
694
|
templateItems: s.purchaseOrder.items
|
|
695
695
|
});
|
|
696
|
-
|
|
696
|
+
x.value = l, r("update:disabled", !1);
|
|
697
697
|
}
|
|
698
698
|
const {
|
|
699
699
|
promptSelectLocations: w,
|
|
@@ -710,33 +710,33 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
710
710
|
function O() {
|
|
711
711
|
var l, n;
|
|
712
712
|
return (l = s.locations) != null && l.find((F) => {
|
|
713
|
-
var
|
|
714
|
-
return ((
|
|
713
|
+
var q, z;
|
|
714
|
+
return ((q = F.doc) == null ? void 0 : q._id) === ((z = s.purchaseOrder.supplier) == null ? void 0 : z._id);
|
|
715
715
|
}) ? `Location ${(n = s.purchaseOrder.supplier) == null ? void 0 : n.name} must be removed because template cannot be used to transfer to itself.` : !0;
|
|
716
716
|
}
|
|
717
|
-
const
|
|
717
|
+
const M = L({
|
|
718
718
|
get() {
|
|
719
719
|
return s.purchaseOrder.remark ?? void 0;
|
|
720
720
|
},
|
|
721
721
|
set(l) {
|
|
722
722
|
s.purchaseOrder.remark = l;
|
|
723
723
|
}
|
|
724
|
-
}),
|
|
724
|
+
}), _ = Y();
|
|
725
725
|
h({
|
|
726
726
|
validateInputs: () => {
|
|
727
727
|
var l, n;
|
|
728
|
-
(n = (l =
|
|
728
|
+
(n = (l = _.value) == null ? void 0 : l.validateInputs) == null || n.call(l);
|
|
729
729
|
},
|
|
730
730
|
resetInputsValidation: () => {
|
|
731
731
|
var l, n;
|
|
732
|
-
(n = (l =
|
|
732
|
+
(n = (l = _.value) == null ? void 0 : l.resetInputsValidation) == null || n.call(l);
|
|
733
733
|
},
|
|
734
734
|
resetInputs: () => {
|
|
735
735
|
var l, n;
|
|
736
|
-
(n = (l =
|
|
736
|
+
(n = (l = _.value) == null ? void 0 : l.resetInputs) == null || n.call(l);
|
|
737
737
|
}
|
|
738
738
|
});
|
|
739
|
-
const W =
|
|
739
|
+
const W = L(() => ({
|
|
740
740
|
duplicateItem: (l) => {
|
|
741
741
|
s.purchaseOrder.items = [
|
|
742
742
|
...s.purchaseOrder.items,
|
|
@@ -754,7 +754,7 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
754
754
|
let n = [];
|
|
755
755
|
l.id ? n = s.purchaseOrder.items.filter((F) => F.id !== l.id) : n = s.purchaseOrder.items.filter((F) => F.sku._id !== l.sku._id), s.purchaseOrder.items = n;
|
|
756
756
|
}
|
|
757
|
-
})), te =
|
|
757
|
+
})), te = Yt(
|
|
758
758
|
{
|
|
759
759
|
duplicateItem: W.value.duplicateItem,
|
|
760
760
|
updateItem: W.value.updateItem,
|
|
@@ -766,14 +766,14 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
766
766
|
return s.purchaseOrder.items;
|
|
767
767
|
},
|
|
768
768
|
get transferType() {
|
|
769
|
-
return X.
|
|
769
|
+
return X.PURCHASE;
|
|
770
770
|
},
|
|
771
771
|
get disabled() {
|
|
772
772
|
return a.disabled;
|
|
773
773
|
}
|
|
774
774
|
},
|
|
775
775
|
b.transferTemplateColumnDefs({
|
|
776
|
-
onUpdate: (l, n, F,
|
|
776
|
+
onUpdate: (l, n, F, q) => {
|
|
777
777
|
if (l < 0 || l >= s.purchaseOrder.items.length) return;
|
|
778
778
|
const z = s.purchaseOrder.items[l];
|
|
779
779
|
z && W.value.updateItem({
|
|
@@ -781,31 +781,31 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
781
781
|
sku: n,
|
|
782
782
|
// Sku might be outdated, so we need to update it
|
|
783
783
|
code: F,
|
|
784
|
-
measurement:
|
|
784
|
+
measurement: q
|
|
785
785
|
});
|
|
786
786
|
}
|
|
787
787
|
})
|
|
788
|
-
), E =
|
|
788
|
+
), E = L(() => te.columnDefs.value), { promptSelectIngredients: B } = Dt();
|
|
789
789
|
async function Z() {
|
|
790
790
|
const n = c.skus.map((D) => ({
|
|
791
791
|
label: D.name,
|
|
792
792
|
sublabel: D.code,
|
|
793
793
|
value: D
|
|
794
794
|
})).filter((D) => {
|
|
795
|
-
var
|
|
796
|
-
return (
|
|
797
|
-
}).map((D) => D.value), F = s.purchaseOrder.items ?? [],
|
|
795
|
+
var R;
|
|
796
|
+
return (R = s.purchaseOrder.items) == null ? void 0 : R.find((K) => K.sku._id === D.value._id);
|
|
797
|
+
}).map((D) => D.value), F = s.purchaseOrder.items ?? [], q = await B(
|
|
798
798
|
n.map((D) => D._id),
|
|
799
799
|
(D) => {
|
|
800
|
-
const
|
|
800
|
+
const R = c.skuById[D], K = F.find((H) => H.sku._id === R._id);
|
|
801
801
|
if (K)
|
|
802
802
|
return K;
|
|
803
|
-
const J = { amount: 1, precision: be(
|
|
804
|
-
let
|
|
803
|
+
const J = { amount: 1, precision: be(R.unit) };
|
|
804
|
+
let S = {
|
|
805
805
|
id: f.usePurchaseOrderV2 ? crypto.randomUUID() : void 0,
|
|
806
|
-
sku:
|
|
807
|
-
code:
|
|
808
|
-
name:
|
|
806
|
+
sku: R,
|
|
807
|
+
code: R.code,
|
|
808
|
+
name: R.name,
|
|
809
809
|
quantity: J,
|
|
810
810
|
minimumQuantity: J,
|
|
811
811
|
// maximumQuantity: adjustmentAmountMultiplyDecimal(minimumQuantity, {
|
|
@@ -815,40 +815,40 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
815
815
|
quantityStep: J
|
|
816
816
|
};
|
|
817
817
|
return k.validateUnitInput(
|
|
818
|
-
|
|
819
|
-
|
|
818
|
+
S,
|
|
819
|
+
R,
|
|
820
820
|
{
|
|
821
821
|
amount: J,
|
|
822
822
|
measurement: null
|
|
823
823
|
},
|
|
824
|
-
(
|
|
825
|
-
|
|
824
|
+
(H) => {
|
|
825
|
+
S.code = H.code;
|
|
826
826
|
}
|
|
827
|
-
),
|
|
827
|
+
), S;
|
|
828
828
|
}
|
|
829
829
|
);
|
|
830
|
-
if (!
|
|
831
|
-
const z =
|
|
830
|
+
if (!q) return;
|
|
831
|
+
const z = q.map((D) => D.sku._id), G = [];
|
|
832
832
|
for (const D of z) {
|
|
833
|
-
const
|
|
834
|
-
if (
|
|
835
|
-
G.push(...
|
|
833
|
+
const R = F.filter((K) => K.sku._id === D);
|
|
834
|
+
if (R.length > 0)
|
|
835
|
+
G.push(...R);
|
|
836
836
|
else {
|
|
837
|
-
const K =
|
|
837
|
+
const K = q.find((J) => J.sku._id === D);
|
|
838
838
|
K && G.push(K);
|
|
839
839
|
}
|
|
840
840
|
}
|
|
841
|
-
G.sort((D,
|
|
841
|
+
G.sort((D, R) => D.sku.code.localeCompare(R.sku.code)), s.purchaseOrder.items = G;
|
|
842
842
|
}
|
|
843
843
|
return (l, n) => {
|
|
844
|
-
const F = V("FmTextField"),
|
|
845
|
-
return
|
|
844
|
+
const F = V("FmTextField"), q = V("FmSelect"), z = V("FmTextarea"), G = V("FmButton"), D = V("FmTable"), R = V("FmFormGroup"), K = V("FmForm");
|
|
845
|
+
return $(), le(K, {
|
|
846
846
|
ref_key: "formRef",
|
|
847
|
-
ref:
|
|
847
|
+
ref: _,
|
|
848
848
|
class: "flex flex-col gap-32",
|
|
849
849
|
disabled: l.disabled
|
|
850
850
|
}, {
|
|
851
|
-
default:
|
|
851
|
+
default: U(() => {
|
|
852
852
|
var J;
|
|
853
853
|
return [
|
|
854
854
|
e("div", co, [
|
|
@@ -857,63 +857,63 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
857
857
|
label: t(u)("inventory.transfer.form.name"),
|
|
858
858
|
"label-mark": "required",
|
|
859
859
|
modelValue: t(s).name,
|
|
860
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
860
|
+
"onUpdate:modelValue": n[0] || (n[0] = (S) => t(s).name = S),
|
|
861
861
|
rules: [t(ke)()]
|
|
862
862
|
}, null, 8, ["label", "modelValue", "rules"]),
|
|
863
|
-
m(
|
|
863
|
+
m(q, {
|
|
864
864
|
label: t(u)("inventory.transfer.form.type.title"),
|
|
865
|
-
"model-value":
|
|
866
|
-
"onUpdate:modelValue": n[1] || (n[1] = (
|
|
865
|
+
"model-value": A.value,
|
|
866
|
+
"onUpdate:modelValue": n[1] || (n[1] = (S) => A.value = S),
|
|
867
867
|
items: [
|
|
868
868
|
{
|
|
869
869
|
label: t(u)("inventory.transfer.form.type.purchase"),
|
|
870
|
-
value: t(X).
|
|
870
|
+
value: t(X).PURCHASE,
|
|
871
871
|
disabled: !t(T).locationOptionsTypePurchase.value.length,
|
|
872
872
|
sublabel: t(T).locationOptionsTypePurchase.value.length ? void 0 : t(u)("inventory.transfer.form.noSupplierAvailable")
|
|
873
873
|
},
|
|
874
874
|
{
|
|
875
875
|
label: t(u)("inventory.transfer.form.type.transfer"),
|
|
876
|
-
value: t(X).
|
|
876
|
+
value: t(X).TRANSFER,
|
|
877
877
|
disabled: !t(T).locationOptionsTypeTransfer.value.length,
|
|
878
878
|
sublabel: t(T).locationOptionsTypeTransfer.value.length ? void 0 : t(u)("inventory.transfer.form.noLocationAvailable")
|
|
879
879
|
}
|
|
880
880
|
],
|
|
881
|
-
rules: [t(we)(1)(
|
|
881
|
+
rules: [t(we)(1)(P.value)]
|
|
882
882
|
}, {
|
|
883
|
-
default:
|
|
883
|
+
default: U(() => [
|
|
884
884
|
e("span", {
|
|
885
885
|
class: re([
|
|
886
886
|
"line-clamp-1 fm-typo-en-body-lg-400",
|
|
887
887
|
l.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
888
888
|
])
|
|
889
|
-
},
|
|
889
|
+
}, I(t(ct)(A.value)), 3)
|
|
890
890
|
]),
|
|
891
891
|
_: 1
|
|
892
892
|
}, 8, ["label", "model-value", "items", "rules"]),
|
|
893
|
-
m(
|
|
894
|
-
label:
|
|
893
|
+
m(q, {
|
|
894
|
+
label: A.value === t(X).PURCHASE ? t(u)("inventory.transfer.form.purchaseFrom") : t(u)("inventory.transfer.form.transferFrom"),
|
|
895
895
|
modelValue: d.value,
|
|
896
|
-
"onUpdate:modelValue": n[2] || (n[2] = (
|
|
897
|
-
items:
|
|
896
|
+
"onUpdate:modelValue": n[2] || (n[2] = (S) => d.value = S),
|
|
897
|
+
items: P.value
|
|
898
898
|
}, {
|
|
899
|
-
"menu-wrapper":
|
|
900
|
-
var
|
|
899
|
+
"menu-wrapper": U((S) => {
|
|
900
|
+
var H;
|
|
901
901
|
return [
|
|
902
|
-
m(
|
|
903
|
-
items:
|
|
904
|
-
"model-value": (
|
|
902
|
+
m($t, Qe(S, {
|
|
903
|
+
items: P.value,
|
|
904
|
+
"model-value": (H = l.modelValue.purchaseOrder.supplier) == null ? void 0 : H._id
|
|
905
905
|
}), null, 16, ["items", "model-value"])
|
|
906
906
|
];
|
|
907
907
|
}),
|
|
908
|
-
default:
|
|
909
|
-
var
|
|
908
|
+
default: U(() => {
|
|
909
|
+
var S;
|
|
910
910
|
return [
|
|
911
911
|
e("span", {
|
|
912
912
|
class: re([
|
|
913
913
|
"line-clamp-1 fm-typo-en-body-lg-400",
|
|
914
914
|
l.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
915
915
|
])
|
|
916
|
-
},
|
|
916
|
+
}, I((S = P.value.find((H) => H.value === d.value)) == null ? void 0 : S.label), 3)
|
|
917
917
|
];
|
|
918
918
|
}),
|
|
919
919
|
_: 1
|
|
@@ -922,14 +922,14 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
922
922
|
label: t(u)("inventory.transfer.form.reference"),
|
|
923
923
|
"label-mark": "optional",
|
|
924
924
|
modelValue: t(s).purchaseOrder.ref,
|
|
925
|
-
"onUpdate:modelValue": n[3] || (n[3] = (
|
|
925
|
+
"onUpdate:modelValue": n[3] || (n[3] = (S) => t(s).purchaseOrder.ref = S)
|
|
926
926
|
}, null, 8, ["label", "modelValue"]),
|
|
927
927
|
m(z, {
|
|
928
928
|
label: t(u)("inventory.transfer.form.remark"),
|
|
929
929
|
"label-mark": "optional",
|
|
930
930
|
"max-length": 240,
|
|
931
|
-
modelValue:
|
|
932
|
-
"onUpdate:modelValue": n[4] || (n[4] = (
|
|
931
|
+
modelValue: M.value,
|
|
932
|
+
"onUpdate:modelValue": n[4] || (n[4] = (S) => M.value = S),
|
|
933
933
|
class: re({ "text-fm-color-typo-disabled": l.disabled })
|
|
934
934
|
}, null, 8, ["label", "modelValue", "class"])
|
|
935
935
|
])
|
|
@@ -954,7 +954,7 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
954
954
|
"hide-footer": ""
|
|
955
955
|
}, null, 8, ["column-defs", "row-data", "onRowClick"]),
|
|
956
956
|
e("div", bo, [
|
|
957
|
-
m(
|
|
957
|
+
m(R, {
|
|
958
958
|
"model-value": [
|
|
959
959
|
(J = a.modelValue.purchaseOrder.supplier) == null ? void 0 : J._id,
|
|
960
960
|
...a.modelValue.locations ?? []
|
|
@@ -965,8 +965,8 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
965
965
|
]),
|
|
966
966
|
e("div", go, [
|
|
967
967
|
e("div", ho, [
|
|
968
|
-
e("div",
|
|
969
|
-
t(b).isEnabled ? (
|
|
968
|
+
e("div", xo, I(t(u)("inventory.transfer.form.items.title")), 1),
|
|
969
|
+
t(b).isEnabled ? ($(), le(G, {
|
|
970
970
|
key: 0,
|
|
971
971
|
label: "Check NetSuite",
|
|
972
972
|
"prepend-icon": "troubleshoot",
|
|
@@ -980,11 +980,11 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
980
980
|
"prepend-icon": "add",
|
|
981
981
|
variant: "plain",
|
|
982
982
|
class: "border-2 rounded-lg border-fm-color-primary",
|
|
983
|
-
onClick: n[5] || (n[5] = (
|
|
983
|
+
onClick: n[5] || (n[5] = (S) => Z()),
|
|
984
984
|
size: "md"
|
|
985
985
|
}, null, 8, ["disabled", "label"])
|
|
986
986
|
]),
|
|
987
|
-
t(b).isEnabled ? (
|
|
987
|
+
t(b).isEnabled ? ($(), N("div", _o, n[9] || (n[9] = [
|
|
988
988
|
ne(" NetSuite is enabled. "),
|
|
989
989
|
e("ul", { style: { "list-style": "initial", "margin-left": "20px" } }, [
|
|
990
990
|
e("li", null, ' When adding new item or changing UOM, the first match available custom code (if any) will be applied to "Code" for each item by default. '),
|
|
@@ -994,36 +994,36 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
994
994
|
]))) : oe("", !0),
|
|
995
995
|
e("div", ko, [
|
|
996
996
|
e("p", wo, [
|
|
997
|
-
ne(' Set "' +
|
|
997
|
+
ne(' Set "' + I(t(u)("inventory.transfer.form.items.table.DefaultAmount")) + '" to "0" to mark the item as ', 1),
|
|
998
998
|
n[10] || (n[10] = e("b", null, "optional", -1)),
|
|
999
999
|
n[11] || (n[11] = ne(" when creating an order request. "))
|
|
1000
1000
|
]),
|
|
1001
1001
|
n[12] || (n[12] = e("p", null, ' You can leave "Max" empty to remove the limit on the maximum quantity of the item when creating an order request. ', -1))
|
|
1002
1002
|
]),
|
|
1003
|
-
(
|
|
1003
|
+
($(), le(D, {
|
|
1004
1004
|
"column-defs": E.value,
|
|
1005
1005
|
"row-data": t(s).purchaseOrder.items,
|
|
1006
|
-
key: t(s).purchaseOrder.items.map((
|
|
1006
|
+
key: t(s).purchaseOrder.items.map((S) => S.sku._id).join("."),
|
|
1007
1007
|
"hide-footer": "",
|
|
1008
1008
|
"page-size": t(s).purchaseOrder.items.length
|
|
1009
1009
|
}, {
|
|
1010
|
-
"table-row":
|
|
1010
|
+
"table-row": U((S) => [
|
|
1011
1011
|
m(po, {
|
|
1012
|
-
row:
|
|
1013
|
-
errorMessage:
|
|
1014
|
-
"onUpdate:item": n[6] || (n[6] = (
|
|
1012
|
+
row: S,
|
|
1013
|
+
errorMessage: x.value[S.index],
|
|
1014
|
+
"onUpdate:item": n[6] || (n[6] = (H) => W.value.updateItem(H)),
|
|
1015
1015
|
disabled: l.disabled
|
|
1016
1016
|
}, null, 8, ["row", "errorMessage", "disabled"])
|
|
1017
1017
|
]),
|
|
1018
|
-
"list-row":
|
|
1019
|
-
(
|
|
1020
|
-
row:
|
|
1021
|
-
key: t(s).purchaseOrder.items.map((
|
|
1018
|
+
"list-row": U((S) => [
|
|
1019
|
+
($(), le(Xe, {
|
|
1020
|
+
row: S,
|
|
1021
|
+
key: t(s).purchaseOrder.items.map((H) => H.sku._id).join(".")
|
|
1022
1022
|
}, {
|
|
1023
|
-
default:
|
|
1023
|
+
default: U((H) => [
|
|
1024
1024
|
m(ro, {
|
|
1025
|
-
row:
|
|
1026
|
-
"cell-by-col-id":
|
|
1025
|
+
row: S,
|
|
1026
|
+
"cell-by-col-id": H,
|
|
1027
1027
|
"onUpdate:item": n[7] || (n[7] = (ie) => W.value.updateItem(ie)),
|
|
1028
1028
|
disabled: l.disabled
|
|
1029
1029
|
}, null, 8, ["row", "cell-by-col-id", "disabled"])
|
|
@@ -1033,7 +1033,7 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1033
1033
|
]),
|
|
1034
1034
|
_: 1
|
|
1035
1035
|
}, 8, ["column-defs", "row-data", "page-size"])),
|
|
1036
|
-
m(
|
|
1036
|
+
m(R, {
|
|
1037
1037
|
"model-value": t(s).purchaseOrder.items.length,
|
|
1038
1038
|
rules: [t(we)(1)]
|
|
1039
1039
|
}, null, 8, ["model-value", "rules"])
|
|
@@ -1054,32 +1054,32 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1054
1054
|
},
|
|
1055
1055
|
emits: ["confirm"],
|
|
1056
1056
|
setup(p, { emit: h }) {
|
|
1057
|
-
const v = p, a = h, r =
|
|
1057
|
+
const v = p, a = h, r = Y(!1);
|
|
1058
1058
|
function s() {
|
|
1059
1059
|
r.value = !1, a("confirm");
|
|
1060
1060
|
}
|
|
1061
|
-
return (u,
|
|
1061
|
+
return (u, x) => {
|
|
1062
1062
|
const C = V("FmButton"), c = V("FmDialog");
|
|
1063
|
-
return
|
|
1063
|
+
return $(), N("div", null, [
|
|
1064
1064
|
m(C, {
|
|
1065
1065
|
label: v.label,
|
|
1066
1066
|
loading: v.loading,
|
|
1067
|
-
onClick:
|
|
1067
|
+
onClick: x[0] || (x[0] = (o) => r.value = !0)
|
|
1068
1068
|
}, null, 8, ["label", "loading"]),
|
|
1069
1069
|
m(c, {
|
|
1070
1070
|
modelValue: r.value,
|
|
1071
|
-
"onUpdate:modelValue":
|
|
1071
|
+
"onUpdate:modelValue": x[2] || (x[2] = (o) => r.value = o),
|
|
1072
1072
|
overlay: !0
|
|
1073
1073
|
}, {
|
|
1074
|
-
"dialog-header":
|
|
1075
|
-
e("div", null,
|
|
1074
|
+
"dialog-header": U(() => [
|
|
1075
|
+
e("div", null, I(v.confirmTitle || "Confirm"), 1)
|
|
1076
1076
|
]),
|
|
1077
|
-
"dialog-footer":
|
|
1077
|
+
"dialog-footer": U(() => [
|
|
1078
1078
|
e("div", Fo, [
|
|
1079
1079
|
m(C, {
|
|
1080
1080
|
label: "Cancel",
|
|
1081
1081
|
variant: "tertiary",
|
|
1082
|
-
onClick:
|
|
1082
|
+
onClick: x[1] || (x[1] = (o) => r.value = !1)
|
|
1083
1083
|
}),
|
|
1084
1084
|
m(C, {
|
|
1085
1085
|
class: "ml-auto",
|
|
@@ -1089,9 +1089,9 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1089
1089
|
})
|
|
1090
1090
|
])
|
|
1091
1091
|
]),
|
|
1092
|
-
default:
|
|
1093
|
-
|
|
1094
|
-
ne(
|
|
1092
|
+
default: U(() => [
|
|
1093
|
+
xe(u.$slots, "dialog-content", {}, () => [
|
|
1094
|
+
ne(I(v.confirmMessage || "Are you sure you want to proceed?"), 1)
|
|
1095
1095
|
])
|
|
1096
1096
|
]),
|
|
1097
1097
|
_: 3
|
|
@@ -1099,9 +1099,9 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1099
1099
|
]);
|
|
1100
1100
|
};
|
|
1101
1101
|
}
|
|
1102
|
-
}),
|
|
1102
|
+
}), So = { class: "flex items-center" }, Io = { class: "fm-typo-en-title-md-800" }, Mo = { class: "flex gap-4" }, $o = /* @__PURE__ */ ae({
|
|
1103
1103
|
__name: "TransferTemplateDialog",
|
|
1104
|
-
props: /* @__PURE__ */
|
|
1104
|
+
props: /* @__PURE__ */ qe({
|
|
1105
1105
|
mode: {},
|
|
1106
1106
|
modelValue: {},
|
|
1107
1107
|
show: { type: Boolean }
|
|
@@ -1109,10 +1109,10 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1109
1109
|
disabled: { type: Boolean },
|
|
1110
1110
|
disabledModifiers: {}
|
|
1111
1111
|
}),
|
|
1112
|
-
emits: /* @__PURE__ */
|
|
1112
|
+
emits: /* @__PURE__ */ qe(["update:show", "submitted"], ["update:disabled"]),
|
|
1113
1113
|
setup(p, { expose: h, emit: v }) {
|
|
1114
1114
|
var w;
|
|
1115
|
-
const a = p, r = v, s =
|
|
1115
|
+
const a = p, r = v, s = Rt(), u = yt(), { t: x } = me(), C = Ke(a, "show");
|
|
1116
1116
|
function c() {
|
|
1117
1117
|
return {
|
|
1118
1118
|
_id: "",
|
|
@@ -1143,7 +1143,7 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1143
1143
|
}
|
|
1144
1144
|
};
|
|
1145
1145
|
}
|
|
1146
|
-
const o =
|
|
1146
|
+
const o = Y(a.modelValue ?? c()), f = Y(((w = a.modelValue) == null ? void 0 : w._id) ?? `${Math.random()}`);
|
|
1147
1147
|
Fe(
|
|
1148
1148
|
() => a.show,
|
|
1149
1149
|
(i) => {
|
|
@@ -1151,17 +1151,17 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1151
1151
|
i && (o.value = a.modelValue ?? c(), f.value = ((g = a.modelValue) == null ? void 0 : g._id) ?? `${Math.random()}`);
|
|
1152
1152
|
}
|
|
1153
1153
|
);
|
|
1154
|
-
const b = lt(p, "disabled"), k =
|
|
1154
|
+
const b = lt(p, "disabled"), k = L(() => {
|
|
1155
1155
|
switch (a.mode) {
|
|
1156
1156
|
case de.READ:
|
|
1157
1157
|
return "";
|
|
1158
1158
|
case de.CREATE:
|
|
1159
|
-
return
|
|
1159
|
+
return x("inventory.transfer.template.create.title");
|
|
1160
1160
|
case de.UPDATE:
|
|
1161
|
-
return
|
|
1161
|
+
return x("inventory.transfer.template.update.title");
|
|
1162
1162
|
}
|
|
1163
1163
|
return "";
|
|
1164
|
-
}), T =
|
|
1164
|
+
}), T = Y();
|
|
1165
1165
|
h({
|
|
1166
1166
|
validateInputs: () => {
|
|
1167
1167
|
var i, g;
|
|
@@ -1176,49 +1176,49 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1176
1176
|
(g = (i = T.value) == null ? void 0 : i.resetInputs) == null || g.call(i);
|
|
1177
1177
|
}
|
|
1178
1178
|
});
|
|
1179
|
-
async function
|
|
1179
|
+
async function A() {
|
|
1180
1180
|
var g, O;
|
|
1181
1181
|
const i = o.value;
|
|
1182
1182
|
if (i) {
|
|
1183
1183
|
b.value = !0, (((g = i.purchaseOrder.supplier) == null ? void 0 : g.internal) === ye.enum.warehouse || ((O = i.purchaseOrder.supplier) == null ? void 0 : O.internal) === ye.enum.restaurant) && (i.purchaseOrder.items = i.purchaseOrder.items.map(
|
|
1184
|
-
({ totalCost:
|
|
1184
|
+
({ totalCost: M, ..._ }) => _
|
|
1185
1185
|
));
|
|
1186
1186
|
try {
|
|
1187
|
-
await s.createTemplate(i), await new Promise((
|
|
1188
|
-
title:
|
|
1189
|
-
message:
|
|
1187
|
+
await s.createTemplate(i), await new Promise((M) => setTimeout(M, 1e3)), u.open({
|
|
1188
|
+
title: x("inventory.transfer.template.create.success"),
|
|
1189
|
+
message: x("inventory.transfer.template.create.successMessage"),
|
|
1190
1190
|
type: "success"
|
|
1191
1191
|
}), r("update:show", !1), r("submitted");
|
|
1192
|
-
} catch (
|
|
1192
|
+
} catch (M) {
|
|
1193
1193
|
u.open({
|
|
1194
|
-
title:
|
|
1195
|
-
message:
|
|
1194
|
+
title: x("inventory.transfer.template.create.error"),
|
|
1195
|
+
message: x("inventory.transfer.template.create.errorMessage"),
|
|
1196
1196
|
type: "error"
|
|
1197
|
-
}), console.error("Error in creating transfer template",
|
|
1197
|
+
}), console.error("Error in creating transfer template", M);
|
|
1198
1198
|
} finally {
|
|
1199
1199
|
b.value = !1;
|
|
1200
1200
|
}
|
|
1201
1201
|
}
|
|
1202
1202
|
}
|
|
1203
|
-
async function
|
|
1203
|
+
async function P() {
|
|
1204
1204
|
var g, O;
|
|
1205
1205
|
const i = o.value;
|
|
1206
1206
|
if (i) {
|
|
1207
1207
|
b.value = !0, (((g = i.purchaseOrder.supplier) == null ? void 0 : g.internal) === ye.enum.warehouse || ((O = i.purchaseOrder.supplier) == null ? void 0 : O.internal) === ye.enum.restaurant) && (i.purchaseOrder.items = i.purchaseOrder.items.map(
|
|
1208
|
-
({ totalCost:
|
|
1208
|
+
({ totalCost: M, ..._ }) => _
|
|
1209
1209
|
));
|
|
1210
1210
|
try {
|
|
1211
|
-
await s.updateTemplate(i), await new Promise((
|
|
1212
|
-
title:
|
|
1213
|
-
message:
|
|
1211
|
+
await s.updateTemplate(i), await new Promise((M) => setTimeout(M, 1e3)), u.open({
|
|
1212
|
+
title: x("inventory.transfer.template.update.success"),
|
|
1213
|
+
message: x("inventory.transfer.template.update.successMessage"),
|
|
1214
1214
|
type: "success"
|
|
1215
1215
|
}), r("update:show", !1), r("submitted");
|
|
1216
|
-
} catch (
|
|
1216
|
+
} catch (M) {
|
|
1217
1217
|
u.open({
|
|
1218
|
-
title:
|
|
1219
|
-
message:
|
|
1218
|
+
title: x("inventory.transfer.template.update.error"),
|
|
1219
|
+
message: x("inventory.transfer.template.update.errorMessage"),
|
|
1220
1220
|
type: "error"
|
|
1221
|
-
}), console.error("Error in updating transfer template",
|
|
1221
|
+
}), console.error("Error in updating transfer template", M);
|
|
1222
1222
|
} finally {
|
|
1223
1223
|
b.value = !1;
|
|
1224
1224
|
}
|
|
@@ -1227,9 +1227,9 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1227
1227
|
function d() {
|
|
1228
1228
|
switch (a.mode) {
|
|
1229
1229
|
case de.CREATE:
|
|
1230
|
-
return
|
|
1230
|
+
return A();
|
|
1231
1231
|
case de.UPDATE:
|
|
1232
|
-
return
|
|
1232
|
+
return P();
|
|
1233
1233
|
}
|
|
1234
1234
|
}
|
|
1235
1235
|
function y() {
|
|
@@ -1237,41 +1237,41 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1237
1237
|
(g = (i = T.value) == null ? void 0 : i.validateInputs) == null || g.call(i);
|
|
1238
1238
|
}
|
|
1239
1239
|
return (i, g) => {
|
|
1240
|
-
const O = V("FmButton"),
|
|
1241
|
-
return
|
|
1240
|
+
const O = V("FmButton"), M = V("FmSideSheet");
|
|
1241
|
+
return $(), le(M, {
|
|
1242
1242
|
modelValue: t(C),
|
|
1243
|
-
"onUpdate:modelValue": g[3] || (g[3] = (
|
|
1243
|
+
"onUpdate:modelValue": g[3] || (g[3] = (_) => Ye(C) ? C.value = _ : null),
|
|
1244
1244
|
"dismiss-away": "",
|
|
1245
1245
|
"close-button": "",
|
|
1246
1246
|
"max-width": 1600
|
|
1247
1247
|
}, {
|
|
1248
|
-
"side-sheet-header":
|
|
1249
|
-
e("div",
|
|
1250
|
-
e("div",
|
|
1248
|
+
"side-sheet-header": U(() => [
|
|
1249
|
+
e("div", So, [
|
|
1250
|
+
e("div", Io, I(k.value), 1)
|
|
1251
1251
|
])
|
|
1252
1252
|
]),
|
|
1253
|
-
default:
|
|
1254
|
-
(
|
|
1253
|
+
default: U(() => [
|
|
1254
|
+
($(), le(To, {
|
|
1255
1255
|
class: "w-full",
|
|
1256
1256
|
ref_key: "formRef",
|
|
1257
1257
|
ref: T,
|
|
1258
1258
|
onValidationSuccess: d,
|
|
1259
1259
|
"model-value": o.value,
|
|
1260
|
-
"onUpdate:modelValue": g[0] || (g[0] = (
|
|
1260
|
+
"onUpdate:modelValue": g[0] || (g[0] = (_) => o.value = _),
|
|
1261
1261
|
disabled: b.value,
|
|
1262
|
-
"onUpdate:disabled": g[1] || (g[1] = (
|
|
1262
|
+
"onUpdate:disabled": g[1] || (g[1] = (_) => b.value = _),
|
|
1263
1263
|
key: f.value
|
|
1264
1264
|
}, null, 8, ["model-value", "disabled"]))
|
|
1265
1265
|
]),
|
|
1266
|
-
"side-sheet-footer":
|
|
1267
|
-
e("div",
|
|
1266
|
+
"side-sheet-footer": U(() => [
|
|
1267
|
+
e("div", Mo, [
|
|
1268
1268
|
m(Co, {
|
|
1269
1269
|
loading: b.value,
|
|
1270
|
-
label: t(
|
|
1270
|
+
label: t(x)("common.save"),
|
|
1271
1271
|
"confirm-title": `Save ${a.mode === t(de).CREATE ? "Template" : "Changes"}`,
|
|
1272
1272
|
onConfirm: y
|
|
1273
1273
|
}, {
|
|
1274
|
-
"dialog-content":
|
|
1274
|
+
"dialog-content": U(() => g[4] || (g[4] = [
|
|
1275
1275
|
e("div", { class: "fm-typo-en-body-md-400 bg-fm-color-primary-oats p-8 rounded" }, [
|
|
1276
1276
|
ne(" Warning: This action "),
|
|
1277
1277
|
e("span", { class: "text-fm-color-system-error-300" }, "will not"),
|
|
@@ -1283,8 +1283,8 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1283
1283
|
m(O, {
|
|
1284
1284
|
disabled: b.value,
|
|
1285
1285
|
variant: "tertiary",
|
|
1286
|
-
label: t(
|
|
1287
|
-
onClick: g[2] || (g[2] = (
|
|
1286
|
+
label: t(x)("common.close"),
|
|
1287
|
+
onClick: g[2] || (g[2] = (_) => r("update:show", !1))
|
|
1288
1288
|
}, null, 8, ["disabled", "label"])
|
|
1289
1289
|
])
|
|
1290
1290
|
]),
|
|
@@ -1292,13 +1292,13 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1292
1292
|
}, 8, ["modelValue"]);
|
|
1293
1293
|
};
|
|
1294
1294
|
}
|
|
1295
|
-
}), Oo = { class: "flex flex-col gap-16 w-full h-full overflow-y-auto" }, Do = { class: "flex justify-between" }, Vo = { class: "fm-typo-en-body-lg-600" },
|
|
1295
|
+
}), Oo = { class: "flex flex-col gap-16 w-full h-full overflow-y-auto" }, Do = { class: "flex justify-between" }, Vo = { class: "fm-typo-en-body-lg-600" }, Ro = { class: "fm-status-badge fm-status-badge-info-secondary" }, Ao = { class: "flex flex-col gap-8" }, Uo = { class: "flex flex-col gap-4" }, Po = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Bo = { class: "flex gap-1" }, qo = { class: "fm-typo-en-body-lg-600" }, No = {
|
|
1296
1296
|
key: 0,
|
|
1297
1297
|
class: "flex flex-col gap-4"
|
|
1298
|
-
},
|
|
1298
|
+
}, Lo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Eo = { class: "flex gap-1" }, zo = { class: "fm-typo-en-body-lg-600" }, Ho = {
|
|
1299
1299
|
key: 1,
|
|
1300
1300
|
class: "flex flex-col gap-4"
|
|
1301
|
-
},
|
|
1301
|
+
}, jo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qo = { class: "fm-typo-en-body-lg-600" }, Yo = {
|
|
1302
1302
|
key: 2,
|
|
1303
1303
|
class: "flex flex-col gap-4"
|
|
1304
1304
|
}, Wo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Go = { class: "fm-typo-en-body-lg-600" }, Ko = {
|
|
@@ -1318,77 +1318,77 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1318
1318
|
},
|
|
1319
1319
|
emits: ["update:show", "action:edit"],
|
|
1320
1320
|
setup(p, { emit: h }) {
|
|
1321
|
-
const v = p, a = h, r = ge(), { t: s } = me(), u =
|
|
1321
|
+
const v = p, a = h, r = ge(), { t: s } = me(), u = L(() => {
|
|
1322
1322
|
var b;
|
|
1323
1323
|
return (b = v.template) == null ? void 0 : b.purchaseOrder;
|
|
1324
|
-
}),
|
|
1324
|
+
}), x = [
|
|
1325
1325
|
{ accessorKey: "name", header: () => "Name" },
|
|
1326
1326
|
{ accessorKey: "type", header: () => "Type" }
|
|
1327
|
-
], C =
|
|
1327
|
+
], C = Y(""), c = L(
|
|
1328
1328
|
() => {
|
|
1329
|
-
var b, k, T,
|
|
1330
|
-
return ((k = (b = u.value) == null ? void 0 : b.supplier) == null ? void 0 : k.internal) === "restaurant" || ((
|
|
1329
|
+
var b, k, T, A;
|
|
1330
|
+
return ((k = (b = u.value) == null ? void 0 : b.supplier) == null ? void 0 : k.internal) === "restaurant" || ((A = (T = u.value) == null ? void 0 : T.supplier) == null ? void 0 : A.internal) === "warehouse" ? X.TRANSFER : X.PURCHASE;
|
|
1331
1331
|
}
|
|
1332
|
-
), o =
|
|
1332
|
+
), o = Y(!0), f = Ke(v, "show");
|
|
1333
1333
|
return (b, k) => {
|
|
1334
1334
|
var g;
|
|
1335
|
-
const T = V("FmMenuDivider"),
|
|
1336
|
-
return
|
|
1335
|
+
const T = V("FmMenuDivider"), A = V("FmCard"), P = V("FmIcon"), d = V("FmTextField"), y = V("FmTable"), w = V("FmButton"), i = V("FmSideSheet");
|
|
1336
|
+
return $(), le(i, {
|
|
1337
1337
|
header: t(s)("inventory.transfer.template.details.view", { template: (g = b.template) == null ? void 0 : g.name }),
|
|
1338
1338
|
modelValue: t(f),
|
|
1339
|
-
"onUpdate:modelValue": k[2] || (k[2] = (O) =>
|
|
1339
|
+
"onUpdate:modelValue": k[2] || (k[2] = (O) => Ye(f) ? f.value = O : null),
|
|
1340
1340
|
"dismiss-away": o.value,
|
|
1341
1341
|
"close-button": "",
|
|
1342
1342
|
"max-width": 1200
|
|
1343
1343
|
}, {
|
|
1344
|
-
default:
|
|
1345
|
-
var O,
|
|
1344
|
+
default: U(() => {
|
|
1345
|
+
var O, M;
|
|
1346
1346
|
return [
|
|
1347
1347
|
e("div", Oo, [
|
|
1348
1348
|
e("div", null, [
|
|
1349
|
-
m(
|
|
1349
|
+
m(A, {
|
|
1350
1350
|
variant: "outlined",
|
|
1351
1351
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
1352
1352
|
}, {
|
|
1353
|
-
default:
|
|
1354
|
-
var
|
|
1353
|
+
default: U(() => {
|
|
1354
|
+
var _, W, te, E, B, Z, l, n, F;
|
|
1355
1355
|
return [
|
|
1356
1356
|
e("div", Do, [
|
|
1357
|
-
e("div", Vo,
|
|
1358
|
-
e("div",
|
|
1357
|
+
e("div", Vo, I(t(s)("inventory.transfer.template.details.templateSummary")), 1),
|
|
1358
|
+
e("div", Ro, I(t(s)(
|
|
1359
1359
|
`inventory.transfer.receiveRequest.details.type.${c.value.toLocaleLowerCase("en-US")}`
|
|
1360
1360
|
)), 1)
|
|
1361
1361
|
]),
|
|
1362
1362
|
m(T),
|
|
1363
|
-
e("div",
|
|
1364
|
-
e("div",
|
|
1365
|
-
e("div",
|
|
1366
|
-
e("div",
|
|
1363
|
+
e("div", Ao, [
|
|
1364
|
+
e("div", Uo, [
|
|
1365
|
+
e("div", Po, [
|
|
1366
|
+
e("div", Bo, I(t(s)("inventory.transfer.receiveRequest.details.createdAt")), 1)
|
|
1367
1367
|
]),
|
|
1368
|
-
e("div",
|
|
1368
|
+
e("div", qo, I(t(At)(((_ = b.template) == null ? void 0 : _._id) ?? "")), 1)
|
|
1369
1369
|
]),
|
|
1370
|
-
(W = b.template) != null && W.updatedAt ? (
|
|
1371
|
-
e("div",
|
|
1372
|
-
e("div", Eo,
|
|
1370
|
+
(W = b.template) != null && W.updatedAt ? ($(), N("div", No, [
|
|
1371
|
+
e("div", Lo, [
|
|
1372
|
+
e("div", Eo, I(t(s)("inventory.transfer.receiveRequest.details.updatedAt")), 1)
|
|
1373
1373
|
]),
|
|
1374
1374
|
e("div", zo, [
|
|
1375
|
-
ne(
|
|
1376
|
-
(te = b.template.updatedBy) != null && te.name ? (
|
|
1377
|
-
ne(" (" +
|
|
1375
|
+
ne(I(t(Ut)(new Date(b.template.updatedAt))) + " ", 1),
|
|
1376
|
+
(te = b.template.updatedBy) != null && te.name ? ($(), N(pe, { key: 0 }, [
|
|
1377
|
+
ne(" (" + I(b.template.updatedBy.name) + ") ", 1)
|
|
1378
1378
|
], 64)) : oe("", !0)
|
|
1379
1379
|
])
|
|
1380
1380
|
])) : oe("", !0),
|
|
1381
|
-
(
|
|
1382
|
-
e("div",
|
|
1383
|
-
e("div",
|
|
1381
|
+
(B = (E = u.value) == null ? void 0 : E.supplier) != null && B.name ? ($(), N("div", Ho, [
|
|
1382
|
+
e("div", jo, I(t(s)("inventory.transfer.receiveRequest.details.from")), 1),
|
|
1383
|
+
e("div", Qo, I((l = (Z = u.value) == null ? void 0 : Z.supplier) == null ? void 0 : l.name), 1)
|
|
1384
1384
|
])) : oe("", !0),
|
|
1385
|
-
(n = u.value) != null && n.ref ? (
|
|
1386
|
-
e("div", Wo,
|
|
1387
|
-
e("div", Go,
|
|
1385
|
+
(n = u.value) != null && n.ref ? ($(), N("div", Yo, [
|
|
1386
|
+
e("div", Wo, I(t(s)("inventory.transfer.receiveRequest.details.reference")), 1),
|
|
1387
|
+
e("div", Go, I(u.value.ref), 1)
|
|
1388
1388
|
])) : oe("", !0),
|
|
1389
|
-
(F = u.value) != null && F.remark ? (
|
|
1390
|
-
e("div", Zo,
|
|
1391
|
-
e("div", Jo,
|
|
1389
|
+
(F = u.value) != null && F.remark ? ($(), N("div", Ko, [
|
|
1390
|
+
e("div", Zo, I(t(s)("inventory.transfer.receiveRequest.details.remark")), 1),
|
|
1391
|
+
e("div", Jo, I(u.value.remark), 1)
|
|
1392
1392
|
])) : oe("", !0)
|
|
1393
1393
|
])
|
|
1394
1394
|
];
|
|
@@ -1398,22 +1398,22 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1398
1398
|
]),
|
|
1399
1399
|
e("div", Xo, [
|
|
1400
1400
|
e("div", es, [
|
|
1401
|
-
e("div", ts,
|
|
1402
|
-
(
|
|
1403
|
-
key:
|
|
1401
|
+
e("div", ts, I(t(s)("inventory.transfer.receiveRequest.details.requestedItems")), 1),
|
|
1402
|
+
($(!0), N(pe, null, je(((O = u.value) == null ? void 0 : O.items) ?? [], (_) => ($(), N("div", {
|
|
1403
|
+
key: _.code,
|
|
1404
1404
|
class: "flex flex-col"
|
|
1405
1405
|
}, [
|
|
1406
1406
|
e("div", os, [
|
|
1407
|
-
e("div", ss,
|
|
1407
|
+
e("div", ss, I(_.name), 1),
|
|
1408
1408
|
k[3] || (k[3] = e("div", { class: "flex-1 min-w-32" }, null, -1)),
|
|
1409
|
-
e("div", ls,
|
|
1409
|
+
e("div", ls, I(t(dt)(_.quantity, _.sku.unit, _.measurement)), 1)
|
|
1410
1410
|
]),
|
|
1411
1411
|
e("div", ns, [
|
|
1412
|
-
e("div", as,
|
|
1413
|
-
|
|
1412
|
+
e("div", as, I(_.code), 1),
|
|
1413
|
+
_.totalCost && t(r).enableTotalCost ? ($(), N("div", rs, " (" + I(t(wt)(_.totalCost)) + ") ", 1)) : oe("", !0)
|
|
1414
1414
|
]),
|
|
1415
|
-
t(mt)(
|
|
1416
|
-
m(
|
|
1415
|
+
t(mt)(_) ? ($(), N("div", is, [
|
|
1416
|
+
m(P, {
|
|
1417
1417
|
name: "error",
|
|
1418
1418
|
color: "system-error-300",
|
|
1419
1419
|
size: "sm"
|
|
@@ -1433,23 +1433,23 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1433
1433
|
e("div", ds, [
|
|
1434
1434
|
m(d, {
|
|
1435
1435
|
modelValue: C.value,
|
|
1436
|
-
"onUpdate:modelValue": k[0] || (k[0] = (
|
|
1436
|
+
"onUpdate:modelValue": k[0] || (k[0] = (_) => C.value = _),
|
|
1437
1437
|
placeholder: "Filter locations",
|
|
1438
1438
|
"prepend-icon": "search"
|
|
1439
1439
|
}, null, 8, ["modelValue"]),
|
|
1440
1440
|
m(y, {
|
|
1441
1441
|
"hide-footer": "",
|
|
1442
1442
|
style: { height: "500px" },
|
|
1443
|
-
"column-defs":
|
|
1443
|
+
"column-defs": x,
|
|
1444
1444
|
"search-value": C.value,
|
|
1445
|
-
"row-data": ((
|
|
1445
|
+
"row-data": ((M = v.template) == null ? void 0 : M.locations) ?? [{ name: "All locations" }]
|
|
1446
1446
|
}, null, 8, ["search-value", "row-data"])
|
|
1447
1447
|
])
|
|
1448
1448
|
])
|
|
1449
1449
|
])
|
|
1450
1450
|
];
|
|
1451
1451
|
}),
|
|
1452
|
-
"side-sheet-footer":
|
|
1452
|
+
"side-sheet-footer": U(() => [
|
|
1453
1453
|
e("div", ms, [
|
|
1454
1454
|
m(w, {
|
|
1455
1455
|
label: t(s)("common.edit"),
|
|
@@ -1465,14 +1465,14 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1465
1465
|
}), cs = { class: "flex-1 flex flex-col gap-8" }, fs = { class: "flex flex-col" }, ys = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, vs = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, bs = { class: "fm-typo-en-body-lg-400" }, gs = { class: "fm-typo-en-body-lg-400 line-clamp-1" }, hs = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, zs = /* @__PURE__ */ ae({
|
|
1466
1466
|
__name: "TransferTemplateView",
|
|
1467
1467
|
setup(p) {
|
|
1468
|
-
const { t: h } = me(), { createTemplate: v, viewTemplate: a, importTemplates: r, exportTemplates: s } =
|
|
1468
|
+
const { t: h } = me(), { createTemplate: v, viewTemplate: a, importTemplates: r, exportTemplates: s } = Ne(), { templateDialogProps: u, templateDetailsProps: x } = ze(Ne()), C = pt(), { loading: c, templates: o } = ze(C), f = Y(!1), b = it(), k = Ge(), { breakpoints: T } = vt();
|
|
1469
1469
|
Te(C.fetchTemplates);
|
|
1470
|
-
const
|
|
1470
|
+
const A = L(
|
|
1471
1471
|
() => f.value || c.value || !k._currentLocation
|
|
1472
|
-
),
|
|
1473
|
-
function i(
|
|
1474
|
-
switch (
|
|
1475
|
-
case
|
|
1472
|
+
), P = L(() => o.value), d = Y(""), y = L(() => T.value.xs || T.value.sm), w = L(() => y.value ? 10 : 20);
|
|
1473
|
+
function i(M) {
|
|
1474
|
+
switch (M) {
|
|
1475
|
+
case Le.Add:
|
|
1476
1476
|
return v();
|
|
1477
1477
|
case "refresh":
|
|
1478
1478
|
return C.fetchTemplates();
|
|
@@ -1482,13 +1482,13 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1482
1482
|
return s();
|
|
1483
1483
|
}
|
|
1484
1484
|
}
|
|
1485
|
-
function g(
|
|
1486
|
-
return
|
|
1485
|
+
function g(M) {
|
|
1486
|
+
return M;
|
|
1487
1487
|
}
|
|
1488
|
-
const O =
|
|
1488
|
+
const O = L(() => [
|
|
1489
1489
|
{
|
|
1490
1490
|
label: h("inventory.closing.template.create.title"),
|
|
1491
|
-
value:
|
|
1491
|
+
value: Le.Add,
|
|
1492
1492
|
isPrimary: !0,
|
|
1493
1493
|
prependIcon: "add"
|
|
1494
1494
|
},
|
|
@@ -1508,15 +1508,15 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1508
1508
|
isPrimary: !1
|
|
1509
1509
|
}
|
|
1510
1510
|
]);
|
|
1511
|
-
return (
|
|
1511
|
+
return (M, _) => {
|
|
1512
1512
|
const W = V("FmTable");
|
|
1513
|
-
return
|
|
1513
|
+
return $(), N(pe, null, [
|
|
1514
1514
|
m(ut, {
|
|
1515
1515
|
title: t(h)("inventory.transfer.template.title2"),
|
|
1516
1516
|
actions: O.value,
|
|
1517
1517
|
"onClick:action": i
|
|
1518
1518
|
}, {
|
|
1519
|
-
default:
|
|
1519
|
+
default: U(() => {
|
|
1520
1520
|
var te;
|
|
1521
1521
|
return [
|
|
1522
1522
|
e("div", {
|
|
@@ -1531,59 +1531,59 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1531
1531
|
m(ft, {
|
|
1532
1532
|
searchable: "",
|
|
1533
1533
|
search: d.value,
|
|
1534
|
-
"onUpdate:search":
|
|
1534
|
+
"onUpdate:search": _[0] || (_[0] = (E) => d.value = E)
|
|
1535
1535
|
}, null, 8, ["search"]),
|
|
1536
|
-
(
|
|
1537
|
-
style:
|
|
1536
|
+
($(), le(W, {
|
|
1537
|
+
style: _e(t(b).tableHeight),
|
|
1538
1538
|
"column-defs": t(C).columnDefs,
|
|
1539
|
-
"row-data":
|
|
1539
|
+
"row-data": P.value,
|
|
1540
1540
|
"search-value": d.value,
|
|
1541
|
-
loading:
|
|
1541
|
+
loading: A.value,
|
|
1542
1542
|
key: (te = t(k)._currentLocation) == null ? void 0 : te.dbName,
|
|
1543
|
-
onRowClick:
|
|
1543
|
+
onRowClick: _[1] || (_[1] = (E) => t(a)(E.original)),
|
|
1544
1544
|
"page-size": w.value
|
|
1545
1545
|
}, {
|
|
1546
|
-
"list-row":
|
|
1546
|
+
"list-row": U((E) => [
|
|
1547
1547
|
m(Xe, {
|
|
1548
1548
|
row: E,
|
|
1549
|
-
onRowClick: (
|
|
1549
|
+
onRowClick: (B) => t(a)(B)
|
|
1550
1550
|
}, {
|
|
1551
|
-
default:
|
|
1552
|
-
var Z, l, n, F,
|
|
1551
|
+
default: U((B) => {
|
|
1552
|
+
var Z, l, n, F, q, z, G, D, R, K, J, S, H, ie, Ce, Se, Ie, Me, $e, Oe, ce, De, Ve, Re, Ae, fe, Ue;
|
|
1553
1553
|
return [
|
|
1554
1554
|
e("div", cs, [
|
|
1555
1555
|
e("div", fs, [
|
|
1556
1556
|
e("div", ys, [
|
|
1557
1557
|
m(t(ee), {
|
|
1558
|
-
render: (n = (l = (Z =
|
|
1559
|
-
props: (
|
|
1558
|
+
render: (n = (l = (Z = B._id) == null ? void 0 : Z.column) == null ? void 0 : l.columnDef) == null ? void 0 : n.cell,
|
|
1559
|
+
props: (q = (F = B._id) == null ? void 0 : F.getContext) == null ? void 0 : q.call(F)
|
|
1560
1560
|
}, null, 8, ["render", "props"])
|
|
1561
1561
|
]),
|
|
1562
1562
|
e("div", vs, [
|
|
1563
1563
|
m(t(ee), {
|
|
1564
|
-
render: (D = (G = (z =
|
|
1565
|
-
props: (K = (
|
|
1564
|
+
render: (D = (G = (z = B.name) == null ? void 0 : z.column) == null ? void 0 : G.columnDef) == null ? void 0 : D.cell,
|
|
1565
|
+
props: (K = (R = B.name) == null ? void 0 : R.getContext) == null ? void 0 : K.call(R)
|
|
1566
1566
|
}, null, 8, ["render", "props"])
|
|
1567
1567
|
]),
|
|
1568
1568
|
e("div", bs, [
|
|
1569
1569
|
m(t(ee), {
|
|
1570
|
-
render: (
|
|
1571
|
-
props: (Ce = (ie =
|
|
1570
|
+
render: (H = (S = (J = B.supplier) == null ? void 0 : J.column) == null ? void 0 : S.columnDef) == null ? void 0 : H.cell,
|
|
1571
|
+
props: (Ce = (ie = B.supplier) == null ? void 0 : ie.getContext) == null ? void 0 : Ce.call(ie)
|
|
1572
1572
|
}, null, 8, ["render", "props"])
|
|
1573
1573
|
]),
|
|
1574
|
-
e("div", null,
|
|
1575
|
-
e("div", gs,
|
|
1574
|
+
e("div", null, I((Se = E.original.locations) != null && Se.length ? `Enabled for ${(Ie = E.original.locations) == null ? void 0 : Ie.length} outlets` : "Enabled for all outlets"), 1),
|
|
1575
|
+
e("div", gs, I(E.original.purchaseOrder.items.length ? E.original.purchaseOrder.items.map((tt) => tt.name).join(", ") : "No items"), 1),
|
|
1576
1576
|
e("div", hs, [
|
|
1577
1577
|
m(t(ee), {
|
|
1578
|
-
render: (Oe = (
|
|
1579
|
-
props: (De = (ce =
|
|
1578
|
+
render: (Oe = ($e = (Me = B.ref) == null ? void 0 : Me.column) == null ? void 0 : $e.columnDef) == null ? void 0 : Oe.cell,
|
|
1579
|
+
props: (De = (ce = B.ref) == null ? void 0 : ce.getContext) == null ? void 0 : De.call(ce)
|
|
1580
1580
|
}, null, 8, ["render", "props"])
|
|
1581
1581
|
])
|
|
1582
1582
|
]),
|
|
1583
1583
|
e("div", null, [
|
|
1584
1584
|
m(t(ee), {
|
|
1585
|
-
render: (
|
|
1586
|
-
props: (
|
|
1585
|
+
render: (Ae = (Re = (Ve = B.type) == null ? void 0 : Ve.column) == null ? void 0 : Re.columnDef) == null ? void 0 : Ae.cell,
|
|
1586
|
+
props: (Ue = (fe = B.type) == null ? void 0 : fe.getContext) == null ? void 0 : Ue.call(fe)
|
|
1587
1587
|
}, null, 8, ["render", "props"])
|
|
1588
1588
|
])
|
|
1589
1589
|
])
|
|
@@ -1599,10 +1599,10 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1599
1599
|
}),
|
|
1600
1600
|
_: 1
|
|
1601
1601
|
}, 8, ["title", "actions"]),
|
|
1602
|
-
(
|
|
1603
|
-
m(ps, at(rt(t(
|
|
1604
|
-
m(
|
|
1605
|
-
onSubmitted:
|
|
1602
|
+
($(), le(nt, { to: "body" }, [
|
|
1603
|
+
m(ps, at(rt(t(x))), null, 16),
|
|
1604
|
+
m($o, Qe(t(u), {
|
|
1605
|
+
onSubmitted: _[2] || (_[2] = (te) => t(C).fetchTemplates())
|
|
1606
1606
|
}), null, 16)
|
|
1607
1607
|
]))
|
|
1608
1608
|
], 64);
|