@feedmepos/mf-inventory-portal 1.0.8 → 1.0.9-dev.2
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-DeBNx7kq.js → App-DfxhucPn.js} +50 -49
- package/dist/{ApprovalView-CYgDG4X-.js → ApprovalView-BUYgTb8S.js} +24 -24
- package/dist/{BindingsDialog-Bojdsd9h.js → BindingsDialog-Cbs9aVch.js} +2 -2
- package/dist/{BindingsPicker-TkiARkrC.js → BindingsPicker-BH9bil6g.js} +3 -3
- package/dist/{BindingsTable-BWYaPoFt.js → BindingsTable-DBsS_9yb.js} +1 -1
- package/dist/ClosingDraftView-CcQssDLY.js +1415 -0
- package/dist/{ClosingTemplateView-CUjkAFjw.js → ClosingTemplateView-BHPqi-bL.js} +10 -10
- package/dist/{DeliveryOrderPrintPreview-BOEKl7zP.js → DeliveryOrderPrintPreview-DlTLtZ1f.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Bve5cng3.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CtJSPDCo.js} +32 -32
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-1-G4gmCj.js → FmUnitInput.vue_vue_type_script_setup_true_lang-B-erI7fq.js} +51 -51
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-Bl526zYj.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DT4nyE8i.js} +1 -1
- package/dist/{IngredientGroupView-stli1Xiv.js → IngredientGroupView-DE15kdqH.js} +11 -11
- package/dist/{IngredientsView-jmDSRSkr.js → IngredientsView-BCEznLxB.js} +15 -14
- package/dist/{IntegrationView-BQZtDqlR.js → IntegrationView-COSJuqnB.js} +146 -145
- package/dist/{InventoryBindingForm-hHgB20dI.js → InventoryBindingForm-B3C8gktf.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-BK36mlQE.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-Bn2X1jxB.js} +20 -20
- package/dist/{InventoryBindingSummary-JsAhd0Jm.js → InventoryBindingSummary-BF1OtGum.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-C4A6bDPB.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BMTXHa4I.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-C6bND0mn.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CZR7wF6-.js} +10 -10
- package/dist/{PublishView-BK7WwXeV.js → PublishView-Cp5tpVb0.js} +12 -12
- package/dist/{PurchaseOrderPrintPreview-CMnaZkzc.js → PurchaseOrderPrintPreview-DWOcxCH8.js} +4 -4
- package/dist/{ReceiveRequestView-Bb6RQyJ8.js → ReceiveRequestView-CRuhm8r1.js} +53 -52
- package/dist/{RecipeView-CZnElbJ8.js → RecipeView-BTS1LBKZ.js} +29 -29
- package/dist/{StockView-CDAHrTyi.js → StockView-CuK8s5rt.js} +73 -72
- package/dist/{SupplierView-WTgrwbJ_.js → SupplierView-Bwpe9RoM.js} +12 -11
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-DDAZMTzq.js +1897 -0
- package/dist/{TransferTemplateView-26w6orAY.js → TransferTemplateView-BlluEiV-.js} +291 -290
- package/dist/{UnitView-DAl0OS01.js → UnitView-BWGQHOWP.js} +23 -23
- package/dist/{WarehouseView-Db2wXza_.js → WarehouseView-dOCu22dg.js} +26 -26
- package/dist/api/bill.d.ts +2 -2
- package/dist/api/food-market-hub.d.ts +1 -1
- package/dist/api/inventory.d.ts +44 -44
- package/dist/api/netsuite.d.ts +3 -3
- package/dist/api/purchase-order.d.ts +5 -1
- package/dist/api/stock.d.ts +1 -0
- package/dist/{app-Ch3IXeOL.js → app-BkIAyhP-.js} +16504 -16961
- package/dist/app.d.ts +7 -7
- package/dist/app.js +1 -1
- package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +8 -8
- package/dist/components/shell/inventory/binding-dialog.vue.d.ts +2 -2
- package/dist/components/shell/inventory/binding-ui.vue.d.ts +5 -5
- package/dist/composable/usePromise.d.ts +41 -0
- package/dist/{decimal-BFWsfQmw.js → decimal-BiC7uGww.js} +1 -1
- package/dist/feature-CCDDWpq8.js +17319 -0
- package/dist/{format-unit-display-CyBzA_Ye.js → format-unit-display-CLa0op_h.js} +60 -60
- package/dist/{index-CKB7R0y2.js → index-BbFvsU1Z.js} +7 -6
- package/dist/{index-CSjhH3PC.js → index-UgbyiGok.js} +1 -1
- package/dist/{stock-BjY9UvKO.js → stock-SxO4bxTm.js} +29 -25
- package/dist/stores/feature.d.ts +5 -20
- package/dist/stores/integration/foodmarkethub.d.ts +1 -1
- package/dist/stores/integration/netsuite.d.ts +7 -7
- package/dist/stores/inventory.d.ts +44 -44
- package/dist/stores/location.d.ts +137 -137
- package/dist/{supplier-8x-ZFcOk.js → supplier-BVdCk7nI.js} +4 -4
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-CxZAaSGc.js → use-ingredient-select-dialog-CDeGXhur.js} +1 -1
- package/dist/{use-inventory-binding-dialog-Kmg24YiM.js → use-inventory-binding-dialog-CeRKqMy7.js} +1 -1
- package/dist/views/adjustment-template/wastage-template/actions.d.ts +228 -228
- package/dist/views/adjustment-template/wastage-template/form/WastageTemplateItemTable.vue.d.ts +2 -2
- package/dist/views/adjustment-template/wastage-template/form/useAdjustmentTemplateItems.d.ts +1 -1
- package/dist/views/adjustment-template/wastage-template/table.d.ts +234 -234
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +780 -74
- package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +424 -409
- package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +4 -4
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +252 -252
- package/dist/views/closing-template/composables/use-closing-template-table.d.ts +252 -252
- package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +12 -12
- package/dist/views/ingredients/components/convert/ConvertForm.vue.d.ts +2 -2
- package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +8 -8
- package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +3 -3
- package/dist/views/ingredients/composables/use-ingredient-table.d.ts +4 -4
- package/dist/views/integration/components/ApplyProduct.vue.d.ts +2 -2
- package/dist/views/integration/components/ApplyProductDialog.vue.d.ts +2 -2
- package/dist/views/integration/components/ApplyProductDialogV4.vue.d.ts +2 -2
- package/dist/views/integration/components/netsuite/AddLocationDialog.vue.d.ts +204 -204
- package/dist/views/integration/components/netsuite/LocationConfigurationDialog.vue.d.ts +2 -2
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +665 -637
- package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +22 -22
- package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +44 -44
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +11 -11
- package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +614 -0
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +1190 -1142
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +1192 -1144
- package/dist/views/receive-request/constants/po-action-to-ui-style.d.ts +6 -0
- package/dist/views/recipe/components/recipe-form/RecipeForm.vue.d.ts +2 -2
- package/dist/views/stock/components/StockRecordCard.vue.d.ts +1 -1
- package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +14 -14
- package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItemTable.vue.d.ts +22 -22
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-template-enabled-locations.d.ts +17 -17
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +11 -11
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +805 -805
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +805 -805
- package/dist/views/transfer-template/composables/useTransferTemplateHelper.d.ts +33 -33
- package/dist/{vue-i18n-CXd9SF_G.js → vue-i18n-3Mh8tKq8.js} +341 -341
- package/package.json +3 -1
- package/dist/ClosingDraftView-C0ECZ9zi.js +0 -1394
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-mHNmxBuV.js +0 -1746
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { defineComponent as ee, onMounted as ve, computed as U, ref as Q, watch as be, inject as et, resolveComponent as A, openBlock as R, createElementBlock as j, createElementVNode as s, createVNode as p, withCtx as N, renderSlot as Re, withDirectives as Ae, normalizeClass as
|
|
2
|
-
import {
|
|
3
|
-
import { useI18n as
|
|
4
|
-
import { P as G, a as _t, f as
|
|
5
|
-
import { components as se, useDialog as kt, useSnackbar as Tt, useProxiedModel as
|
|
1
|
+
import { defineComponent as ee, onMounted as ve, computed as U, ref as Q, watch as be, inject as et, resolveComponent as A, openBlock as R, createElementBlock as j, createElementVNode as s, createVNode as p, withCtx as N, renderSlot as Re, withDirectives as Ae, normalizeClass as X, vModelText as Pe, reactive as tt, h as Z, toDisplayString as D, unref as t, createCommentVNode as oe, Fragment as _e, renderList as ze, normalizeStyle as He, createBlock as J, mergeProps as Qe, isRef as je, Teleport as st, normalizeProps as ot, guardReactiveProps as lt } from "vue";
|
|
2
|
+
import { G as Ke, ay as ce, t as Ue, I as nt, az as at, aA as rt, i as Y, aB as it, b as ut, a as Ge, $ as Be, l as fe, P as me, K as ue, A as ye, M as dt, E as W, u as We, ac as mt, V as pt, C as Ye, d as ne, aC as de, a9 as ct, a1 as ft, z as yt, h as Le, _ as vt, B as bt } from "./app-BkIAyhP-.js";
|
|
3
|
+
import { useI18n as le } from "@feedmepos/mf-common";
|
|
4
|
+
import { P as G, a as _t, f as ht, t as xt, b as qe, u as gt } from "./format-unit-display-CLa0op_h.js";
|
|
5
|
+
import { components as se, useDialog as kt, useSnackbar as Tt, useProxiedModel as Ze, useBreakpoints as wt } from "@feedmepos/ui-library";
|
|
6
6
|
import { defineStore as Ft, storeToRefs as Ee } from "pinia";
|
|
7
|
-
import { _ as It, b as St, F as Ct, a as $t } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-
|
|
8
|
-
import {
|
|
9
|
-
import { u as Vt } from "./
|
|
10
|
-
import { u as
|
|
11
|
-
|
|
7
|
+
import { _ as It, b as St, F as Ct, a as $t } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-B-erI7fq.js";
|
|
8
|
+
import { u as pe } from "./feature-CCDDWpq8.js";
|
|
9
|
+
import { c as Ot, u as Mt, _ as Vt } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CtJSPDCo.js";
|
|
10
|
+
import { u as Dt } from "./supplier-BVdCk7nI.js";
|
|
11
|
+
import { u as Rt } from "./use-ingredient-select-dialog-CDeGXhur.js";
|
|
12
|
+
const At = { class: "flex flex-col" }, Pt = { class: "flex flex-col" }, Ut = { class: "flex-1" }, Bt = { class: "flex items-center" }, Lt = { class: "flex-1" }, qt = { class: "flex-1" }, Et = /* @__PURE__ */ ee({
|
|
12
13
|
__name: "FmMinMaxInput",
|
|
13
14
|
props: {
|
|
14
15
|
rules: {},
|
|
@@ -46,7 +47,7 @@ const At = { class: "flex flex-col" }, Pt = { class: "flex flex-col" }, Ut = { c
|
|
|
46
47
|
helperState: {}
|
|
47
48
|
},
|
|
48
49
|
setup(m) {
|
|
49
|
-
const c = m, v =
|
|
50
|
+
const c = m, v = Ke("modelValue"), e = nt();
|
|
50
51
|
ve(() => {
|
|
51
52
|
const { min: y, max: d } = v ?? {};
|
|
52
53
|
if (!(!y || !d) && y.precision !== d.precision) {
|
|
@@ -54,19 +55,19 @@ const At = { class: "flex flex-col" }, Pt = { class: "flex flex-col" }, Ut = { c
|
|
|
54
55
|
v.min = a, v.max = f;
|
|
55
56
|
}
|
|
56
57
|
});
|
|
57
|
-
const
|
|
58
|
+
const n = U(() => {
|
|
58
59
|
const { min: y, max: d } = v ?? {};
|
|
59
60
|
return Math.max((y == null ? void 0 : y.precision) ?? 0, (d == null ? void 0 : d.precision) ?? 0, c.precision ?? 0);
|
|
60
61
|
}), g = (y) => {
|
|
61
62
|
if (!y) return "";
|
|
62
|
-
const d = at(y), k =
|
|
63
|
+
const d = at(y), k = n.value, a = ce(d, k);
|
|
63
64
|
return rt(
|
|
64
|
-
+
|
|
65
|
+
+Y(a),
|
|
65
66
|
a.precision
|
|
66
67
|
);
|
|
67
68
|
}, b = Q(g(v.min)), i = Q(g(v.max));
|
|
68
69
|
be([b, i], ([y, d]) => {
|
|
69
|
-
const k = v ?? {}, a = e(y), f = e(d), C =
|
|
70
|
+
const k = v ?? {}, a = e(y), f = e(d), C = n.value;
|
|
70
71
|
if (y !== "" && a === !0) {
|
|
71
72
|
const $ = Ue(+y, C);
|
|
72
73
|
k.min = $;
|
|
@@ -79,12 +80,12 @@ const At = { class: "flex flex-col" }, Pt = { class: "flex flex-col" }, Ut = { c
|
|
|
79
80
|
k.max = null;
|
|
80
81
|
v.min = k.min, v.max = k.max;
|
|
81
82
|
});
|
|
82
|
-
const o = Symbol.for("fm:form-state"), u = et(o, null), _ = U(() => c.disabled ?? (u == null ? void 0 : u.getDisabled()) ?? !1), P = Q(), I = Q(),
|
|
83
|
+
const o = Symbol.for("fm:form-state"), u = et(o, null), _ = U(() => c.disabled ?? (u == null ? void 0 : u.getDisabled()) ?? !1), P = Q(), I = Q(), h = Q(!1), S = Q(!1), V = U(() => h.value || S.value), K = U(() => [...[
|
|
83
84
|
function() {
|
|
84
85
|
return typeof e(b.value) == "string" || typeof e(i.value) == "string" ? "Must be a number" : !0;
|
|
85
86
|
},
|
|
86
87
|
function(k) {
|
|
87
|
-
return !k || !k.min || !k.max ? !0 : +
|
|
88
|
+
return !k || !k.min || !k.max ? !0 : +Y(k.min) > +Y(k.max) ? "Min must be less than or equal to max" : !0;
|
|
88
89
|
}
|
|
89
90
|
], ...c.rules ?? []]);
|
|
90
91
|
return (y, d) => {
|
|
@@ -99,20 +100,20 @@ const At = { class: "flex flex-col" }, Pt = { class: "flex flex-col" }, Ut = { c
|
|
|
99
100
|
optional: y.labelMark === "optional"
|
|
100
101
|
}, null, 8, ["label", "disabled", "required", "optional"])
|
|
101
102
|
]),
|
|
102
|
-
p(a, { focused:
|
|
103
|
+
p(a, { focused: V.value }, {
|
|
103
104
|
default: N(() => [
|
|
104
|
-
s("div",
|
|
105
|
+
s("div", Bt, [
|
|
105
106
|
Re(y.$slots, "prepend"),
|
|
106
107
|
d[6] || (d[6] = s("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400 pr-4" }, "Min.", -1)),
|
|
107
|
-
s("div",
|
|
108
|
+
s("div", Lt, [
|
|
108
109
|
Ae(s("input", {
|
|
109
110
|
type: "text",
|
|
110
111
|
ref_key: "minInputRef",
|
|
111
112
|
ref: P,
|
|
112
|
-
onFocus: d[0] || (d[0] = () =>
|
|
113
|
-
onBlur: d[1] || (d[1] = () =>
|
|
113
|
+
onFocus: d[0] || (d[0] = () => h.value = !0),
|
|
114
|
+
onBlur: d[1] || (d[1] = () => h.value = !1),
|
|
114
115
|
"onUpdate:modelValue": d[2] || (d[2] = (C) => b.value = C),
|
|
115
|
-
class:
|
|
116
|
+
class: X({
|
|
116
117
|
"fm-text-field--input fm-typo-en-body-lg-400": !0,
|
|
117
118
|
"text-fm-color-typo-primary": !_.value,
|
|
118
119
|
"text-fm-color-typo-disabled": _.value
|
|
@@ -131,7 +132,7 @@ const At = { class: "flex flex-col" }, Pt = { class: "flex flex-col" }, Ut = { c
|
|
|
131
132
|
onFocus: d[3] || (d[3] = () => S.value = !0),
|
|
132
133
|
onBlur: d[4] || (d[4] = () => S.value = !1),
|
|
133
134
|
"onUpdate:modelValue": d[5] || (d[5] = (C) => i.value = C),
|
|
134
|
-
class:
|
|
135
|
+
class: X({
|
|
135
136
|
"fm-text-field--input fm-typo-en-body-lg-400": !0,
|
|
136
137
|
"text-fm-color-typo-primary": !_.value,
|
|
137
138
|
"text-fm-color-typo-disabled": _.value
|
|
@@ -150,7 +151,7 @@ const At = { class: "flex flex-col" }, Pt = { class: "flex flex-col" }, Ut = { c
|
|
|
150
151
|
class: "flex-1",
|
|
151
152
|
"model-value": y.modelValue,
|
|
152
153
|
info: y.labelInfo,
|
|
153
|
-
rules:
|
|
154
|
+
rules: K.value,
|
|
154
155
|
"helper-text": y.helperText,
|
|
155
156
|
"helper-state": y.helperState
|
|
156
157
|
}, null, 8, ["model-value", "info", "rules", "helper-text", "helper-state"])
|
|
@@ -165,33 +166,33 @@ function Nt({ min: m, max: c } = { min: !0, max: !0 }) {
|
|
|
165
166
|
}
|
|
166
167
|
function zt(m, c) {
|
|
167
168
|
return function(e) {
|
|
168
|
-
return !e || !e.min || !e.max ? !0 : +
|
|
169
|
+
return !e || !e.min || !e.max ? !0 : +Y(e.min) < m ? `Must be between ${m} and ${c}` : +Y(e.max) > c ? `Must be between ${m} and ${c}` : !0;
|
|
169
170
|
};
|
|
170
171
|
}
|
|
171
172
|
function Ht(m) {
|
|
172
|
-
const c = it(m), v =
|
|
173
|
-
return function(
|
|
174
|
-
const g = !(
|
|
173
|
+
const c = it(m), v = Y(m);
|
|
174
|
+
return function(n) {
|
|
175
|
+
const g = !(n != null && n.min) || c(n.min) === !0, b = !(n != null && n.max) || c(n.max) === !0;
|
|
175
176
|
return !g && !b ? `Min & max must be a multiple of ${v}` : g ? b ? !0 : `Max must be a multiple of ${v}` : `Min must be a multiple of ${v}`;
|
|
176
177
|
};
|
|
177
178
|
}
|
|
178
|
-
const
|
|
179
|
+
const Je = Ft("transfer-template-helper", () => {
|
|
179
180
|
const m = ut();
|
|
180
|
-
function c(v, e,
|
|
181
|
+
function c(v, e, n, g, b) {
|
|
181
182
|
var o;
|
|
182
|
-
if (!
|
|
183
|
+
if (!n) {
|
|
183
184
|
b == null || b("Unit is not valid");
|
|
184
185
|
return;
|
|
185
186
|
}
|
|
186
187
|
let i = v.code;
|
|
187
188
|
if (m.isEnabled) {
|
|
188
|
-
const u = m.getItemPKTCode(e, (o =
|
|
189
|
+
const u = m.getItemPKTCode(e, (o = n.measurement) == null ? void 0 : o.id);
|
|
189
190
|
u && (i = u);
|
|
190
191
|
}
|
|
191
192
|
g({
|
|
192
193
|
...v,
|
|
193
|
-
quantity:
|
|
194
|
-
measurement:
|
|
194
|
+
quantity: n.amount,
|
|
195
|
+
measurement: n.measurement ?? null,
|
|
195
196
|
code: i
|
|
196
197
|
});
|
|
197
198
|
}
|
|
@@ -200,17 +201,17 @@ const Xe = Ft("transfer-template-helper", () => {
|
|
|
200
201
|
};
|
|
201
202
|
});
|
|
202
203
|
var H = /* @__PURE__ */ ((m) => (m.Code = "Code", m.Name = "Name", m.DefaultAmount = "DefaultAmount", m.Limit = "Limit", m.Step = "Step", m.Cost = "Cost", m.Delete = "Delete", m))(H || {});
|
|
203
|
-
const Ne =
|
|
204
|
+
const Ne = Je();
|
|
204
205
|
function Qt(m) {
|
|
205
|
-
const { t: c } =
|
|
206
|
+
const { t: c } = le(), v = Ge(), e = pe(), n = tt({});
|
|
206
207
|
ve(() => {
|
|
207
208
|
for (const i of m.items) {
|
|
208
209
|
if (!i.totalCost)
|
|
209
210
|
continue;
|
|
210
211
|
const o = Ot(i.sku, i.quantity, i.measurement, {
|
|
211
212
|
supplier: m.supplier
|
|
212
|
-
}), u = i.totalCost ??
|
|
213
|
-
o ?
|
|
213
|
+
}), u = i.totalCost ?? Be.reset();
|
|
214
|
+
o ? n[i.sku._id] = o.amount !== u.amount || o.precision !== u.precision : n[i.sku._id] = !0;
|
|
214
215
|
}
|
|
215
216
|
});
|
|
216
217
|
const g = [
|
|
@@ -221,7 +222,7 @@ function Qt(m) {
|
|
|
221
222
|
size: 180,
|
|
222
223
|
cell(i) {
|
|
223
224
|
const o = i.row.original;
|
|
224
|
-
return
|
|
225
|
+
return Z(se.FmTextField, {
|
|
225
226
|
modelValue: o.code,
|
|
226
227
|
"onUpdate:modelValue": (u) => {
|
|
227
228
|
m.updateItem({
|
|
@@ -242,7 +243,7 @@ function Qt(m) {
|
|
|
242
243
|
minSize: 300,
|
|
243
244
|
cell(i) {
|
|
244
245
|
const o = i.row.original;
|
|
245
|
-
return
|
|
246
|
+
return Z(se.FmTextField, {
|
|
246
247
|
modelValue: o.name,
|
|
247
248
|
"onUpdate:modelValue": (u) => {
|
|
248
249
|
m.updateItem({
|
|
@@ -262,12 +263,12 @@ function Qt(m) {
|
|
|
262
263
|
header: () => c("inventory.transfer.form.items.table.DefaultAmount"),
|
|
263
264
|
minSize: 200,
|
|
264
265
|
cell(i) {
|
|
265
|
-
var
|
|
266
|
-
const o = i.row.original, u = v.skuById[o.sku._id], _ = v.unitById[(
|
|
267
|
-
var
|
|
268
|
-
return ((
|
|
266
|
+
var h;
|
|
267
|
+
const o = i.row.original, u = v.skuById[o.sku._id], _ = v.unitById[(h = u.unit) == null ? void 0 : h._id], P = _.measurements.find((S) => {
|
|
268
|
+
var V;
|
|
269
|
+
return ((V = o.measurement) == null ? void 0 : V.id) === S.id;
|
|
269
270
|
}), I = o.sku.unit._id !== u.unit._id || !_ || o.measurement && !P;
|
|
270
|
-
return
|
|
271
|
+
return Z(It, {
|
|
271
272
|
style: {
|
|
272
273
|
flex: "1 1 0%"
|
|
273
274
|
},
|
|
@@ -284,22 +285,22 @@ function Qt(m) {
|
|
|
284
285
|
o,
|
|
285
286
|
u,
|
|
286
287
|
S,
|
|
287
|
-
(
|
|
288
|
+
(V) => {
|
|
288
289
|
m.updateItem({
|
|
289
290
|
...o,
|
|
290
|
-
code:
|
|
291
|
+
code: V.code,
|
|
291
292
|
sku: u,
|
|
292
|
-
quantity:
|
|
293
|
-
measurement:
|
|
293
|
+
quantity: V.quantity,
|
|
294
|
+
measurement: V.measurement
|
|
294
295
|
});
|
|
295
296
|
}
|
|
296
297
|
);
|
|
297
298
|
},
|
|
298
299
|
rules: [
|
|
299
300
|
St(o.quantityStep),
|
|
300
|
-
...+
|
|
301
|
+
...+Y(o.quantity) ? [
|
|
301
302
|
Ct(
|
|
302
|
-
+
|
|
303
|
+
+Y(
|
|
303
304
|
o.minimumQuantity ?? {
|
|
304
305
|
amount: 1,
|
|
305
306
|
// NOTE: leave this reading from row.sku.unit and row.measurement instead,
|
|
@@ -309,9 +310,9 @@ function Qt(m) {
|
|
|
309
310
|
)
|
|
310
311
|
] : [],
|
|
311
312
|
$t(
|
|
312
|
-
o.maximumQuantity ? +
|
|
313
|
+
o.maximumQuantity ? +Y(o.maximumQuantity) : 1 / 0
|
|
313
314
|
),
|
|
314
|
-
function(
|
|
315
|
+
function(V) {
|
|
315
316
|
return I ? "This item is no longer valid due to change in unit. Please reapply unit." : !0;
|
|
316
317
|
}
|
|
317
318
|
],
|
|
@@ -327,7 +328,7 @@ function Qt(m) {
|
|
|
327
328
|
minSize: 280,
|
|
328
329
|
cell(i) {
|
|
329
330
|
const o = i.row.original;
|
|
330
|
-
return
|
|
331
|
+
return Z(Et, {
|
|
331
332
|
style: {
|
|
332
333
|
flex: "1 1 0%"
|
|
333
334
|
},
|
|
@@ -346,7 +347,7 @@ function Qt(m) {
|
|
|
346
347
|
Nt({ max: !1 }),
|
|
347
348
|
Ht(o.quantityStep),
|
|
348
349
|
zt(
|
|
349
|
-
+
|
|
350
|
+
+Y({
|
|
350
351
|
amount: 0,
|
|
351
352
|
precision: me(o.sku.unit, o.measurement)
|
|
352
353
|
}),
|
|
@@ -364,8 +365,8 @@ function Qt(m) {
|
|
|
364
365
|
minSize: 100,
|
|
365
366
|
cell(i) {
|
|
366
367
|
const o = i.row.original;
|
|
367
|
-
return
|
|
368
|
-
modelValue:
|
|
368
|
+
return Z(se.FmTextField, {
|
|
369
|
+
modelValue: Y(o.quantityStep ?? Be.reset(), !1),
|
|
369
370
|
key: o.sku._id,
|
|
370
371
|
"onUpdate:modelValue": (u) => {
|
|
371
372
|
m.updateItem({
|
|
@@ -389,8 +390,8 @@ function Qt(m) {
|
|
|
389
390
|
header: "",
|
|
390
391
|
cell(i) {
|
|
391
392
|
const o = i.row.original;
|
|
392
|
-
return
|
|
393
|
-
e.usePurchaseOrderV2 ?
|
|
393
|
+
return Z("div", { class: "flex items-center" }, [
|
|
394
|
+
e.usePurchaseOrderV2 ? Z(
|
|
394
395
|
se.FmTooltip,
|
|
395
396
|
{
|
|
396
397
|
zIndex: 50,
|
|
@@ -398,7 +399,7 @@ function Qt(m) {
|
|
|
398
399
|
},
|
|
399
400
|
{
|
|
400
401
|
default() {
|
|
401
|
-
return
|
|
402
|
+
return Z(se.FmButton, {
|
|
402
403
|
key: o.sku._id,
|
|
403
404
|
type: "button",
|
|
404
405
|
icon: "add_circle",
|
|
@@ -434,7 +435,7 @@ function Qt(m) {
|
|
|
434
435
|
}
|
|
435
436
|
}
|
|
436
437
|
) : null,
|
|
437
|
-
|
|
438
|
+
Z(se.FmButton, {
|
|
438
439
|
class: "delete-button",
|
|
439
440
|
key: o.sku._id,
|
|
440
441
|
type: "button",
|
|
@@ -460,56 +461,56 @@ function Qt(m) {
|
|
|
460
461
|
columnDefs: U(() => pe().enableTotalCost && m.transferType === G.PURCHASE ? g : g.filter((o) => o.id !== "Cost"))
|
|
461
462
|
};
|
|
462
463
|
}
|
|
463
|
-
const jt = { class: "flex flex-col gap-8 py-16" },
|
|
464
|
+
const jt = { class: "flex flex-col gap-8 py-16" }, Kt = { class: "flex items-center" }, Gt = { class: "flex-1 flex gap-1 items-center" }, Wt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Yt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, 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" }, es = {
|
|
464
465
|
key: 0,
|
|
465
466
|
class: "flex gap-8 w-full"
|
|
466
|
-
}, ts = { class: "flex-1 flex flex-col gap-4" }, ss = { class: "flex-1 flex flex-col gap-4" }, os = { class: "flex gap-8 w-full" },
|
|
467
|
+
}, ts = { class: "flex-1 flex flex-col gap-4" }, ss = { class: "flex-1 flex flex-col gap-4" }, os = { class: "flex gap-8 w-full" }, ls = { class: "flex-1 flex flex-col gap-4" }, ns = /* @__PURE__ */ ee({
|
|
467
468
|
__name: "TransferTemplateItem",
|
|
468
469
|
props: {
|
|
469
470
|
cellByColId: {},
|
|
470
471
|
row: {}
|
|
471
472
|
},
|
|
472
473
|
setup(m) {
|
|
473
|
-
const { t: c } =
|
|
474
|
+
const { t: c } = le();
|
|
474
475
|
function v(e) {
|
|
475
476
|
return e;
|
|
476
477
|
}
|
|
477
|
-
return (e,
|
|
478
|
-
var b, i, o, u, _, P, I,
|
|
478
|
+
return (e, n) => {
|
|
479
|
+
var b, i, o, u, _, P, I, h, S, V, K, y, d, k, a, f, C, $, x, l, r, T, F, B, z, O, M, L, q, w;
|
|
479
480
|
const g = A("FmLabel");
|
|
480
481
|
return R(), j("div", jt, [
|
|
481
|
-
s("div",
|
|
482
|
+
s("div", Kt, [
|
|
482
483
|
s("div", Gt, [
|
|
483
|
-
s("span",
|
|
484
|
-
s("span",
|
|
484
|
+
s("span", Wt, " (" + D(e.row.original.sku.code) + ") ", 1),
|
|
485
|
+
s("span", Yt, D(e.row.original.sku.name), 1)
|
|
485
486
|
]),
|
|
486
487
|
s("div", null, [
|
|
487
|
-
p(t(
|
|
488
|
+
p(t(W), {
|
|
488
489
|
render: (o = (i = (b = e.cellByColId.Delete) == null ? void 0 : b.column) == null ? void 0 : i.columnDef) == null ? void 0 : o.cell,
|
|
489
490
|
props: (_ = (u = e.cellByColId.Delete) == null ? void 0 : u.getContext) == null ? void 0 : _.call(u)
|
|
490
491
|
}, null, 8, ["render", "props"])
|
|
491
492
|
])
|
|
492
493
|
]),
|
|
493
|
-
s("div",
|
|
494
|
-
s("div",
|
|
494
|
+
s("div", Zt, [
|
|
495
|
+
s("div", Jt, [
|
|
495
496
|
p(g, {
|
|
496
497
|
label: t(c)(`inventory.transfer.form.items.table.${t(H).Code}`)
|
|
497
498
|
}, null, 8, ["label"]),
|
|
498
|
-
p(t(
|
|
499
|
-
render: (
|
|
500
|
-
props: (
|
|
499
|
+
p(t(W), {
|
|
500
|
+
render: (h = (I = (P = e.cellByColId[t(H).Code]) == null ? void 0 : P.column) == null ? void 0 : I.columnDef) == null ? void 0 : h.cell,
|
|
501
|
+
props: (V = (S = e.cellByColId[t(H).Code]) == null ? void 0 : S.getContext) == null ? void 0 : V.call(S)
|
|
501
502
|
}, null, 8, ["render", "props"]),
|
|
502
|
-
|
|
503
|
+
n[0] || (n[0] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
503
504
|
]),
|
|
504
|
-
s("div",
|
|
505
|
+
s("div", Xt, [
|
|
505
506
|
p(g, {
|
|
506
507
|
label: t(c)(`inventory.transfer.form.items.table.${t(H).Name}`)
|
|
507
508
|
}, null, 8, ["label"]),
|
|
508
|
-
p(t(
|
|
509
|
-
render: (d = (y = (
|
|
509
|
+
p(t(W), {
|
|
510
|
+
render: (d = (y = (K = e.cellByColId[t(H).Name]) == null ? void 0 : K.column) == null ? void 0 : y.columnDef) == null ? void 0 : d.cell,
|
|
510
511
|
props: (a = (k = e.cellByColId[t(H).Name]) == null ? void 0 : k.getContext) == null ? void 0 : a.call(k)
|
|
511
512
|
}, null, 8, ["render", "props"]),
|
|
512
|
-
|
|
513
|
+
n[1] || (n[1] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
513
514
|
])
|
|
514
515
|
]),
|
|
515
516
|
e.row.original ? (R(), j("div", es, [
|
|
@@ -517,33 +518,33 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
517
518
|
p(g, {
|
|
518
519
|
label: t(c)(`inventory.transfer.form.items.table.${t(H).DefaultAmount}`)
|
|
519
520
|
}, null, 8, ["label"]),
|
|
520
|
-
p(t(
|
|
521
|
+
p(t(W), {
|
|
521
522
|
render: ($ = (C = (f = e.cellByColId[t(H).DefaultAmount]) == null ? void 0 : f.column) == null ? void 0 : C.columnDef) == null ? void 0 : $.cell,
|
|
522
|
-
props: (
|
|
523
|
+
props: (l = (x = e.cellByColId[t(H).DefaultAmount]) == null ? void 0 : x.getContext) == null ? void 0 : l.call(x)
|
|
523
524
|
}, null, 8, ["render", "props"]),
|
|
524
|
-
|
|
525
|
+
n[2] || (n[2] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
525
526
|
]),
|
|
526
527
|
s("div", ss, [
|
|
527
528
|
p(g, {
|
|
528
529
|
label: t(c)(`inventory.transfer.form.items.table.${t(H).Step}`)
|
|
529
530
|
}, null, 8, ["label"]),
|
|
530
|
-
p(t(
|
|
531
|
+
p(t(W), {
|
|
531
532
|
render: (F = (T = (r = e.cellByColId[t(H).Step]) == null ? void 0 : r.column) == null ? void 0 : T.columnDef) == null ? void 0 : F.cell,
|
|
532
|
-
props: (z = (
|
|
533
|
+
props: (z = (B = e.cellByColId[t(H).Step]) == null ? void 0 : B.getContext) == null ? void 0 : z.call(B)
|
|
533
534
|
}, null, 8, ["render", "props"]),
|
|
534
|
-
|
|
535
|
+
n[3] || (n[3] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
535
536
|
])
|
|
536
537
|
])) : oe("", !0),
|
|
537
538
|
s("div", os, [
|
|
538
|
-
s("div",
|
|
539
|
+
s("div", ls, [
|
|
539
540
|
p(g, {
|
|
540
541
|
label: t(c)(`inventory.transfer.form.items.table.${t(H).Limit}`)
|
|
541
542
|
}, null, 8, ["label"]),
|
|
542
|
-
p(t(
|
|
543
|
-
render: (
|
|
543
|
+
p(t(W), {
|
|
544
|
+
render: (L = (M = (O = e.cellByColId[t(H).Limit]) == null ? void 0 : O.column) == null ? void 0 : M.columnDef) == null ? void 0 : L.cell,
|
|
544
545
|
props: (w = (q = e.cellByColId[t(H).Limit]) == null ? void 0 : q.getContext) == null ? void 0 : w.call(q)
|
|
545
546
|
}, null, 8, ["render", "props"]),
|
|
546
|
-
|
|
547
|
+
n[4] || (n[4] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
547
548
|
])
|
|
548
549
|
])
|
|
549
550
|
]);
|
|
@@ -561,21 +562,21 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
561
562
|
return v.column.columnDef.meta;
|
|
562
563
|
}
|
|
563
564
|
return (v, e) => (R(), j("tr", as, [
|
|
564
|
-
(R(!0), j(_e, null, ze(v.row.getVisibleCells(), (
|
|
565
|
+
(R(!0), j(_e, null, ze(v.row.getVisibleCells(), (n) => {
|
|
565
566
|
var g, b, i, o, u;
|
|
566
567
|
return R(), j("td", {
|
|
567
|
-
key:
|
|
568
|
-
class:
|
|
568
|
+
key: n.id,
|
|
569
|
+
class: X(["text-fm-color-typo-primary", ((g = c(n)) == null ? void 0 : g.cellClass) ?? "px-16"]),
|
|
569
570
|
style: He({
|
|
570
|
-
width: (b = c(
|
|
571
|
-
maxWidth: (o = c(
|
|
572
|
-
textAlign: ((u = c(
|
|
571
|
+
width: (b = c(n)) != null && b.width ? (i = c(n)) == null ? void 0 : i.width : n.column.getSize() !== 0 ? `${n.column.getSize()}px` : void 0,
|
|
572
|
+
maxWidth: (o = c(n)) == null ? void 0 : o.maxWidth,
|
|
573
|
+
textAlign: ((u = c(n)) == null ? void 0 : u.textAlign) ?? "left"
|
|
573
574
|
})
|
|
574
575
|
}, [
|
|
575
576
|
s("span", rs, [
|
|
576
|
-
p(t(
|
|
577
|
-
props:
|
|
578
|
-
render:
|
|
577
|
+
p(t(W), {
|
|
578
|
+
props: n.getContext(),
|
|
579
|
+
render: n.column.columnDef.cell
|
|
579
580
|
}, null, 8, ["props", "render"])
|
|
580
581
|
])
|
|
581
582
|
], 6);
|
|
@@ -589,99 +590,99 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
589
590
|
disabled: { type: Boolean }
|
|
590
591
|
},
|
|
591
592
|
setup(m, { expose: c }) {
|
|
592
|
-
const v = m, e =
|
|
593
|
+
const v = m, e = Ke(), { t: n } = le(), g = We(), b = Ge(), i = Dt(), o = pe(), u = Je();
|
|
593
594
|
be(
|
|
594
595
|
() => v.modelValue,
|
|
595
|
-
(
|
|
596
|
-
console.log("TransferTemplateForm.model",
|
|
596
|
+
(l) => {
|
|
597
|
+
console.log("TransferTemplateForm.model", l);
|
|
597
598
|
}
|
|
598
599
|
), g.watchLocation(async () => {
|
|
599
|
-
location && (e.purchaseOrder.supplier || (e.purchaseOrder.supplier = i.suppliers.find((
|
|
600
|
+
location && (e.purchaseOrder.supplier || (e.purchaseOrder.supplier = i.suppliers.find((l) => l) ?? e.purchaseOrder.supplier));
|
|
600
601
|
}), kt();
|
|
601
602
|
const _ = Mt(
|
|
602
603
|
() => e.purchaseOrder,
|
|
603
|
-
(
|
|
604
|
+
(l) => {
|
|
604
605
|
e.purchaseOrder = {
|
|
605
606
|
...e.purchaseOrder,
|
|
606
|
-
supplier:
|
|
607
|
+
supplier: l.supplier ?? (e == null ? void 0 : e.purchaseOrder.supplier)
|
|
607
608
|
};
|
|
608
609
|
}
|
|
609
610
|
), P = U({
|
|
610
611
|
get() {
|
|
611
|
-
var
|
|
612
|
-
return typeof ((r = (
|
|
612
|
+
var l, r;
|
|
613
|
+
return typeof ((r = (l = e.purchaseOrder) == null ? void 0 : l.supplier) == null ? void 0 : r.internal) == "string" ? G.TRANSFER : G.PURCHASE;
|
|
613
614
|
},
|
|
614
|
-
set(
|
|
615
|
+
set(l) {
|
|
615
616
|
var T, F;
|
|
616
617
|
const r = typeof ((F = (T = e.purchaseOrder) == null ? void 0 : T.supplier) == null ? void 0 : F.internal) == "string" ? G.TRANSFER : G.PURCHASE;
|
|
617
|
-
|
|
618
|
+
l !== r && (e.purchaseOrder.supplier = l === G.PURCHASE ? _.locationOptionsTypePurchase.value[0] : _.locationOptionsTypeTransfer.value[0]);
|
|
618
619
|
}
|
|
619
|
-
}), I = U(() => _.transferLocationOptions.value),
|
|
620
|
+
}), I = U(() => _.transferLocationOptions.value), h = U({
|
|
620
621
|
get() {
|
|
621
|
-
var
|
|
622
|
-
return (
|
|
622
|
+
var l;
|
|
623
|
+
return (l = e.purchaseOrder.supplier) == null ? void 0 : l._id;
|
|
623
624
|
},
|
|
624
|
-
set(
|
|
625
|
-
_.transferLocationModel.value =
|
|
625
|
+
set(l) {
|
|
626
|
+
_.transferLocationModel.value = l;
|
|
626
627
|
}
|
|
627
628
|
}), {
|
|
628
629
|
promptSelectLocations: S,
|
|
629
|
-
columnDefs:
|
|
630
|
-
rowData:
|
|
630
|
+
columnDefs: V,
|
|
631
|
+
rowData: K
|
|
631
632
|
} = mt({
|
|
632
633
|
getLocations() {
|
|
633
634
|
return e.locations;
|
|
634
635
|
},
|
|
635
|
-
setLocations(
|
|
636
|
-
e.locations =
|
|
636
|
+
setLocations(l) {
|
|
637
|
+
e.locations = l;
|
|
637
638
|
}
|
|
638
639
|
});
|
|
639
640
|
function y() {
|
|
640
|
-
var
|
|
641
|
-
return (
|
|
642
|
-
var F,
|
|
643
|
-
return ((F = T.doc) == null ? void 0 : F._id) === ((
|
|
641
|
+
var l, r;
|
|
642
|
+
return (l = e.locations) != null && l.find((T) => {
|
|
643
|
+
var F, B;
|
|
644
|
+
return ((F = T.doc) == null ? void 0 : F._id) === ((B = e.purchaseOrder.supplier) == null ? void 0 : B._id);
|
|
644
645
|
}) ? `Location ${(r = e.purchaseOrder.supplier) == null ? void 0 : r.name} must be removed because template cannot be used to transfer to itself.` : !0;
|
|
645
646
|
}
|
|
646
647
|
const d = U({
|
|
647
648
|
get() {
|
|
648
649
|
return e.purchaseOrder.remark ?? void 0;
|
|
649
650
|
},
|
|
650
|
-
set(
|
|
651
|
-
e.purchaseOrder.remark =
|
|
651
|
+
set(l) {
|
|
652
|
+
e.purchaseOrder.remark = l;
|
|
652
653
|
}
|
|
653
654
|
}), k = Q();
|
|
654
655
|
c({
|
|
655
656
|
validateInputs: () => {
|
|
656
|
-
var
|
|
657
|
-
(r = (
|
|
657
|
+
var l, r;
|
|
658
|
+
(r = (l = k.value) == null ? void 0 : l.validateInputs) == null || r.call(l);
|
|
658
659
|
},
|
|
659
660
|
resetInputsValidation: () => {
|
|
660
|
-
var
|
|
661
|
-
(r = (
|
|
661
|
+
var l, r;
|
|
662
|
+
(r = (l = k.value) == null ? void 0 : l.resetInputsValidation) == null || r.call(l);
|
|
662
663
|
},
|
|
663
664
|
resetInputs: () => {
|
|
664
|
-
var
|
|
665
|
-
(r = (
|
|
665
|
+
var l, r;
|
|
666
|
+
(r = (l = k.value) == null ? void 0 : l.resetInputs) == null || r.call(l);
|
|
666
667
|
}
|
|
667
668
|
});
|
|
668
669
|
const a = U(() => ({
|
|
669
|
-
duplicateItem: (
|
|
670
|
+
duplicateItem: (l) => {
|
|
670
671
|
e.purchaseOrder.items = [
|
|
671
672
|
...e.purchaseOrder.items,
|
|
672
673
|
{
|
|
673
|
-
...
|
|
674
|
+
...l
|
|
674
675
|
}
|
|
675
676
|
];
|
|
676
677
|
},
|
|
677
|
-
updateItem: (
|
|
678
|
+
updateItem: (l) => {
|
|
678
679
|
let r = [];
|
|
679
|
-
|
|
680
|
+
l.id ? r = e.purchaseOrder.items.map((T) => T.id !== l.id ? T : l) : r = e.purchaseOrder.items.map((T) => T.sku._id !== l.sku._id ? T : l), e.purchaseOrder.items = r;
|
|
680
681
|
},
|
|
681
|
-
deleteItem: (
|
|
682
|
-
console.log(
|
|
682
|
+
deleteItem: (l) => {
|
|
683
|
+
console.log(l.id);
|
|
683
684
|
let r = [];
|
|
684
|
-
|
|
685
|
+
l.id ? r = e.purchaseOrder.items.filter((T) => T.id !== l.id) : r = e.purchaseOrder.items.filter((T) => T.sku._id !== l.sku._id), e.purchaseOrder.items = r;
|
|
685
686
|
}
|
|
686
687
|
})), f = Qt({
|
|
687
688
|
duplicateItem: a.value.duplicateItem,
|
|
@@ -700,20 +701,20 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
700
701
|
return v.disabled;
|
|
701
702
|
}
|
|
702
703
|
}), C = U(() => f.columnDefs.value), { promptSelectIngredients: $ } = Rt();
|
|
703
|
-
async function
|
|
704
|
+
async function x() {
|
|
704
705
|
const r = b.skus.map((O) => ({
|
|
705
706
|
label: O.name,
|
|
706
707
|
sublabel: O.code,
|
|
707
708
|
value: O
|
|
708
709
|
})).filter((O) => {
|
|
709
710
|
var M;
|
|
710
|
-
return (M = e.purchaseOrder.items) == null ? void 0 : M.find((
|
|
711
|
+
return (M = e.purchaseOrder.items) == null ? void 0 : M.find((L) => L.sku._id === O.value._id);
|
|
711
712
|
}).map((O) => O.value), T = e.purchaseOrder.items ?? [], F = await $(
|
|
712
713
|
r.map((O) => O._id),
|
|
713
714
|
(O) => {
|
|
714
|
-
const M = b.skuById[O],
|
|
715
|
-
if (
|
|
716
|
-
return
|
|
715
|
+
const M = b.skuById[O], L = T.find((E) => E.sku._id === M._id);
|
|
716
|
+
if (L)
|
|
717
|
+
return L;
|
|
717
718
|
const q = { amount: 1, precision: me(M.unit) };
|
|
718
719
|
let w = {
|
|
719
720
|
id: o.usePurchaseOrderV2 ? crypto.randomUUID() : void 0,
|
|
@@ -742,25 +743,25 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
742
743
|
}
|
|
743
744
|
);
|
|
744
745
|
if (!F) return;
|
|
745
|
-
const
|
|
746
|
-
for (const O of
|
|
747
|
-
const M = T.filter((
|
|
746
|
+
const B = F.map((O) => O.sku._id), z = [];
|
|
747
|
+
for (const O of B) {
|
|
748
|
+
const M = T.filter((L) => L.sku._id === O);
|
|
748
749
|
if (M.length > 0)
|
|
749
750
|
z.push(...M);
|
|
750
751
|
else {
|
|
751
|
-
const
|
|
752
|
-
|
|
752
|
+
const L = F.find((q) => q.sku._id === O);
|
|
753
|
+
L && z.push(L);
|
|
753
754
|
}
|
|
754
755
|
}
|
|
755
756
|
z.sort((O, M) => O.sku.code.localeCompare(M.sku.code)), e.purchaseOrder.items = z;
|
|
756
757
|
}
|
|
757
|
-
return (
|
|
758
|
-
const T = A("FmTextField"), F = A("FmSelect"),
|
|
759
|
-
return R(),
|
|
758
|
+
return (l, r) => {
|
|
759
|
+
const T = A("FmTextField"), F = A("FmSelect"), B = A("FmTextarea"), z = A("FmButton"), O = A("FmTable"), M = A("FmFormGroup"), L = A("FmForm");
|
|
760
|
+
return R(), J(L, {
|
|
760
761
|
ref_key: "formRef",
|
|
761
762
|
ref: k,
|
|
762
763
|
class: "flex flex-col gap-32",
|
|
763
|
-
disabled:
|
|
764
|
+
disabled: l.disabled
|
|
764
765
|
}, {
|
|
765
766
|
default: N(() => {
|
|
766
767
|
var q;
|
|
@@ -768,54 +769,54 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
768
769
|
s("div", us, [
|
|
769
770
|
s("div", ds, [
|
|
770
771
|
p(T, {
|
|
771
|
-
label: t(
|
|
772
|
+
label: t(n)("inventory.transfer.form.name"),
|
|
772
773
|
"label-mark": "required",
|
|
773
774
|
modelValue: t(e).name,
|
|
774
775
|
"onUpdate:modelValue": r[0] || (r[0] = (w) => t(e).name = w),
|
|
775
776
|
rules: [t(fe)()]
|
|
776
777
|
}, null, 8, ["label", "modelValue", "rules"]),
|
|
777
778
|
p(F, {
|
|
778
|
-
label: t(
|
|
779
|
+
label: t(n)("inventory.transfer.form.type.title"),
|
|
779
780
|
"model-value": P.value,
|
|
780
781
|
"onUpdate:modelValue": r[1] || (r[1] = (w) => P.value = w),
|
|
781
782
|
items: [
|
|
782
783
|
{
|
|
783
|
-
label: t(
|
|
784
|
+
label: t(n)("inventory.transfer.form.type.purchase"),
|
|
784
785
|
value: t(G).PURCHASE,
|
|
785
786
|
disabled: !t(_).locationOptionsTypePurchase.value.length,
|
|
786
|
-
sublabel: t(_).locationOptionsTypePurchase.value.length ? void 0 : t(
|
|
787
|
+
sublabel: t(_).locationOptionsTypePurchase.value.length ? void 0 : t(n)("inventory.transfer.form.noSupplierAvailable")
|
|
787
788
|
},
|
|
788
789
|
{
|
|
789
|
-
label: t(
|
|
790
|
+
label: t(n)("inventory.transfer.form.type.transfer"),
|
|
790
791
|
value: t(G).TRANSFER,
|
|
791
792
|
disabled: !t(_).locationOptionsTypeTransfer.value.length,
|
|
792
|
-
sublabel: t(_).locationOptionsTypeTransfer.value.length ? void 0 : t(
|
|
793
|
+
sublabel: t(_).locationOptionsTypeTransfer.value.length ? void 0 : t(n)("inventory.transfer.form.noLocationAvailable")
|
|
793
794
|
}
|
|
794
795
|
],
|
|
795
796
|
rules: [t(ye)(1)(I.value)]
|
|
796
797
|
}, {
|
|
797
798
|
default: N(() => [
|
|
798
799
|
s("span", {
|
|
799
|
-
class:
|
|
800
|
+
class: X([
|
|
800
801
|
"line-clamp-1 fm-typo-en-body-lg-400",
|
|
801
|
-
|
|
802
|
+
l.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
802
803
|
])
|
|
803
|
-
},
|
|
804
|
+
}, D(t(pt)(P.value)), 3)
|
|
804
805
|
]),
|
|
805
806
|
_: 1
|
|
806
807
|
}, 8, ["label", "model-value", "items", "rules"]),
|
|
807
808
|
p(F, {
|
|
808
|
-
label: P.value === t(G).PURCHASE ? t(
|
|
809
|
-
modelValue:
|
|
810
|
-
"onUpdate:modelValue": r[2] || (r[2] = (w) =>
|
|
809
|
+
label: P.value === t(G).PURCHASE ? t(n)("inventory.transfer.form.purchaseFrom") : t(n)("inventory.transfer.form.transferFrom"),
|
|
810
|
+
modelValue: h.value,
|
|
811
|
+
"onUpdate:modelValue": r[2] || (r[2] = (w) => h.value = w),
|
|
811
812
|
items: I.value
|
|
812
813
|
}, {
|
|
813
814
|
"menu-wrapper": N((w) => {
|
|
814
815
|
var E;
|
|
815
816
|
return [
|
|
816
|
-
p(
|
|
817
|
+
p(Vt, Qe(w, {
|
|
817
818
|
items: I.value,
|
|
818
|
-
"model-value": (E =
|
|
819
|
+
"model-value": (E = l.modelValue.purchaseOrder.supplier) == null ? void 0 : E._id
|
|
819
820
|
}), null, 16, ["items", "model-value"])
|
|
820
821
|
];
|
|
821
822
|
}),
|
|
@@ -823,28 +824,28 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
823
824
|
var w;
|
|
824
825
|
return [
|
|
825
826
|
s("span", {
|
|
826
|
-
class:
|
|
827
|
+
class: X([
|
|
827
828
|
"line-clamp-1 fm-typo-en-body-lg-400",
|
|
828
|
-
|
|
829
|
+
l.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
829
830
|
])
|
|
830
|
-
},
|
|
831
|
+
}, D((w = I.value.find((E) => E.value === h.value)) == null ? void 0 : w.label), 3)
|
|
831
832
|
];
|
|
832
833
|
}),
|
|
833
834
|
_: 1
|
|
834
835
|
}, 8, ["label", "modelValue", "items"]),
|
|
835
836
|
p(T, {
|
|
836
|
-
label: t(
|
|
837
|
+
label: t(n)("inventory.transfer.form.reference"),
|
|
837
838
|
"label-mark": "optional",
|
|
838
839
|
modelValue: t(e).purchaseOrder.ref,
|
|
839
840
|
"onUpdate:modelValue": r[3] || (r[3] = (w) => t(e).purchaseOrder.ref = w)
|
|
840
841
|
}, null, 8, ["label", "modelValue"]),
|
|
841
|
-
p(
|
|
842
|
-
label: t(
|
|
842
|
+
p(B, {
|
|
843
|
+
label: t(n)("inventory.transfer.form.remark"),
|
|
843
844
|
"label-mark": "optional",
|
|
844
845
|
"max-length": 240,
|
|
845
846
|
modelValue: d.value,
|
|
846
847
|
"onUpdate:modelValue": r[4] || (r[4] = (w) => d.value = w),
|
|
847
|
-
class:
|
|
848
|
+
class: X({ "text-fm-color-typo-disabled": l.disabled })
|
|
848
849
|
}, null, 8, ["label", "modelValue", "class"])
|
|
849
850
|
])
|
|
850
851
|
]),
|
|
@@ -852,7 +853,7 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
852
853
|
s("div", ps, [
|
|
853
854
|
r[8] || (r[8] = s("div", { class: "flex-1 fm-typo-en-title-sm-600" }, "Locations", -1)),
|
|
854
855
|
p(z, {
|
|
855
|
-
disabled:
|
|
856
|
+
disabled: l.disabled,
|
|
856
857
|
label: "Select location",
|
|
857
858
|
"prepend-icon": "add",
|
|
858
859
|
variant: "plain",
|
|
@@ -861,8 +862,8 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
861
862
|
}, null, 8, ["disabled", "onClick"])
|
|
862
863
|
]),
|
|
863
864
|
p(O, {
|
|
864
|
-
"column-defs": t(
|
|
865
|
-
"row-data": t(
|
|
865
|
+
"column-defs": t(V),
|
|
866
|
+
"row-data": t(K),
|
|
866
867
|
"shrink-at": 9999,
|
|
867
868
|
onRowClick: t(S),
|
|
868
869
|
"hide-footer": ""
|
|
@@ -879,18 +880,18 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
879
880
|
]),
|
|
880
881
|
s("div", fs, [
|
|
881
882
|
s("div", ys, [
|
|
882
|
-
s("div", vs,
|
|
883
|
+
s("div", vs, D(t(n)("inventory.transfer.form.items.title")), 1),
|
|
883
884
|
p(z, {
|
|
884
|
-
disabled:
|
|
885
|
-
label: t(
|
|
885
|
+
disabled: l.disabled,
|
|
886
|
+
label: t(n)("inventory.transfer.form.items.addItem"),
|
|
886
887
|
"prepend-icon": "add",
|
|
887
888
|
variant: "plain",
|
|
888
889
|
class: "border-2 rounded-lg border-fm-color-primary",
|
|
889
|
-
onClick: r[5] || (r[5] = (w) =>
|
|
890
|
+
onClick: r[5] || (r[5] = (w) => x()),
|
|
890
891
|
size: "md"
|
|
891
892
|
}, null, 8, ["disabled", "label"])
|
|
892
893
|
]),
|
|
893
|
-
(R(),
|
|
894
|
+
(R(), J(O, {
|
|
894
895
|
"column-defs": C.value,
|
|
895
896
|
"row-data": t(e).purchaseOrder.items,
|
|
896
897
|
key: t(e).purchaseOrder.items.map((w) => w.sku._id).join("."),
|
|
@@ -901,20 +902,20 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
901
902
|
p(is, {
|
|
902
903
|
row: w,
|
|
903
904
|
"onUpdate:item": r[6] || (r[6] = (E) => a.value.updateItem(E)),
|
|
904
|
-
disabled:
|
|
905
|
+
disabled: l.disabled
|
|
905
906
|
}, null, 8, ["row", "disabled"])
|
|
906
907
|
]),
|
|
907
908
|
"list-row": N((w) => [
|
|
908
|
-
(R(),
|
|
909
|
+
(R(), J(Ye, {
|
|
909
910
|
row: w,
|
|
910
911
|
key: t(e).purchaseOrder.items.map((E) => E.sku._id).join(".")
|
|
911
912
|
}, {
|
|
912
913
|
default: N((E) => [
|
|
913
|
-
p(
|
|
914
|
+
p(ns, {
|
|
914
915
|
row: w,
|
|
915
916
|
"cell-by-col-id": E,
|
|
916
917
|
"onUpdate:item": r[7] || (r[7] = (te) => a.value.updateItem(te)),
|
|
917
|
-
disabled:
|
|
918
|
+
disabled: l.disabled
|
|
918
919
|
}, null, 8, ["row", "cell-by-col-id", "disabled"])
|
|
919
920
|
]),
|
|
920
921
|
_: 2
|
|
@@ -933,7 +934,7 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
933
934
|
}, 8, ["disabled"]);
|
|
934
935
|
};
|
|
935
936
|
}
|
|
936
|
-
}), _s = { class: "flex items-center" },
|
|
937
|
+
}), _s = { class: "flex items-center" }, hs = { class: "fm-typo-en-title-md-800" }, xs = { class: "flex gap-4" }, gs = /* @__PURE__ */ ee({
|
|
937
938
|
__name: "TransferTemplateDialog",
|
|
938
939
|
props: {
|
|
939
940
|
mode: {},
|
|
@@ -943,7 +944,7 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
943
944
|
emits: ["update:show", "submitted"],
|
|
944
945
|
setup(m, { expose: c, emit: v }) {
|
|
945
946
|
var k;
|
|
946
|
-
const e = m,
|
|
947
|
+
const e = m, n = v, g = _t(), b = Tt(), { t: i } = le(), o = Ze(e, "show");
|
|
947
948
|
function u() {
|
|
948
949
|
return {
|
|
949
950
|
_id: "",
|
|
@@ -982,13 +983,13 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
982
983
|
a && (_.value = e.modelValue ?? u(), P.value = ((f = e.modelValue) == null ? void 0 : f._id) ?? `${Math.random()}`);
|
|
983
984
|
}
|
|
984
985
|
);
|
|
985
|
-
const I = Q(!1),
|
|
986
|
+
const I = Q(!1), h = U(() => {
|
|
986
987
|
switch (e.mode) {
|
|
987
|
-
case
|
|
988
|
+
case ne.READ:
|
|
988
989
|
return "";
|
|
989
|
-
case
|
|
990
|
+
case ne.CREATE:
|
|
990
991
|
return i("inventory.transfer.template.create.title");
|
|
991
|
-
case
|
|
992
|
+
case ne.UPDATE:
|
|
992
993
|
return i("inventory.transfer.template.update.title");
|
|
993
994
|
}
|
|
994
995
|
return "";
|
|
@@ -1007,19 +1008,19 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
1007
1008
|
(f = (a = S.value) == null ? void 0 : a.resetInputs) == null || f.call(a);
|
|
1008
1009
|
}
|
|
1009
1010
|
});
|
|
1010
|
-
async function
|
|
1011
|
+
async function V() {
|
|
1011
1012
|
var f, C;
|
|
1012
1013
|
const a = _.value;
|
|
1013
1014
|
if (a) {
|
|
1014
1015
|
I.value = !0, (((f = a.purchaseOrder.supplier) == null ? void 0 : f.internal) === de.enum.warehouse || ((C = a.purchaseOrder.supplier) == null ? void 0 : C.internal) === de.enum.restaurant) && (a.purchaseOrder.items = a.purchaseOrder.items.map(
|
|
1015
|
-
({ totalCost: $, ...
|
|
1016
|
+
({ totalCost: $, ...x }) => x
|
|
1016
1017
|
));
|
|
1017
1018
|
try {
|
|
1018
1019
|
await g.createTemplate(a), await new Promise(($) => setTimeout($, 1e3)), b.open({
|
|
1019
1020
|
title: i("inventory.transfer.template.create.success"),
|
|
1020
1021
|
message: i("inventory.transfer.template.create.successMessage"),
|
|
1021
1022
|
type: "success"
|
|
1022
|
-
}),
|
|
1023
|
+
}), n("update:show", !1), n("submitted");
|
|
1023
1024
|
} catch ($) {
|
|
1024
1025
|
b.open({
|
|
1025
1026
|
title: i("inventory.transfer.template.create.error"),
|
|
@@ -1031,19 +1032,19 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
1031
1032
|
}
|
|
1032
1033
|
}
|
|
1033
1034
|
}
|
|
1034
|
-
async function
|
|
1035
|
+
async function K() {
|
|
1035
1036
|
var f, C;
|
|
1036
1037
|
const a = _.value;
|
|
1037
1038
|
if (a) {
|
|
1038
1039
|
I.value = !0, (((f = a.purchaseOrder.supplier) == null ? void 0 : f.internal) === de.enum.warehouse || ((C = a.purchaseOrder.supplier) == null ? void 0 : C.internal) === de.enum.restaurant) && (a.purchaseOrder.items = a.purchaseOrder.items.map(
|
|
1039
|
-
({ totalCost: $, ...
|
|
1040
|
+
({ totalCost: $, ...x }) => x
|
|
1040
1041
|
));
|
|
1041
1042
|
try {
|
|
1042
1043
|
await g.updateTemplate(a), await new Promise(($) => setTimeout($, 1e3)), b.open({
|
|
1043
1044
|
title: i("inventory.transfer.template.update.success"),
|
|
1044
1045
|
message: i("inventory.transfer.template.update.successMessage"),
|
|
1045
1046
|
type: "success"
|
|
1046
|
-
}),
|
|
1047
|
+
}), n("update:show", !1), n("submitted");
|
|
1047
1048
|
} catch ($) {
|
|
1048
1049
|
b.open({
|
|
1049
1050
|
title: i("inventory.transfer.template.update.error"),
|
|
@@ -1057,10 +1058,10 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
1057
1058
|
}
|
|
1058
1059
|
function y() {
|
|
1059
1060
|
switch (e.mode) {
|
|
1060
|
-
case
|
|
1061
|
-
return
|
|
1062
|
-
case
|
|
1063
|
-
return
|
|
1061
|
+
case ne.CREATE:
|
|
1062
|
+
return V();
|
|
1063
|
+
case ne.UPDATE:
|
|
1064
|
+
return K();
|
|
1064
1065
|
}
|
|
1065
1066
|
}
|
|
1066
1067
|
function d() {
|
|
@@ -1069,32 +1070,32 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
1069
1070
|
}
|
|
1070
1071
|
return (a, f) => {
|
|
1071
1072
|
const C = A("FmButton"), $ = A("FmSideSheet");
|
|
1072
|
-
return R(),
|
|
1073
|
+
return R(), J($, {
|
|
1073
1074
|
modelValue: t(o),
|
|
1074
|
-
"onUpdate:modelValue": f[2] || (f[2] = (
|
|
1075
|
+
"onUpdate:modelValue": f[2] || (f[2] = (x) => je(o) ? o.value = x : null),
|
|
1075
1076
|
"dismiss-away": "",
|
|
1076
1077
|
"close-button": "",
|
|
1077
1078
|
"max-width": 1200
|
|
1078
1079
|
}, {
|
|
1079
1080
|
"side-sheet-header": N(() => [
|
|
1080
1081
|
s("div", _s, [
|
|
1081
|
-
s("div",
|
|
1082
|
+
s("div", hs, D(h.value), 1)
|
|
1082
1083
|
])
|
|
1083
1084
|
]),
|
|
1084
1085
|
default: N(() => [
|
|
1085
|
-
(R(),
|
|
1086
|
+
(R(), J(bs, {
|
|
1086
1087
|
class: "w-full",
|
|
1087
1088
|
ref_key: "formRef",
|
|
1088
1089
|
ref: S,
|
|
1089
1090
|
onValidationSuccess: y,
|
|
1090
1091
|
"model-value": _.value,
|
|
1091
|
-
"onUpdate:modelValue": f[0] || (f[0] = (
|
|
1092
|
+
"onUpdate:modelValue": f[0] || (f[0] = (x) => _.value = x),
|
|
1092
1093
|
disabled: I.value,
|
|
1093
1094
|
key: P.value
|
|
1094
1095
|
}, null, 8, ["model-value", "disabled"]))
|
|
1095
1096
|
]),
|
|
1096
1097
|
"side-sheet-footer": N(() => [
|
|
1097
|
-
s("div",
|
|
1098
|
+
s("div", xs, [
|
|
1098
1099
|
p(C, {
|
|
1099
1100
|
loading: I.value,
|
|
1100
1101
|
label: t(i)("common.save"),
|
|
@@ -1104,7 +1105,7 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
1104
1105
|
disabled: I.value,
|
|
1105
1106
|
variant: "tertiary",
|
|
1106
1107
|
label: t(i)("common.close"),
|
|
1107
|
-
onClick: f[1] || (f[1] = (
|
|
1108
|
+
onClick: f[1] || (f[1] = (x) => n("update:show", !1))
|
|
1108
1109
|
}, null, 8, ["disabled", "label"])
|
|
1109
1110
|
])
|
|
1110
1111
|
]),
|
|
@@ -1115,19 +1116,19 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
1115
1116
|
}), ks = { class: "flex flex-col gap-16 w-full h-full overflow-y-auto" }, Ts = { class: "flex justify-between" }, ws = { class: "fm-typo-en-body-lg-600" }, Fs = { class: "fm-status-badge fm-status-badge-info-secondary" }, Is = { class: "flex flex-col gap-8" }, Ss = { class: "flex flex-col gap-4" }, Cs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, $s = { class: "flex gap-1" }, Os = { class: "fm-typo-en-body-lg-600" }, Ms = {
|
|
1116
1117
|
key: 0,
|
|
1117
1118
|
class: "flex flex-col gap-4"
|
|
1118
|
-
},
|
|
1119
|
+
}, Vs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ds = { class: "fm-typo-en-body-lg-600" }, Rs = {
|
|
1119
1120
|
key: 1,
|
|
1120
1121
|
class: "flex flex-col gap-4"
|
|
1121
1122
|
}, As = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ps = { class: "fm-typo-en-body-lg-600" }, Us = {
|
|
1122
1123
|
key: 2,
|
|
1123
1124
|
class: "flex flex-col gap-4"
|
|
1124
|
-
},
|
|
1125
|
+
}, Bs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ls = { class: "fm-typo-en-body-lg-600" }, qs = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Es = { class: "flex flex-col gap-8" }, Ns = { class: "fm-typo-en-body-lg-600" }, zs = { class: "flex w-full gap-4" }, Hs = { class: "grow fm-typo-en-body-lg-400 line-clamp-2" }, Qs = { class: "fm-typo-en-body-lg-600 shrink-0" }, js = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, Ks = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Gs = {
|
|
1125
1126
|
key: 0,
|
|
1126
1127
|
class: "shrink-0 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
1127
|
-
},
|
|
1128
|
+
}, Ws = {
|
|
1128
1129
|
key: 0,
|
|
1129
1130
|
class: "flex gap-4 items-center"
|
|
1130
|
-
},
|
|
1131
|
+
}, Ys = { class: "flex flex-col gap-12" }, Zs = { class: "flex flex-col gap-8" }, Js = { class: "flex gap-8 xs:flex-col" }, Xs = /* @__PURE__ */ ee({
|
|
1131
1132
|
__name: "TransferTemplateDetails",
|
|
1132
1133
|
props: {
|
|
1133
1134
|
template: {},
|
|
@@ -1135,7 +1136,7 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
1135
1136
|
},
|
|
1136
1137
|
emits: ["update:show", "action:edit"],
|
|
1137
1138
|
setup(m, { emit: c }) {
|
|
1138
|
-
const v = m, e = c,
|
|
1139
|
+
const v = m, e = c, n = pe(), { t: g } = le(), b = U(() => {
|
|
1139
1140
|
var I;
|
|
1140
1141
|
return (I = v.template) == null ? void 0 : I.purchaseOrder;
|
|
1141
1142
|
}), i = [
|
|
@@ -1143,17 +1144,17 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
1143
1144
|
{ accessorKey: "type", header: () => "Type" }
|
|
1144
1145
|
], o = Q(""), u = U(
|
|
1145
1146
|
() => {
|
|
1146
|
-
var I,
|
|
1147
|
-
return ((
|
|
1147
|
+
var I, h, S, V;
|
|
1148
|
+
return ((h = (I = b.value) == null ? void 0 : I.supplier) == null ? void 0 : h.internal) === "restaurant" || ((V = (S = b.value) == null ? void 0 : S.supplier) == null ? void 0 : V.internal) === "warehouse" ? G.TRANSFER : G.PURCHASE;
|
|
1148
1149
|
}
|
|
1149
|
-
), _ = Q(!0), P =
|
|
1150
|
-
return (I,
|
|
1150
|
+
), _ = Q(!0), P = Ze(v, "show");
|
|
1151
|
+
return (I, h) => {
|
|
1151
1152
|
var f;
|
|
1152
|
-
const S = A("FmMenuDivider"),
|
|
1153
|
-
return R(),
|
|
1153
|
+
const S = A("FmMenuDivider"), V = A("FmCard"), K = A("FmIcon"), y = A("FmTextField"), d = A("FmTable"), k = A("FmButton"), a = A("FmSideSheet");
|
|
1154
|
+
return R(), J(a, {
|
|
1154
1155
|
header: t(g)("inventory.transfer.template.details.view", { template: (f = I.template) == null ? void 0 : f.name }),
|
|
1155
1156
|
modelValue: t(P),
|
|
1156
|
-
"onUpdate:modelValue":
|
|
1157
|
+
"onUpdate:modelValue": h[2] || (h[2] = (C) => je(P) ? P.value = C : null),
|
|
1157
1158
|
"dismiss-away": _.value,
|
|
1158
1159
|
"close-button": "",
|
|
1159
1160
|
"max-width": 500
|
|
@@ -1163,16 +1164,16 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
1163
1164
|
return [
|
|
1164
1165
|
s("div", ks, [
|
|
1165
1166
|
s("div", null, [
|
|
1166
|
-
p(
|
|
1167
|
+
p(V, {
|
|
1167
1168
|
variant: "outlined",
|
|
1168
1169
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
1169
1170
|
}, {
|
|
1170
1171
|
default: N(() => {
|
|
1171
|
-
var
|
|
1172
|
+
var x, l, r, T, F, B, z;
|
|
1172
1173
|
return [
|
|
1173
1174
|
s("div", Ts, [
|
|
1174
|
-
s("div", ws,
|
|
1175
|
-
s("div", Fs,
|
|
1175
|
+
s("div", ws, D(t(g)("inventory.transfer.template.details.templateSummary")), 1),
|
|
1176
|
+
s("div", Fs, D(t(g)(
|
|
1176
1177
|
`inventory.transfer.receiveRequest.details.type.${u.value.toLocaleLowerCase("en-US")}`
|
|
1177
1178
|
)), 1)
|
|
1178
1179
|
]),
|
|
@@ -1180,21 +1181,21 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
1180
1181
|
s("div", Is, [
|
|
1181
1182
|
s("div", Ss, [
|
|
1182
1183
|
s("div", Cs, [
|
|
1183
|
-
s("div", $s,
|
|
1184
|
+
s("div", $s, D(t(g)("inventory.transfer.receiveRequest.details.createdAt")), 1)
|
|
1184
1185
|
]),
|
|
1185
|
-
s("div", Os,
|
|
1186
|
+
s("div", Os, D(t(ct)(((x = I.template) == null ? void 0 : x._id) ?? "")), 1)
|
|
1186
1187
|
]),
|
|
1187
|
-
(r = (
|
|
1188
|
-
s("div",
|
|
1189
|
-
s("div",
|
|
1188
|
+
(r = (l = b.value) == null ? void 0 : l.supplier) != null && r.name ? (R(), j("div", Ms, [
|
|
1189
|
+
s("div", Vs, D(t(g)("inventory.transfer.receiveRequest.details.from")), 1),
|
|
1190
|
+
s("div", Ds, D((F = (T = b.value) == null ? void 0 : T.supplier) == null ? void 0 : F.name), 1)
|
|
1190
1191
|
])) : oe("", !0),
|
|
1191
|
-
(
|
|
1192
|
-
s("div", As,
|
|
1193
|
-
s("div", Ps,
|
|
1192
|
+
(B = b.value) != null && B.ref ? (R(), j("div", Rs, [
|
|
1193
|
+
s("div", As, D(t(g)("inventory.transfer.receiveRequest.details.reference")), 1),
|
|
1194
|
+
s("div", Ps, D(b.value.ref), 1)
|
|
1194
1195
|
])) : oe("", !0),
|
|
1195
1196
|
(z = b.value) != null && z.remark ? (R(), j("div", Us, [
|
|
1196
|
-
s("div",
|
|
1197
|
-
s("div",
|
|
1197
|
+
s("div", Bs, D(t(g)("inventory.transfer.receiveRequest.details.remark")), 1),
|
|
1198
|
+
s("div", Ls, D(b.value.remark), 1)
|
|
1198
1199
|
])) : oe("", !0)
|
|
1199
1200
|
])
|
|
1200
1201
|
];
|
|
@@ -1204,42 +1205,42 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
1204
1205
|
]),
|
|
1205
1206
|
s("div", qs, [
|
|
1206
1207
|
s("div", Es, [
|
|
1207
|
-
s("div", Ns,
|
|
1208
|
-
(R(!0), j(_e, null, ze(((C = b.value) == null ? void 0 : C.items) ?? [], (
|
|
1209
|
-
key:
|
|
1208
|
+
s("div", Ns, D(t(g)("inventory.transfer.receiveRequest.details.requestedItems")), 1),
|
|
1209
|
+
(R(!0), j(_e, null, ze(((C = b.value) == null ? void 0 : C.items) ?? [], (x) => (R(), j("div", {
|
|
1210
|
+
key: x.code,
|
|
1210
1211
|
class: "flex flex-col"
|
|
1211
1212
|
}, [
|
|
1212
1213
|
s("div", zs, [
|
|
1213
|
-
s("div", Hs,
|
|
1214
|
-
|
|
1215
|
-
s("div", Qs,
|
|
1214
|
+
s("div", Hs, D(x.name), 1),
|
|
1215
|
+
h[3] || (h[3] = s("div", { class: "flex-1 min-w-32" }, null, -1)),
|
|
1216
|
+
s("div", Qs, D(t(ht)(x.quantity, x.sku.unit, x.measurement)), 1)
|
|
1216
1217
|
]),
|
|
1217
1218
|
s("div", js, [
|
|
1218
|
-
s("div",
|
|
1219
|
-
|
|
1219
|
+
s("div", Ks, D(x.code), 1),
|
|
1220
|
+
x.totalCost && t(n).enableTotalCost ? (R(), j("div", Gs, " (" + D(t(ft)(x.totalCost)) + ") ", 1)) : oe("", !0)
|
|
1220
1221
|
]),
|
|
1221
|
-
t(
|
|
1222
|
-
p(
|
|
1222
|
+
t(xt)(x) ? (R(), j("div", Ws, [
|
|
1223
|
+
p(K, {
|
|
1223
1224
|
name: "error",
|
|
1224
1225
|
color: "system-error-300",
|
|
1225
1226
|
size: "sm"
|
|
1226
1227
|
}),
|
|
1227
|
-
|
|
1228
|
+
h[4] || (h[4] = s("div", { class: "fm-typo-en-body-sm-400 text-fm-color-system-error-400" }, " This item has invalid unit configuration. Apply update on this item. ", -1))
|
|
1228
1229
|
])) : oe("", !0)
|
|
1229
1230
|
]))), 128))
|
|
1230
1231
|
])
|
|
1231
1232
|
]),
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
s("div",
|
|
1235
|
-
|
|
1233
|
+
h[6] || (h[6] = s("div", null, null, -1)),
|
|
1234
|
+
h[7] || (h[7] = s("div", null, null, -1)),
|
|
1235
|
+
s("div", Ys, [
|
|
1236
|
+
h[5] || (h[5] = s("div", { class: "flex flex-col" }, [
|
|
1236
1237
|
s("div", { class: "fm-typo-en-body-lg-600" }, "Enabled locations"),
|
|
1237
1238
|
s("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " This template is only usable for the following locations. ")
|
|
1238
1239
|
], -1)),
|
|
1239
|
-
s("div",
|
|
1240
|
+
s("div", Zs, [
|
|
1240
1241
|
p(y, {
|
|
1241
1242
|
modelValue: o.value,
|
|
1242
|
-
"onUpdate:modelValue":
|
|
1243
|
+
"onUpdate:modelValue": h[0] || (h[0] = (x) => o.value = x),
|
|
1243
1244
|
placeholder: "Filter locations",
|
|
1244
1245
|
"prepend-icon": "search"
|
|
1245
1246
|
}, null, 8, ["modelValue"]),
|
|
@@ -1256,10 +1257,10 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
1256
1257
|
];
|
|
1257
1258
|
}),
|
|
1258
1259
|
"side-sheet-footer": N(() => [
|
|
1259
|
-
s("div",
|
|
1260
|
+
s("div", Js, [
|
|
1260
1261
|
p(k, {
|
|
1261
1262
|
label: t(g)("common.edit"),
|
|
1262
|
-
onClick:
|
|
1263
|
+
onClick: h[1] || (h[1] = (C) => e("action:edit")),
|
|
1263
1264
|
variant: "tertiary"
|
|
1264
1265
|
}, null, 8, ["label"])
|
|
1265
1266
|
])
|
|
@@ -1268,22 +1269,22 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
1268
1269
|
}, 8, ["header", "modelValue", "dismiss-away"]);
|
|
1269
1270
|
};
|
|
1270
1271
|
}
|
|
1271
|
-
}), eo = { class: "flex-1 flex flex-col gap-8" }, to = { class: "flex flex-col" }, so = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, oo = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" },
|
|
1272
|
+
}), eo = { class: "flex-1 flex flex-col gap-8" }, to = { class: "flex flex-col" }, so = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, oo = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, lo = { class: "fm-typo-en-body-lg-400" }, no = { class: "fm-typo-en-body-lg-400 line-clamp-1" }, ao = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, ho = /* @__PURE__ */ ee({
|
|
1272
1273
|
__name: "TransferTemplateView",
|
|
1273
1274
|
setup(m) {
|
|
1274
|
-
const { t: c } =
|
|
1275
|
+
const { t: c } = le(), { createTemplate: v, viewTemplate: e, importTemplates: n, exportTemplates: g } = qe(), { templateDialogProps: b, templateDetailsProps: i } = Ee(qe()), o = gt(), { loading: u, templates: _ } = Ee(o), P = Q(!1), I = yt(), h = We(), { breakpoints: S } = wt();
|
|
1275
1276
|
ve(o.fetchTemplates);
|
|
1276
|
-
const
|
|
1277
|
-
() => P.value || u.value || !
|
|
1278
|
-
),
|
|
1277
|
+
const V = U(
|
|
1278
|
+
() => P.value || u.value || !h._currentLocation
|
|
1279
|
+
), K = U(() => _.value), y = Q(""), d = U(() => S.value.xs || S.value.sm), k = U(() => d.value ? 10 : 20);
|
|
1279
1280
|
function a($) {
|
|
1280
1281
|
switch ($) {
|
|
1281
|
-
case
|
|
1282
|
+
case Le.Add:
|
|
1282
1283
|
return v();
|
|
1283
1284
|
case "refresh":
|
|
1284
1285
|
return o.fetchTemplates();
|
|
1285
1286
|
case "import":
|
|
1286
|
-
return
|
|
1287
|
+
return n();
|
|
1287
1288
|
case "export":
|
|
1288
1289
|
return g();
|
|
1289
1290
|
}
|
|
@@ -1294,7 +1295,7 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
1294
1295
|
const C = U(() => [
|
|
1295
1296
|
{
|
|
1296
1297
|
label: c("inventory.closing.template.create.title"),
|
|
1297
|
-
value:
|
|
1298
|
+
value: Le.Add,
|
|
1298
1299
|
isPrimary: !0,
|
|
1299
1300
|
prependIcon: "add"
|
|
1300
1301
|
},
|
|
@@ -1314,8 +1315,8 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
1314
1315
|
isPrimary: !1
|
|
1315
1316
|
}
|
|
1316
1317
|
]);
|
|
1317
|
-
return ($,
|
|
1318
|
-
const
|
|
1318
|
+
return ($, x) => {
|
|
1319
|
+
const l = A("FmTable");
|
|
1319
1320
|
return R(), j(_e, null, [
|
|
1320
1321
|
p(vt, {
|
|
1321
1322
|
title: t(c)("inventory.transfer.template.title2"),
|
|
@@ -1326,7 +1327,7 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
1326
1327
|
var r;
|
|
1327
1328
|
return [
|
|
1328
1329
|
s("div", {
|
|
1329
|
-
class:
|
|
1330
|
+
class: X([
|
|
1330
1331
|
"flex flex-col gap-8 max-h-full",
|
|
1331
1332
|
{
|
|
1332
1333
|
"p-0": d.value,
|
|
@@ -1337,59 +1338,59 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
1337
1338
|
p(bt, {
|
|
1338
1339
|
searchable: "",
|
|
1339
1340
|
search: y.value,
|
|
1340
|
-
"onUpdate:search":
|
|
1341
|
+
"onUpdate:search": x[0] || (x[0] = (T) => y.value = T)
|
|
1341
1342
|
}, null, 8, ["search"]),
|
|
1342
|
-
(R(),
|
|
1343
|
+
(R(), J(l, {
|
|
1343
1344
|
style: He(t(I).tableHeight),
|
|
1344
1345
|
"column-defs": t(o).columnDefs,
|
|
1345
|
-
"row-data":
|
|
1346
|
+
"row-data": K.value,
|
|
1346
1347
|
"search-value": y.value,
|
|
1347
|
-
loading:
|
|
1348
|
-
key: (r = t(
|
|
1349
|
-
onRowClick:
|
|
1348
|
+
loading: V.value,
|
|
1349
|
+
key: (r = t(h)._currentLocation) == null ? void 0 : r.dbName,
|
|
1350
|
+
onRowClick: x[1] || (x[1] = (T) => t(e)(T.original)),
|
|
1350
1351
|
"page-size": k.value
|
|
1351
1352
|
}, {
|
|
1352
1353
|
"list-row": N((T) => [
|
|
1353
|
-
p(
|
|
1354
|
+
p(Ye, {
|
|
1354
1355
|
row: T,
|
|
1355
1356
|
onRowClick: (F) => t(e)(F)
|
|
1356
1357
|
}, {
|
|
1357
1358
|
default: N((F) => {
|
|
1358
|
-
var
|
|
1359
|
+
var B, z, O, M, L, q, w, E, te, he, xe, ge, ke, ae, Te, we, Fe, Ie, Se, Ce, re, $e, Oe, Me, Ve, ie, De;
|
|
1359
1360
|
return [
|
|
1360
1361
|
s("div", eo, [
|
|
1361
1362
|
s("div", to, [
|
|
1362
1363
|
s("div", so, [
|
|
1363
|
-
p(t(
|
|
1364
|
-
render: (O = (z = (
|
|
1365
|
-
props: (
|
|
1364
|
+
p(t(W), {
|
|
1365
|
+
render: (O = (z = (B = F._id) == null ? void 0 : B.column) == null ? void 0 : z.columnDef) == null ? void 0 : O.cell,
|
|
1366
|
+
props: (L = (M = F._id) == null ? void 0 : M.getContext) == null ? void 0 : L.call(M)
|
|
1366
1367
|
}, null, 8, ["render", "props"])
|
|
1367
1368
|
]),
|
|
1368
1369
|
s("div", oo, [
|
|
1369
|
-
p(t(
|
|
1370
|
+
p(t(W), {
|
|
1370
1371
|
render: (E = (w = (q = F.name) == null ? void 0 : q.column) == null ? void 0 : w.columnDef) == null ? void 0 : E.cell,
|
|
1371
|
-
props: (
|
|
1372
|
+
props: (he = (te = F.name) == null ? void 0 : te.getContext) == null ? void 0 : he.call(te)
|
|
1372
1373
|
}, null, 8, ["render", "props"])
|
|
1373
1374
|
]),
|
|
1374
|
-
s("div",
|
|
1375
|
-
p(t(
|
|
1376
|
-
render: (ke = (ge = (
|
|
1375
|
+
s("div", lo, [
|
|
1376
|
+
p(t(W), {
|
|
1377
|
+
render: (ke = (ge = (xe = F.supplier) == null ? void 0 : xe.column) == null ? void 0 : ge.columnDef) == null ? void 0 : ke.cell,
|
|
1377
1378
|
props: (Te = (ae = F.supplier) == null ? void 0 : ae.getContext) == null ? void 0 : Te.call(ae)
|
|
1378
1379
|
}, null, 8, ["render", "props"])
|
|
1379
1380
|
]),
|
|
1380
|
-
s("div", null,
|
|
1381
|
-
s("div",
|
|
1381
|
+
s("div", null, D((we = T.original.locations) != null && we.length ? `Enabled for ${(Fe = T.original.locations) == null ? void 0 : Fe.length} outlets` : "Enabled for all outlets"), 1),
|
|
1382
|
+
s("div", no, D(T.original.purchaseOrder.items.length ? T.original.purchaseOrder.items.map((Xe) => Xe.name).join(", ") : "No items"), 1),
|
|
1382
1383
|
s("div", ao, [
|
|
1383
|
-
p(t(
|
|
1384
|
+
p(t(W), {
|
|
1384
1385
|
render: (Ce = (Se = (Ie = F.ref) == null ? void 0 : Ie.column) == null ? void 0 : Se.columnDef) == null ? void 0 : Ce.cell,
|
|
1385
1386
|
props: ($e = (re = F.ref) == null ? void 0 : re.getContext) == null ? void 0 : $e.call(re)
|
|
1386
1387
|
}, null, 8, ["render", "props"])
|
|
1387
1388
|
])
|
|
1388
1389
|
]),
|
|
1389
1390
|
s("div", null, [
|
|
1390
|
-
p(t(
|
|
1391
|
-
render: (
|
|
1392
|
-
props: (
|
|
1391
|
+
p(t(W), {
|
|
1392
|
+
render: (Ve = (Me = (Oe = F.type) == null ? void 0 : Oe.column) == null ? void 0 : Me.columnDef) == null ? void 0 : Ve.cell,
|
|
1393
|
+
props: (De = (ie = F.type) == null ? void 0 : ie.getContext) == null ? void 0 : De.call(ie)
|
|
1393
1394
|
}, null, 8, ["render", "props"])
|
|
1394
1395
|
])
|
|
1395
1396
|
])
|
|
@@ -1405,10 +1406,10 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
1405
1406
|
}),
|
|
1406
1407
|
_: 1
|
|
1407
1408
|
}, 8, ["title", "actions"]),
|
|
1408
|
-
(R(),
|
|
1409
|
-
p(
|
|
1409
|
+
(R(), J(st, { to: "body" }, [
|
|
1410
|
+
p(Xs, ot(lt(t(i))), null, 16),
|
|
1410
1411
|
p(gs, Qe(t(b), {
|
|
1411
|
-
onSubmitted:
|
|
1412
|
+
onSubmitted: x[2] || (x[2] = (r) => t(o).fetchTemplates())
|
|
1412
1413
|
}), null, 16)
|
|
1413
1414
|
]))
|
|
1414
1415
|
], 64);
|
|
@@ -1416,5 +1417,5 @@ const jt = { class: "flex flex-col gap-8 py-16" }, Wt = { class: "flex items-cen
|
|
|
1416
1417
|
}
|
|
1417
1418
|
});
|
|
1418
1419
|
export {
|
|
1419
|
-
|
|
1420
|
+
ho as default
|
|
1420
1421
|
};
|