@feedmepos/mf-inventory-portal 1.2.46-dev.3 → 1.2.46-dev.5
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-ySxcDomm.js → App-DsW9zwH-.js} +3 -3
- package/dist/{ApprovalView-_EJKApES.js → ApprovalView-Dvyp3wel.js} +5 -5
- package/dist/{BindingsDialog-9GOaeI8n.js → BindingsDialog-YBp__WSV.js} +2 -2
- package/dist/{BindingsPicker-BeGibuLu.js → BindingsPicker-DlBjt-Ba.js} +2 -2
- package/dist/{BindingsTable-BRIxUXYh.js → BindingsTable-CTRzUUB-.js} +3 -3
- package/dist/ClosingDraftView-6c7X_KiP.js +2410 -0
- package/dist/{ClosingHistoryView-Dn4Cjswm.js → ClosingHistoryView-bOwlkF4Q.js} +3 -3
- package/dist/{ClosingTemplateView-Co_DSUTb.js → ClosingTemplateView-CA-f8FAh.js} +14 -14
- package/dist/{DeliveryOrderPrintPreview-DkJwksMs.js → DeliveryOrderPrintPreview-DmjK4cj3.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DyWHsoW6.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-B813CRxg.js} +4 -4
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-No_HFW6L.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-lgr6bbOW.js} +2 -2
- package/dist/{FmMultiselectDialog-BQgNlFR9.js → FmMultiselectDialog-26pdE-k-.js} +1 -1
- package/dist/{FmMultiselectDialog-Cf8uKaTm.js → FmMultiselectDialog-72g5JwZ9.js} +2 -2
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CNLY-Hzz.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CQAnQxH8.js} +3 -3
- package/dist/{ImportView-D1v8E1VD.js → ImportView-4mjAMfeB.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CQzXwQYK.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-CDodN-Rh.js} +1 -1
- package/dist/{IngredientGroupView-BrZ_OwZv.js → IngredientGroupView-DmcHEj63.js} +5 -5
- package/dist/{IngredientsView-C6RNpxxb.js → IngredientsView-BDPANb85.js} +14 -14
- package/dist/{IntegrationView-Ca7ejuaF.js → IntegrationView-pyqYL2jb.js} +12 -12
- package/dist/{InventoryBindingForm-D0pD3HsN.js → InventoryBindingForm-DSbRfb3F.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CTdLmzkv.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-KfPb4N5d.js} +4 -4
- package/dist/{InventoryBindingSummary-DeaupJPl.js → InventoryBindingSummary-BcGBSNvn.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Dyeizcb9.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Dgauy-iB.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-SpBOB8Jf.js → PremiumBadge.vue_vue_type_script_setup_true_lang-B53Hy6EY.js} +2 -2
- package/dist/{PublishView-C6mc-X3S.js → PublishView-CJBqs89f.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-D2iF1QHy.js → PurchaseOrderPrintPreview-BKvf3c7F.js} +1 -1
- package/dist/{ReceiveRequestView-CdtV-Shg.js → ReceiveRequestView-DwclAVDm.js} +18 -18
- package/dist/{RecipeView-DWZfk8K4.js → RecipeView-CYIOyih-.js} +8 -8
- package/dist/{StockView-8wAAtKfj.js → StockView-loAHU_aR.js} +15 -15
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DVpjp5eW.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CNIpGt9s.js} +1 -1
- package/dist/{SupplierView-CH_KBKSr.js → SupplierView-D0h-AaRw.js} +11 -11
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-Ddn8qCWG.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-D1UE7aKR.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CjaWOrc7.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DhqGYaf-.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-B1SE0VPO.js → TransferDetails.vue_vue_type_script_setup_true_lang-D-g6cXC3.js} +14 -14
- package/dist/{TransferTemplateView-CJ74oEFd.js → TransferTemplateView-dvekbFPc.js} +412 -412
- package/dist/{UnitView-CHZpS66w.js → UnitView-BJPDHJ1t.js} +6 -6
- package/dist/{WarehouseView-BdlEzxyN.js → WarehouseView-DfBC9bn5.js} +5 -5
- package/dist/{WastageTemplateView-DPYFFFPg.js → WastageTemplateView-D7txOfrr.js} +14 -14
- package/dist/{app-L6j_SX6Z.js → app-DZ9CIN-l.js} +22 -22
- package/dist/app.js +1 -1
- package/dist/{closing-template-DL2xo4-p.js → closing-template-Bhuuo6RL.js} +1 -1
- package/dist/{date2-C60QiPZL.js → date2-D0I4_co0.js} +1 -1
- package/dist/{dayjs.min-1i9VF7ko.js → dayjs.min-DyYDX3Ns.js} +1 -1
- package/dist/{decimal-DfXZArxr.js → decimal-CpLUQcWa.js} +2 -2
- package/dist/{defineDeepModel-DYMBS2Up.js → defineDeepModel-CBc_F4eu.js} +1 -1
- package/dist/{duplicate-template-DbCPaO6i.js → duplicate-template-BIMQgrkD.js} +1 -1
- package/dist/{feature-BrCYCAw3.js → feature-CjK6Ds77.js} +2 -2
- package/dist/{format-time-from-id-Cr_k7Wi5.js → format-time-from-id-9kP1kaTe.js} +1 -1
- package/dist/{format-unit-display-DSOafWus.js → format-unit-display-De_mv7m7.js} +10 -10
- package/dist/{import-export.helper-BLHYLWps.js → import-export.helper-BcEjyb3B.js} +5 -5
- package/dist/{index-D-ZXljMu.js → index-B1bw59a2.js} +1 -1
- package/dist/{index-CL_V6m9F.js → index-BcRb-JAY.js} +3 -3
- package/dist/{index-DGIytAs7.js → index-CJRR1JAe.js} +1 -1
- package/dist/{lodash-iJopJ73U.js → lodash-AfG_nKQX.js} +1 -1
- package/dist/{netsuite-C7gUg5Ne.js → netsuite-d7P730Bm.js} +3 -3
- package/dist/{purchase-order-template-Qy0dXMvI.js → purchase-order-template-J9nWMrS2.js} +1 -1
- package/dist/{rules-DNwy6oOH.js → rules-9v8VtDWl.js} +3 -3
- package/dist/{stock-DQX_I8wd.js → stock-C2_qYIxU.js} +1 -1
- package/dist/{stock-DTK8SpFp.js → stock-Cjj5e8_a.js} +3 -3
- package/dist/{supplier-Dl0JI_BN.js → supplier-Ds2vZ4qg.js} +2 -2
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-B6akNhzG.js → use-ingredient-select-dialog-CAKpgkQ9.js} +2 -2
- package/dist/{use-inventory-binding-dialog-C72_9SY7.js → use-inventory-binding-dialog-D98L2Cuv.js} +2 -2
- package/dist/{use-template-enabled-locations-2-Ba-OnSOi.js → use-template-enabled-locations-2-DrUrir8n.js} +2 -2
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftApprovalDialog.vue.d.ts +2 -10
- package/dist/views/closing-draft/composables/use-closing-draft-actions.d.ts +3 -3
- package/dist/{vue-i18n-Drpwc5_v.js → vue-i18n-CNwuZJlQ.js} +242 -242
- package/dist/{xlsx-DLXI5MPN.js → xlsx-BfWdatQl.js} +1 -1
- package/dist/{xlsx.util-Coy8SybJ.js → xlsx.util-sMO_ulne.js} +1 -1
- package/package.json +3 -3
- package/dist/ClosingDraftView-BatMvmqU.js +0 -2362
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { defineComponent as ae, onMounted as Te, computed as N, ref as H, watch as Fe, inject as ot, resolveComponent as V, openBlock as S, createElementBlock as L, createElementVNode as e, createVNode as
|
|
1
|
+
import { defineComponent as ae, onMounted as Te, computed as N, ref as H, watch as Fe, inject as ot, resolveComponent as V, openBlock as S, createElementBlock as L, createElementVNode as e, createVNode as c, withCtx as B, renderSlot as _e, withDirectives as Ue, normalizeClass as re, vModelText as qe, reactive as st, h as Q, toDisplayString as I, unref as t, createCommentVNode as oe, Fragment as pe, normalizeStyle as xe, renderList as Qe, createBlock as ne, mergeProps as Ye, createTextVNode as le, mergeModels as Pe, useModel as nt, isRef as He, Teleport as lt, 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 Le, a as pt } from "./format-unit-display-
|
|
4
|
+
import { f as dt, t as mt, u as Le, a as pt } from "./format-unit-display-De_mv7m7.js";
|
|
5
5
|
import { R as Ne } from "./row-action.enum-BcW_L_nE.js";
|
|
6
|
-
import { a as We, s as Ee, t as X, u as Ge, v as ct, k as ye } from "./app-
|
|
7
|
-
import { _ as ft } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-
|
|
6
|
+
import { a as We, s as Ee, t as X, u as Ge, v as ct, k as ye } from "./app-DZ9CIN-l.js";
|
|
7
|
+
import { _ as ft } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-lgr6bbOW.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 je, I as gt, b as ht, n as _t, a as se, c as xt, R as ke, g as be, d as ve, A as we, M as kt, e as wt } from "./rules-
|
|
12
|
-
import { d as Ze } from "./defineDeepModel-
|
|
13
|
-
import { _ as Tt, F as Ft, a as Ct, b as It } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-
|
|
14
|
-
import { u as ge } from "./feature-
|
|
15
|
-
import { c as Mt, u as $t, _ as St } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-
|
|
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 je, I as gt, b as ht, n as _t, a as se, c as xt, R as ke, g as be, d as ve, A as we, M as kt, e as wt } from "./rules-9v8VtDWl.js";
|
|
12
|
+
import { d as Ze } from "./defineDeepModel-CBc_F4eu.js";
|
|
13
|
+
import { _ as Tt, F as Ft, a as Ct, b as It } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-CQAnQxH8.js";
|
|
14
|
+
import { u as ge } from "./feature-CjK6Ds77.js";
|
|
15
|
+
import { c as Mt, u as $t, _ as St } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-B813CRxg.js";
|
|
16
|
+
import { u as Je } from "./netsuite-d7P730Bm.js";
|
|
17
|
+
import { u as Ot } from "./supplier-Ds2vZ4qg.js";
|
|
18
|
+
import { u as Dt } from "./use-ingredient-select-dialog-CAKpgkQ9.js";
|
|
19
19
|
import { F as ee, _ as Xe } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-cfFHDIwQ.js";
|
|
20
|
-
import { u as Vt } from "./use-template-enabled-locations-2-
|
|
21
|
-
import { u as At } from "./purchase-order-template-
|
|
22
|
-
import { f as Rt } from "./format-time-from-id-
|
|
23
|
-
import { f as Bt } from "./date2-
|
|
20
|
+
import { u as Vt } from "./use-template-enabled-locations-2-DrUrir8n.js";
|
|
21
|
+
import { u as At } from "./purchase-order-template-J9nWMrS2.js";
|
|
22
|
+
import { f as Rt } from "./format-time-from-id-9kP1kaTe.js";
|
|
23
|
+
import { f as Bt } from "./date2-D0I4_co0.js";
|
|
24
24
|
const Ut = { class: "flex flex-col" }, qt = { class: "flex flex-col" }, Pt = { class: "flex-1" }, Lt = { class: "flex items-center" }, Nt = { class: "flex-1" }, Et = { class: "flex-1" }, zt = /* @__PURE__ */ ae({
|
|
25
25
|
__name: "FmMinMaxInput",
|
|
26
26
|
props: {
|
|
@@ -58,41 +58,41 @@ const Ut = { class: "flex flex-col" }, qt = { class: "flex flex-col" }, Pt = { c
|
|
|
58
58
|
helperText: {},
|
|
59
59
|
helperState: {}
|
|
60
60
|
},
|
|
61
|
-
setup(
|
|
62
|
-
const h =
|
|
61
|
+
setup(f) {
|
|
62
|
+
const h = f, y = Ze("modelValue"), a = gt();
|
|
63
63
|
Te(() => {
|
|
64
|
-
const { min:
|
|
65
|
-
if (!(!
|
|
66
|
-
const w = Math.max(
|
|
67
|
-
|
|
64
|
+
const { min: p, max: b } = y ?? {};
|
|
65
|
+
if (!(!p || !b) && p.precision !== b.precision) {
|
|
66
|
+
const w = Math.max(p.precision, b.precision), i = he(p, w), g = he(b, w);
|
|
67
|
+
y.min = i, y.max = g;
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
70
|
const r = N(() => {
|
|
71
|
-
const { min:
|
|
72
|
-
return Math.max((
|
|
73
|
-
}), s = (
|
|
74
|
-
if (!
|
|
75
|
-
const
|
|
71
|
+
const { min: p, max: b } = y ?? {};
|
|
72
|
+
return Math.max((p == null ? void 0 : p.precision) ?? 0, (b == null ? void 0 : b.precision) ?? 0, h.precision ?? 0);
|
|
73
|
+
}), s = (p) => {
|
|
74
|
+
if (!p) return "";
|
|
75
|
+
const b = ht(p), w = r.value, i = he(b, w);
|
|
76
76
|
return _t(
|
|
77
77
|
+se(i),
|
|
78
78
|
i.precision
|
|
79
79
|
);
|
|
80
|
-
}, u = H(s(
|
|
81
|
-
Fe([u, _], ([
|
|
82
|
-
const w =
|
|
83
|
-
if (
|
|
84
|
-
const $ = je(+
|
|
80
|
+
}, u = H(s(y.min)), _ = H(s(y.max));
|
|
81
|
+
Fe([u, _], ([p, b]) => {
|
|
82
|
+
const w = y ?? {}, i = a(p), g = a(b), O = r.value;
|
|
83
|
+
if (p !== "" && i === !0) {
|
|
84
|
+
const $ = je(+p, O);
|
|
85
85
|
w.min = $;
|
|
86
86
|
} else
|
|
87
87
|
w.min = null;
|
|
88
|
-
if (
|
|
89
|
-
const $ = je(+
|
|
88
|
+
if (b !== "" && g === !0) {
|
|
89
|
+
const $ = je(+b, O);
|
|
90
90
|
w.max = $;
|
|
91
91
|
} else
|
|
92
92
|
w.max = null;
|
|
93
|
-
|
|
93
|
+
y.min = w.min, y.max = w.max;
|
|
94
94
|
});
|
|
95
|
-
const
|
|
95
|
+
const M = Symbol.for("fm:form-state"), v = ot(M, null), o = N(() => h.disabled ?? (v == null ? void 0 : v.getDisabled()) ?? !1), d = H(), m = H(), k = H(!1), T = H(!1), R = N(() => k.value || T.value), U = N(() => [...[
|
|
96
96
|
function() {
|
|
97
97
|
return typeof a(u.value) == "string" || typeof a(_.value) == "string" ? "Must be a number" : !0;
|
|
98
98
|
},
|
|
@@ -100,31 +100,31 @@ const Ut = { class: "flex flex-col" }, qt = { class: "flex flex-col" }, Pt = { c
|
|
|
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;
|
|
101
101
|
}
|
|
102
102
|
], ...h.rules ?? []]);
|
|
103
|
-
return (
|
|
103
|
+
return (p, b) => {
|
|
104
104
|
const w = V("FmLabel"), i = V("FmField"), g = V("FmFormGroup");
|
|
105
105
|
return S(), L("div", Ut, [
|
|
106
106
|
e("div", qt, [
|
|
107
107
|
e("div", Pt, [
|
|
108
|
-
|
|
109
|
-
label:
|
|
110
|
-
disabled:
|
|
111
|
-
required:
|
|
112
|
-
optional:
|
|
108
|
+
c(w, {
|
|
109
|
+
label: p.label,
|
|
110
|
+
disabled: p.disabled,
|
|
111
|
+
required: p.labelMark === "required",
|
|
112
|
+
optional: p.labelMark === "optional"
|
|
113
113
|
}, null, 8, ["label", "disabled", "required", "optional"])
|
|
114
114
|
]),
|
|
115
|
-
|
|
115
|
+
c(i, { focused: R.value }, {
|
|
116
116
|
default: B(() => [
|
|
117
117
|
e("div", Lt, [
|
|
118
|
-
_e(
|
|
119
|
-
|
|
118
|
+
_e(p.$slots, "prepend"),
|
|
119
|
+
b[6] || (b[6] = e("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400 pr-4" }, "Min.", -1)),
|
|
120
120
|
e("div", Nt, [
|
|
121
121
|
Ue(e("input", {
|
|
122
122
|
type: "text",
|
|
123
123
|
ref_key: "minInputRef",
|
|
124
|
-
ref:
|
|
125
|
-
onFocus:
|
|
126
|
-
onBlur:
|
|
127
|
-
"onUpdate:modelValue":
|
|
124
|
+
ref: d,
|
|
125
|
+
onFocus: b[0] || (b[0] = () => k.value = !0),
|
|
126
|
+
onBlur: b[1] || (b[1] = () => k.value = !1),
|
|
127
|
+
"onUpdate:modelValue": b[2] || (b[2] = (O) => u.value = O),
|
|
128
128
|
class: re({
|
|
129
129
|
"fm-text-field--input fm-typo-en-body-lg-400": !0,
|
|
130
130
|
"text-fm-color-typo-primary": !o.value,
|
|
@@ -134,16 +134,16 @@ const Ut = { class: "flex flex-col" }, qt = { class: "flex flex-col" }, Pt = { c
|
|
|
134
134
|
[qe, u.value]
|
|
135
135
|
])
|
|
136
136
|
]),
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
b[7] || (b[7] = e("div", { class: "block h-32 mx-4 w-[1px] bg-fm-color-neutral-gray-200" }, null, -1)),
|
|
138
|
+
b[8] || (b[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
|
Ue(e("input", {
|
|
141
141
|
type: "text",
|
|
142
142
|
ref_key: "maxInputRef",
|
|
143
|
-
ref:
|
|
144
|
-
onFocus:
|
|
145
|
-
onBlur:
|
|
146
|
-
"onUpdate:modelValue":
|
|
143
|
+
ref: m,
|
|
144
|
+
onFocus: b[3] || (b[3] = () => T.value = !0),
|
|
145
|
+
onBlur: b[4] || (b[4] = () => T.value = !1),
|
|
146
|
+
"onUpdate:modelValue": b[5] || (b[5] = (O) => _.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,
|
|
@@ -153,56 +153,56 @@ const Ut = { class: "flex flex-col" }, qt = { class: "flex flex-col" }, Pt = { c
|
|
|
153
153
|
[qe, _.value]
|
|
154
154
|
])
|
|
155
155
|
]),
|
|
156
|
-
_e(
|
|
156
|
+
_e(p.$slots, "append")
|
|
157
157
|
])
|
|
158
158
|
]),
|
|
159
159
|
_: 3
|
|
160
160
|
}, 8, ["focused"])
|
|
161
161
|
]),
|
|
162
|
-
|
|
162
|
+
c(g, {
|
|
163
163
|
class: "flex-1",
|
|
164
|
-
"model-value":
|
|
165
|
-
info:
|
|
164
|
+
"model-value": p.modelValue,
|
|
165
|
+
info: p.labelInfo,
|
|
166
166
|
rules: U.value,
|
|
167
|
-
"helper-text":
|
|
168
|
-
"helper-state":
|
|
167
|
+
"helper-text": p.helperText,
|
|
168
|
+
"helper-state": p.helperState
|
|
169
169
|
}, null, 8, ["model-value", "info", "rules", "helper-text", "helper-state"])
|
|
170
170
|
]);
|
|
171
171
|
};
|
|
172
172
|
}
|
|
173
173
|
});
|
|
174
|
-
function jt({ min:
|
|
174
|
+
function jt({ min: f, max: h } = { min: !0, max: !0 }) {
|
|
175
175
|
return function(a) {
|
|
176
|
-
return !a || !a.min &&
|
|
176
|
+
return !a || !a.min && f != !1 || !a.max && h != !1 ? "Required" : !0;
|
|
177
177
|
};
|
|
178
178
|
}
|
|
179
|
-
function Qt(
|
|
179
|
+
function Qt(f, h) {
|
|
180
180
|
return function(a) {
|
|
181
|
-
return !a || !a.min || !a.max ? !0 : +se(a.min) <
|
|
181
|
+
return !a || !a.min || !a.max ? !0 : +se(a.min) < f ? `Must be between ${f} and ${h}` : +se(a.max) > h ? `Must be between ${f} and ${h}` : !0;
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
|
-
function Yt(
|
|
185
|
-
const h = xt(
|
|
184
|
+
function Yt(f) {
|
|
185
|
+
const h = xt(f), y = se(f);
|
|
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
|
-
return !s && !u ? `Min & max must be a multiple of ${
|
|
188
|
+
return !s && !u ? `Min & max must be a multiple of ${y}` : s ? u ? !0 : `Max must be a multiple of ${y}` : `Min must be a multiple of ${y}`;
|
|
189
189
|
};
|
|
190
190
|
}
|
|
191
191
|
const et = bt("netsuite-custom-field-helper", () => {
|
|
192
|
-
const
|
|
193
|
-
function h(
|
|
194
|
-
var
|
|
192
|
+
const f = Je();
|
|
193
|
+
function h(y, a, r, s, u) {
|
|
194
|
+
var v, o, d;
|
|
195
195
|
if (!r) {
|
|
196
196
|
u == null || u("Unit is not valid");
|
|
197
197
|
return;
|
|
198
198
|
}
|
|
199
|
-
let _ =
|
|
200
|
-
if (
|
|
201
|
-
const
|
|
202
|
-
|
|
199
|
+
let _ = y.code;
|
|
200
|
+
if (((v = y.measurement) == null ? void 0 : v.id) !== ((o = r.measurement) == null ? void 0 : o.id) && f.isEnabled) {
|
|
201
|
+
const m = f.getItemCustomCode(a, (d = r.measurement) == null ? void 0 : d.id);
|
|
202
|
+
m && (_ = m);
|
|
203
203
|
}
|
|
204
204
|
s({
|
|
205
|
-
...
|
|
205
|
+
...y,
|
|
206
206
|
quantity: r.amount,
|
|
207
207
|
measurement: r.measurement ?? null,
|
|
208
208
|
code: _
|
|
@@ -212,29 +212,29 @@ const et = bt("netsuite-custom-field-helper", () => {
|
|
|
212
212
|
validateUnitInput: h
|
|
213
213
|
};
|
|
214
214
|
});
|
|
215
|
-
var Y = /* @__PURE__ */ ((
|
|
216
|
-
function Ht(
|
|
217
|
-
const { t:
|
|
215
|
+
var Y = /* @__PURE__ */ ((f) => (f.Code = "Code", f.Name = "Name", f.DefaultAmount = "DefaultAmount", f.Limit = "Limit", f.Step = "Step", f.Cost = "Cost", f.Delete = "Delete", f))(Y || {});
|
|
216
|
+
function Ht(f, h = {}) {
|
|
217
|
+
const { t: y } = me(), a = We(), r = ge(), s = st({}), u = et();
|
|
218
218
|
Te(() => {
|
|
219
|
-
for (const
|
|
220
|
-
if (!
|
|
219
|
+
for (const v of f.items) {
|
|
220
|
+
if (!v.totalCost)
|
|
221
221
|
continue;
|
|
222
222
|
const { cost: o } = Mt(
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
223
|
+
v.sku,
|
|
224
|
+
v.quantity,
|
|
225
|
+
v.measurement,
|
|
226
226
|
{
|
|
227
|
-
supplier:
|
|
227
|
+
supplier: f.supplier
|
|
228
228
|
}
|
|
229
|
-
),
|
|
230
|
-
o ? s[
|
|
229
|
+
), d = v.totalCost ?? Ee.reset();
|
|
230
|
+
o ? s[v.sku._id] = o.amount !== d.amount || o.precision !== d.precision : s[v.sku._id] = !0;
|
|
231
231
|
}
|
|
232
232
|
});
|
|
233
233
|
const _ = [
|
|
234
234
|
{
|
|
235
235
|
id: "Code",
|
|
236
236
|
header: () => Q("div", { class: "flex-col" }, [
|
|
237
|
-
Q("div",
|
|
237
|
+
Q("div", y("inventory.transfer.form.items.table.Code")),
|
|
238
238
|
Q(
|
|
239
239
|
"div",
|
|
240
240
|
{ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
@@ -243,15 +243,15 @@ function Ht(p, h = {}) {
|
|
|
243
243
|
]),
|
|
244
244
|
accessorKey: "code",
|
|
245
245
|
size: 180,
|
|
246
|
-
cell(
|
|
247
|
-
const o =
|
|
246
|
+
cell(v) {
|
|
247
|
+
const o = v.row.original;
|
|
248
248
|
return Q("div", [
|
|
249
249
|
Q(ue.FmTextField, {
|
|
250
250
|
modelValue: o.code,
|
|
251
|
-
"onUpdate:modelValue": (
|
|
252
|
-
|
|
251
|
+
"onUpdate:modelValue": (d) => {
|
|
252
|
+
f.updateItem({
|
|
253
253
|
...o,
|
|
254
|
-
code:
|
|
254
|
+
code: d
|
|
255
255
|
});
|
|
256
256
|
},
|
|
257
257
|
helperText: o.sku.code,
|
|
@@ -266,7 +266,7 @@ function Ht(p, h = {}) {
|
|
|
266
266
|
{
|
|
267
267
|
id: "Name",
|
|
268
268
|
header: () => Q("div", { class: "flex-col" }, [
|
|
269
|
-
Q("div",
|
|
269
|
+
Q("div", y("inventory.transfer.form.items.table.Name")),
|
|
270
270
|
Q(
|
|
271
271
|
"div",
|
|
272
272
|
{ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
@@ -274,15 +274,15 @@ function Ht(p, h = {}) {
|
|
|
274
274
|
)
|
|
275
275
|
]),
|
|
276
276
|
minSize: 300,
|
|
277
|
-
cell(
|
|
278
|
-
const o =
|
|
277
|
+
cell(v) {
|
|
278
|
+
const o = v.row.original;
|
|
279
279
|
return Q("div", [
|
|
280
280
|
Q(ue.FmTextField, {
|
|
281
281
|
modelValue: o.name,
|
|
282
|
-
"onUpdate:modelValue": (
|
|
283
|
-
|
|
282
|
+
"onUpdate:modelValue": (d) => {
|
|
283
|
+
f.updateItem({
|
|
284
284
|
...o,
|
|
285
|
-
name:
|
|
285
|
+
name: d
|
|
286
286
|
});
|
|
287
287
|
},
|
|
288
288
|
helperText: o.sku.name,
|
|
@@ -296,14 +296,14 @@ function Ht(p, h = {}) {
|
|
|
296
296
|
},
|
|
297
297
|
{
|
|
298
298
|
id: "DefaultAmount",
|
|
299
|
-
header: () =>
|
|
299
|
+
header: () => y("inventory.transfer.form.items.table.DefaultAmount"),
|
|
300
300
|
minSize: 200,
|
|
301
|
-
cell(
|
|
301
|
+
cell(v) {
|
|
302
302
|
var R;
|
|
303
|
-
const o =
|
|
304
|
-
var
|
|
305
|
-
return ((
|
|
306
|
-
}), T = o.sku.unit._id !==
|
|
303
|
+
const o = v.row.original, d = a.skuById[o.sku._id], m = a.unitById[(R = d.unit) == null ? void 0 : R._id], k = m.measurements.find((U) => {
|
|
304
|
+
var p;
|
|
305
|
+
return ((p = o.measurement) == null ? void 0 : p.id) === U.id;
|
|
306
|
+
}), T = o.sku.unit._id !== d.unit._id || !m || o.measurement && !k;
|
|
307
307
|
return Q(Tt, {
|
|
308
308
|
style: {
|
|
309
309
|
flex: "1 1 0%"
|
|
@@ -311,22 +311,22 @@ function Ht(p, h = {}) {
|
|
|
311
311
|
modelValue: {
|
|
312
312
|
amount: o.quantity ?? { amount: 1, precision: 0 },
|
|
313
313
|
// NOTE: leave this reading from row.sku.unit and row.measurement instead,
|
|
314
|
-
measurement: o.measurement ?? (o.sku.unit._id !==
|
|
314
|
+
measurement: o.measurement ?? (o.sku.unit._id !== d.unit._id ? { ...o.sku.unit, id: "", conversion: { amount: 1, precision: 0 } } : null)
|
|
315
315
|
},
|
|
316
|
-
disabled:
|
|
316
|
+
disabled: f.disabled,
|
|
317
317
|
key: o.sku._id,
|
|
318
|
-
unit:
|
|
318
|
+
unit: m,
|
|
319
319
|
"onUpdate:modelValue": (U) => {
|
|
320
320
|
u.validateUnitInput(
|
|
321
321
|
o,
|
|
322
|
-
|
|
322
|
+
d,
|
|
323
323
|
U,
|
|
324
|
-
(
|
|
325
|
-
|
|
324
|
+
(p) => {
|
|
325
|
+
f.updateItem({
|
|
326
326
|
...o,
|
|
327
|
-
code:
|
|
328
|
-
quantity:
|
|
329
|
-
measurement:
|
|
327
|
+
code: p.code,
|
|
328
|
+
quantity: p.quantity,
|
|
329
|
+
measurement: p.measurement
|
|
330
330
|
});
|
|
331
331
|
}
|
|
332
332
|
);
|
|
@@ -347,7 +347,7 @@ function Ht(p, h = {}) {
|
|
|
347
347
|
It(
|
|
348
348
|
o.maximumQuantity ? +se(o.maximumQuantity) : 1 / 0
|
|
349
349
|
),
|
|
350
|
-
function(
|
|
350
|
+
function(p) {
|
|
351
351
|
return T ? "This item is no longer valid due to change in unit. Please reapply unit." : !0;
|
|
352
352
|
}
|
|
353
353
|
],
|
|
@@ -361,8 +361,8 @@ function Ht(p, h = {}) {
|
|
|
361
361
|
header: () => "Limit",
|
|
362
362
|
// TODO: i18n,
|
|
363
363
|
minSize: 280,
|
|
364
|
-
cell(
|
|
365
|
-
const o =
|
|
364
|
+
cell(v) {
|
|
365
|
+
const o = v.row.original;
|
|
366
366
|
return Q(zt, {
|
|
367
367
|
style: {
|
|
368
368
|
flex: "1 1 0%"
|
|
@@ -371,12 +371,12 @@ function Ht(p, h = {}) {
|
|
|
371
371
|
min: o.minimumQuantity,
|
|
372
372
|
max: o.maximumQuantity
|
|
373
373
|
},
|
|
374
|
-
disabled:
|
|
374
|
+
disabled: f.disabled,
|
|
375
375
|
key: o.sku._id,
|
|
376
376
|
unit: o.sku.unit,
|
|
377
|
-
"onUpdate:modelValue": (
|
|
378
|
-
const
|
|
379
|
-
|
|
377
|
+
"onUpdate:modelValue": (d) => {
|
|
378
|
+
const m = { ...o };
|
|
379
|
+
d != null && d.min ? m.minimumQuantity = d.min : m.minimumQuantity = null, d != null && d.max ? m.maximumQuantity = d.max : m.maximumQuantity = null, f.updateItem(m);
|
|
380
380
|
},
|
|
381
381
|
rules: [
|
|
382
382
|
jt({ max: !1 }),
|
|
@@ -396,17 +396,17 @@ function Ht(p, h = {}) {
|
|
|
396
396
|
},
|
|
397
397
|
{
|
|
398
398
|
id: "Step",
|
|
399
|
-
header: () =>
|
|
399
|
+
header: () => y("inventory.transfer.form.items.table.Step"),
|
|
400
400
|
minSize: 100,
|
|
401
|
-
cell(
|
|
402
|
-
const o =
|
|
401
|
+
cell(v) {
|
|
402
|
+
const o = v.row.original;
|
|
403
403
|
return Q(ue.FmTextField, {
|
|
404
404
|
modelValue: se(o.quantityStep ?? Ee.reset(), !1),
|
|
405
405
|
key: o.sku._id,
|
|
406
|
-
"onUpdate:modelValue": (
|
|
407
|
-
|
|
406
|
+
"onUpdate:modelValue": (d) => {
|
|
407
|
+
f.updateItem({
|
|
408
408
|
...o,
|
|
409
|
-
quantityStep: ve(+
|
|
409
|
+
quantityStep: ve(+d)
|
|
410
410
|
});
|
|
411
411
|
},
|
|
412
412
|
rules: [
|
|
@@ -423,8 +423,8 @@ function Ht(p, h = {}) {
|
|
|
423
423
|
{
|
|
424
424
|
id: "Delete",
|
|
425
425
|
header: "",
|
|
426
|
-
cell(
|
|
427
|
-
const o =
|
|
426
|
+
cell(v) {
|
|
427
|
+
const o = v.row.original;
|
|
428
428
|
return Q("div", { class: "flex items-center" }, [
|
|
429
429
|
r.usePurchaseOrderV2 ? Q(
|
|
430
430
|
ue.FmTooltip,
|
|
@@ -440,9 +440,9 @@ function Ht(p, h = {}) {
|
|
|
440
440
|
icon: "add_circle",
|
|
441
441
|
variant: "tertiary",
|
|
442
442
|
size: "md",
|
|
443
|
-
disabled:
|
|
443
|
+
disabled: f.disabled,
|
|
444
444
|
onClick: async () => {
|
|
445
|
-
const
|
|
445
|
+
const d = {
|
|
446
446
|
id: crypto.randomUUID(),
|
|
447
447
|
sku: o.sku,
|
|
448
448
|
code: o.sku.code,
|
|
@@ -452,16 +452,16 @@ function Ht(p, h = {}) {
|
|
|
452
452
|
minimumQuantity: ve(1)
|
|
453
453
|
};
|
|
454
454
|
u.validateUnitInput(
|
|
455
|
-
|
|
455
|
+
d,
|
|
456
456
|
o.sku,
|
|
457
457
|
{
|
|
458
|
-
amount:
|
|
458
|
+
amount: d.quantity,
|
|
459
459
|
measurement: null
|
|
460
460
|
},
|
|
461
|
-
(
|
|
462
|
-
|
|
461
|
+
(m) => {
|
|
462
|
+
d.code = m.code;
|
|
463
463
|
}
|
|
464
|
-
),
|
|
464
|
+
), f.duplicateItem(d);
|
|
465
465
|
}
|
|
466
466
|
});
|
|
467
467
|
},
|
|
@@ -477,9 +477,9 @@ function Ht(p, h = {}) {
|
|
|
477
477
|
icon: "delete",
|
|
478
478
|
variant: "tertiary",
|
|
479
479
|
size: "md",
|
|
480
|
-
disabled:
|
|
480
|
+
disabled: f.disabled,
|
|
481
481
|
onClick: () => {
|
|
482
|
-
|
|
482
|
+
f.deleteItem(o);
|
|
483
483
|
}
|
|
484
484
|
})
|
|
485
485
|
]);
|
|
@@ -494,64 +494,64 @@ function Ht(p, h = {}) {
|
|
|
494
494
|
];
|
|
495
495
|
return {
|
|
496
496
|
columnDefs: N(() => {
|
|
497
|
-
const
|
|
497
|
+
const v = ge(), o = [..._];
|
|
498
498
|
if (Object.keys(h).length > 0)
|
|
499
|
-
for (const [
|
|
500
|
-
o.splice(Number(
|
|
501
|
-
...
|
|
502
|
-
id:
|
|
499
|
+
for (const [d, m] of Object.entries(h))
|
|
500
|
+
o.splice(Number(d), 0, {
|
|
501
|
+
...m,
|
|
502
|
+
id: d
|
|
503
503
|
});
|
|
504
|
-
return
|
|
504
|
+
return v.enableTotalCost && f.transferType === X.enum.purchase ? o : o.filter((d) => d.id !== "Cost");
|
|
505
505
|
})
|
|
506
506
|
};
|
|
507
507
|
}
|
|
508
508
|
const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-center" }, Kt = { class: "flex-1 flex gap-1 items-center" }, Zt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Jt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Xt = { class: "flex gap-8 w-full" }, eo = { class: "flex-1 flex flex-col gap-4" }, to = { class: "flex-1 flex flex-col gap-4" }, oo = {
|
|
509
509
|
key: 0,
|
|
510
510
|
class: "flex gap-8 w-full"
|
|
511
|
-
}, so = { class: "flex-1 flex flex-col gap-4" },
|
|
511
|
+
}, so = { class: "flex-1 flex flex-col gap-4" }, no = { class: "flex-1 flex flex-col gap-4" }, lo = { class: "flex gap-8 w-full" }, ao = { class: "flex-1 flex flex-col gap-4" }, ro = /* @__PURE__ */ ae({
|
|
512
512
|
__name: "TransferTemplateItem",
|
|
513
513
|
props: {
|
|
514
514
|
cellByColId: {},
|
|
515
515
|
row: {}
|
|
516
516
|
},
|
|
517
|
-
setup(
|
|
517
|
+
setup(f) {
|
|
518
518
|
const { t: h } = me();
|
|
519
|
-
function
|
|
519
|
+
function y(a) {
|
|
520
520
|
return a;
|
|
521
521
|
}
|
|
522
522
|
return (a, r) => {
|
|
523
|
-
var u, _,
|
|
523
|
+
var u, _, M, v, o, d, m, k, T, R, U, p, b, w, i, g, O, $, x, W, te, E, q, Z, n, l, F, P, z, G;
|
|
524
524
|
const s = V("FmLabel");
|
|
525
525
|
return S(), L("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
|
-
|
|
533
|
-
render: (
|
|
534
|
-
props: (o = (
|
|
532
|
+
c(t(ee), {
|
|
533
|
+
render: (M = (_ = (u = a.cellByColId.Delete) == null ? void 0 : u.column) == null ? void 0 : _.columnDef) == null ? void 0 : M.cell,
|
|
534
|
+
props: (o = (v = a.cellByColId.Delete) == null ? void 0 : v.getContext) == null ? void 0 : o.call(v)
|
|
535
535
|
}, null, 8, ["render", "props"])
|
|
536
536
|
])
|
|
537
537
|
]),
|
|
538
538
|
e("div", Xt, [
|
|
539
539
|
e("div", eo, [
|
|
540
|
-
|
|
540
|
+
c(s, {
|
|
541
541
|
label: t(h)(`inventory.transfer.form.items.table.${t(Y).Code}`)
|
|
542
542
|
}, null, 8, ["label"]),
|
|
543
|
-
|
|
544
|
-
render: (k = (
|
|
543
|
+
c(t(ee), {
|
|
544
|
+
render: (k = (m = (d = a.cellByColId[t(Y).Code]) == null ? void 0 : d.column) == null ? void 0 : m.columnDef) == null ? void 0 : k.cell,
|
|
545
545
|
props: (R = (T = a.cellByColId[t(Y).Code]) == null ? void 0 : T.getContext) == null ? void 0 : R.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
|
+
c(s, {
|
|
551
551
|
label: t(h)(`inventory.transfer.form.items.table.${t(Y).Name}`)
|
|
552
552
|
}, null, 8, ["label"]),
|
|
553
|
-
|
|
554
|
-
render: (
|
|
553
|
+
c(t(ee), {
|
|
554
|
+
render: (b = (p = (U = a.cellByColId[t(Y).Name]) == null ? void 0 : U.column) == null ? void 0 : p.columnDef) == null ? void 0 : b.cell,
|
|
555
555
|
props: (i = (w = a.cellByColId[t(Y).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))
|
|
@@ -559,33 +559,33 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
559
559
|
]),
|
|
560
560
|
a.row.original ? (S(), L("div", oo, [
|
|
561
561
|
e("div", so, [
|
|
562
|
-
|
|
562
|
+
c(s, {
|
|
563
563
|
label: t(h)(`inventory.transfer.form.items.table.${t(Y).DefaultAmount}`)
|
|
564
564
|
}, null, 8, ["label"]),
|
|
565
|
-
|
|
565
|
+
c(t(ee), {
|
|
566
566
|
render: ($ = (O = (g = a.cellByColId[t(Y).DefaultAmount]) == null ? void 0 : g.column) == null ? void 0 : O.columnDef) == null ? void 0 : $.cell,
|
|
567
567
|
props: (W = (x = a.cellByColId[t(Y).DefaultAmount]) == null ? void 0 : x.getContext) == null ? void 0 : W.call(x)
|
|
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
|
-
e("div",
|
|
572
|
-
|
|
571
|
+
e("div", no, [
|
|
572
|
+
c(s, {
|
|
573
573
|
label: t(h)(`inventory.transfer.form.items.table.${t(Y).Step}`)
|
|
574
574
|
}, null, 8, ["label"]),
|
|
575
|
-
|
|
575
|
+
c(t(ee), {
|
|
576
576
|
render: (q = (E = (te = a.cellByColId[t(Y).Step]) == null ? void 0 : te.column) == null ? void 0 : E.columnDef) == null ? void 0 : q.cell,
|
|
577
|
-
props: (
|
|
577
|
+
props: (n = (Z = a.cellByColId[t(Y).Step]) == null ? void 0 : Z.getContext) == null ? void 0 : n.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
|
])
|
|
581
581
|
])) : oe("", !0),
|
|
582
|
-
e("div",
|
|
582
|
+
e("div", lo, [
|
|
583
583
|
e("div", ao, [
|
|
584
|
-
|
|
584
|
+
c(s, {
|
|
585
585
|
label: t(h)(`inventory.transfer.form.items.table.${t(Y).Limit}`)
|
|
586
586
|
}, null, 8, ["label"]),
|
|
587
|
-
|
|
588
|
-
render: (P = (F = (
|
|
587
|
+
c(t(ee), {
|
|
588
|
+
render: (P = (F = (l = a.cellByColId[t(Y).Limit]) == null ? void 0 : l.column) == null ? void 0 : F.columnDef) == null ? void 0 : P.cell,
|
|
589
589
|
props: (G = (z = a.cellByColId[t(Y).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))
|
|
@@ -602,28 +602,28 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
602
602
|
errorMessage: {}
|
|
603
603
|
},
|
|
604
604
|
emits: ["update:item"],
|
|
605
|
-
setup(
|
|
606
|
-
function h(
|
|
607
|
-
return
|
|
605
|
+
setup(f) {
|
|
606
|
+
function h(y) {
|
|
607
|
+
return y.column.columnDef.meta;
|
|
608
608
|
}
|
|
609
|
-
return (
|
|
609
|
+
return (y, a) => (S(), L(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: xe({ backgroundColor:
|
|
612
|
+
style: xe({ backgroundColor: y.errorMessage ? "#ffd6d6" : void 0 })
|
|
613
613
|
}, [
|
|
614
|
-
(S(!0), L(pe, null, Qe(
|
|
615
|
-
var s, u, _,
|
|
614
|
+
(S(!0), L(pe, null, Qe(y.row.getVisibleCells(), (r) => {
|
|
615
|
+
var s, u, _, M, v;
|
|
616
616
|
return S(), L("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
619
|
style: xe({
|
|
620
620
|
width: (u = h(r)) != null && u.width ? (_ = h(r)) == null ? void 0 : _.width : r.column.getSize() !== 0 ? `${r.column.getSize()}px` : void 0,
|
|
621
|
-
maxWidth: (
|
|
622
|
-
textAlign: ((
|
|
621
|
+
maxWidth: (M = h(r)) == null ? void 0 : M.maxWidth,
|
|
622
|
+
textAlign: ((v = h(r)) == null ? void 0 : v.textAlign) ?? "left"
|
|
623
623
|
})
|
|
624
624
|
}, [
|
|
625
625
|
e("span", io, [
|
|
626
|
-
|
|
626
|
+
c(t(ee), {
|
|
627
627
|
props: r.getContext(),
|
|
628
628
|
render: r.column.columnDef.cell
|
|
629
629
|
}, null, 8, ["props", "render"])
|
|
@@ -631,11 +631,11 @@ 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
|
-
|
|
634
|
+
y.errorMessage ? (S(), L("tr", uo, [
|
|
635
635
|
e("td", {
|
|
636
|
-
colspan:
|
|
636
|
+
colspan: y.row.getVisibleCells().length,
|
|
637
637
|
class: "text-red-600 px-16 py-2"
|
|
638
|
-
},
|
|
638
|
+
}, I(y.errorMessage), 9, mo)
|
|
639
639
|
])) : oe("", !0)
|
|
640
640
|
], 64));
|
|
641
641
|
}
|
|
@@ -649,51 +649,51 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
649
649
|
disabled: { type: Boolean }
|
|
650
650
|
},
|
|
651
651
|
emits: ["update:disabled"],
|
|
652
|
-
setup(
|
|
653
|
-
const a =
|
|
652
|
+
setup(f, { expose: h, emit: y }) {
|
|
653
|
+
const a = f, r = y, s = Ze(), { t: u } = me(), _ = H({}), M = Ge(), v = We(), o = Ot(), d = ge(), m = Je(), k = et();
|
|
654
654
|
Fe(
|
|
655
655
|
() => s.purchaseOrder.items.length,
|
|
656
656
|
() => {
|
|
657
657
|
_.value = {};
|
|
658
658
|
}
|
|
659
|
-
),
|
|
660
|
-
location && (s.purchaseOrder.supplier || (s.purchaseOrder.supplier = o.suppliers.find((
|
|
659
|
+
), M.watchLocation(async () => {
|
|
660
|
+
location && (s.purchaseOrder.supplier || (s.purchaseOrder.supplier = o.suppliers.find((n) => n) ?? s.purchaseOrder.supplier));
|
|
661
661
|
});
|
|
662
662
|
const T = $t(
|
|
663
663
|
() => s.purchaseOrder,
|
|
664
|
-
(
|
|
664
|
+
(n) => {
|
|
665
665
|
s.purchaseOrder = {
|
|
666
666
|
...s.purchaseOrder,
|
|
667
|
-
supplier:
|
|
667
|
+
supplier: n.supplier ?? (s == null ? void 0 : s.purchaseOrder.supplier)
|
|
668
668
|
};
|
|
669
669
|
}
|
|
670
670
|
), R = N({
|
|
671
671
|
get() {
|
|
672
|
-
var
|
|
673
|
-
return typeof ((
|
|
672
|
+
var n, l;
|
|
673
|
+
return typeof ((l = (n = s.purchaseOrder) == null ? void 0 : n.supplier) == null ? void 0 : l.internal) == "string" ? X.enum.transfer : X.enum.purchase;
|
|
674
674
|
},
|
|
675
|
-
set(
|
|
675
|
+
set(n) {
|
|
676
676
|
var F, P;
|
|
677
|
-
const
|
|
678
|
-
|
|
677
|
+
const l = typeof ((P = (F = s.purchaseOrder) == null ? void 0 : F.supplier) == null ? void 0 : P.internal) == "string" ? X.enum.transfer : X.enum.purchase;
|
|
678
|
+
n !== l && (s.purchaseOrder.supplier = n === X.enum.purchase ? T.locationOptionsTypePurchase.value[0] : T.locationOptionsTypeTransfer.value[0]);
|
|
679
679
|
}
|
|
680
|
-
}), U = N(() => T.transferLocationOptions.value),
|
|
680
|
+
}), U = N(() => T.transferLocationOptions.value), p = N({
|
|
681
681
|
get() {
|
|
682
|
-
var
|
|
683
|
-
return (
|
|
682
|
+
var n;
|
|
683
|
+
return (n = s.purchaseOrder.supplier) == null ? void 0 : n._id;
|
|
684
684
|
},
|
|
685
|
-
set(
|
|
686
|
-
T.transferLocationModel.value =
|
|
685
|
+
set(n) {
|
|
686
|
+
T.transferLocationModel.value = n;
|
|
687
687
|
}
|
|
688
688
|
});
|
|
689
|
-
async function
|
|
690
|
-
const
|
|
689
|
+
async function b() {
|
|
690
|
+
const n = await m.checkCustomFieldCodes({
|
|
691
691
|
beforeStart: async () => {
|
|
692
692
|
r("update:disabled", !0);
|
|
693
693
|
},
|
|
694
694
|
templateItems: s.purchaseOrder.items
|
|
695
695
|
});
|
|
696
|
-
_.value =
|
|
696
|
+
_.value = n, r("update:disabled", !1);
|
|
697
697
|
}
|
|
698
698
|
const {
|
|
699
699
|
promptSelectLocations: w,
|
|
@@ -703,56 +703,56 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
703
703
|
getLocations() {
|
|
704
704
|
return s.locations;
|
|
705
705
|
},
|
|
706
|
-
setLocations(
|
|
707
|
-
s.locations =
|
|
706
|
+
setLocations(n) {
|
|
707
|
+
s.locations = n;
|
|
708
708
|
}
|
|
709
709
|
});
|
|
710
710
|
function O() {
|
|
711
|
-
var
|
|
712
|
-
return (
|
|
711
|
+
var n, l;
|
|
712
|
+
return (n = s.locations) != null && n.find((F) => {
|
|
713
713
|
var P, z;
|
|
714
714
|
return ((P = F.doc) == null ? void 0 : P._id) === ((z = s.purchaseOrder.supplier) == null ? void 0 : z._id);
|
|
715
|
-
}) ? `Location ${(
|
|
715
|
+
}) ? `Location ${(l = s.purchaseOrder.supplier) == null ? void 0 : l.name} must be removed because template cannot be used to transfer to itself.` : !0;
|
|
716
716
|
}
|
|
717
717
|
const $ = N({
|
|
718
718
|
get() {
|
|
719
719
|
return s.purchaseOrder.remark ?? void 0;
|
|
720
720
|
},
|
|
721
|
-
set(
|
|
722
|
-
s.purchaseOrder.remark =
|
|
721
|
+
set(n) {
|
|
722
|
+
s.purchaseOrder.remark = n;
|
|
723
723
|
}
|
|
724
724
|
}), x = H();
|
|
725
725
|
h({
|
|
726
726
|
validateInputs: () => {
|
|
727
|
-
var
|
|
728
|
-
(
|
|
727
|
+
var n, l;
|
|
728
|
+
(l = (n = x.value) == null ? void 0 : n.validateInputs) == null || l.call(n);
|
|
729
729
|
},
|
|
730
730
|
resetInputsValidation: () => {
|
|
731
|
-
var
|
|
732
|
-
(
|
|
731
|
+
var n, l;
|
|
732
|
+
(l = (n = x.value) == null ? void 0 : n.resetInputsValidation) == null || l.call(n);
|
|
733
733
|
},
|
|
734
734
|
resetInputs: () => {
|
|
735
|
-
var
|
|
736
|
-
(
|
|
735
|
+
var n, l;
|
|
736
|
+
(l = (n = x.value) == null ? void 0 : n.resetInputs) == null || l.call(n);
|
|
737
737
|
}
|
|
738
738
|
});
|
|
739
739
|
const W = N(() => ({
|
|
740
|
-
duplicateItem: (
|
|
740
|
+
duplicateItem: (n) => {
|
|
741
741
|
s.purchaseOrder.items = [
|
|
742
742
|
...s.purchaseOrder.items,
|
|
743
743
|
{
|
|
744
|
-
...
|
|
744
|
+
...n
|
|
745
745
|
}
|
|
746
746
|
];
|
|
747
747
|
},
|
|
748
|
-
updateItem: (
|
|
749
|
-
let
|
|
750
|
-
|
|
748
|
+
updateItem: (n) => {
|
|
749
|
+
let l = [];
|
|
750
|
+
n.id ? l = s.purchaseOrder.items.map((F) => F.id !== n.id ? F : n) : l = s.purchaseOrder.items.map((F) => F.sku._id !== n.sku._id ? F : n), s.purchaseOrder.items = l;
|
|
751
751
|
},
|
|
752
|
-
deleteItem: (
|
|
753
|
-
console.log(
|
|
754
|
-
let
|
|
755
|
-
|
|
752
|
+
deleteItem: (n) => {
|
|
753
|
+
console.log(n.id);
|
|
754
|
+
let l = [];
|
|
755
|
+
n.id ? l = s.purchaseOrder.items.filter((F) => F.id !== n.id) : l = s.purchaseOrder.items.filter((F) => F.sku._id !== n.sku._id), s.purchaseOrder.items = l;
|
|
756
756
|
}
|
|
757
757
|
})), te = Ht(
|
|
758
758
|
{
|
|
@@ -772,13 +772,13 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
772
772
|
return a.disabled;
|
|
773
773
|
}
|
|
774
774
|
},
|
|
775
|
-
|
|
776
|
-
onUpdate: (
|
|
777
|
-
if (
|
|
778
|
-
const z = s.purchaseOrder.items[
|
|
775
|
+
m.transferTemplateColumnDefs({
|
|
776
|
+
onUpdate: (n, l, F, P) => {
|
|
777
|
+
if (n < 0 || n >= s.purchaseOrder.items.length) return;
|
|
778
|
+
const z = s.purchaseOrder.items[n];
|
|
779
779
|
z && W.value.updateItem({
|
|
780
780
|
...z,
|
|
781
|
-
sku:
|
|
781
|
+
sku: l,
|
|
782
782
|
// Sku might be outdated, so we need to update it
|
|
783
783
|
code: F,
|
|
784
784
|
measurement: P
|
|
@@ -787,7 +787,7 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
787
787
|
})
|
|
788
788
|
), E = N(() => te.columnDefs.value), { promptSelectIngredients: q } = Dt();
|
|
789
789
|
async function Z() {
|
|
790
|
-
const
|
|
790
|
+
const l = v.skus.map((D) => ({
|
|
791
791
|
label: D.name,
|
|
792
792
|
sublabel: D.code,
|
|
793
793
|
value: D
|
|
@@ -795,14 +795,14 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
795
795
|
var A;
|
|
796
796
|
return (A = s.purchaseOrder.items) == null ? void 0 : A.find((K) => K.sku._id === D.value._id);
|
|
797
797
|
}).map((D) => D.value), F = s.purchaseOrder.items ?? [], P = await q(
|
|
798
|
-
|
|
798
|
+
l.map((D) => D._id),
|
|
799
799
|
(D) => {
|
|
800
|
-
const A =
|
|
800
|
+
const A = v.skuById[D], K = F.find((j) => j.sku._id === A._id);
|
|
801
801
|
if (K)
|
|
802
802
|
return K;
|
|
803
803
|
const J = { amount: 1, precision: be(A.unit) };
|
|
804
|
-
let
|
|
805
|
-
id:
|
|
804
|
+
let C = {
|
|
805
|
+
id: d.usePurchaseOrderV2 ? crypto.randomUUID() : void 0,
|
|
806
806
|
sku: A,
|
|
807
807
|
code: A.code,
|
|
808
808
|
name: A.name,
|
|
@@ -815,16 +815,16 @@ 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
|
-
|
|
818
|
+
C,
|
|
819
819
|
A,
|
|
820
820
|
{
|
|
821
821
|
amount: J,
|
|
822
822
|
measurement: null
|
|
823
823
|
},
|
|
824
824
|
(j) => {
|
|
825
|
-
|
|
825
|
+
C.code = j.code;
|
|
826
826
|
}
|
|
827
|
-
),
|
|
827
|
+
), C;
|
|
828
828
|
}
|
|
829
829
|
);
|
|
830
830
|
if (!P) return;
|
|
@@ -840,30 +840,30 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
840
840
|
}
|
|
841
841
|
G.sort((D, A) => D.sku.code.localeCompare(A.sku.code)), s.purchaseOrder.items = G;
|
|
842
842
|
}
|
|
843
|
-
return (
|
|
843
|
+
return (n, l) => {
|
|
844
844
|
const F = V("FmTextField"), P = V("FmSelect"), z = V("FmTextarea"), G = V("FmButton"), D = V("FmTable"), A = V("FmFormGroup"), K = V("FmForm");
|
|
845
|
-
return S(),
|
|
845
|
+
return S(), ne(K, {
|
|
846
846
|
ref_key: "formRef",
|
|
847
847
|
ref: x,
|
|
848
848
|
class: "flex flex-col gap-32",
|
|
849
|
-
disabled:
|
|
849
|
+
disabled: n.disabled
|
|
850
850
|
}, {
|
|
851
851
|
default: B(() => {
|
|
852
852
|
var J;
|
|
853
853
|
return [
|
|
854
854
|
e("div", co, [
|
|
855
855
|
e("div", fo, [
|
|
856
|
-
|
|
856
|
+
c(F, {
|
|
857
857
|
label: t(u)("inventory.transfer.form.name"),
|
|
858
858
|
"label-mark": "required",
|
|
859
859
|
modelValue: t(s).name,
|
|
860
|
-
"onUpdate:modelValue":
|
|
860
|
+
"onUpdate:modelValue": l[0] || (l[0] = (C) => t(s).name = C),
|
|
861
861
|
rules: [t(ke)()]
|
|
862
862
|
}, null, 8, ["label", "modelValue", "rules"]),
|
|
863
|
-
|
|
863
|
+
c(P, {
|
|
864
864
|
label: t(u)("inventory.transfer.form.type.title"),
|
|
865
865
|
"model-value": R.value,
|
|
866
|
-
"onUpdate:modelValue":
|
|
866
|
+
"onUpdate:modelValue": l[1] || (l[1] = (C) => R.value = C),
|
|
867
867
|
items: [
|
|
868
868
|
{
|
|
869
869
|
label: t(u)("inventory.transfer.form.type.purchase"),
|
|
@@ -884,61 +884,61 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
884
884
|
e("span", {
|
|
885
885
|
class: re([
|
|
886
886
|
"line-clamp-1 fm-typo-en-body-lg-400",
|
|
887
|
-
|
|
887
|
+
n.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
888
888
|
])
|
|
889
|
-
},
|
|
889
|
+
}, I(t(ct)(R.value)), 3)
|
|
890
890
|
]),
|
|
891
891
|
_: 1
|
|
892
892
|
}, 8, ["label", "model-value", "items", "rules"]),
|
|
893
|
-
|
|
893
|
+
c(P, {
|
|
894
894
|
label: R.value === t(X).enum.purchase ? t(u)("inventory.transfer.form.purchaseFrom") : t(u)("inventory.transfer.form.transferFrom"),
|
|
895
|
-
modelValue:
|
|
896
|
-
"onUpdate:modelValue":
|
|
895
|
+
modelValue: p.value,
|
|
896
|
+
"onUpdate:modelValue": l[2] || (l[2] = (C) => p.value = C),
|
|
897
897
|
items: U.value
|
|
898
898
|
}, {
|
|
899
|
-
"menu-wrapper": B((
|
|
899
|
+
"menu-wrapper": B((C) => {
|
|
900
900
|
var j;
|
|
901
901
|
return [
|
|
902
|
-
|
|
902
|
+
c(St, Ye(C, {
|
|
903
903
|
items: U.value,
|
|
904
|
-
"model-value": (j =
|
|
904
|
+
"model-value": (j = n.modelValue.purchaseOrder.supplier) == null ? void 0 : j._id
|
|
905
905
|
}), null, 16, ["items", "model-value"])
|
|
906
906
|
];
|
|
907
907
|
}),
|
|
908
908
|
default: B(() => {
|
|
909
|
-
var
|
|
909
|
+
var C;
|
|
910
910
|
return [
|
|
911
911
|
e("span", {
|
|
912
912
|
class: re([
|
|
913
913
|
"line-clamp-1 fm-typo-en-body-lg-400",
|
|
914
|
-
|
|
914
|
+
n.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
915
915
|
])
|
|
916
|
-
},
|
|
916
|
+
}, I((C = U.value.find((j) => j.value === p.value)) == null ? void 0 : C.label), 3)
|
|
917
917
|
];
|
|
918
918
|
}),
|
|
919
919
|
_: 1
|
|
920
920
|
}, 8, ["label", "modelValue", "items"]),
|
|
921
|
-
|
|
921
|
+
c(F, {
|
|
922
922
|
label: t(u)("inventory.transfer.form.reference"),
|
|
923
923
|
"label-mark": "optional",
|
|
924
924
|
modelValue: t(s).purchaseOrder.ref,
|
|
925
|
-
"onUpdate:modelValue":
|
|
925
|
+
"onUpdate:modelValue": l[3] || (l[3] = (C) => t(s).purchaseOrder.ref = C)
|
|
926
926
|
}, null, 8, ["label", "modelValue"]),
|
|
927
|
-
|
|
927
|
+
c(z, {
|
|
928
928
|
label: t(u)("inventory.transfer.form.remark"),
|
|
929
929
|
"label-mark": "optional",
|
|
930
930
|
"max-length": 240,
|
|
931
931
|
modelValue: $.value,
|
|
932
|
-
"onUpdate:modelValue":
|
|
933
|
-
class: re({ "text-fm-color-typo-disabled":
|
|
932
|
+
"onUpdate:modelValue": l[4] || (l[4] = (C) => $.value = C),
|
|
933
|
+
class: re({ "text-fm-color-typo-disabled": n.disabled })
|
|
934
934
|
}, null, 8, ["label", "modelValue", "class"])
|
|
935
935
|
])
|
|
936
936
|
]),
|
|
937
937
|
e("div", yo, [
|
|
938
938
|
e("div", vo, [
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
disabled:
|
|
939
|
+
l[8] || (l[8] = e("div", { class: "flex-1 fm-typo-en-title-sm-600" }, "Locations", -1)),
|
|
940
|
+
c(G, {
|
|
941
|
+
disabled: n.disabled,
|
|
942
942
|
label: "Select location",
|
|
943
943
|
"prepend-icon": "add",
|
|
944
944
|
variant: "plain",
|
|
@@ -946,7 +946,7 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
946
946
|
onClick: t(w)
|
|
947
947
|
}, null, 8, ["disabled", "onClick"])
|
|
948
948
|
]),
|
|
949
|
-
|
|
949
|
+
c(D, {
|
|
950
950
|
"column-defs": t(i),
|
|
951
951
|
"row-data": t(g),
|
|
952
952
|
"shrink-at": 9999,
|
|
@@ -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
|
-
|
|
957
|
+
c(A, {
|
|
958
958
|
"model-value": [
|
|
959
959
|
(J = a.modelValue.purchaseOrder.supplier) == null ? void 0 : J._id,
|
|
960
960
|
...a.modelValue.locations ?? []
|
|
@@ -965,27 +965,27 @@ 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", _o,
|
|
969
|
-
t(
|
|
968
|
+
e("div", _o, I(t(u)("inventory.transfer.form.items.title")), 1),
|
|
969
|
+
t(m).isEnabled ? (S(), ne(G, {
|
|
970
970
|
key: 0,
|
|
971
971
|
label: "Check NetSuite",
|
|
972
972
|
"prepend-icon": "troubleshoot",
|
|
973
973
|
variant: "secondary",
|
|
974
|
-
onClick:
|
|
974
|
+
onClick: b,
|
|
975
975
|
size: "md"
|
|
976
976
|
})) : oe("", !0),
|
|
977
|
-
|
|
978
|
-
disabled:
|
|
977
|
+
c(G, {
|
|
978
|
+
disabled: n.disabled,
|
|
979
979
|
label: t(u)("inventory.transfer.form.items.addItem"),
|
|
980
980
|
"prepend-icon": "add",
|
|
981
981
|
variant: "plain",
|
|
982
982
|
class: "border-2 rounded-lg border-fm-color-primary",
|
|
983
|
-
onClick:
|
|
983
|
+
onClick: l[5] || (l[5] = (C) => Z()),
|
|
984
984
|
size: "md"
|
|
985
985
|
}, null, 8, ["disabled", "label"])
|
|
986
986
|
]),
|
|
987
|
-
t(
|
|
988
|
-
|
|
987
|
+
t(m).isEnabled ? (S(), L("div", xo, l[9] || (l[9] = [
|
|
988
|
+
le(" 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. '),
|
|
991
991
|
e("li", null, ' You can also choose to change the code by selecting from the "NetSuite" button in each row. ')
|
|
@@ -994,38 +994,38 @@ 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
|
-
|
|
998
|
-
|
|
999
|
-
|
|
997
|
+
le(' Set "' + I(t(u)("inventory.transfer.form.items.table.DefaultAmount")) + '" to "0" to mark the item as ', 1),
|
|
998
|
+
l[10] || (l[10] = e("b", null, "optional", -1)),
|
|
999
|
+
l[11] || (l[11] = le(" when creating an order request. "))
|
|
1000
1000
|
]),
|
|
1001
|
-
|
|
1001
|
+
l[12] || (l[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
|
-
(S(),
|
|
1003
|
+
(S(), ne(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((C) => C.sku._id).join("."),
|
|
1007
1007
|
"hide-footer": "",
|
|
1008
1008
|
"page-size": t(s).purchaseOrder.items.length
|
|
1009
1009
|
}, {
|
|
1010
|
-
"table-row": B((
|
|
1011
|
-
|
|
1012
|
-
row:
|
|
1013
|
-
errorMessage: _.value[
|
|
1014
|
-
"onUpdate:item":
|
|
1015
|
-
disabled:
|
|
1010
|
+
"table-row": B((C) => [
|
|
1011
|
+
c(po, {
|
|
1012
|
+
row: C,
|
|
1013
|
+
errorMessage: _.value[C.index],
|
|
1014
|
+
"onUpdate:item": l[6] || (l[6] = (j) => W.value.updateItem(j)),
|
|
1015
|
+
disabled: n.disabled
|
|
1016
1016
|
}, null, 8, ["row", "errorMessage", "disabled"])
|
|
1017
1017
|
]),
|
|
1018
|
-
"list-row": B((
|
|
1019
|
-
(S(),
|
|
1020
|
-
row:
|
|
1018
|
+
"list-row": B((C) => [
|
|
1019
|
+
(S(), ne(Xe, {
|
|
1020
|
+
row: C,
|
|
1021
1021
|
key: t(s).purchaseOrder.items.map((j) => j.sku._id).join(".")
|
|
1022
1022
|
}, {
|
|
1023
1023
|
default: B((j) => [
|
|
1024
|
-
|
|
1025
|
-
row:
|
|
1024
|
+
c(ro, {
|
|
1025
|
+
row: C,
|
|
1026
1026
|
"cell-by-col-id": j,
|
|
1027
|
-
"onUpdate:item":
|
|
1028
|
-
disabled:
|
|
1027
|
+
"onUpdate:item": l[7] || (l[7] = (ie) => W.value.updateItem(ie)),
|
|
1028
|
+
disabled: n.disabled
|
|
1029
1029
|
}, null, 8, ["row", "cell-by-col-id", "disabled"])
|
|
1030
1030
|
]),
|
|
1031
1031
|
_: 2
|
|
@@ -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
|
-
|
|
1036
|
+
c(A, {
|
|
1037
1037
|
"model-value": t(s).purchaseOrder.items.length,
|
|
1038
1038
|
rules: [t(we)(1)]
|
|
1039
1039
|
}, null, 8, ["model-value", "rules"])
|
|
@@ -1053,35 +1053,35 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1053
1053
|
confirmMessage: {}
|
|
1054
1054
|
},
|
|
1055
1055
|
emits: ["confirm"],
|
|
1056
|
-
setup(
|
|
1057
|
-
const
|
|
1056
|
+
setup(f, { emit: h }) {
|
|
1057
|
+
const y = f, a = h, r = H(!1);
|
|
1058
1058
|
function s() {
|
|
1059
1059
|
r.value = !1, a("confirm");
|
|
1060
1060
|
}
|
|
1061
1061
|
return (u, _) => {
|
|
1062
|
-
const
|
|
1062
|
+
const M = V("FmButton"), v = V("FmDialog");
|
|
1063
1063
|
return S(), L("div", null, [
|
|
1064
|
-
|
|
1065
|
-
label:
|
|
1066
|
-
loading:
|
|
1064
|
+
c(M, {
|
|
1065
|
+
label: y.label,
|
|
1066
|
+
loading: y.loading,
|
|
1067
1067
|
onClick: _[0] || (_[0] = (o) => r.value = !0)
|
|
1068
1068
|
}, null, 8, ["label", "loading"]),
|
|
1069
|
-
|
|
1069
|
+
c(v, {
|
|
1070
1070
|
modelValue: r.value,
|
|
1071
1071
|
"onUpdate:modelValue": _[2] || (_[2] = (o) => r.value = o),
|
|
1072
1072
|
overlay: !0
|
|
1073
1073
|
}, {
|
|
1074
1074
|
"dialog-header": B(() => [
|
|
1075
|
-
e("div", null,
|
|
1075
|
+
e("div", null, I(y.confirmTitle || "Confirm"), 1)
|
|
1076
1076
|
]),
|
|
1077
1077
|
"dialog-footer": B(() => [
|
|
1078
1078
|
e("div", Fo, [
|
|
1079
|
-
|
|
1079
|
+
c(M, {
|
|
1080
1080
|
label: "Cancel",
|
|
1081
1081
|
variant: "tertiary",
|
|
1082
1082
|
onClick: _[1] || (_[1] = (o) => r.value = !1)
|
|
1083
1083
|
}),
|
|
1084
|
-
|
|
1084
|
+
c(M, {
|
|
1085
1085
|
class: "ml-auto",
|
|
1086
1086
|
label: "Confirm",
|
|
1087
1087
|
variant: "primary",
|
|
@@ -1091,7 +1091,7 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1091
1091
|
]),
|
|
1092
1092
|
default: B(() => [
|
|
1093
1093
|
_e(u.$slots, "dialog-content", {}, () => [
|
|
1094
|
-
|
|
1094
|
+
le(I(y.confirmMessage || "Are you sure you want to proceed?"), 1)
|
|
1095
1095
|
])
|
|
1096
1096
|
]),
|
|
1097
1097
|
_: 3
|
|
@@ -1110,10 +1110,10 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1110
1110
|
disabledModifiers: {}
|
|
1111
1111
|
}),
|
|
1112
1112
|
emits: /* @__PURE__ */ Pe(["update:show", "submitted"], ["update:disabled"]),
|
|
1113
|
-
setup(
|
|
1113
|
+
setup(f, { expose: h, emit: y }) {
|
|
1114
1114
|
var w;
|
|
1115
|
-
const a =
|
|
1116
|
-
function
|
|
1115
|
+
const a = f, r = y, s = At(), u = yt(), { t: _ } = me(), M = Ke(a, "show");
|
|
1116
|
+
function v() {
|
|
1117
1117
|
return {
|
|
1118
1118
|
_id: "",
|
|
1119
1119
|
name: "",
|
|
@@ -1143,15 +1143,15 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1143
1143
|
}
|
|
1144
1144
|
};
|
|
1145
1145
|
}
|
|
1146
|
-
const o = H(a.modelValue ??
|
|
1146
|
+
const o = H(a.modelValue ?? v()), d = H(((w = a.modelValue) == null ? void 0 : w._id) ?? `${Math.random()}`);
|
|
1147
1147
|
Fe(
|
|
1148
1148
|
() => a.show,
|
|
1149
1149
|
(i) => {
|
|
1150
1150
|
var g;
|
|
1151
|
-
i && (o.value = a.modelValue ??
|
|
1151
|
+
i && (o.value = a.modelValue ?? v(), d.value = ((g = a.modelValue) == null ? void 0 : g._id) ?? `${Math.random()}`);
|
|
1152
1152
|
}
|
|
1153
1153
|
);
|
|
1154
|
-
const
|
|
1154
|
+
const m = nt(f, "disabled"), k = N(() => {
|
|
1155
1155
|
switch (a.mode) {
|
|
1156
1156
|
case de.READ:
|
|
1157
1157
|
return "";
|
|
@@ -1180,7 +1180,7 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1180
1180
|
var g, O;
|
|
1181
1181
|
const i = o.value;
|
|
1182
1182
|
if (i) {
|
|
1183
|
-
|
|
1183
|
+
m.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
1184
|
({ totalCost: $, ...x }) => x
|
|
1185
1185
|
));
|
|
1186
1186
|
try {
|
|
@@ -1196,7 +1196,7 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1196
1196
|
type: "error"
|
|
1197
1197
|
}), console.error("Error in creating transfer template", $);
|
|
1198
1198
|
} finally {
|
|
1199
|
-
|
|
1199
|
+
m.value = !1;
|
|
1200
1200
|
}
|
|
1201
1201
|
}
|
|
1202
1202
|
}
|
|
@@ -1204,7 +1204,7 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1204
1204
|
var g, O;
|
|
1205
1205
|
const i = o.value;
|
|
1206
1206
|
if (i) {
|
|
1207
|
-
|
|
1207
|
+
m.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
1208
|
({ totalCost: $, ...x }) => x
|
|
1209
1209
|
));
|
|
1210
1210
|
try {
|
|
@@ -1220,11 +1220,11 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1220
1220
|
type: "error"
|
|
1221
1221
|
}), console.error("Error in updating transfer template", $);
|
|
1222
1222
|
} finally {
|
|
1223
|
-
|
|
1223
|
+
m.value = !1;
|
|
1224
1224
|
}
|
|
1225
1225
|
}
|
|
1226
1226
|
}
|
|
1227
|
-
function
|
|
1227
|
+
function p() {
|
|
1228
1228
|
switch (a.mode) {
|
|
1229
1229
|
case de.CREATE:
|
|
1230
1230
|
return R();
|
|
@@ -1232,56 +1232,56 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1232
1232
|
return U();
|
|
1233
1233
|
}
|
|
1234
1234
|
}
|
|
1235
|
-
function
|
|
1235
|
+
function b() {
|
|
1236
1236
|
var i, g;
|
|
1237
1237
|
(g = (i = T.value) == null ? void 0 : i.validateInputs) == null || g.call(i);
|
|
1238
1238
|
}
|
|
1239
1239
|
return (i, g) => {
|
|
1240
1240
|
const O = V("FmButton"), $ = V("FmSideSheet");
|
|
1241
|
-
return S(),
|
|
1242
|
-
modelValue: t(
|
|
1243
|
-
"onUpdate:modelValue": g[3] || (g[3] = (x) => He(
|
|
1241
|
+
return S(), ne($, {
|
|
1242
|
+
modelValue: t(M),
|
|
1243
|
+
"onUpdate:modelValue": g[3] || (g[3] = (x) => He(M) ? M.value = x : null),
|
|
1244
1244
|
"dismiss-away": "",
|
|
1245
1245
|
"close-button": "",
|
|
1246
1246
|
"max-width": 1600
|
|
1247
1247
|
}, {
|
|
1248
1248
|
"side-sheet-header": B(() => [
|
|
1249
1249
|
e("div", Io, [
|
|
1250
|
-
e("div", Mo,
|
|
1250
|
+
e("div", Mo, I(k.value), 1)
|
|
1251
1251
|
])
|
|
1252
1252
|
]),
|
|
1253
1253
|
default: B(() => [
|
|
1254
|
-
(S(),
|
|
1254
|
+
(S(), ne(To, {
|
|
1255
1255
|
class: "w-full",
|
|
1256
1256
|
ref_key: "formRef",
|
|
1257
1257
|
ref: T,
|
|
1258
|
-
onValidationSuccess:
|
|
1258
|
+
onValidationSuccess: p,
|
|
1259
1259
|
"model-value": o.value,
|
|
1260
1260
|
"onUpdate:modelValue": g[0] || (g[0] = (x) => o.value = x),
|
|
1261
|
-
disabled:
|
|
1262
|
-
"onUpdate:disabled": g[1] || (g[1] = (x) =>
|
|
1263
|
-
key:
|
|
1261
|
+
disabled: m.value,
|
|
1262
|
+
"onUpdate:disabled": g[1] || (g[1] = (x) => m.value = x),
|
|
1263
|
+
key: d.value
|
|
1264
1264
|
}, null, 8, ["model-value", "disabled"]))
|
|
1265
1265
|
]),
|
|
1266
1266
|
"side-sheet-footer": B(() => [
|
|
1267
1267
|
e("div", $o, [
|
|
1268
|
-
|
|
1269
|
-
loading:
|
|
1268
|
+
c(Co, {
|
|
1269
|
+
loading: m.value,
|
|
1270
1270
|
label: t(_)("common.save"),
|
|
1271
1271
|
"confirm-title": `Save ${a.mode === t(de).CREATE ? "Template" : "Changes"}`,
|
|
1272
|
-
onConfirm:
|
|
1272
|
+
onConfirm: b
|
|
1273
1273
|
}, {
|
|
1274
1274
|
"dialog-content": B(() => 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
|
+
le(" Warning: This action "),
|
|
1277
1277
|
e("span", { class: "text-fm-color-system-error-300" }, "will not"),
|
|
1278
|
-
|
|
1278
|
+
le(" create or update any order request, but only a template. ")
|
|
1279
1279
|
], -1)
|
|
1280
1280
|
])),
|
|
1281
1281
|
_: 1
|
|
1282
1282
|
}, 8, ["loading", "label", "confirm-title"]),
|
|
1283
|
-
|
|
1284
|
-
disabled:
|
|
1283
|
+
c(O, {
|
|
1284
|
+
disabled: m.value,
|
|
1285
1285
|
variant: "tertiary",
|
|
1286
1286
|
label: t(_)("common.close"),
|
|
1287
1287
|
onClick: g[2] || (g[2] = (x) => r("update:show", !1))
|
|
@@ -1304,7 +1304,7 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1304
1304
|
}, Wo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Go = { class: "fm-typo-en-body-lg-600" }, Ko = {
|
|
1305
1305
|
key: 3,
|
|
1306
1306
|
class: "flex flex-col gap-4"
|
|
1307
|
-
}, Zo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Jo = { class: "fm-typo-en-body-lg-600" }, Xo = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, es = { class: "flex flex-col gap-8" }, ts = { class: "fm-typo-en-body-lg-600" }, os = { class: "flex w-full gap-4" }, ss = { class: "grow fm-typo-en-body-lg-400 line-clamp-2" },
|
|
1307
|
+
}, Zo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Jo = { class: "fm-typo-en-body-lg-600" }, Xo = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, es = { class: "flex flex-col gap-8" }, ts = { class: "fm-typo-en-body-lg-600" }, os = { class: "flex w-full gap-4" }, ss = { class: "grow fm-typo-en-body-lg-400 line-clamp-2" }, ns = { class: "fm-typo-en-body-lg-600 shrink-0" }, ls = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, as = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, rs = {
|
|
1308
1308
|
key: 0,
|
|
1309
1309
|
class: "shrink-0 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
1310
1310
|
}, is = {
|
|
@@ -1317,26 +1317,26 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1317
1317
|
show: { type: Boolean }
|
|
1318
1318
|
},
|
|
1319
1319
|
emits: ["update:show", "action:edit"],
|
|
1320
|
-
setup(
|
|
1321
|
-
const
|
|
1322
|
-
var
|
|
1323
|
-
return (
|
|
1320
|
+
setup(f, { emit: h }) {
|
|
1321
|
+
const y = f, a = h, r = ge(), { t: s } = me(), u = N(() => {
|
|
1322
|
+
var m;
|
|
1323
|
+
return (m = y.template) == null ? void 0 : m.purchaseOrder;
|
|
1324
1324
|
}), _ = [
|
|
1325
1325
|
{ accessorKey: "name", header: () => "Name" },
|
|
1326
1326
|
{ accessorKey: "type", header: () => "Type" }
|
|
1327
|
-
],
|
|
1327
|
+
], M = H(""), v = N(
|
|
1328
1328
|
() => {
|
|
1329
|
-
var
|
|
1330
|
-
return ((k = (
|
|
1329
|
+
var m, k, T, R;
|
|
1330
|
+
return ((k = (m = u.value) == null ? void 0 : m.supplier) == null ? void 0 : k.internal) === "restaurant" || ((R = (T = u.value) == null ? void 0 : T.supplier) == null ? void 0 : R.internal) === "warehouse" ? X.enum.transfer : X.enum.purchase;
|
|
1331
1331
|
}
|
|
1332
|
-
), o = H(!0),
|
|
1333
|
-
return (
|
|
1332
|
+
), o = H(!0), d = Ke(y, "show");
|
|
1333
|
+
return (m, k) => {
|
|
1334
1334
|
var g;
|
|
1335
|
-
const T = V("FmMenuDivider"), R = V("FmCard"), U = V("FmIcon"),
|
|
1336
|
-
return S(),
|
|
1337
|
-
header: t(s)("inventory.transfer.template.details.view", { template: (g =
|
|
1338
|
-
modelValue: t(
|
|
1339
|
-
"onUpdate:modelValue": k[2] || (k[2] = (O) => He(
|
|
1335
|
+
const T = V("FmMenuDivider"), R = V("FmCard"), U = V("FmIcon"), p = V("FmTextField"), b = V("FmTable"), w = V("FmButton"), i = V("FmSideSheet");
|
|
1336
|
+
return S(), ne(i, {
|
|
1337
|
+
header: t(s)("inventory.transfer.template.details.view", { template: (g = m.template) == null ? void 0 : g.name }),
|
|
1338
|
+
modelValue: t(d),
|
|
1339
|
+
"onUpdate:modelValue": k[2] || (k[2] = (O) => He(d) ? d.value = O : null),
|
|
1340
1340
|
"dismiss-away": o.value,
|
|
1341
1341
|
"close-button": "",
|
|
1342
1342
|
"max-width": 1200
|
|
@@ -1346,49 +1346,49 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1346
1346
|
return [
|
|
1347
1347
|
e("div", Oo, [
|
|
1348
1348
|
e("div", null, [
|
|
1349
|
-
|
|
1349
|
+
c(R, {
|
|
1350
1350
|
variant: "outlined",
|
|
1351
1351
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
1352
1352
|
}, {
|
|
1353
1353
|
default: B(() => {
|
|
1354
|
-
var x, W, te, E, q, Z,
|
|
1354
|
+
var x, W, te, E, q, Z, n, l, F;
|
|
1355
1355
|
return [
|
|
1356
1356
|
e("div", Do, [
|
|
1357
|
-
e("div", Vo,
|
|
1358
|
-
e("div", Ao,
|
|
1359
|
-
`inventory.transfer.receiveRequest.details.type.${
|
|
1357
|
+
e("div", Vo, I(t(s)("inventory.transfer.template.details.templateSummary")), 1),
|
|
1358
|
+
e("div", Ao, I(t(s)(
|
|
1359
|
+
`inventory.transfer.receiveRequest.details.type.${v.value.toLocaleLowerCase("en-US")}`
|
|
1360
1360
|
)), 1)
|
|
1361
1361
|
]),
|
|
1362
|
-
|
|
1362
|
+
c(T),
|
|
1363
1363
|
e("div", Ro, [
|
|
1364
1364
|
e("div", Bo, [
|
|
1365
1365
|
e("div", Uo, [
|
|
1366
|
-
e("div", qo,
|
|
1366
|
+
e("div", qo, I(t(s)("inventory.transfer.receiveRequest.details.createdAt")), 1)
|
|
1367
1367
|
]),
|
|
1368
|
-
e("div", Po,
|
|
1368
|
+
e("div", Po, I(t(Rt)(((x = m.template) == null ? void 0 : x._id) ?? "")), 1)
|
|
1369
1369
|
]),
|
|
1370
|
-
(W =
|
|
1370
|
+
(W = m.template) != null && W.updatedAt ? (S(), L("div", Lo, [
|
|
1371
1371
|
e("div", No, [
|
|
1372
|
-
e("div", Eo,
|
|
1372
|
+
e("div", Eo, I(t(s)("inventory.transfer.receiveRequest.details.updatedAt")), 1)
|
|
1373
1373
|
]),
|
|
1374
1374
|
e("div", zo, [
|
|
1375
|
-
|
|
1376
|
-
(te =
|
|
1377
|
-
|
|
1375
|
+
le(I(t(Bt)(new Date(m.template.updatedAt))) + " ", 1),
|
|
1376
|
+
(te = m.template.updatedBy) != null && te.name ? (S(), L(pe, { key: 0 }, [
|
|
1377
|
+
le(" (" + I(m.template.updatedBy.name) + ") ", 1)
|
|
1378
1378
|
], 64)) : oe("", !0)
|
|
1379
1379
|
])
|
|
1380
1380
|
])) : oe("", !0),
|
|
1381
1381
|
(q = (E = u.value) == null ? void 0 : E.supplier) != null && q.name ? (S(), L("div", jo, [
|
|
1382
|
-
e("div", Qo,
|
|
1383
|
-
e("div", Yo,
|
|
1382
|
+
e("div", Qo, I(t(s)("inventory.transfer.receiveRequest.details.from")), 1),
|
|
1383
|
+
e("div", Yo, I((n = (Z = u.value) == null ? void 0 : Z.supplier) == null ? void 0 : n.name), 1)
|
|
1384
1384
|
])) : oe("", !0),
|
|
1385
|
-
(
|
|
1386
|
-
e("div", Wo,
|
|
1387
|
-
e("div", Go,
|
|
1385
|
+
(l = u.value) != null && l.ref ? (S(), L("div", Ho, [
|
|
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
1389
|
(F = u.value) != null && F.remark ? (S(), L("div", Ko, [
|
|
1390
|
-
e("div", Zo,
|
|
1391
|
-
e("div", Jo,
|
|
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,
|
|
1401
|
+
e("div", ts, I(t(s)("inventory.transfer.receiveRequest.details.requestedItems")), 1),
|
|
1402
1402
|
(S(!0), L(pe, null, Qe(((O = u.value) == null ? void 0 : O.items) ?? [], (x) => (S(), L("div", {
|
|
1403
1403
|
key: x.code,
|
|
1404
1404
|
class: "flex flex-col"
|
|
1405
1405
|
}, [
|
|
1406
1406
|
e("div", os, [
|
|
1407
|
-
e("div", ss,
|
|
1407
|
+
e("div", ss, I(x.name), 1),
|
|
1408
1408
|
k[3] || (k[3] = e("div", { class: "flex-1 min-w-32" }, null, -1)),
|
|
1409
|
-
e("div",
|
|
1409
|
+
e("div", ns, I(t(dt)(x.quantity, x.sku.unit, x.measurement)), 1)
|
|
1410
1410
|
]),
|
|
1411
|
-
e("div",
|
|
1412
|
-
e("div", as,
|
|
1413
|
-
x.totalCost && t(r).enableTotalCost ? (S(), L("div", rs, " (" +
|
|
1411
|
+
e("div", ls, [
|
|
1412
|
+
e("div", as, I(x.code), 1),
|
|
1413
|
+
x.totalCost && t(r).enableTotalCost ? (S(), L("div", rs, " (" + I(t(wt)(x.totalCost)) + ") ", 1)) : oe("", !0)
|
|
1414
1414
|
]),
|
|
1415
1415
|
t(mt)(x) ? (S(), L("div", is, [
|
|
1416
|
-
|
|
1416
|
+
c(U, {
|
|
1417
1417
|
name: "error",
|
|
1418
1418
|
color: "system-error-300",
|
|
1419
1419
|
size: "sm"
|
|
@@ -1431,18 +1431,18 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1431
1431
|
e("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " This template is only usable for the following locations. ")
|
|
1432
1432
|
], -1)),
|
|
1433
1433
|
e("div", ds, [
|
|
1434
|
-
|
|
1435
|
-
modelValue:
|
|
1436
|
-
"onUpdate:modelValue": k[0] || (k[0] = (x) =>
|
|
1434
|
+
c(p, {
|
|
1435
|
+
modelValue: M.value,
|
|
1436
|
+
"onUpdate:modelValue": k[0] || (k[0] = (x) => M.value = x),
|
|
1437
1437
|
placeholder: "Filter locations",
|
|
1438
1438
|
"prepend-icon": "search"
|
|
1439
1439
|
}, null, 8, ["modelValue"]),
|
|
1440
|
-
|
|
1440
|
+
c(b, {
|
|
1441
1441
|
"hide-footer": "",
|
|
1442
1442
|
style: { height: "500px" },
|
|
1443
1443
|
"column-defs": _,
|
|
1444
|
-
"search-value":
|
|
1445
|
-
"row-data": (($ =
|
|
1444
|
+
"search-value": M.value,
|
|
1445
|
+
"row-data": (($ = y.template) == null ? void 0 : $.locations) ?? [{ name: "All locations" }]
|
|
1446
1446
|
}, null, 8, ["search-value", "row-data"])
|
|
1447
1447
|
])
|
|
1448
1448
|
])
|
|
@@ -1451,7 +1451,7 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1451
1451
|
}),
|
|
1452
1452
|
"side-sheet-footer": B(() => [
|
|
1453
1453
|
e("div", ms, [
|
|
1454
|
-
|
|
1454
|
+
c(w, {
|
|
1455
1455
|
label: t(s)("common.edit"),
|
|
1456
1456
|
onClick: k[1] || (k[1] = (O) => a("action:edit")),
|
|
1457
1457
|
variant: "tertiary"
|
|
@@ -1464,18 +1464,18 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1464
1464
|
}
|
|
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
|
-
setup(
|
|
1468
|
-
const { t: h } = me(), { createTemplate:
|
|
1469
|
-
Te(
|
|
1467
|
+
setup(f) {
|
|
1468
|
+
const { t: h } = me(), { createTemplate: y, viewTemplate: a, importTemplates: r, exportTemplates: s } = Le(), { templateDialogProps: u, templateDetailsProps: _ } = ze(Le()), M = pt(), { loading: v, templates: o } = ze(M), d = H(!1), m = it(), k = Ge(), { breakpoints: T } = vt();
|
|
1469
|
+
Te(M.fetchTemplates);
|
|
1470
1470
|
const R = N(
|
|
1471
|
-
() =>
|
|
1472
|
-
), U = N(() => o.value),
|
|
1471
|
+
() => d.value || v.value || !k._currentLocation
|
|
1472
|
+
), U = N(() => o.value), p = H(""), b = N(() => T.value.xs || T.value.sm), w = N(() => b.value ? 10 : 20);
|
|
1473
1473
|
function i($) {
|
|
1474
1474
|
switch ($) {
|
|
1475
1475
|
case Ne.Add:
|
|
1476
|
-
return
|
|
1476
|
+
return y();
|
|
1477
1477
|
case "refresh":
|
|
1478
|
-
return
|
|
1478
|
+
return M.fetchTemplates();
|
|
1479
1479
|
case "import":
|
|
1480
1480
|
return r();
|
|
1481
1481
|
case "export":
|
|
@@ -1511,7 +1511,7 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1511
1511
|
return ($, x) => {
|
|
1512
1512
|
const W = V("FmTable");
|
|
1513
1513
|
return S(), L(pe, null, [
|
|
1514
|
-
|
|
1514
|
+
c(ut, {
|
|
1515
1515
|
title: t(h)("inventory.transfer.template.title2"),
|
|
1516
1516
|
actions: O.value,
|
|
1517
1517
|
"onClick:action": i
|
|
@@ -1523,65 +1523,65 @@ const Wt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-cen
|
|
|
1523
1523
|
class: re([
|
|
1524
1524
|
"flex flex-col gap-8 max-h-full",
|
|
1525
1525
|
{
|
|
1526
|
-
"p-0":
|
|
1527
|
-
"px-24 ": !
|
|
1526
|
+
"p-0": b.value,
|
|
1527
|
+
"px-24 ": !b.value
|
|
1528
1528
|
}
|
|
1529
1529
|
])
|
|
1530
1530
|
}, [
|
|
1531
|
-
|
|
1531
|
+
c(ft, {
|
|
1532
1532
|
searchable: "",
|
|
1533
|
-
search:
|
|
1534
|
-
"onUpdate:search": x[0] || (x[0] = (E) =>
|
|
1533
|
+
search: p.value,
|
|
1534
|
+
"onUpdate:search": x[0] || (x[0] = (E) => p.value = E)
|
|
1535
1535
|
}, null, 8, ["search"]),
|
|
1536
|
-
(S(),
|
|
1537
|
-
style: xe(t(
|
|
1538
|
-
"column-defs": t(
|
|
1536
|
+
(S(), ne(W, {
|
|
1537
|
+
style: xe(t(m).tableHeight),
|
|
1538
|
+
"column-defs": t(M).columnDefs,
|
|
1539
1539
|
"row-data": U.value,
|
|
1540
|
-
"search-value":
|
|
1540
|
+
"search-value": p.value,
|
|
1541
1541
|
loading: R.value,
|
|
1542
1542
|
key: (te = t(k)._currentLocation) == null ? void 0 : te.dbName,
|
|
1543
1543
|
onRowClick: x[1] || (x[1] = (E) => t(a)(E.original)),
|
|
1544
1544
|
"page-size": w.value
|
|
1545
1545
|
}, {
|
|
1546
1546
|
"list-row": B((E) => [
|
|
1547
|
-
|
|
1547
|
+
c(Xe, {
|
|
1548
1548
|
row: E,
|
|
1549
1549
|
onRowClick: (q) => t(a)(q)
|
|
1550
1550
|
}, {
|
|
1551
1551
|
default: B((q) => {
|
|
1552
|
-
var Z,
|
|
1552
|
+
var Z, n, l, F, P, z, G, D, A, K, J, C, j, ie, Ce, Ie, Me, $e, Se, Oe, ce, De, Ve, Ae, Re, fe, Be;
|
|
1553
1553
|
return [
|
|
1554
1554
|
e("div", cs, [
|
|
1555
1555
|
e("div", fs, [
|
|
1556
1556
|
e("div", ys, [
|
|
1557
|
-
|
|
1558
|
-
render: (
|
|
1557
|
+
c(t(ee), {
|
|
1558
|
+
render: (l = (n = (Z = q._id) == null ? void 0 : Z.column) == null ? void 0 : n.columnDef) == null ? void 0 : l.cell,
|
|
1559
1559
|
props: (P = (F = q._id) == null ? void 0 : F.getContext) == null ? void 0 : P.call(F)
|
|
1560
1560
|
}, null, 8, ["render", "props"])
|
|
1561
1561
|
]),
|
|
1562
1562
|
e("div", vs, [
|
|
1563
|
-
|
|
1563
|
+
c(t(ee), {
|
|
1564
1564
|
render: (D = (G = (z = q.name) == null ? void 0 : z.column) == null ? void 0 : G.columnDef) == null ? void 0 : D.cell,
|
|
1565
1565
|
props: (K = (A = q.name) == null ? void 0 : A.getContext) == null ? void 0 : K.call(A)
|
|
1566
1566
|
}, null, 8, ["render", "props"])
|
|
1567
1567
|
]),
|
|
1568
1568
|
e("div", bs, [
|
|
1569
|
-
|
|
1570
|
-
render: (j = (
|
|
1569
|
+
c(t(ee), {
|
|
1570
|
+
render: (j = (C = (J = q.supplier) == null ? void 0 : J.column) == null ? void 0 : C.columnDef) == null ? void 0 : j.cell,
|
|
1571
1571
|
props: (Ce = (ie = q.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((Ie = E.original.locations) != null && Ie.length ? `Enabled for ${(Me = E.original.locations) == null ? void 0 : Me.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
|
+
c(t(ee), {
|
|
1578
1578
|
render: (Oe = (Se = ($e = q.ref) == null ? void 0 : $e.column) == null ? void 0 : Se.columnDef) == null ? void 0 : Oe.cell,
|
|
1579
1579
|
props: (De = (ce = q.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
|
+
c(t(ee), {
|
|
1585
1585
|
render: (Re = (Ae = (Ve = q.type) == null ? void 0 : Ve.column) == null ? void 0 : Ae.columnDef) == null ? void 0 : Re.cell,
|
|
1586
1586
|
props: (Be = (fe = q.type) == null ? void 0 : fe.getContext) == null ? void 0 : Be.call(fe)
|
|
1587
1587
|
}, null, 8, ["render", "props"])
|
|
@@ -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
|
-
(S(),
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
onSubmitted: x[2] || (x[2] = (te) => t(
|
|
1602
|
+
(S(), ne(lt, { to: "body" }, [
|
|
1603
|
+
c(ps, at(rt(t(_))), null, 16),
|
|
1604
|
+
c(So, Ye(t(u), {
|
|
1605
|
+
onSubmitted: x[2] || (x[2] = (te) => t(M).fetchTemplates())
|
|
1606
1606
|
}), null, 16)
|
|
1607
1607
|
]))
|
|
1608
1608
|
], 64);
|