@feedmepos/mf-inventory-portal 0.0.25-dev.4 → 0.0.25-dev.42
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-DavuRdR4.js → App-BgLyTa3Z.js} +35 -34
- package/dist/ApprovalView-UC31qsPD.js +143 -0
- package/dist/{BindingsDialog-Ckbhr9x3.js → BindingsDialog-h9el4EvX.js} +6 -6
- package/dist/{BindingsPicker-B63gIPVJ.js → BindingsPicker-Cw5AT6xO.js} +8 -8
- package/dist/{BindingsTable-5w7_8JzF.js → BindingsTable-Boj3hZup.js} +6 -6
- package/dist/ClosingDraftView-DOH7FmkH.js +1348 -0
- package/dist/ClosingTemplateView-CG7qArA8.js +1859 -0
- package/dist/FmCustomAttribute.vue_vue_type_script_setup_true_lang-D-IWRjRD.js +34 -0
- package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-k1J8dWcK.js +211 -0
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-M5pWGm8D.js → FmUnitInput.vue_vue_type_script_setup_true_lang-C5qp_p1A.js} +52 -52
- package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-DBYsiV9t.js +51 -0
- package/dist/{IngredientGroupView-D_1gJl4X.js → IngredientGroupView-CWEw3I3i.js} +14 -14
- package/dist/{IngredientsView-Xzt0_AP8.js → IngredientsView-B6EDjPTe.js} +577 -551
- package/dist/{IntegrationView-BcF7Qhvw.js → IntegrationView-DiSoM1K8.js} +660 -623
- package/dist/{InventoryBindingForm-Cm49VDtA.js → InventoryBindingForm-nKWx-EUW.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-EJ0U2gdF.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BMMD4hwX.js} +96 -96
- package/dist/{InventoryBindingSummary-D821YZ-3.js → InventoryBindingSummary-CQnCjIY4.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-D6jGlkOx.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Cr8DwdOC.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-TMYgOcbh.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DnZI3Gfj.js} +15 -15
- package/dist/PublishView-DvHW27pI.js +222 -0
- package/dist/{PurchaseOrderPrintPreview-DiCTMEY4.js → PurchaseOrderPrintPreview-DSTbRKyh.js} +1 -1
- package/dist/ReceiveRequestView-BKRHqSU-.js +2577 -0
- package/dist/{RecipeView-k5yiAPop.js → RecipeView-CFTrf0YF.js} +47 -46
- package/dist/{index-DhAsCP14.js → StockView-CAPLd29m.js} +3564 -1764
- package/dist/{SupplierView-De4_YCtR.js → SupplierView-C_CrS9FM.js} +446 -457
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-BWuWB95v.js +1564 -0
- package/dist/TransferTemplateView-BaJaiaO9.js +1526 -0
- package/dist/{UnitView-DouWNXFf.js → UnitView-DY9nZs1y.js} +14 -14
- package/dist/{WarehouseView-RQN-XBeO.js → WarehouseView-CAFxl8K4.js} +332 -314
- package/dist/api/closing-draft.d.ts +1 -0
- package/dist/api/inventory.d.ts +9 -6
- package/dist/api/netsuite.d.ts +21 -4
- package/dist/api/purchase-order.d.ts +6 -1
- package/dist/api/stock.d.ts +1 -0
- package/dist/{app-Bmmin1VX.js → app-Jh5wwLsF.js} +28968 -28906
- package/dist/app.js +1 -1
- package/dist/components/FmAutocompleteTextField.vue.d.ts +31 -0
- package/dist/components/FmCustomAttribute.vue.d.ts +3 -8
- package/dist/components/FmLockableField.vue.d.ts +3 -0
- package/dist/components/FmMultiselectDialog.d.ts +23 -0
- package/dist/components/FmMultiselectDialog.vue.d.ts +20 -3
- package/dist/components/FmMultiselectDialogProps.d.ts +2 -0
- package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +1 -1
- package/dist/components/shell/inventory/binding-ui.vue.d.ts +1 -1
- package/dist/{decimal-CZhBTty7.js → decimal-0_acpDRy.js} +1 -1
- package/dist/feature-CqX_LtOl.js +1007 -0
- package/dist/{format-unit-display-CijRcRSo.js → format-unit-display-CYPC8_oX.js} +335 -328
- package/dist/helper/country.d.ts +1 -0
- package/dist/helper/fuzzy.d.ts +10 -0
- package/dist/index-QcOk4LDU.js +35546 -0
- package/dist/{stock-D5lxPBQG.js → stock-BpWEKDoQ.js} +29 -25
- package/dist/stores/feature.d.ts +4 -5
- package/dist/stores/helper/generate-backend-urls.d.ts +0 -1
- package/dist/stores/integration/netsuite.d.ts +21 -4
- package/dist/stores/inventory.d.ts +135 -8
- package/dist/stores/location.d.ts +100 -0
- package/dist/stores/warehouse.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/{supplier-BU1WhNTR.js → supplier-By3gzRHW.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/use-ingredient-select-dialog-hkbfGnB9.js +51 -0
- package/dist/{use-inventory-binding-dialog-ZneYylve.js → use-inventory-binding-dialog-BFG04MUx.js} +1 -1
- package/dist/views/adjustment-template/wastage-template/actions.d.ts +24 -0
- package/dist/views/adjustment-template/wastage-template/table.d.ts +24 -0
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +8 -4
- package/dist/views/closing-draft/composables/use-closing-draft-actions.d.ts +4 -1
- package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +48 -24
- package/dist/views/closing-draft/helpers/export-draft.helper.d.ts +1 -1
- package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +1 -1
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +36 -12
- package/dist/views/closing-template/composables/use-closing-template-table.d.ts +36 -12
- package/dist/views/dev/components/AutocompleteTextField.vue.d.ts +2 -0
- package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +3 -3
- package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +2 -2
- package/dist/views/ingredients/composables/use-ingredient-select-dialog.d.ts +16 -0
- package/dist/views/ingredients/composables/use-ingredient-table.d.ts +1 -1
- package/dist/views/receive-request/components/netsuite/NetSuiteProps.d.ts +2 -0
- package/dist/views/receive-request/components/transfer-details/TransferDetailsProps.d.ts +4 -1
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +411 -17
- package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +6 -2
- package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +382 -2
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +6 -3
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +822 -29
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +650 -48
- package/dist/views/receive-request/import/XilnexImportDialog.vue.d.ts +22 -0
- package/dist/views/receive-request/import/XilnexImportForm.vue.d.ts +17 -0
- package/dist/views/receive-request/import/XilnexResult.vue.d.ts +17 -0
- package/dist/views/receive-request/import/export.d.ts +12 -0
- package/dist/views/receive-request/import/props.d.ts +7 -0
- package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +4 -2
- package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItemTable.vue.d.ts +220 -0
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-template-enabled-locations-2.d.ts +8 -0
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-template-enabled-locations.d.ts +1 -0
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +9 -4
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +60 -12
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +60 -12
- package/dist/views/transfer-template/composables/useTransferTemplateHelper.d.ts +305 -0
- package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +2 -0
- package/dist/{vue-i18n-BQNx5sCM.js → vue-i18n-D57Xfcpf.js} +226 -226
- package/package.json +3 -3
- package/dist/ApprovalView-DjDzZmVI.js +0 -138
- package/dist/ClosingDraftView-BwV3uiYC.js +0 -1225
- package/dist/ClosingTemplateView-vaAj0Y-0.js +0 -1819
- package/dist/FmCustomAttribute.vue_vue_type_script_setup_true_lang-Dy1BXu1R.js +0 -142
- package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DZ_Q-3lU.js +0 -286
- package/dist/PublishView-CYdu5jl4.js +0 -192
- package/dist/ReceiveRequestView-DGqs1rpr.js +0 -1876
- package/dist/StockView-DX0RjayP.js +0 -1817
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-DhdMwHAA.js +0 -1327
- package/dist/TransferTemplateView-DEwJaqYB.js +0 -1284
- package/dist/components/FmCustomAttribute2.vue.d.ts +0 -18
- package/dist/index-DbE8p73U.js +0 -29202
|
@@ -0,0 +1,1526 @@
|
|
|
1
|
+
import { defineComponent as ae, onMounted as xe, computed as H, ref as z, watch as be, inject as Ye, resolveComponent as A, openBlock as C, createElementBlock as N, createElementVNode as l, createVNode as m, withCtx as L, renderSlot as Ae, withDirectives as Ue, normalizeClass as ne, vModelText as Pe, reactive as et, h as le, toDisplayString as D, unref as e, createCommentVNode as se, Fragment as me, renderList as Te, normalizeStyle as He, createBlock as ee, mergeProps as Qe, isRef as ke, createSlots as tt, Teleport as ot, normalizeProps as lt, guardReactiveProps as st } from "vue";
|
|
2
|
+
import { G as je, aC as he, t as Le, I as nt, aD as at, aE as rt, i as te, aF as it, b as ut, a as Ke, Z as Be, l as ge, O as ve, K as fe, A as _e, M as dt, E as J, u as Ge, af as mt, T as pt, ag as ct, C as We, d as de, aG as ye, ac as ft, a0 as yt, z as vt, h as qe, _ as bt, B as ht } from "./app-Jh5wwLsF.js";
|
|
3
|
+
import { useI18n as ue } from "@feedmepos/mf-common";
|
|
4
|
+
import { P as Y, a as gt, f as _t, t as xt, b as Ee, u as Tt } from "./format-unit-display-CYPC8_oX.js";
|
|
5
|
+
import { components as ie, useSnackbar as kt, useProxiedModel as Ze, useBreakpoints as wt } from "@feedmepos/ui-library";
|
|
6
|
+
import { defineStore as Ft, storeToRefs as Ne } from "pinia";
|
|
7
|
+
import { _ as Ct, b as It, F as St, a as $t } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-C5qp_p1A.js";
|
|
8
|
+
import { c as Ot, u as Mt, _ as Vt } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-k1J8dWcK.js";
|
|
9
|
+
import { u as Dt } from "./supplier-By3gzRHW.js";
|
|
10
|
+
import { u as Rt } from "./use-ingredient-select-dialog-hkbfGnB9.js";
|
|
11
|
+
import { u as At } from "./feature-CqX_LtOl.js";
|
|
12
|
+
const Ut = { class: "flex flex-col" }, Pt = { class: "flex flex-col" }, Lt = { class: "flex-1" }, Bt = { class: "flex items-center" }, qt = { class: "flex-1" }, Et = { class: "flex-1" }, Nt = /* @__PURE__ */ ae({
|
|
13
|
+
__name: "FmMinMaxInput",
|
|
14
|
+
props: {
|
|
15
|
+
rules: {},
|
|
16
|
+
label: {},
|
|
17
|
+
minPlaceholder: {},
|
|
18
|
+
maxPlaceholder: {},
|
|
19
|
+
modelValue: {},
|
|
20
|
+
precision: {},
|
|
21
|
+
minLength: {},
|
|
22
|
+
maxLength: {},
|
|
23
|
+
inputmode: {},
|
|
24
|
+
type: {},
|
|
25
|
+
readonly: { type: Boolean },
|
|
26
|
+
labelMark: {},
|
|
27
|
+
prependIcon: {},
|
|
28
|
+
appendIcon: {},
|
|
29
|
+
showValidBorder: { type: Boolean },
|
|
30
|
+
labelInfo: {},
|
|
31
|
+
showWordCount: { type: Boolean },
|
|
32
|
+
invalid: { type: Boolean },
|
|
33
|
+
autofocus: { type: Boolean },
|
|
34
|
+
formatter: { type: Function },
|
|
35
|
+
decimal: {},
|
|
36
|
+
datalist: {},
|
|
37
|
+
shiftDatalist: { type: Boolean },
|
|
38
|
+
datalistMaxHeight: {},
|
|
39
|
+
datalistMinHeight: {},
|
|
40
|
+
offsetDatalist: {},
|
|
41
|
+
datalistPlacement: {},
|
|
42
|
+
datalistZIndex: {},
|
|
43
|
+
datalistWidth: {},
|
|
44
|
+
disabled: { type: Boolean },
|
|
45
|
+
focused: { type: Boolean },
|
|
46
|
+
helperText: {},
|
|
47
|
+
helperState: {}
|
|
48
|
+
},
|
|
49
|
+
setup(c) {
|
|
50
|
+
const y = c, v = je("modelValue"), t = nt();
|
|
51
|
+
xe(() => {
|
|
52
|
+
const { min: p, max: d } = v ?? {};
|
|
53
|
+
if (!(!p || !d) && p.precision !== d.precision) {
|
|
54
|
+
const g = Math.max(p.precision, d.precision), i = he(p, g), f = he(d, g);
|
|
55
|
+
v.min = i, v.max = f;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
const r = H(() => {
|
|
59
|
+
const { min: p, max: d } = v ?? {};
|
|
60
|
+
return Math.max((p == null ? void 0 : p.precision) ?? 0, (d == null ? void 0 : d.precision) ?? 0, y.precision ?? 0);
|
|
61
|
+
}), u = (p) => {
|
|
62
|
+
if (!p) return "";
|
|
63
|
+
const d = at(p), g = r.value, i = he(d, g);
|
|
64
|
+
return rt(
|
|
65
|
+
+te(i),
|
|
66
|
+
i.precision
|
|
67
|
+
);
|
|
68
|
+
}, o = z(u(v.min)), a = z(u(v.max));
|
|
69
|
+
be([o, a], ([p, d]) => {
|
|
70
|
+
const g = v ?? {}, i = t(p), f = t(d), V = r.value;
|
|
71
|
+
if (p !== "" && i === !0) {
|
|
72
|
+
const F = Le(+p, V);
|
|
73
|
+
g.min = F;
|
|
74
|
+
} else
|
|
75
|
+
g.min = null;
|
|
76
|
+
if (d !== "" && f === !0) {
|
|
77
|
+
const F = Le(+d, V);
|
|
78
|
+
g.max = F;
|
|
79
|
+
} else
|
|
80
|
+
g.max = null;
|
|
81
|
+
v.min = g.min, v.max = g.max;
|
|
82
|
+
});
|
|
83
|
+
const h = Symbol.for("fm:form-state"), _ = Ye(h, null), M = H(() => y.disabled ?? (_ == null ? void 0 : _.getDisabled()) ?? !1), B = z(), I = z(), $ = z(!1), w = z(!1), O = H(() => $.value || w.value), b = H(() => [...[
|
|
84
|
+
function() {
|
|
85
|
+
return typeof t(o.value) == "string" || typeof t(a.value) == "string" ? "Must be a number" : !0;
|
|
86
|
+
},
|
|
87
|
+
function(g) {
|
|
88
|
+
return !g || !g.min || !g.max ? !0 : +te(g.min) > +te(g.max) ? "Min must be less than or equal to max" : !0;
|
|
89
|
+
}
|
|
90
|
+
], ...y.rules ?? []]);
|
|
91
|
+
return (p, d) => {
|
|
92
|
+
const g = A("FmLabel"), i = A("FmField"), f = A("FmFormGroup");
|
|
93
|
+
return C(), N("div", Ut, [
|
|
94
|
+
l("div", Pt, [
|
|
95
|
+
l("div", Lt, [
|
|
96
|
+
m(g, {
|
|
97
|
+
label: p.label,
|
|
98
|
+
disabled: p.disabled,
|
|
99
|
+
required: p.labelMark === "required",
|
|
100
|
+
optional: p.labelMark === "optional"
|
|
101
|
+
}, null, 8, ["label", "disabled", "required", "optional"])
|
|
102
|
+
]),
|
|
103
|
+
m(i, { focused: O.value }, {
|
|
104
|
+
default: L(() => [
|
|
105
|
+
l("div", Bt, [
|
|
106
|
+
Ae(p.$slots, "prepend"),
|
|
107
|
+
d[6] || (d[6] = l("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400 pr-4" }, "Min.", -1)),
|
|
108
|
+
l("div", qt, [
|
|
109
|
+
Ue(l("input", {
|
|
110
|
+
type: "text",
|
|
111
|
+
ref_key: "minInputRef",
|
|
112
|
+
ref: B,
|
|
113
|
+
onFocus: d[0] || (d[0] = () => $.value = !0),
|
|
114
|
+
onBlur: d[1] || (d[1] = () => $.value = !1),
|
|
115
|
+
"onUpdate:modelValue": d[2] || (d[2] = (V) => o.value = V),
|
|
116
|
+
class: ne({
|
|
117
|
+
"fm-text-field--input fm-typo-en-body-lg-400": !0,
|
|
118
|
+
"text-fm-color-typo-primary": !M.value,
|
|
119
|
+
"text-fm-color-typo-disabled": M.value
|
|
120
|
+
})
|
|
121
|
+
}, null, 34), [
|
|
122
|
+
[Pe, o.value]
|
|
123
|
+
])
|
|
124
|
+
]),
|
|
125
|
+
d[7] || (d[7] = l("div", { class: "block h-32 mx-4 w-[1px] bg-fm-color-neutral-gray-200" }, null, -1)),
|
|
126
|
+
d[8] || (d[8] = l("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400 pr-4" }, "Max.", -1)),
|
|
127
|
+
l("div", Et, [
|
|
128
|
+
Ue(l("input", {
|
|
129
|
+
type: "text",
|
|
130
|
+
ref_key: "maxInputRef",
|
|
131
|
+
ref: I,
|
|
132
|
+
onFocus: d[3] || (d[3] = () => w.value = !0),
|
|
133
|
+
onBlur: d[4] || (d[4] = () => w.value = !1),
|
|
134
|
+
"onUpdate:modelValue": d[5] || (d[5] = (V) => a.value = V),
|
|
135
|
+
class: ne({
|
|
136
|
+
"fm-text-field--input fm-typo-en-body-lg-400": !0,
|
|
137
|
+
"text-fm-color-typo-primary": !M.value,
|
|
138
|
+
"text-fm-color-typo-disabled": M.value
|
|
139
|
+
})
|
|
140
|
+
}, null, 34), [
|
|
141
|
+
[Pe, a.value]
|
|
142
|
+
])
|
|
143
|
+
]),
|
|
144
|
+
Ae(p.$slots, "append")
|
|
145
|
+
])
|
|
146
|
+
]),
|
|
147
|
+
_: 3
|
|
148
|
+
}, 8, ["focused"])
|
|
149
|
+
]),
|
|
150
|
+
m(f, {
|
|
151
|
+
class: "flex-1",
|
|
152
|
+
"model-value": p.modelValue,
|
|
153
|
+
info: p.labelInfo,
|
|
154
|
+
rules: b.value,
|
|
155
|
+
"helper-text": p.helperText,
|
|
156
|
+
"helper-state": p.helperState
|
|
157
|
+
}, null, 8, ["model-value", "info", "rules", "helper-text", "helper-state"])
|
|
158
|
+
]);
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
function zt({ min: c, max: y } = { min: !0, max: !0 }) {
|
|
163
|
+
return function(t) {
|
|
164
|
+
return !t || !t.min && c != !1 || !t.max && y != !1 ? "Required" : !0;
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
function Ht(c, y) {
|
|
168
|
+
return function(t) {
|
|
169
|
+
return !t || !t.min || !t.max ? !0 : +te(t.min) < c ? `Must be between ${c} and ${y}` : +te(t.max) > y ? `Must be between ${c} and ${y}` : !0;
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
function Qt(c) {
|
|
173
|
+
const y = it(c), v = te(c);
|
|
174
|
+
return function(r) {
|
|
175
|
+
const u = !(r != null && r.min) || y(r.min) === !0, o = !(r != null && r.max) || y(r.max) === !0;
|
|
176
|
+
return !u && !o ? `Min & max must be a multiple of ${v}` : u ? o ? !0 : `Max must be a multiple of ${v}` : `Min must be a multiple of ${v}`;
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
const Je = Ft("transfer-template-helper", () => {
|
|
180
|
+
const c = ut();
|
|
181
|
+
function y(v, t, r, u, o) {
|
|
182
|
+
var h;
|
|
183
|
+
if (!r) {
|
|
184
|
+
o == null || o("Unit is not valid");
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
let a = v.code;
|
|
188
|
+
if (c.isEnabled) {
|
|
189
|
+
const _ = c.getItemPKTCode(t, (h = r.measurement) == null ? void 0 : h.id);
|
|
190
|
+
_ && (a = _);
|
|
191
|
+
}
|
|
192
|
+
u({
|
|
193
|
+
...v,
|
|
194
|
+
quantity: r.amount,
|
|
195
|
+
measurement: r.measurement ?? null,
|
|
196
|
+
code: a
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
return {
|
|
200
|
+
validateUnitInput: y
|
|
201
|
+
};
|
|
202
|
+
});
|
|
203
|
+
var j = /* @__PURE__ */ ((c) => (c.Code = "Code", c.Name = "Name", c.DefaultAmount = "DefaultAmount", c.Limit = "Limit", c.Step = "Step", c.Cost = "Cost", c.Delete = "Delete", c))(j || {});
|
|
204
|
+
const ze = Je();
|
|
205
|
+
function jt(c) {
|
|
206
|
+
const { t: y } = ue(), v = Ke(), t = et({});
|
|
207
|
+
return xe(() => {
|
|
208
|
+
for (const u of c.items) {
|
|
209
|
+
if (!u.totalCost)
|
|
210
|
+
continue;
|
|
211
|
+
const o = Ot(u.sku, u.quantity, u.measurement, {
|
|
212
|
+
supplier: c.supplier
|
|
213
|
+
}), a = u.totalCost ?? Be.reset();
|
|
214
|
+
o ? t[u.sku._id] = o.amount !== a.amount || o.precision !== a.precision : t[u.sku._id] = !0;
|
|
215
|
+
}
|
|
216
|
+
}), {
|
|
217
|
+
columnDefs: [
|
|
218
|
+
{
|
|
219
|
+
id: "Code",
|
|
220
|
+
header: () => y("inventory.transfer.form.items.table.Code"),
|
|
221
|
+
accessorKey: "code",
|
|
222
|
+
size: 180,
|
|
223
|
+
cell(u) {
|
|
224
|
+
const o = u.row.original;
|
|
225
|
+
return le(ie.FmTextField, {
|
|
226
|
+
modelValue: o.code,
|
|
227
|
+
"onUpdate:modelValue": (a) => {
|
|
228
|
+
c.updateItem({
|
|
229
|
+
...o,
|
|
230
|
+
code: a
|
|
231
|
+
});
|
|
232
|
+
},
|
|
233
|
+
key: o.id ?? o.sku._id,
|
|
234
|
+
rules: [ge()],
|
|
235
|
+
labelMark: "required"
|
|
236
|
+
});
|
|
237
|
+
},
|
|
238
|
+
enableSorting: !1
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
id: "Name",
|
|
242
|
+
header: () => y("inventory.transfer.form.items.table.Name"),
|
|
243
|
+
minSize: 300,
|
|
244
|
+
cell(u) {
|
|
245
|
+
const o = u.row.original;
|
|
246
|
+
return le(ie.FmTextField, {
|
|
247
|
+
modelValue: o.name,
|
|
248
|
+
"onUpdate:modelValue": (a) => {
|
|
249
|
+
c.updateItem({
|
|
250
|
+
...o,
|
|
251
|
+
name: a
|
|
252
|
+
});
|
|
253
|
+
},
|
|
254
|
+
key: o.id ?? o.sku._id,
|
|
255
|
+
rules: [ge()],
|
|
256
|
+
labelMark: "required"
|
|
257
|
+
});
|
|
258
|
+
},
|
|
259
|
+
enableSorting: !1
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
id: "DefaultAmount",
|
|
263
|
+
header: () => y("inventory.transfer.form.items.table.DefaultAmount"),
|
|
264
|
+
minSize: 200,
|
|
265
|
+
cell(u) {
|
|
266
|
+
var B;
|
|
267
|
+
const o = u.row.original, a = v.skuById[o.sku._id], h = v.unitById[(B = a.unit) == null ? void 0 : B._id], _ = h.measurements.find((I) => {
|
|
268
|
+
var $;
|
|
269
|
+
return (($ = o.measurement) == null ? void 0 : $.id) === I.id;
|
|
270
|
+
}), M = o.sku.unit._id !== a.unit._id || !h || o.measurement && !_;
|
|
271
|
+
return le(Ct, {
|
|
272
|
+
style: {
|
|
273
|
+
flex: "1 1 0%"
|
|
274
|
+
},
|
|
275
|
+
modelValue: {
|
|
276
|
+
amount: o.quantity ?? { amount: 1, precision: 0 },
|
|
277
|
+
// NOTE: leave this reading from row.sku.unit and row.measurement instead,
|
|
278
|
+
measurement: o.measurement ?? (o.sku.unit._id !== a.unit._id ? { ...o.sku.unit, id: "", conversion: { amount: 1, precision: 0 } } : null)
|
|
279
|
+
},
|
|
280
|
+
disabled: c.disabled,
|
|
281
|
+
key: o.id ?? o.sku._id,
|
|
282
|
+
unit: h,
|
|
283
|
+
"onUpdate:modelValue": (I) => {
|
|
284
|
+
ze.validateUnitInput(
|
|
285
|
+
o,
|
|
286
|
+
a,
|
|
287
|
+
I,
|
|
288
|
+
($) => {
|
|
289
|
+
c.updateItem({
|
|
290
|
+
...o,
|
|
291
|
+
code: $.code,
|
|
292
|
+
sku: a,
|
|
293
|
+
quantity: $.quantity,
|
|
294
|
+
measurement: $.measurement
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
);
|
|
298
|
+
},
|
|
299
|
+
rules: [
|
|
300
|
+
It(o.quantityStep),
|
|
301
|
+
...+te(o.quantity) ? [
|
|
302
|
+
St(
|
|
303
|
+
+te(
|
|
304
|
+
o.minimumQuantity ?? {
|
|
305
|
+
amount: 1,
|
|
306
|
+
// NOTE: leave this reading from row.sku.unit and row.measurement instead,
|
|
307
|
+
precision: ve(o.sku.unit, o.measurement)
|
|
308
|
+
}
|
|
309
|
+
)
|
|
310
|
+
)
|
|
311
|
+
] : [],
|
|
312
|
+
$t(
|
|
313
|
+
o.maximumQuantity ? +te(o.maximumQuantity) : 1 / 0
|
|
314
|
+
),
|
|
315
|
+
function($) {
|
|
316
|
+
return M ? "This item is no longer valid due to change in unit. Please reapply unit." : !0;
|
|
317
|
+
}
|
|
318
|
+
],
|
|
319
|
+
applyDefaultRules: !0
|
|
320
|
+
});
|
|
321
|
+
},
|
|
322
|
+
enableSorting: !1
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
id: "Limit",
|
|
326
|
+
header: () => "Limit",
|
|
327
|
+
// TODO: i18n,
|
|
328
|
+
minSize: 280,
|
|
329
|
+
cell(u) {
|
|
330
|
+
const o = u.row.original;
|
|
331
|
+
return le(Nt, {
|
|
332
|
+
style: {
|
|
333
|
+
flex: "1 1 0%"
|
|
334
|
+
},
|
|
335
|
+
modelValue: {
|
|
336
|
+
min: o.minimumQuantity,
|
|
337
|
+
max: o.maximumQuantity
|
|
338
|
+
},
|
|
339
|
+
disabled: c.disabled,
|
|
340
|
+
key: o.id ?? o.sku._id,
|
|
341
|
+
unit: o.sku.unit,
|
|
342
|
+
"onUpdate:modelValue": (a) => {
|
|
343
|
+
const h = { ...o };
|
|
344
|
+
a != null && a.min ? h.minimumQuantity = a.min : h.minimumQuantity = null, a != null && a.max ? h.maximumQuantity = a.max : h.maximumQuantity = null, c.updateItem(h);
|
|
345
|
+
},
|
|
346
|
+
rules: [
|
|
347
|
+
zt({ max: !1 }),
|
|
348
|
+
Qt(o.quantityStep),
|
|
349
|
+
Ht(
|
|
350
|
+
+te({
|
|
351
|
+
amount: 0,
|
|
352
|
+
precision: ve(o.sku.unit, o.measurement)
|
|
353
|
+
}),
|
|
354
|
+
1 / 0
|
|
355
|
+
)
|
|
356
|
+
],
|
|
357
|
+
disableUnit: !0,
|
|
358
|
+
applyDefaultRules: !0
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
id: "Step",
|
|
364
|
+
header: () => y("inventory.transfer.form.items.table.Step"),
|
|
365
|
+
minSize: 100,
|
|
366
|
+
cell(u) {
|
|
367
|
+
const o = u.row.original;
|
|
368
|
+
return le(ie.FmTextField, {
|
|
369
|
+
modelValue: te(o.quantityStep ?? Be.reset(), !1),
|
|
370
|
+
key: o.id ?? o.sku._id,
|
|
371
|
+
"onUpdate:modelValue": (a) => {
|
|
372
|
+
c.updateItem({
|
|
373
|
+
...o,
|
|
374
|
+
quantityStep: fe(+a)
|
|
375
|
+
});
|
|
376
|
+
},
|
|
377
|
+
rules: [
|
|
378
|
+
_e({
|
|
379
|
+
amount: 1,
|
|
380
|
+
precision: ve(o.sku.unit, o.measurement)
|
|
381
|
+
}),
|
|
382
|
+
dt(o.sku.unit, o.measurement)
|
|
383
|
+
]
|
|
384
|
+
});
|
|
385
|
+
},
|
|
386
|
+
enableSorting: !1
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
id: "Delete",
|
|
390
|
+
header: "",
|
|
391
|
+
cell(u) {
|
|
392
|
+
const o = u.row.original;
|
|
393
|
+
return le("div", { class: "flex items-center" }, [
|
|
394
|
+
le(
|
|
395
|
+
ie.FmTooltip,
|
|
396
|
+
{
|
|
397
|
+
zIndex: 50,
|
|
398
|
+
placement: "left"
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
default() {
|
|
402
|
+
return le(ie.FmButton, {
|
|
403
|
+
key: o.id ?? o.sku._id,
|
|
404
|
+
type: "button",
|
|
405
|
+
icon: "add_circle",
|
|
406
|
+
variant: "tertiary",
|
|
407
|
+
size: "md",
|
|
408
|
+
disabled: c.disabled,
|
|
409
|
+
onClick: async () => {
|
|
410
|
+
const a = {
|
|
411
|
+
id: crypto.randomUUID(),
|
|
412
|
+
sku: o.sku,
|
|
413
|
+
code: o.sku.code,
|
|
414
|
+
name: o.sku.name,
|
|
415
|
+
quantity: fe(1),
|
|
416
|
+
quantityStep: fe(1),
|
|
417
|
+
minimumQuantity: fe(1)
|
|
418
|
+
};
|
|
419
|
+
ze.validateUnitInput(
|
|
420
|
+
a,
|
|
421
|
+
o.sku,
|
|
422
|
+
{
|
|
423
|
+
amount: a.quantity,
|
|
424
|
+
measurement: null
|
|
425
|
+
},
|
|
426
|
+
(h) => {
|
|
427
|
+
a.code = h.code;
|
|
428
|
+
}
|
|
429
|
+
), c.duplicateItem(a);
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
},
|
|
433
|
+
content() {
|
|
434
|
+
return "Duplicate entry";
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
),
|
|
438
|
+
le(ie.FmButton, {
|
|
439
|
+
class: "delete-button",
|
|
440
|
+
key: o.id ?? o.sku._id,
|
|
441
|
+
type: "button",
|
|
442
|
+
icon: "delete",
|
|
443
|
+
variant: "tertiary",
|
|
444
|
+
size: "md",
|
|
445
|
+
disabled: c.disabled,
|
|
446
|
+
onClick: () => {
|
|
447
|
+
c.deleteItem(o);
|
|
448
|
+
}
|
|
449
|
+
})
|
|
450
|
+
]);
|
|
451
|
+
},
|
|
452
|
+
enableSorting: !1,
|
|
453
|
+
size: 40,
|
|
454
|
+
meta: {
|
|
455
|
+
cellClass: "",
|
|
456
|
+
headerClass: ""
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
]
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
const Kt = { class: "flex flex-col gap-8 py-16" }, Gt = { class: "flex items-center" }, Wt = { class: "flex-1 flex gap-1 items-center" }, Zt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Jt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Xt = { class: "flex gap-8 w-full" }, Yt = { class: "flex-1 flex flex-col gap-4" }, eo = { class: "flex-1 flex flex-col gap-4" }, to = {
|
|
463
|
+
key: 0,
|
|
464
|
+
class: "flex gap-8 w-full"
|
|
465
|
+
}, oo = { class: "flex-1 flex flex-col gap-4" }, lo = { class: "flex-1 flex flex-col gap-4" }, so = { class: "flex gap-8 w-full" }, no = { class: "flex-1 flex flex-col gap-4" }, ao = /* @__PURE__ */ ae({
|
|
466
|
+
__name: "TransferTemplateItem",
|
|
467
|
+
props: {
|
|
468
|
+
cellByColId: {},
|
|
469
|
+
row: {}
|
|
470
|
+
},
|
|
471
|
+
setup(c) {
|
|
472
|
+
const { t: y } = ue();
|
|
473
|
+
function v(t) {
|
|
474
|
+
return t;
|
|
475
|
+
}
|
|
476
|
+
return (t, r) => {
|
|
477
|
+
var o, a, h, _, M, B, I, $, w, O, b, p, d, g, i, f, V, F, S, Z, W, E, U, s, n, T, R, K, q, k;
|
|
478
|
+
const u = A("FmLabel");
|
|
479
|
+
return C(), N("div", Kt, [
|
|
480
|
+
l("div", Gt, [
|
|
481
|
+
l("div", Wt, [
|
|
482
|
+
l("span", Zt, " (" + D(t.row.original.sku.code) + ") ", 1),
|
|
483
|
+
l("span", Jt, D(t.row.original.sku.name), 1)
|
|
484
|
+
]),
|
|
485
|
+
l("div", null, [
|
|
486
|
+
m(e(J), {
|
|
487
|
+
render: (h = (a = (o = t.cellByColId.Delete) == null ? void 0 : o.column) == null ? void 0 : a.columnDef) == null ? void 0 : h.cell,
|
|
488
|
+
props: (M = (_ = t.cellByColId.Delete) == null ? void 0 : _.getContext) == null ? void 0 : M.call(_)
|
|
489
|
+
}, null, 8, ["render", "props"])
|
|
490
|
+
])
|
|
491
|
+
]),
|
|
492
|
+
l("div", Xt, [
|
|
493
|
+
l("div", Yt, [
|
|
494
|
+
m(u, {
|
|
495
|
+
label: e(y)(`inventory.transfer.form.items.table.${e(j).Code}`)
|
|
496
|
+
}, null, 8, ["label"]),
|
|
497
|
+
m(e(J), {
|
|
498
|
+
render: ($ = (I = (B = t.cellByColId[e(j).Code]) == null ? void 0 : B.column) == null ? void 0 : I.columnDef) == null ? void 0 : $.cell,
|
|
499
|
+
props: (O = (w = t.cellByColId[e(j).Code]) == null ? void 0 : w.getContext) == null ? void 0 : O.call(w)
|
|
500
|
+
}, null, 8, ["render", "props"]),
|
|
501
|
+
r[0] || (r[0] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
502
|
+
]),
|
|
503
|
+
l("div", eo, [
|
|
504
|
+
m(u, {
|
|
505
|
+
label: e(y)(`inventory.transfer.form.items.table.${e(j).Name}`)
|
|
506
|
+
}, null, 8, ["label"]),
|
|
507
|
+
m(e(J), {
|
|
508
|
+
render: (d = (p = (b = t.cellByColId[e(j).Name]) == null ? void 0 : b.column) == null ? void 0 : p.columnDef) == null ? void 0 : d.cell,
|
|
509
|
+
props: (i = (g = t.cellByColId[e(j).Name]) == null ? void 0 : g.getContext) == null ? void 0 : i.call(g)
|
|
510
|
+
}, null, 8, ["render", "props"]),
|
|
511
|
+
r[1] || (r[1] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
512
|
+
])
|
|
513
|
+
]),
|
|
514
|
+
t.row.original ? (C(), N("div", to, [
|
|
515
|
+
l("div", oo, [
|
|
516
|
+
m(u, {
|
|
517
|
+
label: e(y)(`inventory.transfer.form.items.table.${e(j).DefaultAmount}`)
|
|
518
|
+
}, null, 8, ["label"]),
|
|
519
|
+
m(e(J), {
|
|
520
|
+
render: (F = (V = (f = t.cellByColId[e(j).DefaultAmount]) == null ? void 0 : f.column) == null ? void 0 : V.columnDef) == null ? void 0 : F.cell,
|
|
521
|
+
props: (Z = (S = t.cellByColId[e(j).DefaultAmount]) == null ? void 0 : S.getContext) == null ? void 0 : Z.call(S)
|
|
522
|
+
}, null, 8, ["render", "props"]),
|
|
523
|
+
r[2] || (r[2] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
524
|
+
]),
|
|
525
|
+
l("div", lo, [
|
|
526
|
+
m(u, {
|
|
527
|
+
label: e(y)(`inventory.transfer.form.items.table.${e(j).Step}`)
|
|
528
|
+
}, null, 8, ["label"]),
|
|
529
|
+
m(e(J), {
|
|
530
|
+
render: (U = (E = (W = t.cellByColId[e(j).Step]) == null ? void 0 : W.column) == null ? void 0 : E.columnDef) == null ? void 0 : U.cell,
|
|
531
|
+
props: (n = (s = t.cellByColId[e(j).Step]) == null ? void 0 : s.getContext) == null ? void 0 : n.call(s)
|
|
532
|
+
}, null, 8, ["render", "props"]),
|
|
533
|
+
r[3] || (r[3] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
534
|
+
])
|
|
535
|
+
])) : se("", !0),
|
|
536
|
+
l("div", so, [
|
|
537
|
+
l("div", no, [
|
|
538
|
+
m(u, {
|
|
539
|
+
label: e(y)(`inventory.transfer.form.items.table.${e(j).Limit}`)
|
|
540
|
+
}, null, 8, ["label"]),
|
|
541
|
+
m(e(J), {
|
|
542
|
+
render: (K = (R = (T = t.cellByColId[e(j).Limit]) == null ? void 0 : T.column) == null ? void 0 : R.columnDef) == null ? void 0 : K.cell,
|
|
543
|
+
props: (k = (q = t.cellByColId[e(j).Limit]) == null ? void 0 : q.getContext) == null ? void 0 : k.call(q)
|
|
544
|
+
}, null, 8, ["render", "props"]),
|
|
545
|
+
r[4] || (r[4] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
546
|
+
])
|
|
547
|
+
])
|
|
548
|
+
]);
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
}), ro = { class: "hover:bg-fm-color-opacity-sm" }, io = { class: "fm-typo-en-body-md-400 line-clamp-2 w-full" }, uo = /* @__PURE__ */ ae({
|
|
552
|
+
__name: "TransferTemplateItemTable",
|
|
553
|
+
props: {
|
|
554
|
+
row: {},
|
|
555
|
+
disabled: { type: Boolean }
|
|
556
|
+
},
|
|
557
|
+
emits: ["update:item"],
|
|
558
|
+
setup(c) {
|
|
559
|
+
function y(v) {
|
|
560
|
+
return v.column.columnDef.meta;
|
|
561
|
+
}
|
|
562
|
+
return (v, t) => (C(), N("tr", ro, [
|
|
563
|
+
(C(!0), N(me, null, Te(v.row.getVisibleCells(), (r) => {
|
|
564
|
+
var u, o, a, h, _;
|
|
565
|
+
return C(), N("td", {
|
|
566
|
+
key: r.id,
|
|
567
|
+
class: ne(["text-fm-color-typo-primary", ((u = y(r)) == null ? void 0 : u.cellClass) ?? "px-16"]),
|
|
568
|
+
style: He({
|
|
569
|
+
width: (o = y(r)) != null && o.width ? (a = y(r)) == null ? void 0 : a.width : r.column.getSize() !== 0 ? `${r.column.getSize()}px` : void 0,
|
|
570
|
+
maxWidth: (h = y(r)) == null ? void 0 : h.maxWidth,
|
|
571
|
+
textAlign: ((_ = y(r)) == null ? void 0 : _.textAlign) ?? "left"
|
|
572
|
+
})
|
|
573
|
+
}, [
|
|
574
|
+
l("span", io, [
|
|
575
|
+
m(e(J), {
|
|
576
|
+
props: r.getContext(),
|
|
577
|
+
render: r.column.columnDef.cell
|
|
578
|
+
}, null, 8, ["props", "render"])
|
|
579
|
+
])
|
|
580
|
+
], 6);
|
|
581
|
+
}), 128))
|
|
582
|
+
]));
|
|
583
|
+
}
|
|
584
|
+
}), mo = { class: "flex flex-col gap-16" }, po = { class: "flex flex-col gap-24" }, co = { class: "flex flex-col gap-16" }, fo = { class: "flex items-center" }, yo = { class: "flex flex-col" }, vo = { class: "flex flex-col gap-4" }, bo = {
|
|
585
|
+
key: 0,
|
|
586
|
+
class: "text-fm-color-typo-error fm-typo-en-body-sm-400"
|
|
587
|
+
}, ho = {
|
|
588
|
+
key: 1,
|
|
589
|
+
class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
590
|
+
}, go = { class: "flex flex-wrap gap-8 fm-typo-en-body-sm-600 text-fm-color-typo-primary" }, _o = { class: "flex flex-col gap-16" }, xo = { class: "flex" }, To = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, ko = /* @__PURE__ */ ae({
|
|
591
|
+
__name: "TransferTemplateForm",
|
|
592
|
+
props: {
|
|
593
|
+
modelValue: {},
|
|
594
|
+
disabled: { type: Boolean }
|
|
595
|
+
},
|
|
596
|
+
setup(c, { expose: y }) {
|
|
597
|
+
const v = c, t = je(), { t: r } = ue(), u = Ge(), o = Ke(), a = Dt(), h = Je();
|
|
598
|
+
be(
|
|
599
|
+
() => v.modelValue,
|
|
600
|
+
(s, n) => {
|
|
601
|
+
s._id === (n == null ? void 0 : n._id) && s._rev === (n == null ? void 0 : n._rev) || (t.purchaseOrder.items = t.purchaseOrder.items.map((T) => ({
|
|
602
|
+
...T,
|
|
603
|
+
id: T.id ?? crypto.randomUUID()
|
|
604
|
+
})));
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
immediate: !0
|
|
608
|
+
}
|
|
609
|
+
), u.watchLocation(async () => {
|
|
610
|
+
location && (t.purchaseOrder.supplier || (t.purchaseOrder.supplier = a.suppliers.find((s) => s) ?? t.purchaseOrder.supplier));
|
|
611
|
+
});
|
|
612
|
+
const _ = Mt(
|
|
613
|
+
() => t.purchaseOrder,
|
|
614
|
+
(s) => {
|
|
615
|
+
t.purchaseOrder = {
|
|
616
|
+
...t.purchaseOrder,
|
|
617
|
+
supplier: s.supplier ?? (t == null ? void 0 : t.purchaseOrder.supplier)
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
), M = H({
|
|
621
|
+
get() {
|
|
622
|
+
var s, n;
|
|
623
|
+
return typeof ((n = (s = t.purchaseOrder) == null ? void 0 : s.supplier) == null ? void 0 : n.internal) == "string" ? Y.TRANSFER : Y.PURCHASE;
|
|
624
|
+
},
|
|
625
|
+
set(s) {
|
|
626
|
+
var T, R;
|
|
627
|
+
const n = typeof ((R = (T = t.purchaseOrder) == null ? void 0 : T.supplier) == null ? void 0 : R.internal) == "string" ? Y.TRANSFER : Y.PURCHASE;
|
|
628
|
+
s !== n && (t.purchaseOrder.supplier = s === Y.PURCHASE ? _.locationOptionsTypePurchase.value[0] : _.locationOptionsTypeTransfer.value[0]);
|
|
629
|
+
}
|
|
630
|
+
}), B = H(() => _.transferLocationOptions.value), I = H({
|
|
631
|
+
get() {
|
|
632
|
+
var s;
|
|
633
|
+
return (s = t.purchaseOrder.supplier) == null ? void 0 : s._id;
|
|
634
|
+
},
|
|
635
|
+
set(s) {
|
|
636
|
+
_.transferLocationModel.value = s;
|
|
637
|
+
}
|
|
638
|
+
}), {
|
|
639
|
+
promptSelectLocations: $,
|
|
640
|
+
columnDefs: w,
|
|
641
|
+
rowData: O,
|
|
642
|
+
hasCustomTag: b,
|
|
643
|
+
locationTagModel: p,
|
|
644
|
+
locationTagAutocomplete: d,
|
|
645
|
+
pushLocationTag: g,
|
|
646
|
+
removeLocationTag: i,
|
|
647
|
+
locationTagError: f
|
|
648
|
+
} = mt({
|
|
649
|
+
getLocations() {
|
|
650
|
+
return t.locations;
|
|
651
|
+
},
|
|
652
|
+
setLocations(s) {
|
|
653
|
+
t.locations = s;
|
|
654
|
+
},
|
|
655
|
+
getLocationTags() {
|
|
656
|
+
return t.locationTags;
|
|
657
|
+
},
|
|
658
|
+
setLocationTags(s) {
|
|
659
|
+
t.locationTags = s;
|
|
660
|
+
}
|
|
661
|
+
});
|
|
662
|
+
function V() {
|
|
663
|
+
var s, n;
|
|
664
|
+
return (s = t.locations) != null && s.find((T) => {
|
|
665
|
+
var R, K;
|
|
666
|
+
return ((R = T.doc) == null ? void 0 : R._id) === ((K = t.purchaseOrder.supplier) == null ? void 0 : K._id);
|
|
667
|
+
}) ? `Location ${(n = t.purchaseOrder.supplier) == null ? void 0 : n.name} must be removed because template cannot be used to transfer to itself.` : !0;
|
|
668
|
+
}
|
|
669
|
+
const F = H({
|
|
670
|
+
get() {
|
|
671
|
+
return t.purchaseOrder.remark ?? void 0;
|
|
672
|
+
},
|
|
673
|
+
set(s) {
|
|
674
|
+
t.purchaseOrder.remark = s;
|
|
675
|
+
}
|
|
676
|
+
}), S = z();
|
|
677
|
+
y({
|
|
678
|
+
validateInputs: () => {
|
|
679
|
+
var s, n;
|
|
680
|
+
(n = (s = S.value) == null ? void 0 : s.validateInputs) == null || n.call(s);
|
|
681
|
+
},
|
|
682
|
+
resetInputsValidation: () => {
|
|
683
|
+
var s, n;
|
|
684
|
+
(n = (s = S.value) == null ? void 0 : s.resetInputsValidation) == null || n.call(s);
|
|
685
|
+
},
|
|
686
|
+
resetInputs: () => {
|
|
687
|
+
var s, n;
|
|
688
|
+
(n = (s = S.value) == null ? void 0 : s.resetInputs) == null || n.call(s);
|
|
689
|
+
}
|
|
690
|
+
});
|
|
691
|
+
const Z = H(() => ({
|
|
692
|
+
duplicateItem: (s) => {
|
|
693
|
+
t.purchaseOrder.items = [
|
|
694
|
+
...t.purchaseOrder.items,
|
|
695
|
+
{
|
|
696
|
+
...s
|
|
697
|
+
}
|
|
698
|
+
];
|
|
699
|
+
},
|
|
700
|
+
updateItem: (s) => {
|
|
701
|
+
let n = [];
|
|
702
|
+
s.id ? n = t.purchaseOrder.items.map((T) => T.id !== s.id ? T : s) : n = t.purchaseOrder.items.map((T) => T.sku._id !== s.sku._id ? T : s), t.purchaseOrder.items = n;
|
|
703
|
+
},
|
|
704
|
+
deleteItem: (s) => {
|
|
705
|
+
console.log(s.id);
|
|
706
|
+
let n = [];
|
|
707
|
+
s.id ? n = t.purchaseOrder.items.filter((T) => T.id !== s.id) : n = t.purchaseOrder.items.filter((T) => T.sku._id !== s.sku._id), t.purchaseOrder.items = n;
|
|
708
|
+
}
|
|
709
|
+
})), W = jt({
|
|
710
|
+
duplicateItem: Z.value.duplicateItem,
|
|
711
|
+
updateItem: Z.value.updateItem,
|
|
712
|
+
deleteItem: Z.value.deleteItem,
|
|
713
|
+
get supplier() {
|
|
714
|
+
return t.purchaseOrder.supplier;
|
|
715
|
+
},
|
|
716
|
+
get items() {
|
|
717
|
+
return t.purchaseOrder.items;
|
|
718
|
+
},
|
|
719
|
+
get transferType() {
|
|
720
|
+
return Y.PURCHASE;
|
|
721
|
+
},
|
|
722
|
+
get disabled() {
|
|
723
|
+
return v.disabled;
|
|
724
|
+
}
|
|
725
|
+
}), { promptSelectIngredients: E } = Rt();
|
|
726
|
+
async function U() {
|
|
727
|
+
const n = o.skus.map((k) => ({
|
|
728
|
+
label: k.name,
|
|
729
|
+
sublabel: k.code,
|
|
730
|
+
value: k
|
|
731
|
+
})).filter((k) => {
|
|
732
|
+
var P;
|
|
733
|
+
return (P = t.purchaseOrder.items) == null ? void 0 : P.find((Q) => Q.sku._id === k.value._id);
|
|
734
|
+
}).map((k) => k.value), T = t.purchaseOrder.items ?? [], R = await E(
|
|
735
|
+
n.map((k) => k._id),
|
|
736
|
+
(k) => {
|
|
737
|
+
const P = o.skuById[k], Q = T.find((x) => x.sku._id === P._id);
|
|
738
|
+
if (Q)
|
|
739
|
+
return Q;
|
|
740
|
+
const X = { amount: 1, precision: ve(P.unit) };
|
|
741
|
+
let oe = {
|
|
742
|
+
id: crypto.randomUUID(),
|
|
743
|
+
sku: P,
|
|
744
|
+
code: P.code,
|
|
745
|
+
name: P.name,
|
|
746
|
+
quantity: X,
|
|
747
|
+
minimumQuantity: X,
|
|
748
|
+
// maximumQuantity: adjustmentAmountMultiplyDecimal(minimumQuantity, {
|
|
749
|
+
// amount: 100,
|
|
750
|
+
// precision: 0
|
|
751
|
+
// }),
|
|
752
|
+
quantityStep: X
|
|
753
|
+
};
|
|
754
|
+
return h.validateUnitInput(
|
|
755
|
+
oe,
|
|
756
|
+
P,
|
|
757
|
+
{
|
|
758
|
+
amount: X,
|
|
759
|
+
measurement: null
|
|
760
|
+
},
|
|
761
|
+
(x) => {
|
|
762
|
+
oe.code = x.code;
|
|
763
|
+
}
|
|
764
|
+
), oe;
|
|
765
|
+
}
|
|
766
|
+
);
|
|
767
|
+
if (!R) return;
|
|
768
|
+
const K = R.map((k) => k.sku._id), q = [];
|
|
769
|
+
for (const k of K) {
|
|
770
|
+
const P = T.filter((Q) => Q.sku._id === k);
|
|
771
|
+
if (P.length > 0)
|
|
772
|
+
q.push(...P);
|
|
773
|
+
else {
|
|
774
|
+
const Q = R.find((X) => X.sku._id === k);
|
|
775
|
+
Q && q.push(Q);
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
q.sort((k, P) => k.sku.code.localeCompare(P.sku.code)), t.purchaseOrder.items = q;
|
|
779
|
+
}
|
|
780
|
+
return (s, n) => {
|
|
781
|
+
const T = A("FmTextField"), R = A("FmSelect"), K = A("FmTextarea"), q = A("FmButton"), k = A("FmTable"), P = A("FmFormGroup"), Q = A("FmChip"), X = A("FmForm");
|
|
782
|
+
return C(), ee(X, {
|
|
783
|
+
ref_key: "formRef",
|
|
784
|
+
ref: S,
|
|
785
|
+
class: "flex flex-col gap-32",
|
|
786
|
+
disabled: s.disabled
|
|
787
|
+
}, {
|
|
788
|
+
default: L(() => {
|
|
789
|
+
var oe;
|
|
790
|
+
return [
|
|
791
|
+
l("div", mo, [
|
|
792
|
+
l("div", po, [
|
|
793
|
+
m(T, {
|
|
794
|
+
label: e(r)("inventory.transfer.form.name"),
|
|
795
|
+
"label-mark": "required",
|
|
796
|
+
modelValue: e(t).name,
|
|
797
|
+
"onUpdate:modelValue": n[0] || (n[0] = (x) => e(t).name = x),
|
|
798
|
+
rules: [e(ge)()]
|
|
799
|
+
}, null, 8, ["label", "modelValue", "rules"]),
|
|
800
|
+
m(R, {
|
|
801
|
+
label: e(r)("inventory.transfer.form.type.title"),
|
|
802
|
+
"model-value": M.value,
|
|
803
|
+
"onUpdate:modelValue": n[1] || (n[1] = (x) => M.value = x),
|
|
804
|
+
items: [
|
|
805
|
+
{
|
|
806
|
+
label: e(r)("inventory.transfer.form.type.purchase"),
|
|
807
|
+
value: e(Y).PURCHASE,
|
|
808
|
+
disabled: !e(_).locationOptionsTypePurchase.value.length,
|
|
809
|
+
sublabel: e(_).locationOptionsTypePurchase.value.length ? void 0 : e(r)("inventory.transfer.form.noSupplierAvailable")
|
|
810
|
+
},
|
|
811
|
+
{
|
|
812
|
+
label: e(r)("inventory.transfer.form.type.transfer"),
|
|
813
|
+
value: e(Y).TRANSFER,
|
|
814
|
+
disabled: !e(_).locationOptionsTypeTransfer.value.length,
|
|
815
|
+
sublabel: e(_).locationOptionsTypeTransfer.value.length ? void 0 : e(r)("inventory.transfer.form.noLocationAvailable")
|
|
816
|
+
}
|
|
817
|
+
],
|
|
818
|
+
rules: [e(_e)(1)(B.value)]
|
|
819
|
+
}, {
|
|
820
|
+
default: L(() => [
|
|
821
|
+
l("span", {
|
|
822
|
+
class: ne([
|
|
823
|
+
"line-clamp-1 fm-typo-en-body-lg-400",
|
|
824
|
+
s.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
825
|
+
])
|
|
826
|
+
}, D(e(pt)(M.value)), 3)
|
|
827
|
+
]),
|
|
828
|
+
_: 1
|
|
829
|
+
}, 8, ["label", "model-value", "items", "rules"]),
|
|
830
|
+
m(R, {
|
|
831
|
+
label: M.value === e(Y).PURCHASE ? e(r)("inventory.transfer.form.purchaseFrom") : e(r)("inventory.transfer.form.transferFrom"),
|
|
832
|
+
modelValue: I.value,
|
|
833
|
+
"onUpdate:modelValue": n[2] || (n[2] = (x) => I.value = x),
|
|
834
|
+
items: B.value
|
|
835
|
+
}, {
|
|
836
|
+
"menu-wrapper": L((x) => {
|
|
837
|
+
var G;
|
|
838
|
+
return [
|
|
839
|
+
m(Vt, Qe(x, {
|
|
840
|
+
items: B.value,
|
|
841
|
+
"model-value": (G = s.modelValue.purchaseOrder.supplier) == null ? void 0 : G._id
|
|
842
|
+
}), null, 16, ["items", "model-value"])
|
|
843
|
+
];
|
|
844
|
+
}),
|
|
845
|
+
default: L(() => {
|
|
846
|
+
var x;
|
|
847
|
+
return [
|
|
848
|
+
l("span", {
|
|
849
|
+
class: ne([
|
|
850
|
+
"line-clamp-1 fm-typo-en-body-lg-400",
|
|
851
|
+
s.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
852
|
+
])
|
|
853
|
+
}, D((x = B.value.find((G) => G.value === I.value)) == null ? void 0 : x.label), 3)
|
|
854
|
+
];
|
|
855
|
+
}),
|
|
856
|
+
_: 1
|
|
857
|
+
}, 8, ["label", "modelValue", "items"]),
|
|
858
|
+
m(T, {
|
|
859
|
+
label: e(r)("inventory.transfer.form.reference"),
|
|
860
|
+
"label-mark": "optional",
|
|
861
|
+
modelValue: e(t).purchaseOrder.ref,
|
|
862
|
+
"onUpdate:modelValue": n[3] || (n[3] = (x) => e(t).purchaseOrder.ref = x)
|
|
863
|
+
}, null, 8, ["label", "modelValue"]),
|
|
864
|
+
m(K, {
|
|
865
|
+
label: e(r)("inventory.transfer.form.remark"),
|
|
866
|
+
"label-mark": "optional",
|
|
867
|
+
"max-length": 240,
|
|
868
|
+
modelValue: F.value,
|
|
869
|
+
"onUpdate:modelValue": n[4] || (n[4] = (x) => F.value = x),
|
|
870
|
+
class: ne({ "text-fm-color-typo-disabled": s.disabled })
|
|
871
|
+
}, null, 8, ["label", "modelValue", "class"])
|
|
872
|
+
])
|
|
873
|
+
]),
|
|
874
|
+
l("div", co, [
|
|
875
|
+
l("div", fo, [
|
|
876
|
+
n[9] || (n[9] = l("div", { class: "flex-1 fm-typo-en-title-sm-600" }, "Locations", -1)),
|
|
877
|
+
m(q, {
|
|
878
|
+
disabled: s.disabled,
|
|
879
|
+
label: "Select location",
|
|
880
|
+
"prepend-icon": "add",
|
|
881
|
+
variant: "plain",
|
|
882
|
+
class: "border-2 rounded-lg border-fm-color-primary",
|
|
883
|
+
onClick: e($)
|
|
884
|
+
}, null, 8, ["disabled", "onClick"])
|
|
885
|
+
]),
|
|
886
|
+
m(k, {
|
|
887
|
+
"column-defs": e(w),
|
|
888
|
+
"row-data": e(O),
|
|
889
|
+
"shrink-at": 9999,
|
|
890
|
+
onRowClick: e($),
|
|
891
|
+
"hide-footer": ""
|
|
892
|
+
}, null, 8, ["column-defs", "row-data", "onRowClick"]),
|
|
893
|
+
l("div", yo, [
|
|
894
|
+
m(P, {
|
|
895
|
+
"model-value": [
|
|
896
|
+
(oe = v.modelValue.purchaseOrder.supplier) == null ? void 0 : oe._id,
|
|
897
|
+
...v.modelValue.locations ?? []
|
|
898
|
+
].join(","),
|
|
899
|
+
rules: [V]
|
|
900
|
+
}, null, 8, ["model-value", "rules"])
|
|
901
|
+
]),
|
|
902
|
+
e(b) ? (C(), ee(ct, {
|
|
903
|
+
key: 0,
|
|
904
|
+
label: "Location tag",
|
|
905
|
+
modelValue: e(p),
|
|
906
|
+
"onUpdate:modelValue": n[5] || (n[5] = (x) => ke(p) ? p.value = x : null),
|
|
907
|
+
"onClick:menuItem": e(g),
|
|
908
|
+
options: e(d),
|
|
909
|
+
placeholder: "Search location tag"
|
|
910
|
+
}, tt({
|
|
911
|
+
"helper-text": L(() => [
|
|
912
|
+
l("div", vo, [
|
|
913
|
+
e(f) ? (C(), N("div", bo, D(e(f)), 1)) : (C(), N("div", ho, " This will match all locations under these values. Tag is configured in the restaurant/warehouse settings. ")),
|
|
914
|
+
l("div", go, [
|
|
915
|
+
(C(!0), N(me, null, Te(s.modelValue.locationTags, (x, G) => (C(), ee(Q, {
|
|
916
|
+
key: G,
|
|
917
|
+
label: x,
|
|
918
|
+
removable: "",
|
|
919
|
+
onChipClosed: () => e(i)(x)
|
|
920
|
+
}, null, 8, ["label", "onChipClosed"]))), 128))
|
|
921
|
+
])
|
|
922
|
+
])
|
|
923
|
+
]),
|
|
924
|
+
_: 2
|
|
925
|
+
}, [
|
|
926
|
+
e(p) ? {
|
|
927
|
+
name: "append",
|
|
928
|
+
fn: L(() => [
|
|
929
|
+
l("div", null, [
|
|
930
|
+
m(q, {
|
|
931
|
+
variant: "tertiary",
|
|
932
|
+
label: "Add",
|
|
933
|
+
icon: "add",
|
|
934
|
+
onClick: e(g)
|
|
935
|
+
}, null, 8, ["onClick"])
|
|
936
|
+
])
|
|
937
|
+
]),
|
|
938
|
+
key: "0"
|
|
939
|
+
} : void 0
|
|
940
|
+
]), 1032, ["modelValue", "onClick:menuItem", "options"])) : se("", !0)
|
|
941
|
+
]),
|
|
942
|
+
l("div", _o, [
|
|
943
|
+
l("div", xo, [
|
|
944
|
+
l("div", To, D(e(r)("inventory.transfer.form.items.title")), 1),
|
|
945
|
+
m(q, {
|
|
946
|
+
disabled: s.disabled,
|
|
947
|
+
label: e(r)("inventory.transfer.form.items.addItem"),
|
|
948
|
+
"prepend-icon": "add",
|
|
949
|
+
variant: "plain",
|
|
950
|
+
class: "border-2 rounded-lg border-fm-color-primary",
|
|
951
|
+
onClick: n[6] || (n[6] = (x) => U()),
|
|
952
|
+
size: "md"
|
|
953
|
+
}, null, 8, ["disabled", "label"])
|
|
954
|
+
]),
|
|
955
|
+
(C(), ee(k, {
|
|
956
|
+
"column-defs": e(W).columnDefs,
|
|
957
|
+
"row-data": e(t).purchaseOrder.items,
|
|
958
|
+
key: e(t).purchaseOrder.items.map((x) => x.sku._id).join("."),
|
|
959
|
+
"hide-footer": "",
|
|
960
|
+
"page-size": e(t).purchaseOrder.items.length
|
|
961
|
+
}, {
|
|
962
|
+
"table-row": L((x) => [
|
|
963
|
+
m(uo, {
|
|
964
|
+
row: x,
|
|
965
|
+
"onUpdate:item": n[7] || (n[7] = (G) => Z.value.updateItem(G)),
|
|
966
|
+
disabled: s.disabled
|
|
967
|
+
}, null, 8, ["row", "disabled"])
|
|
968
|
+
]),
|
|
969
|
+
"list-row": L((x) => [
|
|
970
|
+
(C(), ee(We, {
|
|
971
|
+
row: x,
|
|
972
|
+
key: e(t).purchaseOrder.items.map((G) => G.sku._id).join(".")
|
|
973
|
+
}, {
|
|
974
|
+
default: L((G) => [
|
|
975
|
+
m(ao, {
|
|
976
|
+
row: x,
|
|
977
|
+
"cell-by-col-id": G,
|
|
978
|
+
"onUpdate:item": n[8] || (n[8] = (re) => Z.value.updateItem(re)),
|
|
979
|
+
disabled: s.disabled
|
|
980
|
+
}, null, 8, ["row", "cell-by-col-id", "disabled"])
|
|
981
|
+
]),
|
|
982
|
+
_: 2
|
|
983
|
+
}, 1032, ["row"]))
|
|
984
|
+
]),
|
|
985
|
+
_: 1
|
|
986
|
+
}, 8, ["column-defs", "row-data", "page-size"])),
|
|
987
|
+
m(P, {
|
|
988
|
+
"model-value": e(t).purchaseOrder.items.length,
|
|
989
|
+
rules: [e(_e)(1)]
|
|
990
|
+
}, null, 8, ["model-value", "rules"])
|
|
991
|
+
])
|
|
992
|
+
];
|
|
993
|
+
}),
|
|
994
|
+
_: 1
|
|
995
|
+
}, 8, ["disabled"]);
|
|
996
|
+
};
|
|
997
|
+
}
|
|
998
|
+
}), wo = { class: "flex items-center" }, Fo = { class: "fm-typo-en-title-md-800" }, Co = { class: "flex gap-4" }, Io = /* @__PURE__ */ ae({
|
|
999
|
+
__name: "TransferTemplateDialog",
|
|
1000
|
+
props: {
|
|
1001
|
+
mode: {},
|
|
1002
|
+
modelValue: {},
|
|
1003
|
+
show: { type: Boolean }
|
|
1004
|
+
},
|
|
1005
|
+
emits: ["update:show", "submitted"],
|
|
1006
|
+
setup(c, { expose: y, emit: v }) {
|
|
1007
|
+
var g;
|
|
1008
|
+
const t = c, r = v, u = gt(), o = kt(), { t: a } = ue(), h = Ze(t, "show");
|
|
1009
|
+
function _() {
|
|
1010
|
+
return {
|
|
1011
|
+
_id: "",
|
|
1012
|
+
name: "",
|
|
1013
|
+
purchaseOrder: {
|
|
1014
|
+
remark: void 0,
|
|
1015
|
+
ref: void 0,
|
|
1016
|
+
items: [],
|
|
1017
|
+
supplier: {
|
|
1018
|
+
_rev: void 0,
|
|
1019
|
+
email: void 0,
|
|
1020
|
+
internal: void 0,
|
|
1021
|
+
contactName: void 0,
|
|
1022
|
+
phoneNumber: void 0,
|
|
1023
|
+
registrationNumber: void 0,
|
|
1024
|
+
supplyItems: void 0,
|
|
1025
|
+
_id: "",
|
|
1026
|
+
name: "",
|
|
1027
|
+
address: {
|
|
1028
|
+
line2: void 0,
|
|
1029
|
+
line1: "",
|
|
1030
|
+
state: "",
|
|
1031
|
+
city: "",
|
|
1032
|
+
postcode: "",
|
|
1033
|
+
country: ""
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
};
|
|
1038
|
+
}
|
|
1039
|
+
const M = z(t.modelValue ?? _()), B = z(((g = t.modelValue) == null ? void 0 : g._id) ?? `${Math.random()}`);
|
|
1040
|
+
be(
|
|
1041
|
+
() => t.show,
|
|
1042
|
+
(i) => {
|
|
1043
|
+
var f;
|
|
1044
|
+
i && (M.value = t.modelValue ?? _(), B.value = ((f = t.modelValue) == null ? void 0 : f._id) ?? `${Math.random()}`);
|
|
1045
|
+
}
|
|
1046
|
+
);
|
|
1047
|
+
const I = z(!1), $ = H(() => {
|
|
1048
|
+
switch (t.mode) {
|
|
1049
|
+
case de.READ:
|
|
1050
|
+
return "";
|
|
1051
|
+
case de.CREATE:
|
|
1052
|
+
return a("inventory.transfer.template.create.title");
|
|
1053
|
+
case de.UPDATE:
|
|
1054
|
+
return a("inventory.transfer.template.update.title");
|
|
1055
|
+
}
|
|
1056
|
+
return "";
|
|
1057
|
+
}), w = z();
|
|
1058
|
+
y({
|
|
1059
|
+
validateInputs: () => {
|
|
1060
|
+
var i, f;
|
|
1061
|
+
(f = (i = w.value) == null ? void 0 : i.validateInputs) == null || f.call(i);
|
|
1062
|
+
},
|
|
1063
|
+
resetInputsValidation: () => {
|
|
1064
|
+
var i, f;
|
|
1065
|
+
(f = (i = w.value) == null ? void 0 : i.resetInputsValidation) == null || f.call(i);
|
|
1066
|
+
},
|
|
1067
|
+
resetInputs: () => {
|
|
1068
|
+
var i, f;
|
|
1069
|
+
(f = (i = w.value) == null ? void 0 : i.resetInputs) == null || f.call(i);
|
|
1070
|
+
}
|
|
1071
|
+
});
|
|
1072
|
+
async function O() {
|
|
1073
|
+
var f, V;
|
|
1074
|
+
const i = M.value;
|
|
1075
|
+
if (i) {
|
|
1076
|
+
I.value = !0, (((f = i.purchaseOrder.supplier) == null ? void 0 : f.internal) === ye.enum.warehouse || ((V = i.purchaseOrder.supplier) == null ? void 0 : V.internal) === ye.enum.restaurant) && (i.purchaseOrder.items = i.purchaseOrder.items.map(
|
|
1077
|
+
({ totalCost: F, ...S }) => S
|
|
1078
|
+
));
|
|
1079
|
+
try {
|
|
1080
|
+
await u.createTemplate(i), await new Promise((F) => setTimeout(F, 1e3)), o.open({
|
|
1081
|
+
title: a("inventory.transfer.template.create.success"),
|
|
1082
|
+
message: a("inventory.transfer.template.create.successMessage"),
|
|
1083
|
+
type: "success"
|
|
1084
|
+
}), r("update:show", !1), r("submitted");
|
|
1085
|
+
} catch (F) {
|
|
1086
|
+
o.open({
|
|
1087
|
+
title: a("inventory.transfer.template.create.error"),
|
|
1088
|
+
message: a("inventory.transfer.template.create.errorMessage"),
|
|
1089
|
+
type: "error"
|
|
1090
|
+
}), console.error("Error in creating transfer template", F);
|
|
1091
|
+
} finally {
|
|
1092
|
+
I.value = !1;
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
async function b() {
|
|
1097
|
+
var f, V;
|
|
1098
|
+
const i = M.value;
|
|
1099
|
+
if (i) {
|
|
1100
|
+
I.value = !0, (((f = i.purchaseOrder.supplier) == null ? void 0 : f.internal) === ye.enum.warehouse || ((V = i.purchaseOrder.supplier) == null ? void 0 : V.internal) === ye.enum.restaurant) && (i.purchaseOrder.items = i.purchaseOrder.items.map(
|
|
1101
|
+
({ totalCost: F, ...S }) => S
|
|
1102
|
+
));
|
|
1103
|
+
try {
|
|
1104
|
+
await u.updateTemplate(i), await new Promise((F) => setTimeout(F, 1e3)), o.open({
|
|
1105
|
+
title: a("inventory.transfer.template.update.success"),
|
|
1106
|
+
message: a("inventory.transfer.template.update.successMessage"),
|
|
1107
|
+
type: "success"
|
|
1108
|
+
}), r("update:show", !1), r("submitted");
|
|
1109
|
+
} catch (F) {
|
|
1110
|
+
o.open({
|
|
1111
|
+
title: a("inventory.transfer.template.update.error"),
|
|
1112
|
+
message: a("inventory.transfer.template.update.errorMessage"),
|
|
1113
|
+
type: "error"
|
|
1114
|
+
}), console.error("Error in updating transfer template", F);
|
|
1115
|
+
} finally {
|
|
1116
|
+
I.value = !1;
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
function p() {
|
|
1121
|
+
switch (t.mode) {
|
|
1122
|
+
case de.CREATE:
|
|
1123
|
+
return O();
|
|
1124
|
+
case de.UPDATE:
|
|
1125
|
+
return b();
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
function d() {
|
|
1129
|
+
var i, f;
|
|
1130
|
+
(f = (i = w.value) == null ? void 0 : i.validateInputs) == null || f.call(i);
|
|
1131
|
+
}
|
|
1132
|
+
return (i, f) => {
|
|
1133
|
+
const V = A("FmButton"), F = A("FmSideSheet");
|
|
1134
|
+
return C(), ee(F, {
|
|
1135
|
+
modelValue: e(h),
|
|
1136
|
+
"onUpdate:modelValue": f[2] || (f[2] = (S) => ke(h) ? h.value = S : null),
|
|
1137
|
+
"dismiss-away": "",
|
|
1138
|
+
"close-button": "",
|
|
1139
|
+
"max-width": 1200
|
|
1140
|
+
}, {
|
|
1141
|
+
"side-sheet-header": L(() => [
|
|
1142
|
+
l("div", wo, [
|
|
1143
|
+
l("div", Fo, D($.value), 1)
|
|
1144
|
+
])
|
|
1145
|
+
]),
|
|
1146
|
+
default: L(() => [
|
|
1147
|
+
(C(), ee(ko, {
|
|
1148
|
+
class: "w-full",
|
|
1149
|
+
ref_key: "formRef",
|
|
1150
|
+
ref: w,
|
|
1151
|
+
onValidationSuccess: p,
|
|
1152
|
+
"model-value": M.value,
|
|
1153
|
+
"onUpdate:modelValue": f[0] || (f[0] = (S) => M.value = S),
|
|
1154
|
+
disabled: I.value,
|
|
1155
|
+
key: B.value
|
|
1156
|
+
}, null, 8, ["model-value", "disabled"]))
|
|
1157
|
+
]),
|
|
1158
|
+
"side-sheet-footer": L(() => [
|
|
1159
|
+
l("div", Co, [
|
|
1160
|
+
m(V, {
|
|
1161
|
+
loading: I.value,
|
|
1162
|
+
label: e(a)("common.save"),
|
|
1163
|
+
onClick: d
|
|
1164
|
+
}, null, 8, ["loading", "label"]),
|
|
1165
|
+
m(V, {
|
|
1166
|
+
disabled: I.value,
|
|
1167
|
+
variant: "tertiary",
|
|
1168
|
+
label: e(a)("common.close"),
|
|
1169
|
+
onClick: f[1] || (f[1] = (S) => r("update:show", !1))
|
|
1170
|
+
}, null, 8, ["disabled", "label"])
|
|
1171
|
+
])
|
|
1172
|
+
]),
|
|
1173
|
+
_: 1
|
|
1174
|
+
}, 8, ["modelValue"]);
|
|
1175
|
+
};
|
|
1176
|
+
}
|
|
1177
|
+
}), So = { class: "flex flex-col gap-16 w-full h-full overflow-y-auto" }, $o = { class: "flex justify-between" }, Oo = { class: "fm-typo-en-body-lg-600" }, Mo = { class: "fm-status-badge fm-status-badge-info-secondary" }, Vo = { class: "flex flex-col gap-8" }, Do = { class: "flex flex-col gap-4" }, Ro = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ao = { class: "flex gap-1" }, Uo = { class: "fm-typo-en-body-lg-600" }, Po = {
|
|
1178
|
+
key: 0,
|
|
1179
|
+
class: "flex flex-col gap-4"
|
|
1180
|
+
}, Lo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Bo = { class: "fm-typo-en-body-lg-600" }, qo = {
|
|
1181
|
+
key: 1,
|
|
1182
|
+
class: "flex flex-col gap-4"
|
|
1183
|
+
}, Eo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, No = { class: "fm-typo-en-body-lg-600" }, zo = {
|
|
1184
|
+
key: 2,
|
|
1185
|
+
class: "flex flex-col gap-4"
|
|
1186
|
+
}, Ho = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qo = { class: "fm-typo-en-body-lg-600" }, jo = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Ko = { class: "flex flex-col gap-8" }, Go = { class: "fm-typo-en-body-lg-600" }, Wo = { class: "w-full" }, Zo = { class: "flex flex-col py-8" }, Jo = { class: "flex w-full gap-4" }, Xo = { class: "grow fm-typo-en-body-lg-400 line-clamp-2" }, Yo = { class: "fm-typo-en-body-lg-600 shrink-0" }, el = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, tl = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, ol = {
|
|
1187
|
+
key: 0,
|
|
1188
|
+
class: "shrink-0 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
1189
|
+
}, ll = {
|
|
1190
|
+
key: 0,
|
|
1191
|
+
class: "flex gap-4 items-center"
|
|
1192
|
+
}, sl = { class: "flex flex-col gap-12" }, nl = { class: "flex flex-row flex-wrap gap-8" }, al = { class: "flex flex-col gap-8" }, rl = { class: "flex gap-8 xs:flex-col" }, il = /* @__PURE__ */ ae({
|
|
1193
|
+
__name: "TransferTemplateDetails",
|
|
1194
|
+
props: {
|
|
1195
|
+
template: {},
|
|
1196
|
+
show: { type: Boolean }
|
|
1197
|
+
},
|
|
1198
|
+
emits: ["update:show", "action:edit"],
|
|
1199
|
+
setup(c, { emit: y }) {
|
|
1200
|
+
const v = c, t = y, r = At(), { t: u } = ue(), o = H(() => {
|
|
1201
|
+
var O;
|
|
1202
|
+
return (O = v.template) == null ? void 0 : O.purchaseOrder;
|
|
1203
|
+
}), a = z(""), h = [
|
|
1204
|
+
{ accessorKey: "name", header: () => "Name" },
|
|
1205
|
+
{ accessorKey: "type", header: () => "Type" }
|
|
1206
|
+
], _ = z(""), M = H(
|
|
1207
|
+
() => {
|
|
1208
|
+
var O, b, p, d;
|
|
1209
|
+
return ((b = (O = o.value) == null ? void 0 : O.supplier) == null ? void 0 : b.internal) === "restaurant" || ((d = (p = o.value) == null ? void 0 : p.supplier) == null ? void 0 : d.internal) === "warehouse" ? Y.TRANSFER : Y.PURCHASE;
|
|
1210
|
+
}
|
|
1211
|
+
), B = z(!0), I = Ze(v, "show"), $ = z(!1);
|
|
1212
|
+
be(
|
|
1213
|
+
() => v.show,
|
|
1214
|
+
(O) => {
|
|
1215
|
+
O && ($.value = !0, setTimeout(() => $.value = !1, 300));
|
|
1216
|
+
}
|
|
1217
|
+
);
|
|
1218
|
+
function w(O) {
|
|
1219
|
+
return O.original;
|
|
1220
|
+
}
|
|
1221
|
+
return (O, b) => {
|
|
1222
|
+
var Z;
|
|
1223
|
+
const p = A("FmMenuDivider"), d = A("FmCard"), g = A("FmTextField"), i = A("FmIcon"), f = A("FmTable"), V = A("FmChip"), F = A("FmButton"), S = A("FmSideSheet");
|
|
1224
|
+
return C(), ee(S, {
|
|
1225
|
+
header: e(u)("inventory.transfer.template.details.view", { template: (Z = O.template) == null ? void 0 : Z.name }),
|
|
1226
|
+
modelValue: e(I),
|
|
1227
|
+
"onUpdate:modelValue": b[3] || (b[3] = (W) => ke(I) ? I.value = W : null),
|
|
1228
|
+
"dismiss-away": B.value,
|
|
1229
|
+
"close-button": "",
|
|
1230
|
+
"max-width": 600
|
|
1231
|
+
}, {
|
|
1232
|
+
default: L(() => {
|
|
1233
|
+
var W, E, U;
|
|
1234
|
+
return [
|
|
1235
|
+
l("div", So, [
|
|
1236
|
+
l("div", null, [
|
|
1237
|
+
m(d, {
|
|
1238
|
+
variant: "outlined",
|
|
1239
|
+
class: "flex flex-col gap-8 px-12 py-16"
|
|
1240
|
+
}, {
|
|
1241
|
+
default: L(() => {
|
|
1242
|
+
var s, n, T, R, K, q, k;
|
|
1243
|
+
return [
|
|
1244
|
+
l("div", $o, [
|
|
1245
|
+
l("div", Oo, D(e(u)("inventory.transfer.template.details.templateSummary")), 1),
|
|
1246
|
+
l("div", Mo, D(e(u)(
|
|
1247
|
+
`inventory.transfer.receiveRequest.details.type.${M.value.toLocaleLowerCase("en-US")}`
|
|
1248
|
+
)), 1)
|
|
1249
|
+
]),
|
|
1250
|
+
m(p),
|
|
1251
|
+
l("div", Vo, [
|
|
1252
|
+
l("div", Do, [
|
|
1253
|
+
l("div", Ro, [
|
|
1254
|
+
l("div", Ao, D(e(u)("inventory.transfer.receiveRequest.details.createdAt")), 1)
|
|
1255
|
+
]),
|
|
1256
|
+
l("div", Uo, D(e(ft)(((s = O.template) == null ? void 0 : s._id) ?? "")), 1)
|
|
1257
|
+
]),
|
|
1258
|
+
(T = (n = o.value) == null ? void 0 : n.supplier) != null && T.name ? (C(), N("div", Po, [
|
|
1259
|
+
l("div", Lo, D(e(u)("inventory.transfer.receiveRequest.details.from")), 1),
|
|
1260
|
+
l("div", Bo, D((K = (R = o.value) == null ? void 0 : R.supplier) == null ? void 0 : K.name), 1)
|
|
1261
|
+
])) : se("", !0),
|
|
1262
|
+
(q = o.value) != null && q.ref ? (C(), N("div", qo, [
|
|
1263
|
+
l("div", Eo, D(e(u)("inventory.transfer.receiveRequest.details.reference")), 1),
|
|
1264
|
+
l("div", No, D(o.value.ref), 1)
|
|
1265
|
+
])) : se("", !0),
|
|
1266
|
+
(k = o.value) != null && k.remark ? (C(), N("div", zo, [
|
|
1267
|
+
l("div", Ho, D(e(u)("inventory.transfer.receiveRequest.details.remark")), 1),
|
|
1268
|
+
l("div", Qo, D(o.value.remark), 1)
|
|
1269
|
+
])) : se("", !0)
|
|
1270
|
+
])
|
|
1271
|
+
];
|
|
1272
|
+
}),
|
|
1273
|
+
_: 1
|
|
1274
|
+
})
|
|
1275
|
+
]),
|
|
1276
|
+
l("div", jo, [
|
|
1277
|
+
l("div", Ko, [
|
|
1278
|
+
l("div", Go, D(e(u)("inventory.transfer.receiveRequest.details.requestedItems")), 1),
|
|
1279
|
+
m(g, {
|
|
1280
|
+
modelValue: a.value,
|
|
1281
|
+
"onUpdate:modelValue": b[0] || (b[0] = (s) => a.value = s),
|
|
1282
|
+
placeholder: "Filter items"
|
|
1283
|
+
}, null, 8, ["modelValue"]),
|
|
1284
|
+
l("div", Wo, [
|
|
1285
|
+
m(f, {
|
|
1286
|
+
"shrink-at": -1,
|
|
1287
|
+
"column-defs": [{ accessorKey: "code" }, { accessorKey: "name" }],
|
|
1288
|
+
"row-data": ((W = O.template) == null ? void 0 : W.purchaseOrder.items) ?? [],
|
|
1289
|
+
"search-value": a.value,
|
|
1290
|
+
"force-mobile-footer": "",
|
|
1291
|
+
"hide-header-row": "",
|
|
1292
|
+
loading: $.value
|
|
1293
|
+
}, {
|
|
1294
|
+
"list-row": L((s) => [
|
|
1295
|
+
l("div", Zo, [
|
|
1296
|
+
l("div", Jo, [
|
|
1297
|
+
l("div", Xo, D(w(s).name), 1),
|
|
1298
|
+
b[4] || (b[4] = l("div", { class: "flex-1 min-w-32" }, null, -1)),
|
|
1299
|
+
l("div", Yo, D(e(_t)(
|
|
1300
|
+
w(s).quantity,
|
|
1301
|
+
w(s).sku.unit,
|
|
1302
|
+
w(s).measurement
|
|
1303
|
+
)), 1)
|
|
1304
|
+
]),
|
|
1305
|
+
l("div", el, [
|
|
1306
|
+
l("div", tl, D(w(s).code), 1),
|
|
1307
|
+
w(s).totalCost && e(r).enableTotalCost ? (C(), N("div", ol, " (" + D(e(yt)(w(s).totalCost)) + ") ", 1)) : se("", !0)
|
|
1308
|
+
]),
|
|
1309
|
+
e(xt)(w(s)) ? (C(), N("div", ll, [
|
|
1310
|
+
m(i, {
|
|
1311
|
+
name: "error",
|
|
1312
|
+
color: "system-error-300",
|
|
1313
|
+
size: "sm"
|
|
1314
|
+
}),
|
|
1315
|
+
b[5] || (b[5] = l("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))
|
|
1316
|
+
])) : se("", !0)
|
|
1317
|
+
])
|
|
1318
|
+
]),
|
|
1319
|
+
_: 1
|
|
1320
|
+
}, 8, ["row-data", "search-value", "loading"])
|
|
1321
|
+
])
|
|
1322
|
+
])
|
|
1323
|
+
]),
|
|
1324
|
+
b[10] || (b[10] = l("div", null, null, -1)),
|
|
1325
|
+
b[11] || (b[11] = l("div", null, null, -1)),
|
|
1326
|
+
l("div", sl, [
|
|
1327
|
+
(E = O.template) != null && E.locationTags ? (C(), N(me, { key: 0 }, [
|
|
1328
|
+
b[6] || (b[6] = l("div", { class: "flex flex-col" }, [
|
|
1329
|
+
l("div", { class: "fm-typo-en-body-lg-600" }, "Enabled location tags"),
|
|
1330
|
+
l("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " This template is enabled for the following location tags. ")
|
|
1331
|
+
], -1)),
|
|
1332
|
+
l("div", nl, [
|
|
1333
|
+
(C(!0), N(me, null, Te(O.template.locationTags, (s, n) => (C(), ee(V, {
|
|
1334
|
+
label: s,
|
|
1335
|
+
key: n
|
|
1336
|
+
}, null, 8, ["label"]))), 128))
|
|
1337
|
+
]),
|
|
1338
|
+
b[7] || (b[7] = l("div", null, null, -1)),
|
|
1339
|
+
b[8] || (b[8] = l("div", null, null, -1))
|
|
1340
|
+
], 64)) : se("", !0),
|
|
1341
|
+
b[9] || (b[9] = l("div", { class: "flex flex-col" }, [
|
|
1342
|
+
l("div", { class: "fm-typo-en-body-lg-600" }, "Enabled locations"),
|
|
1343
|
+
l("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " This template is only usable for the following locations. ")
|
|
1344
|
+
], -1)),
|
|
1345
|
+
l("div", al, [
|
|
1346
|
+
m(g, {
|
|
1347
|
+
modelValue: _.value,
|
|
1348
|
+
"onUpdate:modelValue": b[1] || (b[1] = (s) => _.value = s),
|
|
1349
|
+
placeholder: "Filter locations",
|
|
1350
|
+
"prepend-icon": "search"
|
|
1351
|
+
}, null, 8, ["modelValue"]),
|
|
1352
|
+
m(f, {
|
|
1353
|
+
"hide-footer": "",
|
|
1354
|
+
style: { height: "500px" },
|
|
1355
|
+
"column-defs": h,
|
|
1356
|
+
"search-value": _.value,
|
|
1357
|
+
"row-data": ((U = v.template) == null ? void 0 : U.locations) ?? [{ name: "All locations" }]
|
|
1358
|
+
}, null, 8, ["search-value", "row-data"])
|
|
1359
|
+
])
|
|
1360
|
+
])
|
|
1361
|
+
])
|
|
1362
|
+
];
|
|
1363
|
+
}),
|
|
1364
|
+
"side-sheet-footer": L(() => [
|
|
1365
|
+
l("div", rl, [
|
|
1366
|
+
m(F, {
|
|
1367
|
+
label: e(u)("common.edit"),
|
|
1368
|
+
onClick: b[2] || (b[2] = (W) => t("action:edit")),
|
|
1369
|
+
variant: "tertiary"
|
|
1370
|
+
}, null, 8, ["label"])
|
|
1371
|
+
])
|
|
1372
|
+
]),
|
|
1373
|
+
_: 1
|
|
1374
|
+
}, 8, ["header", "modelValue", "dismiss-away"]);
|
|
1375
|
+
};
|
|
1376
|
+
}
|
|
1377
|
+
}), ul = { class: "flex-1 flex flex-col gap-8" }, dl = { class: "flex flex-col" }, ml = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, pl = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, cl = { class: "fm-typo-en-body-lg-400" }, fl = { class: "fm-typo-en-body-lg-400 line-clamp-1" }, yl = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, Il = /* @__PURE__ */ ae({
|
|
1378
|
+
__name: "TransferTemplateView",
|
|
1379
|
+
setup(c) {
|
|
1380
|
+
const { t: y } = ue(), { createTemplate: v, viewTemplate: t, importTemplates: r, exportTemplates: u } = Ee(), { templateDialogProps: o, templateDetailsProps: a } = Ne(Ee()), h = Tt(), { loading: _, templates: M } = Ne(h), B = z(!1), I = vt(), $ = Ge(), { breakpoints: w } = wt();
|
|
1381
|
+
xe(h.fetchTemplates);
|
|
1382
|
+
const O = H(
|
|
1383
|
+
() => B.value || _.value || !$._currentLocation
|
|
1384
|
+
), b = H(() => M.value), p = z(""), d = H(() => w.value.xs || w.value.sm), g = H(() => d.value ? 10 : 20);
|
|
1385
|
+
function i(F) {
|
|
1386
|
+
switch (F) {
|
|
1387
|
+
case qe.Add:
|
|
1388
|
+
return v();
|
|
1389
|
+
case "refresh":
|
|
1390
|
+
return h.fetchTemplates();
|
|
1391
|
+
case "import":
|
|
1392
|
+
return r();
|
|
1393
|
+
case "export":
|
|
1394
|
+
return u();
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
function f(F) {
|
|
1398
|
+
return F;
|
|
1399
|
+
}
|
|
1400
|
+
const V = H(() => [
|
|
1401
|
+
{
|
|
1402
|
+
label: y("inventory.closing.template.create.title"),
|
|
1403
|
+
value: qe.Add,
|
|
1404
|
+
isPrimary: !0,
|
|
1405
|
+
prependIcon: "add"
|
|
1406
|
+
},
|
|
1407
|
+
{
|
|
1408
|
+
label: "Refresh",
|
|
1409
|
+
value: "refresh",
|
|
1410
|
+
isPrimary: !1
|
|
1411
|
+
},
|
|
1412
|
+
{
|
|
1413
|
+
label: "Import",
|
|
1414
|
+
value: "import",
|
|
1415
|
+
isPrimary: !1
|
|
1416
|
+
},
|
|
1417
|
+
{
|
|
1418
|
+
label: "Export",
|
|
1419
|
+
value: "export",
|
|
1420
|
+
isPrimary: !1
|
|
1421
|
+
}
|
|
1422
|
+
]);
|
|
1423
|
+
return (F, S) => {
|
|
1424
|
+
const Z = A("FmTable");
|
|
1425
|
+
return C(), N(me, null, [
|
|
1426
|
+
m(bt, {
|
|
1427
|
+
title: e(y)("inventory.transfer.template.title2"),
|
|
1428
|
+
actions: V.value,
|
|
1429
|
+
"onClick:action": i
|
|
1430
|
+
}, {
|
|
1431
|
+
default: L(() => {
|
|
1432
|
+
var W;
|
|
1433
|
+
return [
|
|
1434
|
+
l("div", {
|
|
1435
|
+
class: ne([
|
|
1436
|
+
"flex flex-col gap-8 max-h-full",
|
|
1437
|
+
{
|
|
1438
|
+
"p-0": d.value,
|
|
1439
|
+
"px-24 ": !d.value
|
|
1440
|
+
}
|
|
1441
|
+
])
|
|
1442
|
+
}, [
|
|
1443
|
+
m(ht, {
|
|
1444
|
+
searchable: "",
|
|
1445
|
+
search: p.value,
|
|
1446
|
+
"onUpdate:search": S[0] || (S[0] = (E) => p.value = E)
|
|
1447
|
+
}, null, 8, ["search"]),
|
|
1448
|
+
(C(), ee(Z, {
|
|
1449
|
+
style: He(e(I).tableHeight),
|
|
1450
|
+
"column-defs": e(h).columnDefs,
|
|
1451
|
+
"row-data": b.value,
|
|
1452
|
+
"search-value": p.value,
|
|
1453
|
+
loading: O.value,
|
|
1454
|
+
key: (W = e($)._currentLocation) == null ? void 0 : W.dbName,
|
|
1455
|
+
onRowClick: S[1] || (S[1] = (E) => e(t)(E.original)),
|
|
1456
|
+
"page-size": g.value
|
|
1457
|
+
}, {
|
|
1458
|
+
"list-row": L((E) => [
|
|
1459
|
+
m(We, {
|
|
1460
|
+
row: E,
|
|
1461
|
+
onRowClick: (U) => e(t)(U)
|
|
1462
|
+
}, {
|
|
1463
|
+
default: L((U) => {
|
|
1464
|
+
var s, n, T, R, K, q, k, P, Q, X, oe, x, G, re, we, Fe, Ce, Ie, Se, $e, pe, Oe, Me, Ve, De, ce, Re;
|
|
1465
|
+
return [
|
|
1466
|
+
l("div", ul, [
|
|
1467
|
+
l("div", dl, [
|
|
1468
|
+
l("div", ml, [
|
|
1469
|
+
m(e(J), {
|
|
1470
|
+
render: (T = (n = (s = U._id) == null ? void 0 : s.column) == null ? void 0 : n.columnDef) == null ? void 0 : T.cell,
|
|
1471
|
+
props: (K = (R = U._id) == null ? void 0 : R.getContext) == null ? void 0 : K.call(R)
|
|
1472
|
+
}, null, 8, ["render", "props"])
|
|
1473
|
+
]),
|
|
1474
|
+
l("div", pl, [
|
|
1475
|
+
m(e(J), {
|
|
1476
|
+
render: (P = (k = (q = U.name) == null ? void 0 : q.column) == null ? void 0 : k.columnDef) == null ? void 0 : P.cell,
|
|
1477
|
+
props: (X = (Q = U.name) == null ? void 0 : Q.getContext) == null ? void 0 : X.call(Q)
|
|
1478
|
+
}, null, 8, ["render", "props"])
|
|
1479
|
+
]),
|
|
1480
|
+
l("div", cl, [
|
|
1481
|
+
m(e(J), {
|
|
1482
|
+
render: (G = (x = (oe = U.supplier) == null ? void 0 : oe.column) == null ? void 0 : x.columnDef) == null ? void 0 : G.cell,
|
|
1483
|
+
props: (we = (re = U.supplier) == null ? void 0 : re.getContext) == null ? void 0 : we.call(re)
|
|
1484
|
+
}, null, 8, ["render", "props"])
|
|
1485
|
+
]),
|
|
1486
|
+
l("div", null, D((Fe = E.original.locations) != null && Fe.length ? `Enabled for ${(Ce = E.original.locations) == null ? void 0 : Ce.length} outlets` : "Enabled for all outlets"), 1),
|
|
1487
|
+
l("div", fl, D(E.original.purchaseOrder.items.length ? E.original.purchaseOrder.items.map((Xe) => Xe.name).join(", ") : "No items"), 1),
|
|
1488
|
+
l("div", yl, [
|
|
1489
|
+
m(e(J), {
|
|
1490
|
+
render: ($e = (Se = (Ie = U.ref) == null ? void 0 : Ie.column) == null ? void 0 : Se.columnDef) == null ? void 0 : $e.cell,
|
|
1491
|
+
props: (Oe = (pe = U.ref) == null ? void 0 : pe.getContext) == null ? void 0 : Oe.call(pe)
|
|
1492
|
+
}, null, 8, ["render", "props"])
|
|
1493
|
+
])
|
|
1494
|
+
]),
|
|
1495
|
+
l("div", null, [
|
|
1496
|
+
m(e(J), {
|
|
1497
|
+
render: (De = (Ve = (Me = U.type) == null ? void 0 : Me.column) == null ? void 0 : Ve.columnDef) == null ? void 0 : De.cell,
|
|
1498
|
+
props: (Re = (ce = U.type) == null ? void 0 : ce.getContext) == null ? void 0 : Re.call(ce)
|
|
1499
|
+
}, null, 8, ["render", "props"])
|
|
1500
|
+
])
|
|
1501
|
+
])
|
|
1502
|
+
];
|
|
1503
|
+
}),
|
|
1504
|
+
_: 2
|
|
1505
|
+
}, 1032, ["row", "onRowClick"])
|
|
1506
|
+
]),
|
|
1507
|
+
_: 1
|
|
1508
|
+
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
1509
|
+
], 2)
|
|
1510
|
+
];
|
|
1511
|
+
}),
|
|
1512
|
+
_: 1
|
|
1513
|
+
}, 8, ["title", "actions"]),
|
|
1514
|
+
(C(), ee(ot, { to: "body" }, [
|
|
1515
|
+
m(il, lt(st(e(a))), null, 16),
|
|
1516
|
+
m(Io, Qe(e(o), {
|
|
1517
|
+
onSubmitted: S[2] || (S[2] = (W) => e(h).fetchTemplates())
|
|
1518
|
+
}), null, 16)
|
|
1519
|
+
]))
|
|
1520
|
+
], 64);
|
|
1521
|
+
};
|
|
1522
|
+
}
|
|
1523
|
+
});
|
|
1524
|
+
export {
|
|
1525
|
+
Il as default
|
|
1526
|
+
};
|