@feedmepos/mf-inventory-portal 0.0.23-dev.1 → 0.0.23-dev.10
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-Y3Ez8Rjf.js → App-DDxwfi6I.js} +36 -31
- package/dist/{ApprovalView-BUU1G4Q2.js → ApprovalView-7rpIigm0.js} +4 -4
- package/dist/{BindingsDialog-8wc4Q0JQ.js → BindingsDialog-DbyzX6mw.js} +2 -2
- package/dist/{BindingsPicker-DGWN1LQc.js → BindingsPicker-FZfhZr5O.js} +2 -2
- package/dist/{BindingsTable-7NJP2jT6.js → BindingsTable-Bk2770OV.js} +6 -6
- package/dist/ClosingDraftView-D9CnCwak.js +772 -0
- package/dist/{ClosingTemplateView-9s7vmwaT.js → ClosingTemplateView-DkpHmTtx.js} +32 -31
- package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DjBiov5r.js +283 -0
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-5DINn0ZB.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CBC214tP.js} +2 -2
- package/dist/{FmMultiselectDialog-7hok9sJP.js → FmMultiselectDialog-CK6xwOeG.js} +128 -124
- package/dist/FmUnitInput.vue_vue_type_script_setup_true_lang-IFTMUhET.js +329 -0
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-FQ0HjuL3.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-D0otwOX8.js} +1 -1
- package/dist/{IngredientGroupView-C3maHTCg.js → IngredientGroupView-D5XtVfIQ.js} +12 -11
- package/dist/IngredientsView-c7WnQiTv.js +1666 -0
- package/dist/{IntegrationView-gO4h89Wj.js → IntegrationView-CHkhMxVM.js} +50 -50
- package/dist/{InventoryBindingForm-dh3GeyG-.js → InventoryBindingForm-BUZ9MS5V.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CJuo3i7W.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-YIRre_Km.js} +13 -13
- package/dist/{InventoryBindingSummary-BPoPcEoe.js → InventoryBindingSummary-BUi0mjeC.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-olm8sZKt.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CpYtHPFH.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BezTV43V.js → PremiumBadge.vue_vue_type_script_setup_true_lang-D8IH1X1o.js} +2 -2
- package/dist/{PurchaseOrderPrintPreview-Dix_fIoo.js → PurchaseOrderPrintPreview-BLuoVz5N.js} +1 -1
- package/dist/ReceiveRequestView-BNM5JdQO.js +4165 -0
- package/dist/{RecipeView-C4-a4IEW.js → RecipeView-DxRumcLY.js} +11 -10
- package/dist/{StockView-Du2txrIP.js → StockView-CZyeg3sX.js} +1356 -1457
- package/dist/{SupplierView-D_09FbQh.js → SupplierView-C2XLbf27.js} +2352 -783
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-BQG6UzUU.js +1229 -0
- package/dist/{TransferTemplateView-j3CRy6Lc.js → TransferTemplateView-BCxZCU0i.js} +307 -307
- package/dist/{UnitView-BXw2Vwq1.js → UnitView-uGpE4txg.js} +81 -80
- package/dist/{WarehouseView-CKamiETC.js → WarehouseView-DvQVmixr.js} +25 -24
- package/dist/api/bill.d.ts +2 -2
- package/dist/api/closing-draft.d.ts +6 -0
- package/dist/api/closing.d.ts +1 -0
- package/dist/api/netsuite.d.ts +70 -0
- package/dist/{app-GUbzqEtW.js → app-BaOENyRY.js} +3425 -3343
- package/dist/app.d.ts +3 -0
- package/dist/app.js +1 -1
- package/dist/components/FmMinMaxInputRules.d.ts +4 -1
- package/dist/components/row-action.enum.d.ts +1 -0
- package/dist/{date2-CLE9fB2R.js → date2-CfGU3sHq.js} +1 -1
- package/dist/{dayjs.min-CY1d38w7.js → dayjs.min-BMk-E1IO.js} +17 -17
- package/dist/{decimal-SIjO6Mjw.js → decimal-BkLhxOFS.js} +1 -1
- package/dist/{defineDeepModel-l40rX7kr.js → defineDeepModel-Cy-_HBnw.js} +1 -1
- package/dist/{feature-BXruKUhX.js → feature-GoxrdjJJ.js} +23 -9
- package/dist/form-mode.enum-BKiNVH6A.js +4 -0
- package/dist/{format-time-from-id-CcFsBXmk.js → format-time-from-id-96hwVl9P.js} +1 -1
- package/dist/format-unit-display-Cp0DBbM8.js +1217 -0
- package/dist/{fuzzy-CVOV9zJc.js → fuzzy-CBGiL1wK.js} +1 -1
- package/dist/index-0HEhOwKT.js +12087 -0
- package/dist/{index-BX5KZXhI.js → index-CoL8wxbn.js} +126 -122
- package/dist/{index-m9e9nYfl.js → index-S7yfliEo.js} +1 -1
- package/dist/netsuite-D3VPLW8O.js +225 -0
- package/dist/router/name.d.ts +1 -0
- package/dist/{row-action.enum-PMKMRrZR.js → row-action.enum-7rGLGZ5v.js} +10 -5
- package/dist/{rules-DlnN8IP3.js → rules-DxLLla7a.js} +40 -35
- package/dist/stock-BbFKtx1y.js +111 -0
- package/dist/stores/feature.d.ts +2 -0
- package/dist/stores/integration/netsuite.d.ts +81 -0
- package/dist/stores/inventory.d.ts +1 -4
- package/dist/style.css +1 -1
- package/dist/{supplier-B21WlSAM.js → supplier-gGovyyjr.js} +22 -22
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-inventory-binding-dialog-D3x6xj2O.js → use-inventory-binding-dialog-DIBMf_9-.js} +2 -2
- package/dist/{use-template-enabled-locations-2-z-b-UXef.js → use-template-enabled-locations-2-Bof9JMYI.js} +2 -2
- package/dist/views/closing-draft/ClosingDraftView.vue.d.ts +2 -0
- package/dist/views/closing-draft/components/closing-draft-action/ClosingDraftAction.vue.d.ts +22 -0
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +447 -0
- package/dist/views/closing-draft/composables/use-closing-draft-actions.d.ts +22 -0
- package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +2601 -0
- package/dist/views/closing-draft/helpers/draft-status-to-class-name.helper.d.ts +1 -0
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +24 -192
- package/dist/views/closing-template/composables/use-closing-template-table.d.ts +24 -192
- package/dist/views/receive-request/components/transfer-form/NetSuiteField.vue.d.ts +2 -2
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +40 -40
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +1 -0
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +63 -63
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +63 -63
- package/dist/views/receive-request/helper/check-netsuite-subsidiary.helper.d.ts +1 -0
- package/dist/views/stock/components/StockRecordCard.vue.d.ts +1 -1
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +8 -8
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +96 -96
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +96 -96
- package/dist/{xlsx-6mM1eNiL.js → xlsx-DOnDmayp.js} +1 -1
- package/dist/{xlsx.util-BLftcF4q.js → xlsx.util-BqsQd9YP.js} +1 -1
- package/package.json +3 -3
- package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-B4DDh9-a.js +0 -267
- package/dist/FmUnitInput.vue_vue_type_script_setup_true_lang-CxR1FCft.js +0 -326
- package/dist/IngredientsView-DCR3IBkR.js +0 -1613
- package/dist/ReceiveRequestView-DdPiYb2P.js +0 -4082
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-C9MOos--.js +0 -1144
- package/dist/format-unit-display-DEKg8cJm.js +0 -1198
- package/dist/index-CVsyOEb1.js +0 -10545
- package/dist/netsuite-DAKRv7zr.js +0 -146
- package/dist/normalizeArguments-DP7Hrren.js +0 -1552
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { defineComponent as Z, onMounted as pe, computed as
|
|
2
|
-
import { u as ot, _ as st, a as lt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { defineComponent as Z, onMounted as pe, computed as R, ref as B, watch as ce, inject as We, resolveComponent as O, openBlock as A, createElementBlock as Q, createElementVNode as t, createVNode as c, withCtx as E, renderSlot as Ie, withDirectives as Ve, normalizeClass as ie, vModelText as Ae, reactive as Ze, h as W, toDisplayString as C, unref as e, createBlock as K, mergeProps as Ue, isRef as Ee, createCommentVNode as Y, Fragment as qe, renderList as Je, normalizeStyle as Xe, Teleport as Ye, normalizeProps as et, guardReactiveProps as tt } from "vue";
|
|
2
|
+
import { u as ot, _ as st, a as lt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CBC214tP.js";
|
|
3
3
|
import { useI18n as J } from "@feedmepos/mf-common";
|
|
4
|
-
import { P as N, a as nt, f as rt, t as at, b as
|
|
5
|
-
import {
|
|
6
|
-
import { a as Ne, u as ze,
|
|
4
|
+
import { P as N, a as nt, f as rt, t as at, b as Re, u as it } from "./format-unit-display-Cp0DBbM8.js";
|
|
5
|
+
import { R as De } from "./row-action.enum-7rGLGZ5v.js";
|
|
6
|
+
import { a as Ne, u as ze, A as ne } from "./app-BaOENyRY.js";
|
|
7
7
|
import { components as re, useDialog as ut, useSnackbar as mt, useProxiedModel as je, useBreakpoints as dt } from "@feedmepos/ui-library";
|
|
8
8
|
import { storeToRefs as Pe } from "pinia";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
9
|
+
import { F as ee } from "./form-mode.enum-BKiNVH6A.js";
|
|
10
|
+
import { u as ue, t as Le, I as pt, n as ct, o as ft, a as G, p as yt, R as me, g as ae, c as vt, A as de, M as bt, b as xt, j as _t } from "./rules-DxLLla7a.js";
|
|
11
|
+
import { d as He } from "./defineDeepModel-Cy-_HBnw.js";
|
|
12
|
+
import { _ as ht, b as gt, F as Ft, a as Tt } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-IFTMUhET.js";
|
|
13
|
+
import { u as Qe } from "./feature-GoxrdjJJ.js";
|
|
14
|
+
import { c as wt, u as kt, _ as Mt } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DjBiov5r.js";
|
|
15
|
+
import { F as Be } from "./index-CoL8wxbn.js";
|
|
16
|
+
import { u as St } from "./supplier-gGovyyjr.js";
|
|
17
|
+
import { F as $t } from "./FmMultiselectDialog-CK6xwOeG.js";
|
|
17
18
|
import { F as j, _ as Ge } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
18
|
-
import { u as Ct } from "./use-template-enabled-locations-2-
|
|
19
|
-
import { f as Ot } from "./format-time-from-id-
|
|
20
|
-
const It = { class: "flex flex-col" }, Vt = { class: "flex flex-col" },
|
|
19
|
+
import { u as Ct } from "./use-template-enabled-locations-2-Bof9JMYI.js";
|
|
20
|
+
import { f as Ot } from "./format-time-from-id-96hwVl9P.js";
|
|
21
|
+
const It = { class: "flex flex-col" }, Vt = { class: "flex flex-col" }, At = { class: "flex-1" }, Rt = { class: "flex items-center" }, Dt = { class: "flex-1" }, Pt = { class: "flex-1" }, Lt = /* @__PURE__ */ Z({
|
|
21
22
|
__name: "FmMinMaxInput",
|
|
22
23
|
props: {
|
|
23
24
|
rules: {},
|
|
@@ -54,64 +55,64 @@ const It = { class: "flex flex-col" }, Vt = { class: "flex flex-col" }, Rt = { c
|
|
|
54
55
|
helperText: {},
|
|
55
56
|
helperState: {}
|
|
56
57
|
},
|
|
57
|
-
setup(
|
|
58
|
-
const _ =
|
|
58
|
+
setup(v) {
|
|
59
|
+
const _ = v, m = He("modelValue"), o = pt();
|
|
59
60
|
pe(() => {
|
|
60
|
-
const { min:
|
|
61
|
-
if (!(!
|
|
62
|
-
const h = Math.max(
|
|
63
|
-
|
|
61
|
+
const { min: b, max: a } = m ?? {};
|
|
62
|
+
if (!(!b || !a) && b.precision !== a.precision) {
|
|
63
|
+
const h = Math.max(b.precision, a.precision), r = ue(b, h), y = ue(a, h);
|
|
64
|
+
m.min = r, m.max = y;
|
|
64
65
|
}
|
|
65
66
|
});
|
|
66
|
-
const p =
|
|
67
|
-
const { min:
|
|
68
|
-
return Math.max((
|
|
69
|
-
}),
|
|
70
|
-
if (!
|
|
71
|
-
const a = ct(
|
|
67
|
+
const p = R(() => {
|
|
68
|
+
const { min: b, max: a } = m ?? {};
|
|
69
|
+
return Math.max((b == null ? void 0 : b.precision) ?? 0, (a == null ? void 0 : a.precision) ?? 0, _.precision ?? 0);
|
|
70
|
+
}), d = (b) => {
|
|
71
|
+
if (!b) return "";
|
|
72
|
+
const a = ct(b), h = p.value, r = ue(a, h);
|
|
72
73
|
return ft(
|
|
73
74
|
+G(r),
|
|
74
75
|
r.precision
|
|
75
76
|
);
|
|
76
|
-
},
|
|
77
|
-
ce([
|
|
78
|
-
const h =
|
|
79
|
-
if (
|
|
80
|
-
const n = Le(+
|
|
77
|
+
}, s = B(d(m.min)), u = B(d(m.max));
|
|
78
|
+
ce([s, u], ([b, a]) => {
|
|
79
|
+
const h = m ?? {}, r = o(b), y = o(a), l = p.value;
|
|
80
|
+
if (b !== "" && r === !0) {
|
|
81
|
+
const n = Le(+b, l);
|
|
81
82
|
h.min = n;
|
|
82
83
|
} else
|
|
83
84
|
h.min = null;
|
|
84
85
|
if (a !== "" && y === !0) {
|
|
85
|
-
const n = Le(+a,
|
|
86
|
+
const n = Le(+a, l);
|
|
86
87
|
h.max = n;
|
|
87
88
|
} else
|
|
88
89
|
h.max = null;
|
|
89
|
-
|
|
90
|
+
m.min = h.min, m.max = h.max;
|
|
90
91
|
});
|
|
91
|
-
const x = Symbol.for("fm:form-state"), T = We(x, null), S =
|
|
92
|
+
const x = Symbol.for("fm:form-state"), T = We(x, null), S = R(() => _.disabled ?? (T == null ? void 0 : T.getDisabled()) ?? !1), I = B(), g = B(), f = B(!1), w = B(!1), L = R(() => f.value || w.value), q = R(() => [...[
|
|
92
93
|
function() {
|
|
93
|
-
return typeof
|
|
94
|
+
return typeof o(s.value) == "string" || typeof o(u.value) == "string" ? "Must be a number" : !0;
|
|
94
95
|
},
|
|
95
96
|
function(h) {
|
|
96
97
|
return !h || !h.min || !h.max ? !0 : +G(h.min) > +G(h.max) ? "Min must be less than or equal to max" : !0;
|
|
97
98
|
}
|
|
98
99
|
], ..._.rules ?? []]);
|
|
99
|
-
return (
|
|
100
|
+
return (b, a) => {
|
|
100
101
|
const h = O("FmLabel"), r = O("FmField"), y = O("FmFormGroup");
|
|
101
|
-
return
|
|
102
|
+
return A(), Q("div", It, [
|
|
102
103
|
t("div", Vt, [
|
|
103
|
-
t("div",
|
|
104
|
+
t("div", At, [
|
|
104
105
|
c(h, {
|
|
105
|
-
label:
|
|
106
|
-
disabled:
|
|
107
|
-
required:
|
|
108
|
-
optional:
|
|
106
|
+
label: b.label,
|
|
107
|
+
disabled: b.disabled,
|
|
108
|
+
required: b.labelMark === "required",
|
|
109
|
+
optional: b.labelMark === "optional"
|
|
109
110
|
}, null, 8, ["label", "disabled", "required", "optional"])
|
|
110
111
|
]),
|
|
111
112
|
c(r, { focused: L.value }, {
|
|
112
113
|
default: E(() => [
|
|
113
|
-
t("div",
|
|
114
|
-
Ie(
|
|
114
|
+
t("div", Rt, [
|
|
115
|
+
Ie(b.$slots, "prepend"),
|
|
115
116
|
a[6] || (a[6] = t("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400 pr-4" }, "Min.", -1)),
|
|
116
117
|
t("div", Dt, [
|
|
117
118
|
Ve(t("input", {
|
|
@@ -120,14 +121,14 @@ const It = { class: "flex flex-col" }, Vt = { class: "flex flex-col" }, Rt = { c
|
|
|
120
121
|
ref: I,
|
|
121
122
|
onFocus: a[0] || (a[0] = () => f.value = !0),
|
|
122
123
|
onBlur: a[1] || (a[1] = () => f.value = !1),
|
|
123
|
-
"onUpdate:modelValue": a[2] || (a[2] = (
|
|
124
|
+
"onUpdate:modelValue": a[2] || (a[2] = (l) => s.value = l),
|
|
124
125
|
class: ie({
|
|
125
126
|
"fm-text-field--input fm-typo-en-body-lg-400": !0,
|
|
126
127
|
"text-fm-color-typo-primary": !S.value,
|
|
127
128
|
"text-fm-color-typo-disabled": S.value
|
|
128
129
|
})
|
|
129
130
|
}, null, 34), [
|
|
130
|
-
[
|
|
131
|
+
[Ae, s.value]
|
|
131
132
|
])
|
|
132
133
|
]),
|
|
133
134
|
a[7] || (a[7] = t("div", { class: "block h-32 mx-4 w-[1px] bg-fm-color-neutral-gray-200" }, null, -1)),
|
|
@@ -139,17 +140,17 @@ const It = { class: "flex flex-col" }, Vt = { class: "flex flex-col" }, Rt = { c
|
|
|
139
140
|
ref: g,
|
|
140
141
|
onFocus: a[3] || (a[3] = () => w.value = !0),
|
|
141
142
|
onBlur: a[4] || (a[4] = () => w.value = !1),
|
|
142
|
-
"onUpdate:modelValue": a[5] || (a[5] = (
|
|
143
|
+
"onUpdate:modelValue": a[5] || (a[5] = (l) => u.value = l),
|
|
143
144
|
class: ie({
|
|
144
145
|
"fm-text-field--input fm-typo-en-body-lg-400": !0,
|
|
145
146
|
"text-fm-color-typo-primary": !S.value,
|
|
146
147
|
"text-fm-color-typo-disabled": S.value
|
|
147
148
|
})
|
|
148
149
|
}, null, 34), [
|
|
149
|
-
[
|
|
150
|
+
[Ae, u.value]
|
|
150
151
|
])
|
|
151
152
|
]),
|
|
152
|
-
Ie(
|
|
153
|
+
Ie(b.$slots, "append")
|
|
153
154
|
])
|
|
154
155
|
]),
|
|
155
156
|
_: 3
|
|
@@ -157,64 +158,63 @@ const It = { class: "flex flex-col" }, Vt = { class: "flex flex-col" }, Rt = { c
|
|
|
157
158
|
]),
|
|
158
159
|
c(y, {
|
|
159
160
|
class: "flex-1",
|
|
160
|
-
"model-value":
|
|
161
|
-
info:
|
|
161
|
+
"model-value": b.modelValue,
|
|
162
|
+
info: b.labelInfo,
|
|
162
163
|
rules: q.value,
|
|
163
|
-
"helper-text":
|
|
164
|
-
"helper-state":
|
|
164
|
+
"helper-text": b.helperText,
|
|
165
|
+
"helper-state": b.helperState
|
|
165
166
|
}, null, 8, ["model-value", "info", "rules", "helper-text", "helper-state"])
|
|
166
167
|
]);
|
|
167
168
|
};
|
|
168
169
|
}
|
|
169
170
|
});
|
|
170
|
-
function Bt() {
|
|
171
|
-
return function(
|
|
172
|
-
return !
|
|
171
|
+
function Bt({ min: v, max: _ } = { min: !0, max: !0 }) {
|
|
172
|
+
return function(o) {
|
|
173
|
+
return !o || !o.min && v != !1 || !o.max && _ != !1 ? "Required" : !0;
|
|
173
174
|
};
|
|
174
175
|
}
|
|
175
|
-
function Ut(
|
|
176
|
-
return function(
|
|
177
|
-
return !
|
|
176
|
+
function Ut(v, _) {
|
|
177
|
+
return function(o) {
|
|
178
|
+
return !o || !o.min || !o.max ? !0 : +G(o.min) < v ? `Must be between ${v} and ${_}` : +G(o.max) > _ ? `Must be between ${v} and ${_}` : !0;
|
|
178
179
|
};
|
|
179
180
|
}
|
|
180
|
-
function Et(
|
|
181
|
-
const _ = yt(
|
|
181
|
+
function Et(v) {
|
|
182
|
+
const _ = yt(v), m = G(v);
|
|
182
183
|
return function(p) {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
return !m && !o ? `Min & max must be a multiple of ${d}` : m ? o ? !0 : `Max must be a multiple of ${d}` : `Min must be a multiple of ${d}`;
|
|
184
|
+
const d = !(p != null && p.min) || _(p.min) === !0, s = !(p != null && p.max) || _(p.max) === !0;
|
|
185
|
+
return !d && !s ? `Min & max must be a multiple of ${m}` : d ? s ? !0 : `Max must be a multiple of ${m}` : `Min must be a multiple of ${m}`;
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
|
-
var P = /* @__PURE__ */ ((
|
|
189
|
-
function qt(
|
|
190
|
-
const { t: _ } = J(),
|
|
188
|
+
var P = /* @__PURE__ */ ((v) => (v.Code = "Code", v.Name = "Name", v.DefaultAmount = "DefaultAmount", v.Limit = "Limit", v.MinimumAmount = "MinimumAmount", v.Step = "Step", v.Cost = "Cost", v.Delete = "Delete", v))(P || {});
|
|
189
|
+
function qt(v) {
|
|
190
|
+
const { t: _ } = J(), m = Ze({});
|
|
191
191
|
pe(() => {
|
|
192
|
-
for (const
|
|
193
|
-
if (!
|
|
192
|
+
for (const d of v.items) {
|
|
193
|
+
if (!d.totalCost)
|
|
194
194
|
continue;
|
|
195
|
-
const
|
|
196
|
-
supplier:
|
|
197
|
-
}), u =
|
|
198
|
-
|
|
195
|
+
const s = wt(d.sku, d.quantity, d.measurement, {
|
|
196
|
+
supplier: v.supplier
|
|
197
|
+
}), u = d.totalCost ?? Be.reset();
|
|
198
|
+
s ? m[d.sku._id] = s.amount !== u.amount || s.precision !== u.precision : m[d.sku._id] = !0;
|
|
199
199
|
}
|
|
200
200
|
});
|
|
201
|
-
const
|
|
201
|
+
const o = [
|
|
202
202
|
{
|
|
203
203
|
id: "Code",
|
|
204
204
|
header: () => _("inventory.transfer.form.items.table.Code"),
|
|
205
205
|
accessorKey: "code",
|
|
206
206
|
size: 96,
|
|
207
|
-
cell(
|
|
208
|
-
const
|
|
207
|
+
cell(d) {
|
|
208
|
+
const s = d.row.original;
|
|
209
209
|
return W(re.FmTextField, {
|
|
210
|
-
modelValue:
|
|
210
|
+
modelValue: s.code,
|
|
211
211
|
"onUpdate:modelValue": (u) => {
|
|
212
|
-
|
|
213
|
-
...
|
|
212
|
+
v.updateItem({
|
|
213
|
+
...s,
|
|
214
214
|
code: u
|
|
215
215
|
});
|
|
216
216
|
},
|
|
217
|
-
key:
|
|
217
|
+
key: s.sku._id,
|
|
218
218
|
rules: [me()],
|
|
219
219
|
labelMark: "required"
|
|
220
220
|
});
|
|
@@ -225,17 +225,17 @@ function qt(b) {
|
|
|
225
225
|
id: "Name",
|
|
226
226
|
header: () => _("inventory.transfer.form.items.table.Name"),
|
|
227
227
|
minSize: 300,
|
|
228
|
-
cell(
|
|
229
|
-
const
|
|
228
|
+
cell(d) {
|
|
229
|
+
const s = d.row.original;
|
|
230
230
|
return W(re.FmTextField, {
|
|
231
|
-
modelValue:
|
|
231
|
+
modelValue: s.name,
|
|
232
232
|
"onUpdate:modelValue": (u) => {
|
|
233
|
-
|
|
234
|
-
...
|
|
233
|
+
v.updateItem({
|
|
234
|
+
...s,
|
|
235
235
|
name: u
|
|
236
236
|
});
|
|
237
237
|
},
|
|
238
|
-
key:
|
|
238
|
+
key: s.sku._id,
|
|
239
239
|
rules: [me()],
|
|
240
240
|
labelMark: "required"
|
|
241
241
|
});
|
|
@@ -246,45 +246,45 @@ function qt(b) {
|
|
|
246
246
|
id: "DefaultAmount",
|
|
247
247
|
header: () => _("inventory.transfer.form.items.table.DefaultAmount"),
|
|
248
248
|
minSize: 200,
|
|
249
|
-
cell(
|
|
249
|
+
cell(d) {
|
|
250
250
|
var g;
|
|
251
|
-
const
|
|
251
|
+
const s = d.row.original, u = Ne(), x = u.skuById[s.sku._id], T = u.unitById[(g = x.unit) == null ? void 0 : g._id], S = T.measurements.find((f) => {
|
|
252
252
|
var w;
|
|
253
|
-
return ((w =
|
|
254
|
-
}), I =
|
|
253
|
+
return ((w = s.measurement) == null ? void 0 : w.id) === f.id;
|
|
254
|
+
}), I = s.sku.unit._id !== x.unit._id || !T || s.measurement && !S;
|
|
255
255
|
return W(ht, {
|
|
256
256
|
style: {
|
|
257
257
|
flex: "1 1 0%"
|
|
258
258
|
},
|
|
259
259
|
modelValue: {
|
|
260
|
-
amount:
|
|
260
|
+
amount: s.quantity ?? { amount: 1, precision: 0 },
|
|
261
261
|
// NOTE: leave this reading from row.sku.unit and row.measurement instead,
|
|
262
|
-
measurement:
|
|
262
|
+
measurement: s.measurement ?? (s.sku.unit._id !== x.unit._id ? { ...s.sku.unit, id: "", conversion: { amount: 1, precision: 0 } } : null)
|
|
263
263
|
},
|
|
264
|
-
disabled:
|
|
265
|
-
key:
|
|
264
|
+
disabled: v.disabled,
|
|
265
|
+
key: s.sku._id,
|
|
266
266
|
unit: T,
|
|
267
267
|
"onUpdate:modelValue": (f) => {
|
|
268
|
-
|
|
269
|
-
...
|
|
268
|
+
v.updateItem({
|
|
269
|
+
...s,
|
|
270
270
|
sku: x,
|
|
271
271
|
quantity: f.amount,
|
|
272
272
|
measurement: f.measurement
|
|
273
273
|
});
|
|
274
274
|
},
|
|
275
275
|
rules: [
|
|
276
|
-
gt(
|
|
276
|
+
gt(s.quantityStep),
|
|
277
277
|
Ft(
|
|
278
278
|
+G(
|
|
279
|
-
|
|
279
|
+
s.minimumQuantity ?? {
|
|
280
280
|
amount: 1,
|
|
281
281
|
// NOTE: leave this reading from row.sku.unit and row.measurement instead,
|
|
282
|
-
precision: ae(
|
|
282
|
+
precision: ae(s.sku.unit, s.measurement)
|
|
283
283
|
}
|
|
284
284
|
)
|
|
285
285
|
),
|
|
286
286
|
Tt(
|
|
287
|
-
|
|
287
|
+
s.maximumQuantity ? +G(s.maximumQuantity) : 1 / 0
|
|
288
288
|
),
|
|
289
289
|
function(w) {
|
|
290
290
|
return I ? "This item is no longer valid due to change in unit. Please reapply unit." : !0;
|
|
@@ -300,30 +300,30 @@ function qt(b) {
|
|
|
300
300
|
header: () => "Limit",
|
|
301
301
|
// TODO: i18n,
|
|
302
302
|
minSize: 280,
|
|
303
|
-
cell(
|
|
304
|
-
const
|
|
303
|
+
cell(d) {
|
|
304
|
+
const s = d.row.original;
|
|
305
305
|
return W(Lt, {
|
|
306
306
|
style: {
|
|
307
307
|
flex: "1 1 0%"
|
|
308
308
|
},
|
|
309
309
|
modelValue: {
|
|
310
|
-
min:
|
|
311
|
-
max:
|
|
310
|
+
min: s.minimumQuantity,
|
|
311
|
+
max: s.maximumQuantity
|
|
312
312
|
},
|
|
313
|
-
disabled:
|
|
314
|
-
key:
|
|
315
|
-
unit:
|
|
313
|
+
disabled: v.disabled,
|
|
314
|
+
key: s.sku._id,
|
|
315
|
+
unit: s.sku.unit,
|
|
316
316
|
"onUpdate:modelValue": (u) => {
|
|
317
|
-
const x = { ...
|
|
318
|
-
u != null && u.min
|
|
317
|
+
const x = { ...s };
|
|
318
|
+
u != null && u.min ? x.minimumQuantity = u.min : x.minimumQuantity = null, u != null && u.max ? x.maximumQuantity = u.max : x.maximumQuantity = null, v.updateItem(x);
|
|
319
319
|
},
|
|
320
320
|
rules: [
|
|
321
|
-
Bt(),
|
|
322
|
-
Et(
|
|
321
|
+
Bt({ max: !1 }),
|
|
322
|
+
Et(s.quantityStep),
|
|
323
323
|
Ut(
|
|
324
324
|
+G({
|
|
325
325
|
amount: 1,
|
|
326
|
-
precision: ae(
|
|
326
|
+
precision: ae(s.sku.unit, s.measurement)
|
|
327
327
|
}),
|
|
328
328
|
1 / 0
|
|
329
329
|
)
|
|
@@ -337,23 +337,23 @@ function qt(b) {
|
|
|
337
337
|
id: "Step",
|
|
338
338
|
header: () => _("inventory.transfer.form.items.table.Step"),
|
|
339
339
|
minSize: 100,
|
|
340
|
-
cell(
|
|
341
|
-
const
|
|
340
|
+
cell(d) {
|
|
341
|
+
const s = d.row.original;
|
|
342
342
|
return W(re.FmTextField, {
|
|
343
|
-
modelValue: G(
|
|
344
|
-
key:
|
|
343
|
+
modelValue: G(s.quantityStep ?? Be.reset(), !1),
|
|
344
|
+
key: s.sku._id,
|
|
345
345
|
"onUpdate:modelValue": (u) => {
|
|
346
|
-
|
|
347
|
-
...
|
|
346
|
+
v.updateItem({
|
|
347
|
+
...s,
|
|
348
348
|
quantityStep: vt(+u)
|
|
349
349
|
});
|
|
350
350
|
},
|
|
351
351
|
rules: [
|
|
352
352
|
de({
|
|
353
353
|
amount: 1,
|
|
354
|
-
precision: ae(
|
|
354
|
+
precision: ae(s.sku.unit, s.measurement)
|
|
355
355
|
}),
|
|
356
|
-
bt(
|
|
356
|
+
bt(s.sku.unit, s.measurement)
|
|
357
357
|
]
|
|
358
358
|
});
|
|
359
359
|
},
|
|
@@ -362,18 +362,18 @@ function qt(b) {
|
|
|
362
362
|
{
|
|
363
363
|
id: "Delete",
|
|
364
364
|
header: "",
|
|
365
|
-
cell(
|
|
366
|
-
const
|
|
365
|
+
cell(d) {
|
|
366
|
+
const s = d.row.original;
|
|
367
367
|
return W(re.FmButton, {
|
|
368
368
|
class: "delete-button",
|
|
369
|
-
key:
|
|
369
|
+
key: s.sku._id,
|
|
370
370
|
type: "button",
|
|
371
371
|
icon: "delete",
|
|
372
372
|
variant: "tertiary",
|
|
373
373
|
size: "md",
|
|
374
|
-
disabled:
|
|
374
|
+
disabled: v.disabled,
|
|
375
375
|
onClick: () => {
|
|
376
|
-
|
|
376
|
+
v.deleteItem(s);
|
|
377
377
|
}
|
|
378
378
|
});
|
|
379
379
|
},
|
|
@@ -386,7 +386,7 @@ function qt(b) {
|
|
|
386
386
|
}
|
|
387
387
|
];
|
|
388
388
|
return {
|
|
389
|
-
columnDefs:
|
|
389
|
+
columnDefs: R(() => Qe().enableTotalCost && v.transferType === N.PURCHASE ? o : o.filter((s) => s.id !== "Cost"))
|
|
390
390
|
};
|
|
391
391
|
}
|
|
392
392
|
const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-center" }, jt = { class: "flex-1 flex gap-1 items-center" }, Ht = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Qt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Gt = { class: "flex gap-8 w-full" }, Kt = { class: "flex-1 flex flex-col gap-4" }, Wt = { class: "flex-1 flex flex-col gap-4" }, Zt = { class: "flex gap-8 w-full" }, Jt = { class: "flex-1 flex flex-col gap-4" }, Xt = { class: "flex-1 flex flex-col gap-4" }, Yt = { class: "flex gap-8 w-full" }, eo = { class: "flex-1 flex flex-col gap-4" }, to = /* @__PURE__ */ Z({
|
|
@@ -395,21 +395,21 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
395
395
|
cellByColId: {},
|
|
396
396
|
row: {}
|
|
397
397
|
},
|
|
398
|
-
setup(
|
|
398
|
+
setup(v) {
|
|
399
399
|
const { t: _ } = J();
|
|
400
|
-
return (
|
|
401
|
-
var
|
|
400
|
+
return (m, o) => {
|
|
401
|
+
var d, s, u, x, T, S, I, g, f, w, L, q, b, a, h, r, y, l, n, i, $, V, k, F, D, z, H, M, U, X;
|
|
402
402
|
const p = O("FmLabel");
|
|
403
|
-
return
|
|
403
|
+
return A(), Q("div", Nt, [
|
|
404
404
|
t("div", zt, [
|
|
405
405
|
t("div", jt, [
|
|
406
|
-
t("span", Ht, " (" + C(
|
|
407
|
-
t("span", Qt, C(
|
|
406
|
+
t("span", Ht, " (" + C(m.row.original.sku.code) + ") ", 1),
|
|
407
|
+
t("span", Qt, C(m.row.original.sku.name), 1)
|
|
408
408
|
]),
|
|
409
409
|
t("div", null, [
|
|
410
410
|
c(e(j), {
|
|
411
|
-
render: (u = (
|
|
412
|
-
props: (T = (x =
|
|
411
|
+
render: (u = (s = (d = m.cellByColId.Delete) == null ? void 0 : d.column) == null ? void 0 : s.columnDef) == null ? void 0 : u.cell,
|
|
412
|
+
props: (T = (x = m.cellByColId.Delete) == null ? void 0 : x.getContext) == null ? void 0 : T.call(x)
|
|
413
413
|
}, null, 8, ["render", "props"])
|
|
414
414
|
])
|
|
415
415
|
]),
|
|
@@ -419,20 +419,20 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
419
419
|
label: e(_)(`inventory.transfer.form.items.table.${e(P).Code}`)
|
|
420
420
|
}, null, 8, ["label"]),
|
|
421
421
|
c(e(j), {
|
|
422
|
-
render: (g = (I = (S =
|
|
423
|
-
props: (w = (f =
|
|
422
|
+
render: (g = (I = (S = m.cellByColId[e(P).Code]) == null ? void 0 : S.column) == null ? void 0 : I.columnDef) == null ? void 0 : g.cell,
|
|
423
|
+
props: (w = (f = m.cellByColId[e(P).Code]) == null ? void 0 : f.getContext) == null ? void 0 : w.call(f)
|
|
424
424
|
}, null, 8, ["render", "props"]),
|
|
425
|
-
|
|
425
|
+
o[0] || (o[0] = t("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
426
426
|
]),
|
|
427
427
|
t("div", Wt, [
|
|
428
428
|
c(p, {
|
|
429
429
|
label: e(_)(`inventory.transfer.form.items.table.${e(P).Name}`)
|
|
430
430
|
}, null, 8, ["label"]),
|
|
431
431
|
c(e(j), {
|
|
432
|
-
render: (
|
|
433
|
-
props: (h = (a =
|
|
432
|
+
render: (b = (q = (L = m.cellByColId[e(P).Name]) == null ? void 0 : L.column) == null ? void 0 : q.columnDef) == null ? void 0 : b.cell,
|
|
433
|
+
props: (h = (a = m.cellByColId[e(P).Name]) == null ? void 0 : a.getContext) == null ? void 0 : h.call(a)
|
|
434
434
|
}, null, 8, ["render", "props"]),
|
|
435
|
-
|
|
435
|
+
o[1] || (o[1] = t("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
436
436
|
])
|
|
437
437
|
]),
|
|
438
438
|
t("div", Zt, [
|
|
@@ -441,20 +441,20 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
441
441
|
label: e(_)(`inventory.transfer.form.items.table.${e(P).DefaultAmount}`)
|
|
442
442
|
}, null, 8, ["label"]),
|
|
443
443
|
c(e(j), {
|
|
444
|
-
render: (
|
|
445
|
-
props: (i = (n =
|
|
444
|
+
render: (l = (y = (r = m.cellByColId[e(P).DefaultAmount]) == null ? void 0 : r.column) == null ? void 0 : y.columnDef) == null ? void 0 : l.cell,
|
|
445
|
+
props: (i = (n = m.cellByColId[e(P).DefaultAmount]) == null ? void 0 : n.getContext) == null ? void 0 : i.call(n)
|
|
446
446
|
}, null, 8, ["render", "props"]),
|
|
447
|
-
|
|
447
|
+
o[2] || (o[2] = t("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
448
448
|
]),
|
|
449
449
|
t("div", Xt, [
|
|
450
450
|
c(p, {
|
|
451
451
|
label: e(_)(`inventory.transfer.form.items.table.${e(P).Step}`)
|
|
452
452
|
}, null, 8, ["label"]),
|
|
453
453
|
c(e(j), {
|
|
454
|
-
render: (k = (V = ($ =
|
|
455
|
-
props: (D = (F =
|
|
454
|
+
render: (k = (V = ($ = m.cellByColId[e(P).Step]) == null ? void 0 : $.column) == null ? void 0 : V.columnDef) == null ? void 0 : k.cell,
|
|
455
|
+
props: (D = (F = m.cellByColId[e(P).Step]) == null ? void 0 : F.getContext) == null ? void 0 : D.call(F)
|
|
456
456
|
}, null, 8, ["render", "props"]),
|
|
457
|
-
|
|
457
|
+
o[3] || (o[3] = t("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
458
458
|
])
|
|
459
459
|
]),
|
|
460
460
|
t("div", Yt, [
|
|
@@ -463,10 +463,10 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
463
463
|
label: e(_)(`inventory.transfer.form.items.table.${e(P).Limit}`)
|
|
464
464
|
}, null, 8, ["label"]),
|
|
465
465
|
c(e(j), {
|
|
466
|
-
render: (M = (H = (z =
|
|
467
|
-
props: (X = (U =
|
|
466
|
+
render: (M = (H = (z = m.cellByColId[e(P).Limit]) == null ? void 0 : z.column) == null ? void 0 : H.columnDef) == null ? void 0 : M.cell,
|
|
467
|
+
props: (X = (U = m.cellByColId[e(P).Limit]) == null ? void 0 : U.getContext) == null ? void 0 : X.call(U)
|
|
468
468
|
}, null, 8, ["render", "props"]),
|
|
469
|
-
|
|
469
|
+
o[4] || (o[4] = t("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
470
470
|
])
|
|
471
471
|
])
|
|
472
472
|
]);
|
|
@@ -478,41 +478,41 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
478
478
|
modelValue: {},
|
|
479
479
|
disabled: { type: Boolean }
|
|
480
480
|
},
|
|
481
|
-
setup(
|
|
482
|
-
const
|
|
481
|
+
setup(v, { expose: _ }) {
|
|
482
|
+
const m = v, o = He(), { t: p } = J(), d = ze(), s = Ne(), u = St();
|
|
483
483
|
ce(
|
|
484
|
-
() =>
|
|
485
|
-
(
|
|
486
|
-
console.log("TransferTemplateForm.model",
|
|
484
|
+
() => m.modelValue,
|
|
485
|
+
(l) => {
|
|
486
|
+
console.log("TransferTemplateForm.model", l);
|
|
487
487
|
}
|
|
488
|
-
),
|
|
489
|
-
location && (
|
|
488
|
+
), d.watchLocation(async () => {
|
|
489
|
+
location && (o.purchaseOrder.supplier || (o.purchaseOrder.supplier = u.suppliers.find((l) => l) ?? o.purchaseOrder.supplier));
|
|
490
490
|
});
|
|
491
491
|
const x = ut(), T = kt(
|
|
492
|
-
() =>
|
|
493
|
-
(
|
|
494
|
-
|
|
495
|
-
...
|
|
496
|
-
supplier:
|
|
492
|
+
() => o.purchaseOrder,
|
|
493
|
+
(l) => {
|
|
494
|
+
o.purchaseOrder = {
|
|
495
|
+
...o.purchaseOrder,
|
|
496
|
+
supplier: l.supplier ?? (o == null ? void 0 : o.purchaseOrder.supplier)
|
|
497
497
|
};
|
|
498
498
|
}
|
|
499
|
-
), S =
|
|
499
|
+
), S = R({
|
|
500
500
|
get() {
|
|
501
|
-
var
|
|
502
|
-
return typeof ((n = (
|
|
501
|
+
var l, n;
|
|
502
|
+
return typeof ((n = (l = o.purchaseOrder) == null ? void 0 : l.supplier) == null ? void 0 : n.internal) == "string" ? N.TRANSFER : N.PURCHASE;
|
|
503
503
|
},
|
|
504
|
-
set(
|
|
504
|
+
set(l) {
|
|
505
505
|
var i, $;
|
|
506
|
-
const n = typeof (($ = (i =
|
|
507
|
-
|
|
506
|
+
const n = typeof (($ = (i = o.purchaseOrder) == null ? void 0 : i.supplier) == null ? void 0 : $.internal) == "string" ? N.TRANSFER : N.PURCHASE;
|
|
507
|
+
l !== n && (o.purchaseOrder.supplier = l === N.PURCHASE ? T.locationOptionsTypePurchase.value[0] : T.locationOptionsTypeTransfer.value[0]);
|
|
508
508
|
}
|
|
509
|
-
}), I =
|
|
509
|
+
}), I = R(() => T.transferLocationOptions.value), g = R({
|
|
510
510
|
get() {
|
|
511
|
-
var
|
|
512
|
-
return (
|
|
511
|
+
var l;
|
|
512
|
+
return (l = o.purchaseOrder.supplier) == null ? void 0 : l._id;
|
|
513
513
|
},
|
|
514
|
-
set(
|
|
515
|
-
T.transferLocationModel.value =
|
|
514
|
+
set(l) {
|
|
515
|
+
T.transferLocationModel.value = l;
|
|
516
516
|
}
|
|
517
517
|
}), {
|
|
518
518
|
promptSelectLocations: f,
|
|
@@ -520,71 +520,71 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
520
520
|
rowData: L
|
|
521
521
|
} = Ct({
|
|
522
522
|
getLocations() {
|
|
523
|
-
return
|
|
523
|
+
return o.locations;
|
|
524
524
|
},
|
|
525
|
-
setLocations(
|
|
526
|
-
|
|
525
|
+
setLocations(l) {
|
|
526
|
+
o.locations = l;
|
|
527
527
|
}
|
|
528
528
|
});
|
|
529
529
|
function q() {
|
|
530
|
-
var
|
|
531
|
-
return (
|
|
530
|
+
var l, n;
|
|
531
|
+
return (l = o.locations) != null && l.find((i) => {
|
|
532
532
|
var $, V;
|
|
533
|
-
return (($ = i.doc) == null ? void 0 : $._id) === ((V =
|
|
534
|
-
}) ? `Location ${(n =
|
|
533
|
+
return (($ = i.doc) == null ? void 0 : $._id) === ((V = o.purchaseOrder.supplier) == null ? void 0 : V._id);
|
|
534
|
+
}) ? `Location ${(n = o.purchaseOrder.supplier) == null ? void 0 : n.name} must be removed because template cannot be used to transfer to itself.` : !0;
|
|
535
535
|
}
|
|
536
|
-
const
|
|
536
|
+
const b = R({
|
|
537
537
|
get() {
|
|
538
|
-
return
|
|
538
|
+
return o.purchaseOrder.remark ?? void 0;
|
|
539
539
|
},
|
|
540
|
-
set(
|
|
541
|
-
|
|
540
|
+
set(l) {
|
|
541
|
+
o.purchaseOrder.remark = l;
|
|
542
542
|
}
|
|
543
543
|
}), a = B();
|
|
544
544
|
_({
|
|
545
545
|
validateInputs: () => {
|
|
546
|
-
var
|
|
547
|
-
(n = (
|
|
546
|
+
var l, n;
|
|
547
|
+
(n = (l = a.value) == null ? void 0 : l.validateInputs) == null || n.call(l);
|
|
548
548
|
},
|
|
549
549
|
resetInputsValidation: () => {
|
|
550
|
-
var
|
|
551
|
-
(n = (
|
|
550
|
+
var l, n;
|
|
551
|
+
(n = (l = a.value) == null ? void 0 : l.resetInputsValidation) == null || n.call(l);
|
|
552
552
|
},
|
|
553
553
|
resetInputs: () => {
|
|
554
|
-
var
|
|
555
|
-
(n = (
|
|
554
|
+
var l, n;
|
|
555
|
+
(n = (l = a.value) == null ? void 0 : l.resetInputs) == null || n.call(l);
|
|
556
556
|
}
|
|
557
557
|
});
|
|
558
558
|
const h = qt({
|
|
559
|
-
updateItem: (
|
|
560
|
-
|
|
559
|
+
updateItem: (l) => {
|
|
560
|
+
o.purchaseOrder.items = o.purchaseOrder.items.map((n) => n.sku._id !== l.sku._id ? n : l);
|
|
561
561
|
},
|
|
562
|
-
deleteItem: (
|
|
563
|
-
|
|
564
|
-
(n) => n.sku._id !==
|
|
562
|
+
deleteItem: (l) => {
|
|
563
|
+
o.purchaseOrder.items = o.purchaseOrder.items.filter(
|
|
564
|
+
(n) => n.sku._id !== l.sku._id
|
|
565
565
|
);
|
|
566
566
|
},
|
|
567
567
|
get supplier() {
|
|
568
|
-
return
|
|
568
|
+
return o.purchaseOrder.supplier;
|
|
569
569
|
},
|
|
570
570
|
get items() {
|
|
571
|
-
return
|
|
571
|
+
return o.purchaseOrder.items;
|
|
572
572
|
},
|
|
573
573
|
get transferType() {
|
|
574
574
|
return N.PURCHASE;
|
|
575
575
|
},
|
|
576
576
|
get disabled() {
|
|
577
|
-
return
|
|
577
|
+
return m.disabled;
|
|
578
578
|
}
|
|
579
|
-
}), r =
|
|
579
|
+
}), r = R(() => h.columnDefs.value);
|
|
580
580
|
function y() {
|
|
581
|
-
const
|
|
581
|
+
const l = s.skus.map((i) => ({
|
|
582
582
|
label: i.name,
|
|
583
583
|
sublabel: i.code,
|
|
584
584
|
value: i
|
|
585
|
-
})), n =
|
|
585
|
+
})), n = l.filter((i) => {
|
|
586
586
|
var $;
|
|
587
|
-
return ($ =
|
|
587
|
+
return ($ = o.purchaseOrder.items) == null ? void 0 : $.find((V) => V.sku._id === i.value._id);
|
|
588
588
|
}).map((i) => i.value);
|
|
589
589
|
x.open({
|
|
590
590
|
title: p("inventory.transfer.form.items.selectItem"),
|
|
@@ -592,7 +592,7 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
592
592
|
contentComponent: $t,
|
|
593
593
|
contentComponentProps: {
|
|
594
594
|
modelValue: n,
|
|
595
|
-
items:
|
|
595
|
+
items: l,
|
|
596
596
|
virtualScroll: !0
|
|
597
597
|
},
|
|
598
598
|
primaryActions: {
|
|
@@ -605,7 +605,7 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
605
605
|
variant: "tertiary"
|
|
606
606
|
}
|
|
607
607
|
}).onPrimary((i) => {
|
|
608
|
-
const $ =
|
|
608
|
+
const $ = o.purchaseOrder.items ?? [], V = i.map((k) => {
|
|
609
609
|
const F = $.find((H) => H.sku._id === k._id);
|
|
610
610
|
if (F)
|
|
611
611
|
return F;
|
|
@@ -616,23 +616,23 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
616
616
|
name: k.name,
|
|
617
617
|
quantity: D,
|
|
618
618
|
minimumQuantity: D,
|
|
619
|
-
maximumQuantity:
|
|
619
|
+
maximumQuantity: xt(D, {
|
|
620
620
|
amount: 100,
|
|
621
621
|
precision: 0
|
|
622
622
|
}),
|
|
623
623
|
quantityStep: D
|
|
624
624
|
};
|
|
625
625
|
});
|
|
626
|
-
V.sort((k, F) => k.sku.code.localeCompare(F.sku.code)),
|
|
626
|
+
V.sort((k, F) => k.sku.code.localeCompare(F.sku.code)), o.purchaseOrder.items = V;
|
|
627
627
|
});
|
|
628
628
|
}
|
|
629
|
-
return (
|
|
629
|
+
return (l, n) => {
|
|
630
630
|
const i = O("FmTextField"), $ = O("FmSelect"), V = O("FmTextarea"), k = O("FmButton"), F = O("FmTable"), D = O("FmFormGroup"), z = O("FmForm");
|
|
631
|
-
return
|
|
631
|
+
return A(), K(z, {
|
|
632
632
|
ref_key: "formRef",
|
|
633
633
|
ref: a,
|
|
634
634
|
class: "flex flex-col gap-32",
|
|
635
|
-
disabled:
|
|
635
|
+
disabled: l.disabled
|
|
636
636
|
}, {
|
|
637
637
|
default: E(() => {
|
|
638
638
|
var H;
|
|
@@ -642,8 +642,8 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
642
642
|
c(i, {
|
|
643
643
|
label: e(p)("inventory.transfer.form.name"),
|
|
644
644
|
"label-mark": "required",
|
|
645
|
-
modelValue: e(
|
|
646
|
-
"onUpdate:modelValue": n[0] || (n[0] = (M) => e(
|
|
645
|
+
modelValue: e(o).name,
|
|
646
|
+
"onUpdate:modelValue": n[0] || (n[0] = (M) => e(o).name = M),
|
|
647
647
|
rules: [e(me)()]
|
|
648
648
|
}, null, 8, ["label", "modelValue", "rules"]),
|
|
649
649
|
c($, {
|
|
@@ -677,7 +677,7 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
677
677
|
return [
|
|
678
678
|
c(Mt, Ue(M, {
|
|
679
679
|
items: I.value,
|
|
680
|
-
"model-value": (U =
|
|
680
|
+
"model-value": (U = l.modelValue.purchaseOrder.supplier) == null ? void 0 : U._id
|
|
681
681
|
}), null, 16, ["items", "model-value"])
|
|
682
682
|
];
|
|
683
683
|
}),
|
|
@@ -686,16 +686,16 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
686
686
|
c(i, {
|
|
687
687
|
label: e(p)("inventory.transfer.form.reference"),
|
|
688
688
|
"label-mark": "optional",
|
|
689
|
-
modelValue: e(
|
|
690
|
-
"onUpdate:modelValue": n[3] || (n[3] = (M) => e(
|
|
689
|
+
modelValue: e(o).purchaseOrder.ref,
|
|
690
|
+
"onUpdate:modelValue": n[3] || (n[3] = (M) => e(o).purchaseOrder.ref = M)
|
|
691
691
|
}, null, 8, ["label", "modelValue"]),
|
|
692
692
|
c(V, {
|
|
693
693
|
label: e(p)("inventory.transfer.form.remark"),
|
|
694
694
|
"label-mark": "optional",
|
|
695
695
|
"max-length": 240,
|
|
696
|
-
modelValue:
|
|
697
|
-
"onUpdate:modelValue": n[4] || (n[4] = (M) =>
|
|
698
|
-
class: ie({ "text-fm-color-typo-disabled":
|
|
696
|
+
modelValue: b.value,
|
|
697
|
+
"onUpdate:modelValue": n[4] || (n[4] = (M) => b.value = M),
|
|
698
|
+
class: ie({ "text-fm-color-typo-disabled": l.disabled })
|
|
699
699
|
}, null, 8, ["label", "modelValue", "class"])
|
|
700
700
|
])
|
|
701
701
|
]),
|
|
@@ -703,7 +703,7 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
703
703
|
t("div", no, [
|
|
704
704
|
n[6] || (n[6] = t("div", { class: "flex-1 fm-typo-en-title-sm-600" }, "Locations", -1)),
|
|
705
705
|
c(k, {
|
|
706
|
-
disabled:
|
|
706
|
+
disabled: l.disabled,
|
|
707
707
|
label: "Select location",
|
|
708
708
|
"prepend-icon": "add",
|
|
709
709
|
variant: "plain",
|
|
@@ -721,8 +721,8 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
721
721
|
t("div", ro, [
|
|
722
722
|
c(D, {
|
|
723
723
|
"model-value": [
|
|
724
|
-
(H =
|
|
725
|
-
...
|
|
724
|
+
(H = m.modelValue.purchaseOrder.supplier) == null ? void 0 : H._id,
|
|
725
|
+
...m.modelValue.locations ?? []
|
|
726
726
|
].join(","),
|
|
727
727
|
rules: [q]
|
|
728
728
|
}, null, 8, ["model-value", "rules"])
|
|
@@ -732,7 +732,7 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
732
732
|
t("div", io, [
|
|
733
733
|
t("div", uo, C(e(p)("inventory.transfer.form.items.title")), 1),
|
|
734
734
|
c(k, {
|
|
735
|
-
disabled:
|
|
735
|
+
disabled: l.disabled,
|
|
736
736
|
label: e(p)("inventory.transfer.form.items.addItem"),
|
|
737
737
|
"prepend-icon": "add",
|
|
738
738
|
variant: "plain",
|
|
@@ -741,17 +741,17 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
741
741
|
size: "md"
|
|
742
742
|
}, null, 8, ["disabled", "label"])
|
|
743
743
|
]),
|
|
744
|
-
(
|
|
744
|
+
(A(), K(F, {
|
|
745
745
|
"column-defs": r.value,
|
|
746
|
-
"row-data": e(
|
|
747
|
-
key: e(
|
|
746
|
+
"row-data": e(o).purchaseOrder.items,
|
|
747
|
+
key: e(o).purchaseOrder.items.map((M) => M.sku._id).join("."),
|
|
748
748
|
"hide-footer": "",
|
|
749
|
-
"page-size": e(
|
|
749
|
+
"page-size": e(o).purchaseOrder.items.length
|
|
750
750
|
}, {
|
|
751
751
|
"list-row": E((M) => [
|
|
752
|
-
(
|
|
752
|
+
(A(), K(Ge, {
|
|
753
753
|
row: M,
|
|
754
|
-
key: e(
|
|
754
|
+
key: e(o).purchaseOrder.items.map((U) => U.sku._id).join(".")
|
|
755
755
|
}, {
|
|
756
756
|
default: E((U) => [
|
|
757
757
|
c(to, {
|
|
@@ -765,7 +765,7 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
765
765
|
_: 1
|
|
766
766
|
}, 8, ["column-defs", "row-data", "page-size"])),
|
|
767
767
|
c(D, {
|
|
768
|
-
"model-value": e(
|
|
768
|
+
"model-value": e(o).purchaseOrder.items.length,
|
|
769
769
|
rules: [e(de)(1)]
|
|
770
770
|
}, null, 8, ["model-value", "rules"])
|
|
771
771
|
])
|
|
@@ -783,9 +783,9 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
783
783
|
show: { type: Boolean }
|
|
784
784
|
},
|
|
785
785
|
emits: ["update:show", "submitted"],
|
|
786
|
-
setup(
|
|
786
|
+
setup(v, { expose: _, emit: m }) {
|
|
787
787
|
var h;
|
|
788
|
-
const
|
|
788
|
+
const o = v, p = m, d = nt(), s = mt(), { t: u } = J(), x = je(o, "show");
|
|
789
789
|
function T() {
|
|
790
790
|
return {
|
|
791
791
|
_id: "",
|
|
@@ -816,16 +816,16 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
816
816
|
}
|
|
817
817
|
};
|
|
818
818
|
}
|
|
819
|
-
const S = B(
|
|
819
|
+
const S = B(o.modelValue ?? T()), I = B(((h = o.modelValue) == null ? void 0 : h._id) ?? `${Math.random()}`);
|
|
820
820
|
ce(
|
|
821
|
-
() =>
|
|
821
|
+
() => o.show,
|
|
822
822
|
(r) => {
|
|
823
823
|
var y;
|
|
824
|
-
r && (S.value =
|
|
824
|
+
r && (S.value = o.modelValue ?? T(), I.value = ((y = o.modelValue) == null ? void 0 : y._id) ?? `${Math.random()}`);
|
|
825
825
|
}
|
|
826
826
|
);
|
|
827
|
-
const g = B(!1), f =
|
|
828
|
-
switch (
|
|
827
|
+
const g = B(!1), f = R(() => {
|
|
828
|
+
switch (o.mode) {
|
|
829
829
|
case ee.READ:
|
|
830
830
|
return "";
|
|
831
831
|
case ee.CREATE:
|
|
@@ -850,20 +850,20 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
850
850
|
}
|
|
851
851
|
});
|
|
852
852
|
async function L() {
|
|
853
|
-
var y,
|
|
853
|
+
var y, l;
|
|
854
854
|
const r = S.value;
|
|
855
855
|
if (r) {
|
|
856
|
-
g.value = !0, (((y = r.purchaseOrder.supplier) == null ? void 0 : y.internal) === ne.enum.warehouse || ((
|
|
856
|
+
g.value = !0, (((y = r.purchaseOrder.supplier) == null ? void 0 : y.internal) === ne.enum.warehouse || ((l = r.purchaseOrder.supplier) == null ? void 0 : l.internal) === ne.enum.restaurant) && (r.purchaseOrder.items = r.purchaseOrder.items.map(
|
|
857
857
|
({ totalCost: n, ...i }) => i
|
|
858
858
|
));
|
|
859
859
|
try {
|
|
860
|
-
await
|
|
860
|
+
await d.createTemplate(r), await new Promise((n) => setTimeout(n, 1e3)), s.open({
|
|
861
861
|
title: u("inventory.transfer.template.create.success"),
|
|
862
862
|
message: u("inventory.transfer.template.create.successMessage"),
|
|
863
863
|
type: "success"
|
|
864
864
|
}), p("update:show", !1), p("submitted");
|
|
865
865
|
} catch (n) {
|
|
866
|
-
|
|
866
|
+
s.open({
|
|
867
867
|
title: u("inventory.transfer.template.create.error"),
|
|
868
868
|
message: u("inventory.transfer.template.create.errorMessage"),
|
|
869
869
|
type: "error"
|
|
@@ -874,20 +874,20 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
874
874
|
}
|
|
875
875
|
}
|
|
876
876
|
async function q() {
|
|
877
|
-
var y,
|
|
877
|
+
var y, l;
|
|
878
878
|
const r = S.value;
|
|
879
879
|
if (r) {
|
|
880
|
-
g.value = !0, (((y = r.purchaseOrder.supplier) == null ? void 0 : y.internal) === ne.enum.warehouse || ((
|
|
880
|
+
g.value = !0, (((y = r.purchaseOrder.supplier) == null ? void 0 : y.internal) === ne.enum.warehouse || ((l = r.purchaseOrder.supplier) == null ? void 0 : l.internal) === ne.enum.restaurant) && (r.purchaseOrder.items = r.purchaseOrder.items.map(
|
|
881
881
|
({ totalCost: n, ...i }) => i
|
|
882
882
|
));
|
|
883
883
|
try {
|
|
884
|
-
await
|
|
884
|
+
await d.updateTemplate(r), await new Promise((n) => setTimeout(n, 1e3)), s.open({
|
|
885
885
|
title: u("inventory.transfer.template.update.success"),
|
|
886
886
|
message: u("inventory.transfer.template.update.successMessage"),
|
|
887
887
|
type: "success"
|
|
888
888
|
}), p("update:show", !1), p("submitted");
|
|
889
889
|
} catch (n) {
|
|
890
|
-
|
|
890
|
+
s.open({
|
|
891
891
|
title: u("inventory.transfer.template.update.error"),
|
|
892
892
|
message: u("inventory.transfer.template.update.errorMessage"),
|
|
893
893
|
type: "error"
|
|
@@ -897,8 +897,8 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
897
897
|
}
|
|
898
898
|
}
|
|
899
899
|
}
|
|
900
|
-
function
|
|
901
|
-
switch (
|
|
900
|
+
function b() {
|
|
901
|
+
switch (o.mode) {
|
|
902
902
|
case ee.CREATE:
|
|
903
903
|
return L();
|
|
904
904
|
case ee.UPDATE:
|
|
@@ -910,8 +910,8 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
910
910
|
(y = (r = w.value) == null ? void 0 : r.validateInputs) == null || y.call(r);
|
|
911
911
|
}
|
|
912
912
|
return (r, y) => {
|
|
913
|
-
const
|
|
914
|
-
return
|
|
913
|
+
const l = O("FmButton"), n = O("FmSideSheet");
|
|
914
|
+
return A(), K(n, {
|
|
915
915
|
modelValue: e(x),
|
|
916
916
|
"onUpdate:modelValue": y[2] || (y[2] = (i) => Ee(x) ? x.value = i : null),
|
|
917
917
|
"dismiss-away": "",
|
|
@@ -924,11 +924,11 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
924
924
|
])
|
|
925
925
|
]),
|
|
926
926
|
default: E(() => [
|
|
927
|
-
(
|
|
927
|
+
(A(), K(mo, {
|
|
928
928
|
class: "w-full",
|
|
929
929
|
ref_key: "formRef",
|
|
930
930
|
ref: w,
|
|
931
|
-
onValidationSuccess:
|
|
931
|
+
onValidationSuccess: b,
|
|
932
932
|
"model-value": S.value,
|
|
933
933
|
"onUpdate:modelValue": y[0] || (y[0] = (i) => S.value = i),
|
|
934
934
|
disabled: g.value,
|
|
@@ -937,12 +937,12 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
937
937
|
]),
|
|
938
938
|
"side-sheet-footer": E(() => [
|
|
939
939
|
t("div", fo, [
|
|
940
|
-
c(
|
|
940
|
+
c(l, {
|
|
941
941
|
loading: g.value,
|
|
942
942
|
label: e(u)("common.save"),
|
|
943
943
|
onClick: a
|
|
944
944
|
}, null, 8, ["loading", "label"]),
|
|
945
|
-
c(
|
|
945
|
+
c(l, {
|
|
946
946
|
disabled: g.value,
|
|
947
947
|
variant: "tertiary",
|
|
948
948
|
label: e(u)("common.close"),
|
|
@@ -954,7 +954,7 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
954
954
|
}, 8, ["modelValue"]);
|
|
955
955
|
};
|
|
956
956
|
}
|
|
957
|
-
}), vo = { class: "flex flex-col gap-16 w-full h-full overflow-y-auto" }, bo = { class: "flex justify-between" },
|
|
957
|
+
}), vo = { class: "flex flex-col gap-16 w-full h-full overflow-y-auto" }, bo = { class: "flex justify-between" }, xo = { class: "fm-typo-en-body-lg-600" }, _o = { class: "fm-status-badge fm-status-badge-info-secondary" }, ho = { class: "flex flex-col gap-8" }, go = { class: "flex flex-col gap-4" }, Fo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, To = { class: "flex gap-1" }, wo = { class: "fm-typo-en-body-lg-600" }, ko = {
|
|
958
958
|
key: 0,
|
|
959
959
|
class: "flex flex-col gap-4"
|
|
960
960
|
}, Mo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, So = { class: "fm-typo-en-body-lg-600" }, $o = {
|
|
@@ -963,7 +963,7 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
963
963
|
}, Co = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Oo = { class: "fm-typo-en-body-lg-600" }, Io = {
|
|
964
964
|
key: 2,
|
|
965
965
|
class: "flex flex-col gap-4"
|
|
966
|
-
}, Vo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
966
|
+
}, Vo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ao = { class: "fm-typo-en-body-lg-600" }, Ro = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Do = { class: "flex flex-col gap-8" }, Po = { class: "fm-typo-en-body-lg-600" }, Lo = { class: "flex w-full gap-4" }, Bo = { class: "grow fm-typo-en-body-lg-400 line-clamp-2" }, Uo = { class: "fm-typo-en-body-lg-600 shrink-0" }, Eo = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, qo = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, No = {
|
|
967
967
|
key: 0,
|
|
968
968
|
class: "shrink-0 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
969
969
|
}, zo = {
|
|
@@ -976,32 +976,32 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
976
976
|
show: { type: Boolean }
|
|
977
977
|
},
|
|
978
978
|
emits: ["update:show", "action:edit"],
|
|
979
|
-
setup(
|
|
980
|
-
const
|
|
979
|
+
setup(v, { emit: _ }) {
|
|
980
|
+
const m = v, o = _, p = Qe(), { t: d } = J(), s = R(() => {
|
|
981
981
|
var g;
|
|
982
|
-
return (g =
|
|
982
|
+
return (g = m.template) == null ? void 0 : g.purchaseOrder;
|
|
983
983
|
}), u = [
|
|
984
984
|
{ accessorKey: "name", header: () => "Name" },
|
|
985
985
|
{ accessorKey: "type", header: () => "Type" }
|
|
986
|
-
], x = B(""), T =
|
|
986
|
+
], x = B(""), T = R(
|
|
987
987
|
() => {
|
|
988
988
|
var g, f, w, L;
|
|
989
|
-
return ((f = (g =
|
|
989
|
+
return ((f = (g = s.value) == null ? void 0 : g.supplier) == null ? void 0 : f.internal) === "restaurant" || ((L = (w = s.value) == null ? void 0 : w.supplier) == null ? void 0 : L.internal) === "warehouse" ? N.TRANSFER : N.PURCHASE;
|
|
990
990
|
}
|
|
991
|
-
), S = B(!0), I = je(
|
|
991
|
+
), S = B(!0), I = je(m, "show");
|
|
992
992
|
return (g, f) => {
|
|
993
993
|
var y;
|
|
994
|
-
const w = O("FmMenuDivider"), L = O("FmCard"), q = O("FmIcon"),
|
|
995
|
-
return
|
|
996
|
-
header: e(
|
|
994
|
+
const w = O("FmMenuDivider"), L = O("FmCard"), q = O("FmIcon"), b = O("FmTextField"), a = O("FmTable"), h = O("FmButton"), r = O("FmSideSheet");
|
|
995
|
+
return A(), K(r, {
|
|
996
|
+
header: e(d)("inventory.transfer.template.details.view", { template: (y = g.template) == null ? void 0 : y.name }),
|
|
997
997
|
modelValue: e(I),
|
|
998
|
-
"onUpdate:modelValue": f[2] || (f[2] = (
|
|
998
|
+
"onUpdate:modelValue": f[2] || (f[2] = (l) => Ee(I) ? I.value = l : null),
|
|
999
999
|
"dismiss-away": S.value,
|
|
1000
1000
|
"close-button": "",
|
|
1001
1001
|
"max-width": 500
|
|
1002
1002
|
}, {
|
|
1003
1003
|
default: E(() => {
|
|
1004
|
-
var
|
|
1004
|
+
var l, n;
|
|
1005
1005
|
return [
|
|
1006
1006
|
t("div", vo, [
|
|
1007
1007
|
t("div", null, [
|
|
@@ -1013,8 +1013,8 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
1013
1013
|
var i, $, V, k, F, D, z;
|
|
1014
1014
|
return [
|
|
1015
1015
|
t("div", bo, [
|
|
1016
|
-
t("div",
|
|
1017
|
-
t("div",
|
|
1016
|
+
t("div", xo, C(e(d)("inventory.transfer.template.details.templateSummary")), 1),
|
|
1017
|
+
t("div", _o, C(e(d)(
|
|
1018
1018
|
`inventory.transfer.receiveRequest.details.type.${T.value.toLocaleLowerCase("en-US")}`
|
|
1019
1019
|
)), 1)
|
|
1020
1020
|
]),
|
|
@@ -1022,21 +1022,21 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
1022
1022
|
t("div", ho, [
|
|
1023
1023
|
t("div", go, [
|
|
1024
1024
|
t("div", Fo, [
|
|
1025
|
-
t("div", To, C(e(
|
|
1025
|
+
t("div", To, C(e(d)("inventory.transfer.receiveRequest.details.createdAt")), 1)
|
|
1026
1026
|
]),
|
|
1027
1027
|
t("div", wo, C(e(Ot)(((i = g.template) == null ? void 0 : i._id) ?? "")), 1)
|
|
1028
1028
|
]),
|
|
1029
|
-
(V = ($ =
|
|
1030
|
-
t("div", Mo, C(e(
|
|
1031
|
-
t("div", So, C((F = (k =
|
|
1029
|
+
(V = ($ = s.value) == null ? void 0 : $.supplier) != null && V.name ? (A(), Q("div", ko, [
|
|
1030
|
+
t("div", Mo, C(e(d)("inventory.transfer.receiveRequest.details.from")), 1),
|
|
1031
|
+
t("div", So, C((F = (k = s.value) == null ? void 0 : k.supplier) == null ? void 0 : F.name), 1)
|
|
1032
1032
|
])) : Y("", !0),
|
|
1033
|
-
(D =
|
|
1034
|
-
t("div", Co, C(e(
|
|
1035
|
-
t("div", Oo, C(
|
|
1033
|
+
(D = s.value) != null && D.ref ? (A(), Q("div", $o, [
|
|
1034
|
+
t("div", Co, C(e(d)("inventory.transfer.receiveRequest.details.reference")), 1),
|
|
1035
|
+
t("div", Oo, C(s.value.ref), 1)
|
|
1036
1036
|
])) : Y("", !0),
|
|
1037
|
-
(z =
|
|
1038
|
-
t("div", Vo, C(e(
|
|
1039
|
-
t("div",
|
|
1037
|
+
(z = s.value) != null && z.remark ? (A(), Q("div", Io, [
|
|
1038
|
+
t("div", Vo, C(e(d)("inventory.transfer.receiveRequest.details.remark")), 1),
|
|
1039
|
+
t("div", Ao, C(s.value.remark), 1)
|
|
1040
1040
|
])) : Y("", !0)
|
|
1041
1041
|
])
|
|
1042
1042
|
];
|
|
@@ -1044,10 +1044,10 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
1044
1044
|
_: 1
|
|
1045
1045
|
})
|
|
1046
1046
|
]),
|
|
1047
|
-
t("div",
|
|
1047
|
+
t("div", Ro, [
|
|
1048
1048
|
t("div", Do, [
|
|
1049
|
-
t("div", Po, C(e(
|
|
1050
|
-
(
|
|
1049
|
+
t("div", Po, C(e(d)("inventory.transfer.receiveRequest.details.requestedItems")), 1),
|
|
1050
|
+
(A(!0), Q(qe, null, Je(((l = s.value) == null ? void 0 : l.items) ?? [], (i) => (A(), Q("div", {
|
|
1051
1051
|
key: i.code,
|
|
1052
1052
|
class: "flex flex-col"
|
|
1053
1053
|
}, [
|
|
@@ -1058,9 +1058,9 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
1058
1058
|
]),
|
|
1059
1059
|
t("div", Eo, [
|
|
1060
1060
|
t("div", qo, C(i.code), 1),
|
|
1061
|
-
i.totalCost && e(p).enableTotalCost ? (
|
|
1061
|
+
i.totalCost && e(p).enableTotalCost ? (A(), Q("div", No, " (" + C(e(_t)(i.totalCost)) + ") ", 1)) : Y("", !0)
|
|
1062
1062
|
]),
|
|
1063
|
-
e(at)(i) ? (
|
|
1063
|
+
e(at)(i) ? (A(), Q("div", zo, [
|
|
1064
1064
|
c(q, {
|
|
1065
1065
|
name: "error",
|
|
1066
1066
|
color: "system-error-300",
|
|
@@ -1079,7 +1079,7 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
1079
1079
|
t("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " This template is only usable for the following locations. ")
|
|
1080
1080
|
], -1)),
|
|
1081
1081
|
t("div", Ho, [
|
|
1082
|
-
c(
|
|
1082
|
+
c(b, {
|
|
1083
1083
|
modelValue: x.value,
|
|
1084
1084
|
"onUpdate:modelValue": f[0] || (f[0] = (i) => x.value = i),
|
|
1085
1085
|
placeholder: "Filter locations",
|
|
@@ -1090,7 +1090,7 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
1090
1090
|
style: { height: "500px" },
|
|
1091
1091
|
"column-defs": u,
|
|
1092
1092
|
"search-value": x.value,
|
|
1093
|
-
"row-data": ((n =
|
|
1093
|
+
"row-data": ((n = m.template) == null ? void 0 : n.locations) ?? [{ name: "All locations" }]
|
|
1094
1094
|
}, null, 8, ["search-value", "row-data"])
|
|
1095
1095
|
])
|
|
1096
1096
|
])
|
|
@@ -1100,8 +1100,8 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
1100
1100
|
"side-sheet-footer": E(() => [
|
|
1101
1101
|
t("div", Qo, [
|
|
1102
1102
|
c(h, {
|
|
1103
|
-
label: e(
|
|
1104
|
-
onClick: f[1] || (f[1] = (
|
|
1103
|
+
label: e(d)("common.edit"),
|
|
1104
|
+
onClick: f[1] || (f[1] = (l) => o("action:edit")),
|
|
1105
1105
|
variant: "tertiary"
|
|
1106
1106
|
}, null, 8, ["label"])
|
|
1107
1107
|
])
|
|
@@ -1110,30 +1110,30 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
1110
1110
|
}, 8, ["header", "modelValue", "dismiss-away"]);
|
|
1111
1111
|
};
|
|
1112
1112
|
}
|
|
1113
|
-
}), Ko = { class: "flex-1 flex flex-col gap-8" }, Wo = { class: "flex flex-col" }, Zo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Jo = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Xo = { class: "fm-typo-en-body-lg-400" }, Yo = { class: "fm-typo-en-body-lg-400 line-clamp-1" }, es = { class: "fm-typo-en-body-lg-400 line-clamp-2" },
|
|
1113
|
+
}), Ko = { class: "flex-1 flex flex-col gap-8" }, Wo = { class: "flex flex-col" }, Zo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Jo = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Xo = { class: "fm-typo-en-body-lg-400" }, Yo = { class: "fm-typo-en-body-lg-400 line-clamp-1" }, es = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, gs = /* @__PURE__ */ Z({
|
|
1114
1114
|
__name: "TransferTemplateView",
|
|
1115
|
-
setup(
|
|
1116
|
-
const { t: _ } = J(), { createTemplate:
|
|
1115
|
+
setup(v) {
|
|
1116
|
+
const { t: _ } = J(), { createTemplate: m, viewTemplate: o, importTemplates: p, exportTemplates: d } = Re(), { templateDialogProps: s, templateDetailsProps: u } = Pe(Re()), x = it(), { loading: T, templates: S } = Pe(x), I = B(!1), g = ot(), f = ze(), { breakpoints: w } = dt();
|
|
1117
1117
|
pe(x.fetchTemplates);
|
|
1118
|
-
const L =
|
|
1118
|
+
const L = R(
|
|
1119
1119
|
() => I.value || T.value || !f._currentLocation
|
|
1120
|
-
), q =
|
|
1120
|
+
), q = R(() => S.value), b = B(""), a = R(() => w.value.xs || w.value.sm), h = R(() => a.value ? 10 : 20);
|
|
1121
1121
|
function r(n) {
|
|
1122
1122
|
switch (n) {
|
|
1123
1123
|
case De.Add:
|
|
1124
|
-
return
|
|
1124
|
+
return m();
|
|
1125
1125
|
case "refresh":
|
|
1126
1126
|
return x.fetchTemplates();
|
|
1127
1127
|
case "import":
|
|
1128
1128
|
return p();
|
|
1129
1129
|
case "export":
|
|
1130
|
-
return
|
|
1130
|
+
return d();
|
|
1131
1131
|
}
|
|
1132
1132
|
}
|
|
1133
1133
|
function y(n) {
|
|
1134
1134
|
return n;
|
|
1135
1135
|
}
|
|
1136
|
-
const
|
|
1136
|
+
const l = R(() => [
|
|
1137
1137
|
{
|
|
1138
1138
|
label: _("inventory.closing.template.create.title"),
|
|
1139
1139
|
value: De.Add,
|
|
@@ -1158,10 +1158,10 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
1158
1158
|
]);
|
|
1159
1159
|
return (n, i) => {
|
|
1160
1160
|
const $ = O("FmTable");
|
|
1161
|
-
return
|
|
1161
|
+
return A(), Q(qe, null, [
|
|
1162
1162
|
c(st, {
|
|
1163
1163
|
title: e(_)("inventory.transfer.template.title2"),
|
|
1164
|
-
actions:
|
|
1164
|
+
actions: l.value,
|
|
1165
1165
|
"onClick:action": r
|
|
1166
1166
|
}, {
|
|
1167
1167
|
default: E(() => {
|
|
@@ -1178,26 +1178,26 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
1178
1178
|
}, [
|
|
1179
1179
|
c(lt, {
|
|
1180
1180
|
searchable: "",
|
|
1181
|
-
search:
|
|
1182
|
-
"onUpdate:search": i[0] || (i[0] = (k) =>
|
|
1181
|
+
search: b.value,
|
|
1182
|
+
"onUpdate:search": i[0] || (i[0] = (k) => b.value = k)
|
|
1183
1183
|
}, null, 8, ["search"]),
|
|
1184
|
-
(
|
|
1184
|
+
(A(), K($, {
|
|
1185
1185
|
style: Xe(e(g).tableHeight),
|
|
1186
1186
|
"column-defs": e(x).columnDefs,
|
|
1187
1187
|
"row-data": q.value,
|
|
1188
|
-
"search-value":
|
|
1188
|
+
"search-value": b.value,
|
|
1189
1189
|
loading: L.value,
|
|
1190
1190
|
key: (V = e(f)._currentLocation) == null ? void 0 : V.dbName,
|
|
1191
|
-
onRowClick: i[1] || (i[1] = (k) => e(
|
|
1191
|
+
onRowClick: i[1] || (i[1] = (k) => e(o)(k.original)),
|
|
1192
1192
|
"page-size": h.value
|
|
1193
1193
|
}, {
|
|
1194
1194
|
"list-row": E((k) => [
|
|
1195
1195
|
c(Ge, {
|
|
1196
1196
|
row: k,
|
|
1197
|
-
onRowClick: (F) => e(
|
|
1197
|
+
onRowClick: (F) => e(o)(F)
|
|
1198
1198
|
}, {
|
|
1199
1199
|
default: E((F) => {
|
|
1200
|
-
var D, z, H, M, U, X, fe, ye, te, ve, be,
|
|
1200
|
+
var D, z, H, M, U, X, fe, ye, te, ve, be, xe, _e, oe, he, ge, Fe, Te, we, ke, se, Me, Se, $e, Ce, le, Oe;
|
|
1201
1201
|
return [
|
|
1202
1202
|
t("div", Ko, [
|
|
1203
1203
|
t("div", Wo, [
|
|
@@ -1215,7 +1215,7 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
1215
1215
|
]),
|
|
1216
1216
|
t("div", Xo, [
|
|
1217
1217
|
c(e(j), {
|
|
1218
|
-
render: (
|
|
1218
|
+
render: (_e = (xe = (be = F.supplier) == null ? void 0 : be.column) == null ? void 0 : xe.columnDef) == null ? void 0 : _e.cell,
|
|
1219
1219
|
props: (he = (oe = F.supplier) == null ? void 0 : oe.getContext) == null ? void 0 : he.call(oe)
|
|
1220
1220
|
}, null, 8, ["render", "props"])
|
|
1221
1221
|
]),
|
|
@@ -1247,9 +1247,9 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
1247
1247
|
}),
|
|
1248
1248
|
_: 1
|
|
1249
1249
|
}, 8, ["title", "actions"]),
|
|
1250
|
-
(
|
|
1250
|
+
(A(), K(Ye, { to: "body" }, [
|
|
1251
1251
|
c(Go, et(tt(e(u))), null, 16),
|
|
1252
|
-
c(yo, Ue(e(
|
|
1252
|
+
c(yo, Ue(e(s), {
|
|
1253
1253
|
onSubmitted: i[2] || (i[2] = (V) => e(x).fetchTemplates())
|
|
1254
1254
|
}), null, 16)
|
|
1255
1255
|
]))
|
|
@@ -1258,5 +1258,5 @@ const Nt = { class: "flex flex-col gap-8 py-16" }, zt = { class: "flex items-cen
|
|
|
1258
1258
|
}
|
|
1259
1259
|
});
|
|
1260
1260
|
export {
|
|
1261
|
-
|
|
1261
|
+
gs as default
|
|
1262
1262
|
};
|