@feedmepos/mf-inventory-portal 0.0.9-dev.4 → 0.0.9-dev.6
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/{ApprovalView-CxLA9Tk4.js → ApprovalView-Cy6o4vgq.js} +6 -6
- package/dist/{BindingsDialog-2d8KMiNt.js → BindingsDialog-Da4mKx5M.js} +2 -2
- package/dist/{BindingsPicker-Dq3KYBOH.js → BindingsPicker-9l3ylHk3.js} +2 -2
- package/dist/{BindingsTable-VR_PJt-H.js → BindingsTable-BBd97tsS.js} +3 -3
- package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-BI1e8qoK.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-BBqgA2aN.js} +1 -1
- package/dist/{FmMultiselectDialog.vue_vue_type_script_setup_true_lang-BXmff--W.js → FmMultiselectDialog.vue_vue_type_script_setup_true_lang-D9kKpClR.js} +2 -2
- package/dist/FmUnitInput.vue_vue_type_script_setup_true_lang-21-IoTzr.js +223 -0
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-Y14_-iJZ.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DdRnS0yE.js} +1 -1
- package/dist/{IngredientsView-BBebPKbz.js → IngredientsView-CtAESxcL.js} +6 -6
- package/dist/{IntegrationView-B37GHYlO.js → IntegrationView-CzO3PutO.js} +3 -3
- package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-eJrgpgsK.js +276 -0
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-g073RKQ2.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BaPCT7m6.js} +1 -1
- package/dist/{PurchaseOrderPrintPreview-BhdBZIJt.js → PurchaseOrderPrintPreview-S5uXyleV.js} +1 -1
- package/dist/{ReceiveRequestView-CFfPqNJl.js → ReceiveRequestView-B_iVgs0l.js} +387 -385
- package/dist/{RecipeView-B5TcxFNE.js → RecipeView-CTC9v2hH.js} +7 -7
- package/dist/{StockView-CVCN3wkh.js → StockView-DbukZ1Pu.js} +12 -12
- package/dist/SupplierView-C98G3f39.js +803 -0
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-M0Z_1-dh.js → TransferDetails.vue_vue_type_script_setup_true_lang-DN2t2tQn.js} +5 -5
- package/dist/{UnitView-VjvCa-_J.js → UnitView-DVl7voaF.js} +6 -6
- package/dist/{WarehouseView-CudKexeI.js → WarehouseView-DPe_npYA.js} +3 -3
- package/dist/{app-BKRjwub_.js → app-BrtBi6V8.js} +3 -3
- package/dist/app.js +1 -1
- package/dist/components/FmDecimalInputProps.d.ts +13 -0
- package/dist/components/FmUnitInputProps.d.ts +7 -0
- package/dist/{date2-C8AM1GIN.js → date2-BvGKe7pe.js} +1 -1
- package/dist/{dayjs.min-DYayH1UN.js → dayjs.min-DM-sejr0.js} +2 -2
- package/dist/{decimal-CMayQ-Di.js → decimal-Cbm8313c.js} +1 -1
- package/dist/{fuzzy-DfvjJF-Y.js → fuzzy-BG3pP_WO.js} +1 -1
- package/dist/{init-date-range-DdbbMhPB.js → init-date-range-d84mdcG8.js} +1 -1
- package/dist/{layout-JDXCtoya.js → layout-TawyfRi7.js} +1 -1
- package/dist/{rules-CyIMpyLJ.js → rules-D-Bw7E0k.js} +25 -28
- package/dist/{stock-estimate-B_iBijXH.js → stock-estimate-rFOPsZNO.js} +2 -2
- package/dist/{supplier-CGgz9s7x.js → supplier-BXkTD6wl.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-inventory-binding-dialog-BLeDIWYh.js → use-inventory-binding-dialog-DuVk-QOK.js} +2 -2
- package/dist/views/dev/components/FmDecimalInputTest.vue.d.ts +2 -0
- package/dist/{xlsx-CeDIlGss.js → xlsx-D150Vh83.js} +637 -637
- package/package.json +3 -3
- package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-CEthycAQ.js +0 -476
- package/dist/SupplierView-CRpaJJyN.js +0 -831
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { defineComponent as ke, ref as j, watch as ue, computed as
|
|
2
|
-
import { I as ut, d as xe, m as Ce, n as
|
|
3
|
-
import { i as st } from "./init-date-range-
|
|
4
|
-
import { u as
|
|
5
|
-
import { a as G, k as
|
|
6
|
-
import { _ as
|
|
7
|
-
import { d as
|
|
8
|
-
import { _ as
|
|
9
|
-
import { _ as
|
|
10
|
-
import { useDialog as
|
|
11
|
-
import { R as
|
|
1
|
+
import { defineComponent as ke, ref as j, watch as ue, computed as $, resolveComponent as S, openBlock as _, createBlock as W, withCtx as T, createElementVNode as a, createVNode as u, toDisplayString as Z, createElementBlock as F, Fragment as $e, renderList as ot, unref as d, createTextVNode as co, mergeModels as Kt, reactive as mo, useModel as po, onMounted as fo, createCommentVNode as B, normalizeClass as Je, normalizeStyle as lo, resolveDynamicComponent as vo, h as Y, isRef as _o, Teleport as go, mergeProps as Bt } from "vue";
|
|
2
|
+
import { I as ut, d as xe, m as Ce, n as yo, e as ft, a as ho, C as ct, u as bo, o as Xe, p as xo } from "./app-BrtBi6V8.js";
|
|
3
|
+
import { i as st } from "./init-date-range-d84mdcG8.js";
|
|
4
|
+
import { u as no, p as Gt, P as A, a as Co, b as ko, _ as wo, g as So } from "./TransferDetails.vue_vue_type_script_setup_true_lang-DN2t2tQn.js";
|
|
5
|
+
import { a as G, k as Wt, b as tt, s as pt, t as Do, u as Fo, v as Zt, w as Vo, i as Jt, x as Po, q as dt, y as To, j as Xt, c as eo } from "./date2-BvGKe7pe.js";
|
|
6
|
+
import { _ as Uo, u as Ro, i as Ao, e as $o } from "./stock-estimate-rFOPsZNO.js";
|
|
7
|
+
import { d as mt } from "./dayjs.min-DM-sejr0.js";
|
|
8
|
+
import { _ as Mo } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CFjO4TPG.js";
|
|
9
|
+
import { _ as Eo } from "./ChangeLocationComponent.vue_vue_type_script_setup_true_lang-BBqgA2aN.js";
|
|
10
|
+
import { useDialog as Oo, useSnackbar as vt, components as le, useProxiedModel as No, useBreakpoints as Ho } from "@feedmepos/ui-library";
|
|
11
|
+
import { R as to, F as Ae } from "./row-action.enum-BwQbURNh.js";
|
|
12
12
|
import { useCoreStore as Io } from "@feedmepos/mf-common";
|
|
13
|
-
import { _ as
|
|
14
|
-
import { F as ee, _ as
|
|
15
|
-
import { R as et, B as
|
|
16
|
-
import { u as
|
|
17
|
-
import { _ as
|
|
18
|
-
const
|
|
13
|
+
import { _ as Yo } from "./FmMultiselectDialog.vue_vue_type_script_setup_true_lang-D9kKpClR.js";
|
|
14
|
+
import { F as ee, _ as ro, u as qo } from "./layout-TawyfRi7.js";
|
|
15
|
+
import { R as et, B as zo, A as Lo, M as oo, a as jo } from "./rules-D-Bw7E0k.js";
|
|
16
|
+
import { u as io } from "./supplier-BXkTD6wl.js";
|
|
17
|
+
import { _ as Qo } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-BvadeWUz.js";
|
|
18
|
+
const Ko = { class: "inline-flex rounded-md items-center gap-4 justify-center h-[30px] px-8 py-4 bg-fm-color-neutral-gray-100 cursor-pointer text-fm-color-neutral-gray-400" }, Bo = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, Go = /* @__PURE__ */ ke({
|
|
19
19
|
__name: "FmDateRangePickerChip",
|
|
20
20
|
props: {
|
|
21
21
|
modelValue: { default: (q) => q.modelValue ?? st() }
|
|
@@ -26,39 +26,39 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
26
26
|
ue(k, (C) => {
|
|
27
27
|
J("update:modelValue", C);
|
|
28
28
|
});
|
|
29
|
-
const
|
|
30
|
-
const { startDate: C, endDate:
|
|
31
|
-
return !C && !
|
|
29
|
+
const M = $(() => {
|
|
30
|
+
const { startDate: C, endDate: y } = k.value;
|
|
31
|
+
return !C && !y ? "" : `${C} - ${y}`;
|
|
32
32
|
});
|
|
33
|
-
return (C,
|
|
34
|
-
const
|
|
33
|
+
return (C, y) => {
|
|
34
|
+
const U = S("FmIcon"), z = S("FmDateRangePicker");
|
|
35
35
|
return _(), W(z, {
|
|
36
36
|
"show-predefined-range": "",
|
|
37
37
|
modelValue: k.value,
|
|
38
|
-
"onUpdate:modelValue":
|
|
38
|
+
"onUpdate:modelValue": y[0] || (y[0] = (g) => k.value = g),
|
|
39
39
|
"start-label": "",
|
|
40
40
|
"end-label": ""
|
|
41
41
|
}, {
|
|
42
|
-
"trigger-button":
|
|
43
|
-
a("div",
|
|
44
|
-
u(
|
|
42
|
+
"trigger-button": T(() => [
|
|
43
|
+
a("div", Ko, [
|
|
44
|
+
u(U, {
|
|
45
45
|
name: "calendar_month",
|
|
46
46
|
size: "sm"
|
|
47
47
|
}),
|
|
48
|
-
a("div",
|
|
48
|
+
a("div", Bo, Z(M.value), 1)
|
|
49
49
|
])
|
|
50
50
|
]),
|
|
51
51
|
_: 1
|
|
52
52
|
}, 8, ["modelValue"]);
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
}),
|
|
55
|
+
}), Wo = {
|
|
56
56
|
width: "24",
|
|
57
57
|
height: "24",
|
|
58
58
|
viewBox: "0 0 24 24",
|
|
59
59
|
fill: "none",
|
|
60
60
|
xmlns: "http://www.w3.org/2000/svg"
|
|
61
|
-
},
|
|
61
|
+
}, Zo = ["fill"], Jo = ["fill"], Xo = ["stroke"], es = ["stroke"], ts = /* @__PURE__ */ ke({
|
|
62
62
|
__name: "SparkIcon",
|
|
63
63
|
props: {
|
|
64
64
|
size: {
|
|
@@ -71,84 +71,84 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
73
|
setup(q) {
|
|
74
|
-
return (te, J) => (_(), F("svg",
|
|
74
|
+
return (te, J) => (_(), F("svg", Wo, [
|
|
75
75
|
a("path", {
|
|
76
76
|
d: "M7.6 7.6C8.17076 6.94229 8.5 5.5 8.5 5.5C8.5 5.5 8.81356 6.87361 9.35714 7.5C9.92948 8.15953 11.5 8.5 11.5 8.5C11.5 8.5 9.92948 8.69761 9.35714 9.35714C8.81356 9.98354 8.5 11.5 8.5 11.5C8.5 11.5 8.32076 10.1888 7.75 9.59091C7.14905 8.96136 5.5 8.5 5.5 8.5C5.5 8.5 6.99905 8.29251 7.6 7.6Z",
|
|
77
77
|
fill: q.color
|
|
78
|
-
}, null, 8,
|
|
78
|
+
}, null, 8, Zo),
|
|
79
79
|
a("path", {
|
|
80
80
|
d: "M12.2 12.2C13.3415 10.8846 14 8 14 8C14 8 14.6271 10.7472 15.7143 12C16.859 13.3191 20 14 20 14C20 14 16.859 14.3952 15.7143 15.7143C14.6271 16.9671 14 20 14 20C14 20 13.6415 17.3777 12.5 16.1818C11.2981 14.9227 8 14 8 14C8 14 10.9981 13.585 12.2 12.2Z",
|
|
81
81
|
fill: q.color
|
|
82
|
-
}, null, 8,
|
|
82
|
+
}, null, 8, Jo),
|
|
83
83
|
a("path", {
|
|
84
84
|
d: "M7.6 7.6C8.17076 6.94229 8.5 5.5 8.5 5.5C8.5 5.5 8.81356 6.87361 9.35714 7.5C9.92948 8.15953 11.5 8.5 11.5 8.5C11.5 8.5 9.92948 8.69761 9.35714 9.35714C8.81356 9.98354 8.5 11.5 8.5 11.5C8.5 11.5 8.32076 10.1888 7.75 9.59091C7.14905 8.96136 5.5 8.5 5.5 8.5C5.5 8.5 6.99905 8.29251 7.6 7.6Z",
|
|
85
85
|
stroke: q.color,
|
|
86
86
|
"stroke-width": "1.5",
|
|
87
87
|
"stroke-linecap": "round",
|
|
88
88
|
"stroke-linejoin": "round"
|
|
89
|
-
}, null, 8,
|
|
89
|
+
}, null, 8, Xo),
|
|
90
90
|
a("path", {
|
|
91
91
|
d: "M12.2 12.2C13.3415 10.8846 14 8 14 8C14 8 14.6271 10.7472 15.7143 12C16.859 13.3191 20 14 20 14C20 14 16.859 14.3952 15.7143 15.7143C14.6271 16.9671 14 20 14 20C14 20 13.6415 17.3777 12.5 16.1818C11.2981 14.9227 8 14 8 14C8 14 10.9981 13.585 12.2 12.2Z",
|
|
92
92
|
stroke: q.color,
|
|
93
93
|
"stroke-width": "1.5",
|
|
94
94
|
"stroke-linecap": "round",
|
|
95
95
|
"stroke-linejoin": "round"
|
|
96
|
-
}, null, 8,
|
|
96
|
+
}, null, 8, es)
|
|
97
97
|
]));
|
|
98
98
|
}
|
|
99
|
-
}),
|
|
99
|
+
}), os = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center" }, ss = { class: "fm-typo-body-md-400 mr-auto xs:w-full" }, as = { class: "hidden xs:inline" }, ls = {
|
|
100
100
|
key: 0,
|
|
101
101
|
class: "fm-typo-body-sm-700"
|
|
102
|
-
},
|
|
102
|
+
}, ns = { class: "xs:hidden" }, rs = {
|
|
103
103
|
key: 1,
|
|
104
104
|
class: "fm-typo-body-sm-700 text-fm-color-typo-disabled"
|
|
105
|
-
},
|
|
105
|
+
}, is = { class: "fm-typo-body-sm-400 text-fm-color-typo-secondary" }, us = {
|
|
106
106
|
key: 0,
|
|
107
107
|
class: "flex flex-col"
|
|
108
|
-
},
|
|
108
|
+
}, cs = { key: 1 }, so = /* @__PURE__ */ ke({
|
|
109
109
|
__name: "SupplierPriceHistory",
|
|
110
110
|
props: {
|
|
111
111
|
prices: {}
|
|
112
112
|
},
|
|
113
113
|
setup(q) {
|
|
114
|
-
const te =
|
|
114
|
+
const te = io();
|
|
115
115
|
function J(k) {
|
|
116
|
-
return te.suppliers.find((
|
|
116
|
+
return te.suppliers.find((M) => M._id === k);
|
|
117
117
|
}
|
|
118
|
-
return (k,
|
|
119
|
-
const C =
|
|
120
|
-
return _(), F("div",
|
|
121
|
-
(_(!0), F(
|
|
122
|
-
var
|
|
118
|
+
return (k, M) => {
|
|
119
|
+
const C = S("FmTooltip");
|
|
120
|
+
return _(), F("div", os, [
|
|
121
|
+
(_(!0), F($e, null, ot(Object.keys(k.prices), (y) => {
|
|
122
|
+
var U, z, g;
|
|
123
123
|
return _(), F("div", {
|
|
124
|
-
key:
|
|
124
|
+
key: y,
|
|
125
125
|
class: "flex items-center gap-12 xs:gap-4 xs:flex-wrap w-full"
|
|
126
126
|
}, [
|
|
127
|
-
a("div",
|
|
128
|
-
a("span", null, Z((
|
|
129
|
-
a("span",
|
|
127
|
+
a("div", ss, [
|
|
128
|
+
a("span", null, Z((U = J(y)) == null ? void 0 : U.name), 1),
|
|
129
|
+
a("span", as, " (per " + Z((g = (z = k.prices[y].find((f) => f.unit)) == null ? void 0 : z.unit) == null ? void 0 : g.abbrev) + ") ", 1)
|
|
130
130
|
]),
|
|
131
|
-
(_(!0), F(
|
|
131
|
+
(_(!0), F($e, null, ot(k.prices[y], (f) => (_(), F("div", {
|
|
132
132
|
key: f.date,
|
|
133
133
|
class: "flex flex-col w-120 xs:w-72 xs:flex-1 text-ellipsis cursor-pointer"
|
|
134
134
|
}, [
|
|
135
135
|
u(C, { "z-index": 50 }, {
|
|
136
|
-
content:
|
|
137
|
-
f.totalUnits && f.unit && f.pricePerUnit ? (_(), F("div",
|
|
136
|
+
content: T(() => [
|
|
137
|
+
f.totalUnits && f.unit && f.pricePerUnit ? (_(), F("div", us, [
|
|
138
138
|
a("div", null, " Total units: " + Z(d(G)(f.totalUnits)) + " " + Z(f.unit.abbrev), 1),
|
|
139
|
-
a("div", null, " Total bought: " + Z(d(
|
|
139
|
+
a("div", null, " Total bought: " + Z(d(Wt)({
|
|
140
140
|
...d(tt)(f.pricePerUnit, f.totalUnits),
|
|
141
141
|
currency: f.pricePerUnit.currency
|
|
142
142
|
})), 1)
|
|
143
|
-
])) : (_(), F("div",
|
|
143
|
+
])) : (_(), F("div", cs, "No data"))
|
|
144
144
|
]),
|
|
145
|
-
default:
|
|
145
|
+
default: T(() => [
|
|
146
146
|
a("div", null, [
|
|
147
|
-
f.pricePerUnit && f.unit ? (_(), F("div",
|
|
148
|
-
|
|
149
|
-
a("span",
|
|
150
|
-
])) : (_(), F("div",
|
|
151
|
-
a("div",
|
|
147
|
+
f.pricePerUnit && f.unit ? (_(), F("div", ls, [
|
|
148
|
+
co(Z(d(Wt)(f.pricePerUnit)) + " ", 1),
|
|
149
|
+
a("span", ns, "/ " + Z(f.unit.abbrev), 1)
|
|
150
|
+
])) : (_(), F("div", rs, "No data")),
|
|
151
|
+
a("div", is, Z(d(pt)(new Date(f.date))), 1)
|
|
152
152
|
])
|
|
153
153
|
]),
|
|
154
154
|
_: 2
|
|
@@ -159,28 +159,28 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
159
159
|
]);
|
|
160
160
|
};
|
|
161
161
|
}
|
|
162
|
-
}),
|
|
162
|
+
}), ds = { class: "flex flex-col w-full gap-40" }, ms = { class: "flex flex-col gap-8" }, ps = /* @__PURE__ */ a("div", { class: "fm-typo-en-title-sm-800" }, "Transfer details", -1), fs = { class: "flex items-center gap-8" }, vs = /* @__PURE__ */ a("div", null, null, -1), _s = { class: "flex flex-col gap-4" }, gs = {
|
|
163
163
|
key: 0,
|
|
164
164
|
class: "p-16 border border-fm-color-neutral-gray-300 fm-corner-radius-md flex flex-col"
|
|
165
|
-
},
|
|
165
|
+
}, ys = { class: "flex xs:flex-col sm:flex-col" }, hs = /* @__PURE__ */ a("div", { class: "xs:hidden sm:hidden h-48 lg:w-16 md:w-16" }, null, -1), bs = {
|
|
166
166
|
key: 0,
|
|
167
167
|
class: "flex-1 flex gap-8 h-48 xs:flex-col xs:pt-16 sm:flex-col sm:pt-16"
|
|
168
|
-
},
|
|
168
|
+
}, xs = { class: "flex-1" }, Cs = { class: "flex-1" }, ks = {
|
|
169
169
|
key: 1,
|
|
170
170
|
class: "flex items-center gap-4"
|
|
171
|
-
},
|
|
171
|
+
}, ws = /* @__PURE__ */ a("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary translate-y-[1px]" }, " Cannot backdate without an initial closing made to the system. ", -1), Ss = { class: "flex flex-col gap-8" }, Ds = { class: "flex items-center xs:flex-col xs:gap-4" }, Fs = /* @__PURE__ */ a("div", { class: "xs:w-full flex-1 fm-typo-en-title-sm-800" }, "Transfer items", -1), Vs = {
|
|
172
172
|
key: 0,
|
|
173
173
|
class: "xs:w-full"
|
|
174
|
-
}, Ps = { class: "flex gap-2" },
|
|
174
|
+
}, Ps = { class: "flex gap-2" }, Ts = ["disabled"], Us = { class: "w-[343px] px-24 py-16 rounded-lg shadow-light-300 flex flex-col gap-[20px]" }, Rs = { class: "flex items-center" }, As = /* @__PURE__ */ a("p", { class: "flex-1 fm-typo-en-title-sm-800" }, "Forecast stock", -1), $s = { class: "flex items-start gap-8" }, Ms = /* @__PURE__ */ a("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Selecting forecast stock will replace your current item selection. ", -1), Es = { class: "flex gap-1" }, Os = /* @__PURE__ */ a("div", { class: "grow" }, null, -1), Ns = { key: 0 }, Hs = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, Is = { key: 0 }, Ys = ["colspan"], qs = { class: "flex flex-col gap-4" }, zs = { class: "flex items-center" }, Ls = { class: "flex-1" }, js = { class: "grid grid-cols-2 gap-4" }, Qs = { class: "flex flex-col" }, Ks = { class: "flex flex-col" }, Bs = { class: "flex flex-col" }, Gs = { class: "flex flex-col" }, Ws = {
|
|
175
175
|
key: 0,
|
|
176
176
|
class: "flex flex-col col-span-2",
|
|
177
177
|
"data-cy": "fm-table-list-view-cost-label"
|
|
178
|
-
},
|
|
178
|
+
}, Zs = {
|
|
179
179
|
key: 0,
|
|
180
180
|
class: "flex gap-4 text-fm-color-typo-primary fm-typo-en-body-lg-600"
|
|
181
|
-
},
|
|
181
|
+
}, Js = /* @__PURE__ */ ke({
|
|
182
182
|
__name: "TransferForm",
|
|
183
|
-
props: /* @__PURE__ */
|
|
183
|
+
props: /* @__PURE__ */ Kt({
|
|
184
184
|
modelValue: {},
|
|
185
185
|
disabled: { type: Boolean },
|
|
186
186
|
suppliers: { default: () => [] },
|
|
@@ -195,21 +195,21 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
195
195
|
},
|
|
196
196
|
modelModifiers: {}
|
|
197
197
|
}),
|
|
198
|
-
emits: /* @__PURE__ */
|
|
198
|
+
emits: /* @__PURE__ */ Kt(["validation-success"], ["update:modelValue"]),
|
|
199
199
|
setup(q, { expose: te, emit: J }) {
|
|
200
|
-
const k =
|
|
200
|
+
const k = ft(), M = Ro(), C = Io(), y = no(), U = ho(), z = mo({}), g = q, f = $(() => {
|
|
201
201
|
function e(o) {
|
|
202
202
|
return Object.prototype.hasOwnProperty.call(o, "_rev") && Object.prototype.hasOwnProperty.call(o, "status");
|
|
203
203
|
}
|
|
204
|
-
const t =
|
|
204
|
+
const t = g.modelValue;
|
|
205
205
|
return !e(t) || t.status === "DRAFT";
|
|
206
|
-
}), oe =
|
|
206
|
+
}), oe = $(() => {
|
|
207
207
|
var o;
|
|
208
208
|
if (f.value)
|
|
209
209
|
return !0;
|
|
210
|
-
const e =
|
|
210
|
+
const e = g.lastClosingDate, t = (o = g.modelValue) != null && o._id ? Gt(g.modelValue._id) : null;
|
|
211
211
|
return !e || !t ? !1 : t.getTime() > e.getTime();
|
|
212
|
-
}), se = J, i =
|
|
212
|
+
}), se = J, i = po(q, "modelValue"), ve = $({
|
|
213
213
|
get() {
|
|
214
214
|
var e;
|
|
215
215
|
return ((e = i.value) == null ? void 0 : e.remark) ?? "";
|
|
@@ -218,13 +218,13 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
218
218
|
i.value.remark = e;
|
|
219
219
|
}
|
|
220
220
|
});
|
|
221
|
-
ue([() =>
|
|
221
|
+
ue([() => g.suppliers], () => {
|
|
222
222
|
if (b.value === A.PURCHASE) {
|
|
223
|
-
i.value.supplier =
|
|
223
|
+
i.value.supplier = g.suppliers[0];
|
|
224
224
|
return;
|
|
225
225
|
}
|
|
226
226
|
});
|
|
227
|
-
const
|
|
227
|
+
const V = $(() => g.disabled), R = $(() => i.value.items ?? []), E = (e) => {
|
|
228
228
|
const { name: t, address: o, regNo: l, phoneNo: s } = e.doc.profile;
|
|
229
229
|
return {
|
|
230
230
|
_id: e.doc._id,
|
|
@@ -245,14 +245,14 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
245
245
|
label: "Transfer",
|
|
246
246
|
value: A.TRANSFER
|
|
247
247
|
}
|
|
248
|
-
], b = j(A.PURCHASE), m =
|
|
248
|
+
], b = j(A.PURCHASE), m = $(() => {
|
|
249
249
|
var t;
|
|
250
250
|
const e = ((t = k._currentLocation) == null ? void 0 : t.type) === ut.warehouse;
|
|
251
251
|
return k.locations.filter((o) => {
|
|
252
252
|
var s;
|
|
253
253
|
return !(o.dbName === ((s = k._currentLocation) == null ? void 0 : s.dbName)) && (!e || o.type === ut.warehouse) && o.acceptRequest;
|
|
254
254
|
});
|
|
255
|
-
}), c =
|
|
255
|
+
}), c = $(() => b.value === A.PURCHASE ? g.suppliers.map((e) => ({
|
|
256
256
|
label: e.name,
|
|
257
257
|
value: e._id,
|
|
258
258
|
disabled: !1
|
|
@@ -260,16 +260,16 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
260
260
|
label: e.disabled ? `${e.name} (Upgrade POS)` : e.name,
|
|
261
261
|
value: e._id,
|
|
262
262
|
disabled: e.disabled
|
|
263
|
-
}))),
|
|
263
|
+
}))), D = $({
|
|
264
264
|
get() {
|
|
265
265
|
var e;
|
|
266
266
|
return ((e = i.value.supplier) == null ? void 0 : e._id) ?? null;
|
|
267
267
|
},
|
|
268
268
|
set(e) {
|
|
269
269
|
if (b.value === A.PURCHASE) {
|
|
270
|
-
i.value.supplier =
|
|
270
|
+
i.value.supplier = g.suppliers.find((o) => o._id === e) ?? null, i.value.items && (i.value.items = i.value.items.map((o) => ({
|
|
271
271
|
...o,
|
|
272
|
-
totalCost:
|
|
272
|
+
totalCost: H(o)
|
|
273
273
|
})));
|
|
274
274
|
return;
|
|
275
275
|
}
|
|
@@ -289,16 +289,16 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
289
289
|
return "MYR";
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
|
-
function
|
|
293
|
-
var x,
|
|
292
|
+
function H(e) {
|
|
293
|
+
var x, I, re, P, K, w, O, de, N, be;
|
|
294
294
|
if (z[e.sku._id])
|
|
295
295
|
return e.totalCost;
|
|
296
|
-
const t = e.measurement, l = ((K = (
|
|
297
|
-
(
|
|
298
|
-
)) == null ? void 0 :
|
|
296
|
+
const t = e.measurement, l = ((K = (P = (re = (I = (x = g.modelValue) == null ? void 0 : x.supplier) == null ? void 0 : I.supplyItems) == null ? void 0 : re.find(
|
|
297
|
+
(Pe) => Pe.skuId === e.sku._id
|
|
298
|
+
)) == null ? void 0 : P.defaultCost) == null ? void 0 : K.costPerUnit) ?? ((w = e.sku.defaultCost) == null ? void 0 : w.costPerUnit), s = l ? (O = e.sku.defaultCost) != null && O.measurement ? +G(l) / +G((de = e.sku.defaultCost) == null ? void 0 : de.measurement.conversion) : +G(l) : void 0, r = s ? t ? s * +G(t.conversion) : s : void 0, n = r ? +G(e.quantity) * r : void 0;
|
|
299
299
|
return e.totalCost ?? n ? {
|
|
300
300
|
...Do(n ?? 0, 2),
|
|
301
|
-
currency: X(((
|
|
301
|
+
currency: X(((N = C.currentCountry) == null ? void 0 : N.value) ?? xe)
|
|
302
302
|
} : {
|
|
303
303
|
amount: 1,
|
|
304
304
|
precision: 0,
|
|
@@ -307,40 +307,40 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
307
307
|
}
|
|
308
308
|
ue([() => b.value], ([e]) => {
|
|
309
309
|
var t;
|
|
310
|
-
|
|
311
|
-
const l =
|
|
310
|
+
D.value = ((t = c.value.find((o) => !o.disabled)) == null ? void 0 : t.value) ?? null, e === A.PURCHASE && U.enableTotalCost && (i.value.items = i.value.items.map((o) => {
|
|
311
|
+
const l = H(o);
|
|
312
312
|
return {
|
|
313
313
|
...o,
|
|
314
314
|
totalCost: l
|
|
315
315
|
};
|
|
316
316
|
}));
|
|
317
|
-
}), ue([() =>
|
|
317
|
+
}), ue([() => g.modelValue], ([e]) => {
|
|
318
318
|
var t, o, l;
|
|
319
|
-
((t = e == null ? void 0 : e.supplier) == null ? void 0 : t.internal) === Ce.enum.restaurant || ((o = e == null ? void 0 : e.supplier) == null ? void 0 : o.internal) === Ce.enum.warehouse ? b.value = A.TRANSFER : b.value = A.PURCHASE,
|
|
319
|
+
((t = e == null ? void 0 : e.supplier) == null ? void 0 : t.internal) === Ce.enum.restaurant || ((o = e == null ? void 0 : e.supplier) == null ? void 0 : o.internal) === Ce.enum.warehouse ? b.value = A.TRANSFER : b.value = A.PURCHASE, D.value = ((l = c.value.find((s) => {
|
|
320
320
|
var r, n;
|
|
321
|
-
return s.value === ((n = (r =
|
|
321
|
+
return s.value === ((n = (r = g.modelValue) == null ? void 0 : r.supplier) == null ? void 0 : n._id);
|
|
322
322
|
})) == null ? void 0 : l.value) ?? null;
|
|
323
|
-
}),
|
|
323
|
+
}), fo(() => {
|
|
324
324
|
var e, t, o, l, s, r, n;
|
|
325
|
-
((t = (e =
|
|
326
|
-
var x,
|
|
327
|
-
return p.value === ((
|
|
325
|
+
((t = (e = g.modelValue) == null ? void 0 : e.supplier) == null ? void 0 : t.internal) === Ce.enum.restaurant || ((l = (o = g.modelValue) == null ? void 0 : o.supplier) == null ? void 0 : l.internal) === Ce.enum.warehouse ? b.value = A.TRANSFER : b.value = A.PURCHASE, D.value = (s = g.modelValue) != null && s.supplier ? ((r = c.value.find((p) => {
|
|
326
|
+
var x, I;
|
|
327
|
+
return p.value === ((I = (x = g.modelValue) == null ? void 0 : x.supplier) == null ? void 0 : I._id);
|
|
328
328
|
})) == null ? void 0 : r.value) ?? null : ((n = c.value.find((p) => !p.disabled)) == null ? void 0 : n.value) ?? null;
|
|
329
329
|
});
|
|
330
|
-
const
|
|
330
|
+
const Me = Oo(), ne = j(7), ie = j(!1), we = vt();
|
|
331
331
|
async function Ee() {
|
|
332
332
|
if (ne.value < 1)
|
|
333
333
|
return;
|
|
334
|
-
ie.value = !1, await
|
|
334
|
+
ie.value = !1, await M.readPurchaseOrder(ne.value);
|
|
335
335
|
const e = {
|
|
336
336
|
...i.value
|
|
337
337
|
}, t = [];
|
|
338
|
-
if (
|
|
338
|
+
if (M.purchaseOrderForecast.skus.length <= 0) {
|
|
339
339
|
we.open({ message: "There is no forecast at the moment.", type: "info" });
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
|
-
e.items =
|
|
343
|
-
const s =
|
|
342
|
+
e.items = M.purchaseOrderForecast.skus.reduce((o, l) => {
|
|
343
|
+
const s = g.skus.find((p) => p._id === l.id);
|
|
344
344
|
if (o.find((p) => p.sku._id === l.id) || !s)
|
|
345
345
|
return o;
|
|
346
346
|
const n = {
|
|
@@ -356,7 +356,7 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
356
356
|
}, t), i.value = e;
|
|
357
357
|
}
|
|
358
358
|
function Oe() {
|
|
359
|
-
const e =
|
|
359
|
+
const e = g.skus.map((o) => ({
|
|
360
360
|
label: o.name,
|
|
361
361
|
sublabel: o.code,
|
|
362
362
|
value: o
|
|
@@ -364,10 +364,10 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
364
364
|
var l;
|
|
365
365
|
return (l = i.value.items) == null ? void 0 : l.find((s) => s.sku._id === o.value._id);
|
|
366
366
|
}).map((o) => o.value);
|
|
367
|
-
|
|
367
|
+
Me.open({
|
|
368
368
|
title: "Select item",
|
|
369
369
|
closeButton: !0,
|
|
370
|
-
contentComponent:
|
|
370
|
+
contentComponent: Yo,
|
|
371
371
|
contentComponentProps: {
|
|
372
372
|
modelValue: t,
|
|
373
373
|
items: e
|
|
@@ -385,7 +385,7 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
385
385
|
const l = {
|
|
386
386
|
...i.value
|
|
387
387
|
}, s = l.items ?? [], r = o.map((n) => {
|
|
388
|
-
const p = s.find((
|
|
388
|
+
const p = s.find((I) => I.sku._id === n._id);
|
|
389
389
|
if (p)
|
|
390
390
|
return p;
|
|
391
391
|
const x = {
|
|
@@ -397,20 +397,20 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
397
397
|
precision: 0
|
|
398
398
|
}
|
|
399
399
|
};
|
|
400
|
-
return b.value === A.PURCHASE &&
|
|
400
|
+
return b.value === A.PURCHASE && U.enableTotalCost && (x.totalCost = H(x)), x;
|
|
401
401
|
});
|
|
402
402
|
r.sort((n, p) => n.sku.code.localeCompare(p.sku.code)), l.items = r, i.value = l;
|
|
403
403
|
});
|
|
404
404
|
}
|
|
405
405
|
function _e(e, t) {
|
|
406
406
|
var o;
|
|
407
|
-
if (e ===
|
|
407
|
+
if (e === to.Delete) {
|
|
408
408
|
const l = ((o = i.value) == null ? void 0 : o.items) ?? [];
|
|
409
409
|
i.value.items = l.filter((s) => s.sku._id !== t);
|
|
410
410
|
return;
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
|
-
function
|
|
413
|
+
function Se(e) {
|
|
414
414
|
var r, n;
|
|
415
415
|
const t = ((r = i.value) == null ? void 0 : r.items) ?? [], o = (n = t == null ? void 0 : t.find((p) => p.sku._id === e)) == null ? void 0 : n.sku;
|
|
416
416
|
if (!o)
|
|
@@ -427,22 +427,22 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
427
427
|
}))
|
|
428
428
|
];
|
|
429
429
|
}
|
|
430
|
-
function
|
|
430
|
+
function De(e) {
|
|
431
431
|
var r;
|
|
432
432
|
const o = (((r = i.value) == null ? void 0 : r.items) ?? []).find((n) => n.sku._id === e), l = o == null ? void 0 : o.sku;
|
|
433
433
|
if (!o || !l) return null;
|
|
434
|
-
const s =
|
|
434
|
+
const s = Se(e);
|
|
435
435
|
return o.measurement ? s.find((n) => {
|
|
436
436
|
var p, x;
|
|
437
437
|
return ((p = n.value) == null ? void 0 : p.id) === ((x = o.measurement) == null ? void 0 : x.id);
|
|
438
438
|
}) : s.find((n) => n.value === null);
|
|
439
439
|
}
|
|
440
|
-
function
|
|
440
|
+
function Ne(e, t) {
|
|
441
441
|
var l;
|
|
442
442
|
const o = ((l = i.value) == null ? void 0 : l.items) ?? [];
|
|
443
|
-
i.value.items = o.map((s) => s.sku._id !== e ? s : t ? (s.measurement = t,
|
|
443
|
+
i.value.items = o.map((s) => s.sku._id !== e ? s : t ? (s.measurement = t, U.enableTotalCost && (s.totalCost = H(s)), s) : (delete s.measurement, s));
|
|
444
444
|
}
|
|
445
|
-
function
|
|
445
|
+
function He(e, t) {
|
|
446
446
|
const o = i.value, l = o.items ?? [];
|
|
447
447
|
o.items = l.map((s) => (s.sku._id !== e || (s.code = t), s));
|
|
448
448
|
}
|
|
@@ -450,16 +450,16 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
450
450
|
const o = i.value, l = o.items ?? [];
|
|
451
451
|
o.items = l.map((s) => (s.sku._id !== e || (s.name = t), s));
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function Ie(e, t) {
|
|
454
454
|
const o = +t, l = i.value, s = l.items ?? [];
|
|
455
|
-
t.length > 0 && isFinite(o) ? l.items = s.map((r) => (r.sku._id !== e || (r.quantity =
|
|
455
|
+
t.length > 0 && isFinite(o) ? l.items = s.map((r) => (r.sku._id !== e || (r.quantity = eo(o), U.enableTotalCost && (r.totalCost = H(r))), r)) : l.items = s.map((r) => (r.sku._id !== e || (r.quantity = { amount: 0, precision: 0 }, U.enableTotalCost && (r.totalCost = H(r))), r));
|
|
456
456
|
}
|
|
457
|
-
function
|
|
457
|
+
function Ye(e, t) {
|
|
458
458
|
const o = +t, l = i.value, s = l.items ?? [];
|
|
459
459
|
t.length > 0 && isFinite(o) ? l.items = s.map((r) => {
|
|
460
460
|
var n;
|
|
461
461
|
return r.sku._id !== e || (r.totalCost = {
|
|
462
|
-
...
|
|
462
|
+
...eo(o),
|
|
463
463
|
currency: X(((n = C.currentCountry) == null ? void 0 : n.value) ?? xe)
|
|
464
464
|
}), r;
|
|
465
465
|
}) : l.items = s.map((r) => {
|
|
@@ -478,10 +478,10 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
478
478
|
size: 96,
|
|
479
479
|
cell(e) {
|
|
480
480
|
const t = e.row.original;
|
|
481
|
-
return f.value ?
|
|
481
|
+
return f.value ? Y(le.FmTextField, {
|
|
482
482
|
modelValue: t.code,
|
|
483
483
|
"onUpdate:modelValue": (o) => {
|
|
484
|
-
|
|
484
|
+
He(t.sku._id, o);
|
|
485
485
|
},
|
|
486
486
|
rules: [et()],
|
|
487
487
|
labelMark: "required"
|
|
@@ -495,7 +495,7 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
495
495
|
size: "auto",
|
|
496
496
|
cell(e) {
|
|
497
497
|
const t = e.row.original;
|
|
498
|
-
return f.value ?
|
|
498
|
+
return f.value ? Y(le.FmTextField, {
|
|
499
499
|
modelValue: t.name,
|
|
500
500
|
"onUpdate:modelValue": (o) => {
|
|
501
501
|
ge(t.sku._id, o);
|
|
@@ -513,15 +513,15 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
513
513
|
cell(e) {
|
|
514
514
|
var l, s, r;
|
|
515
515
|
const t = e.row.original, o = (r = (s = (l = i.value) == null ? void 0 : l.items) == null ? void 0 : s.find) == null ? void 0 : r.call(s, (n) => n.sku._id === t.sku._id);
|
|
516
|
-
return f.value ?
|
|
516
|
+
return f.value ? Y(le.FmTextField, {
|
|
517
517
|
style: {
|
|
518
518
|
flex: "1 1 0%"
|
|
519
519
|
},
|
|
520
520
|
modelValue: +G((o == null ? void 0 : o.quantity) ?? { amount: 1, precision: 0 }),
|
|
521
521
|
"onUpdate:modelValue": (n) => {
|
|
522
|
-
|
|
522
|
+
Ie(t.sku._id, n);
|
|
523
523
|
},
|
|
524
|
-
rules: [
|
|
524
|
+
rules: [oo(o.sku.unit, o.measurement)]
|
|
525
525
|
}) : G((o == null ? void 0 : o.quantity) ?? { amount: 1, precision: 0 });
|
|
526
526
|
},
|
|
527
527
|
enableSorting: !1
|
|
@@ -533,14 +533,14 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
533
533
|
cell(e) {
|
|
534
534
|
var o, l;
|
|
535
535
|
const t = e.row.original;
|
|
536
|
-
return f.value ?
|
|
536
|
+
return f.value ? Y(le.FmSelect, {
|
|
537
537
|
style: {
|
|
538
538
|
flex: "1 1 0%"
|
|
539
539
|
},
|
|
540
|
-
items:
|
|
541
|
-
modelValue: (o =
|
|
542
|
-
"onUpdate:modelValue": (s) =>
|
|
543
|
-
}) : (l =
|
|
540
|
+
items: Se(t.sku._id),
|
|
541
|
+
modelValue: (o = De(t.sku._id)) == null ? void 0 : o.value,
|
|
542
|
+
"onUpdate:modelValue": (s) => Ne(t.sku._id, s)
|
|
543
|
+
}) : (l = De(t.sku._id)) == null ? void 0 : l.label;
|
|
544
544
|
},
|
|
545
545
|
enableSorting: !1
|
|
546
546
|
},
|
|
@@ -548,8 +548,8 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
548
548
|
id: "Cost",
|
|
549
549
|
header: () => {
|
|
550
550
|
var e, t;
|
|
551
|
-
return
|
|
552
|
-
|
|
551
|
+
return Y(
|
|
552
|
+
Qo,
|
|
553
553
|
{
|
|
554
554
|
zIndex: 50
|
|
555
555
|
},
|
|
@@ -562,7 +562,7 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
562
562
|
cell(e) {
|
|
563
563
|
var l, s, r;
|
|
564
564
|
const t = e.row.original, o = (r = (s = (l = i.value) == null ? void 0 : l.items) == null ? void 0 : s.find) == null ? void 0 : r.call(s, (n) => n.sku._id === t.sku._id);
|
|
565
|
-
return oe.value ? z[(o == null ? void 0 : o.sku._id) ?? ""] ?
|
|
565
|
+
return oe.value ? z[(o == null ? void 0 : o.sku._id) ?? ""] ? Y(
|
|
566
566
|
le.FmTextField,
|
|
567
567
|
{
|
|
568
568
|
style: {
|
|
@@ -570,36 +570,36 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
570
570
|
},
|
|
571
571
|
modelValue: +G((o == null ? void 0 : o.totalCost) ?? { amount: 1, precision: 0 }),
|
|
572
572
|
"onUpdate:modelValue": (n) => {
|
|
573
|
-
|
|
573
|
+
Ye(t.sku._id, n);
|
|
574
574
|
},
|
|
575
|
-
rules: [
|
|
575
|
+
rules: [jo(0), oo(2)]
|
|
576
576
|
},
|
|
577
577
|
{
|
|
578
|
-
append:
|
|
578
|
+
append: Y(le.FmButton, {
|
|
579
579
|
prependIcon: "close",
|
|
580
580
|
variant: "tertiary",
|
|
581
581
|
onClick: () => {
|
|
582
582
|
var p;
|
|
583
583
|
z[(o == null ? void 0 : o.sku._id) ?? ""] = !1;
|
|
584
584
|
const n = ((p = i.value) == null ? void 0 : p.items) ?? [];
|
|
585
|
-
i.value.items = n.map((x) => (
|
|
585
|
+
i.value.items = n.map((x) => (U.enableTotalCost && (x.totalCost = H(x)), x));
|
|
586
586
|
}
|
|
587
587
|
})
|
|
588
588
|
}
|
|
589
|
-
) :
|
|
589
|
+
) : Y(
|
|
590
590
|
"div",
|
|
591
591
|
{
|
|
592
592
|
class: "flex items-center gap-4"
|
|
593
593
|
},
|
|
594
594
|
[
|
|
595
|
-
|
|
595
|
+
Y(le.FmButton, {
|
|
596
596
|
prependIcon: "edit",
|
|
597
597
|
variant: "tertiary",
|
|
598
598
|
onClick: () => {
|
|
599
599
|
z[(o == null ? void 0 : o.sku._id) ?? ""] = !0;
|
|
600
600
|
}
|
|
601
601
|
}),
|
|
602
|
-
|
|
602
|
+
Y(
|
|
603
603
|
"div",
|
|
604
604
|
{
|
|
605
605
|
class: "text-fm-color-typo-primary fm-typo-en-body-lg-400"
|
|
@@ -607,7 +607,7 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
607
607
|
G((o == null ? void 0 : o.totalCost) ?? { amount: 1, precision: 0 })
|
|
608
608
|
)
|
|
609
609
|
]
|
|
610
|
-
) :
|
|
610
|
+
) : Y(
|
|
611
611
|
"div",
|
|
612
612
|
{
|
|
613
613
|
style: {
|
|
@@ -617,18 +617,19 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
617
617
|
}
|
|
618
618
|
},
|
|
619
619
|
[
|
|
620
|
-
|
|
620
|
+
Y(
|
|
621
621
|
"div",
|
|
622
622
|
o != null && o.totalCost ? +G((o == null ? void 0 : o.totalCost) ?? { amount: 1, precision: 0 }) : "0.00"
|
|
623
623
|
),
|
|
624
|
-
|
|
624
|
+
Y(
|
|
625
625
|
le.FmTooltip,
|
|
626
626
|
{
|
|
627
|
-
content:
|
|
628
|
-
placement: "left"
|
|
627
|
+
content: g.lastClosingDate ? `Last closing was already done at ${dt(g.lastClosingDate)} ${Xt(g.lastClosingDate)}. You may no longer change total cost of this purchase order.` : "You may only change the total cost if you have done a closing with recent costing feature.",
|
|
628
|
+
placement: "left",
|
|
629
|
+
zIndex: 50
|
|
629
630
|
},
|
|
630
631
|
[
|
|
631
|
-
|
|
632
|
+
Y(le.FmIcon, {
|
|
632
633
|
name: "info",
|
|
633
634
|
size: "sm",
|
|
634
635
|
color: "typo-secondary"
|
|
@@ -644,14 +645,14 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
644
645
|
id: "Delete",
|
|
645
646
|
header: "",
|
|
646
647
|
cell(e) {
|
|
647
|
-
return
|
|
648
|
+
return Y(le.FmButton, {
|
|
648
649
|
class: "delete-button",
|
|
649
650
|
type: "button",
|
|
650
651
|
icon: "delete",
|
|
651
652
|
variant: "tertiary",
|
|
652
653
|
size: "md",
|
|
653
654
|
onClick: () => {
|
|
654
|
-
_e(
|
|
655
|
+
_e(to.Delete, e.row.original.sku._id);
|
|
655
656
|
}
|
|
656
657
|
});
|
|
657
658
|
},
|
|
@@ -662,9 +663,9 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
662
663
|
headerClass: ""
|
|
663
664
|
}
|
|
664
665
|
}
|
|
665
|
-
], ce =
|
|
666
|
+
], ce = $(
|
|
666
667
|
() => f.value ? Fe : Fe.filter((e) => e.id !== "Delete")
|
|
667
|
-
), qe =
|
|
668
|
+
), qe = $(() => b.value === A.PURCHASE && U.enableTotalCost ? ce.value : ce.value.filter((e) => e.id !== "Cost")), ye = j();
|
|
668
669
|
te({
|
|
669
670
|
validateInputs: () => {
|
|
670
671
|
var e, t;
|
|
@@ -681,70 +682,70 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
681
682
|
});
|
|
682
683
|
const he = j(!1);
|
|
683
684
|
ue(he, (e) => {
|
|
684
|
-
e && (ze.value = !0,
|
|
685
|
+
e && (ze.value = !0, uo().finally(() => {
|
|
685
686
|
ze.value = !1;
|
|
686
687
|
}));
|
|
687
688
|
});
|
|
688
|
-
async function
|
|
689
|
+
async function uo() {
|
|
689
690
|
try {
|
|
690
|
-
const { startDate: e, endDate: t } =
|
|
691
|
+
const { startDate: e, endDate: t } = Fo(3), s = (await y.getPurchaseOrders({ start: e, end: t })).filter(
|
|
691
692
|
(n) => {
|
|
692
693
|
var p, x;
|
|
693
|
-
return n.status ===
|
|
694
|
+
return n.status === yo.enum.COMPLETE && ((p = n.supplier) == null ? void 0 : p.internal) !== "warehouse" && ((x = n.supplier) == null ? void 0 : x.internal) !== "restaurant";
|
|
694
695
|
}
|
|
695
696
|
).reduce((n, p) => {
|
|
696
697
|
var re;
|
|
697
|
-
const x =
|
|
698
|
-
for (const
|
|
699
|
-
if (!
|
|
700
|
-
const K = n[
|
|
698
|
+
const x = Gt(p._id), I = p.supplier._id;
|
|
699
|
+
for (const P of p.items) {
|
|
700
|
+
if (!P.totalCost) continue;
|
|
701
|
+
const K = n[P.sku._id] ?? {}, w = K[I] ?? [], O = P.measurement ? tt(P.quantity, P.measurement.conversion) : P.quantity;
|
|
701
702
|
w.push({
|
|
702
703
|
date: ((re = x == null ? void 0 : x.toISOString) == null ? void 0 : re.call(x)) ?? "",
|
|
703
704
|
pricePerUnit: {
|
|
704
|
-
...
|
|
705
|
-
currency:
|
|
705
|
+
...Zt(P.totalCost, O),
|
|
706
|
+
currency: P.totalCost.currency
|
|
706
707
|
},
|
|
707
708
|
totalUnits: O,
|
|
708
|
-
unit:
|
|
709
|
-
}), K[
|
|
709
|
+
unit: P.sku.unit
|
|
710
|
+
}), K[I] = w, n[P.sku._id] = K;
|
|
710
711
|
}
|
|
711
712
|
return n;
|
|
712
713
|
}, {}), r = Object.keys(s).reduce((n, p) => {
|
|
713
714
|
const x = Object.keys(s[p]);
|
|
714
|
-
for (const
|
|
715
|
-
const
|
|
715
|
+
for (const I of x) {
|
|
716
|
+
const P = s[p][I].reduce(
|
|
716
717
|
(w, O) => {
|
|
717
|
-
const de =
|
|
718
|
-
if (w[
|
|
718
|
+
const de = Vo(new Date(O.date)), N = pt(de);
|
|
719
|
+
if (w[N]) {
|
|
719
720
|
const be = tt(
|
|
720
|
-
w[
|
|
721
|
-
w[
|
|
722
|
-
),
|
|
721
|
+
w[N].pricePerUnit,
|
|
722
|
+
w[N].totalUnits
|
|
723
|
+
), Pe = tt(
|
|
723
724
|
O.pricePerUnit,
|
|
724
725
|
O.totalUnits
|
|
725
|
-
), it =
|
|
726
|
+
), it = Jt(
|
|
726
727
|
be,
|
|
727
|
-
|
|
728
|
-
), me =
|
|
729
|
-
...
|
|
728
|
+
Pe
|
|
729
|
+
), me = Jt(w[N].totalUnits, O.totalUnits), je = {
|
|
730
|
+
...Zt(it, me),
|
|
730
731
|
currency: O.pricePerUnit.currency
|
|
731
732
|
};
|
|
732
|
-
w[
|
|
733
|
+
w[N].totalUnits = me, w[N].pricePerUnit = je;
|
|
733
734
|
} else
|
|
734
|
-
w[
|
|
735
|
-
return w[
|
|
735
|
+
w[N] = O;
|
|
736
|
+
return w[N].date = de.toISOString(), w;
|
|
736
737
|
},
|
|
737
738
|
{}
|
|
738
739
|
);
|
|
739
740
|
n[p] ?? (n[p] = {});
|
|
740
|
-
const K =
|
|
741
|
-
n[p][
|
|
741
|
+
const K = Po(3).map((w) => pt(w));
|
|
742
|
+
n[p][I] = K.map((w) => P[w] ? P[w] : {
|
|
742
743
|
date: w
|
|
743
|
-
}), Object.values(
|
|
744
|
+
}), Object.values(P).sort((w, O) => O.date.localeCompare(w.date)).slice(0, 3).reverse();
|
|
744
745
|
}
|
|
745
746
|
return n;
|
|
746
747
|
}, {});
|
|
747
|
-
|
|
748
|
+
Ve.value = r;
|
|
748
749
|
} catch {
|
|
749
750
|
we.open({
|
|
750
751
|
title: "Something went wrong",
|
|
@@ -752,59 +753,59 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
752
753
|
}), he.value = !1;
|
|
753
754
|
}
|
|
754
755
|
}
|
|
755
|
-
const ze = j(!1),
|
|
756
|
+
const ze = j(!1), Ve = j({});
|
|
756
757
|
function Le(e) {
|
|
757
758
|
return e.column.columnDef.meta;
|
|
758
759
|
}
|
|
759
|
-
const L =
|
|
760
|
+
const L = $({
|
|
760
761
|
get() {
|
|
761
762
|
var e, t;
|
|
762
|
-
return (e =
|
|
763
|
+
return (e = g.modelValue) != null && e.effectiveAt ? new Date((t = g.modelValue) == null ? void 0 : t.effectiveAt) : null;
|
|
763
764
|
},
|
|
764
765
|
set(e) {
|
|
765
766
|
i.value.effectiveAt = (e == null ? void 0 : e.toISOString()) ?? null;
|
|
766
767
|
}
|
|
767
|
-
}), lt =
|
|
768
|
+
}), lt = $({
|
|
768
769
|
get() {
|
|
769
770
|
return !!L.value;
|
|
770
771
|
},
|
|
771
772
|
set(e) {
|
|
772
773
|
e ? L.value = /* @__PURE__ */ new Date() : L.value = null;
|
|
773
774
|
}
|
|
774
|
-
}), nt =
|
|
775
|
+
}), nt = $({
|
|
775
776
|
get() {
|
|
776
|
-
return L.value === null ? "" :
|
|
777
|
+
return L.value === null ? "" : dt(L.value);
|
|
777
778
|
},
|
|
778
779
|
set(e) {
|
|
779
780
|
e ? L.value = /* @__PURE__ */ new Date(`${e} ${rt.value}`) : L.value = null;
|
|
780
781
|
}
|
|
781
|
-
}), rt =
|
|
782
|
+
}), rt = $({
|
|
782
783
|
get() {
|
|
783
|
-
return L.value === null ? "" :
|
|
784
|
+
return L.value === null ? "" : To(L.value);
|
|
784
785
|
},
|
|
785
786
|
set(e) {
|
|
786
787
|
e ? L.value = /* @__PURE__ */ new Date(`${nt.value} ${e}`) : L.value = null;
|
|
787
788
|
}
|
|
788
|
-
}),
|
|
789
|
+
}), _t = $(() => {
|
|
789
790
|
var e;
|
|
790
791
|
return (e = k._currentLocation) == null ? void 0 : e.dbName.startsWith("restaurant");
|
|
791
792
|
});
|
|
792
793
|
return (e, t) => {
|
|
793
|
-
const o =
|
|
794
|
+
const o = S("FmChip"), l = S("FmSelect"), s = S("FmMenuItem"), r = S("FmTextField"), n = S("FmTextarea"), p = S("FmSwitch"), x = S("FmDatePicker"), I = S("FmTimePicker"), re = S("FmFormGroup"), P = S("FmIcon"), K = S("FmButton"), w = S("FmCard"), O = S("FmStepperField"), de = S("FmPopover"), N = S("FmLabel"), be = S("FmSpacer"), Pe = S("FmTable"), it = S("FmForm");
|
|
794
795
|
return _(), W(it, {
|
|
795
796
|
ref_key: "formRef",
|
|
796
797
|
ref: ye,
|
|
797
798
|
onReset: t[14] || (t[14] = (me) => b.value = d(A).PURCHASE),
|
|
798
799
|
onValidationSuccess: t[15] || (t[15] = (me) => se("validation-success")),
|
|
799
|
-
disabled:
|
|
800
|
+
disabled: V.value
|
|
800
801
|
}, {
|
|
801
|
-
default:
|
|
802
|
-
var me, je,
|
|
802
|
+
default: T(() => {
|
|
803
|
+
var me, je, gt, yt;
|
|
803
804
|
return [
|
|
804
|
-
a("div",
|
|
805
|
-
a("div",
|
|
806
|
-
|
|
807
|
-
a("div",
|
|
805
|
+
a("div", ds, [
|
|
806
|
+
a("div", ms, [
|
|
807
|
+
ps,
|
|
808
|
+
a("div", fs, [
|
|
808
809
|
u(o, {
|
|
809
810
|
label: d(k).currentLocation.name,
|
|
810
811
|
icon: "storefront",
|
|
@@ -812,19 +813,19 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
812
813
|
}, null, 8, ["label"]),
|
|
813
814
|
(je = (me = d(C).currentRestaurant) == null ? void 0 : me.value) != null && je.posVersion ? (_(), W(o, {
|
|
814
815
|
key: 0,
|
|
815
|
-
label: `POS v${(
|
|
816
|
+
label: `POS v${(yt = (gt = d(C).currentRestaurant) == null ? void 0 : gt.value) == null ? void 0 : yt.posVersion}`,
|
|
816
817
|
icon: "point_of_sale",
|
|
817
818
|
compact: ""
|
|
818
819
|
}, null, 8, ["label"])) : B("", !0),
|
|
819
820
|
e.lastClosingDate ? (_(), W(o, {
|
|
820
821
|
key: 1,
|
|
821
|
-
label: `Last closing: ${d(
|
|
822
|
+
label: `Last closing: ${d(dt)(e.lastClosingDate)} ${d(Xt)(e.lastClosingDate)}`,
|
|
822
823
|
icon: "calendar_month",
|
|
823
824
|
compact: ""
|
|
824
825
|
}, null, 8, ["label"])) : B("", !0)
|
|
825
826
|
]),
|
|
826
|
-
|
|
827
|
-
a("div",
|
|
827
|
+
vs,
|
|
828
|
+
a("div", _s, [
|
|
828
829
|
u(l, {
|
|
829
830
|
items: Q,
|
|
830
831
|
rules: [d(et)()],
|
|
@@ -832,22 +833,22 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
832
833
|
label: "Transfer type",
|
|
833
834
|
modelValue: b.value,
|
|
834
835
|
"onUpdate:modelValue": t[0] || (t[0] = (v) => b.value = v),
|
|
835
|
-
disabled:
|
|
836
|
+
disabled: V.value || !f.value,
|
|
836
837
|
"data-cy": "fm-select-transaction-type"
|
|
837
838
|
}, null, 8, ["rules", "modelValue", "disabled"]),
|
|
838
839
|
u(l, {
|
|
839
840
|
label: b.value === d(A).PURCHASE ? "Supplier" : "Transfer From",
|
|
840
841
|
items: c.value,
|
|
841
|
-
modelValue:
|
|
842
|
-
"onUpdate:modelValue": t[1] || (t[1] = (v) =>
|
|
843
|
-
disabled:
|
|
842
|
+
modelValue: D.value,
|
|
843
|
+
"onUpdate:modelValue": t[1] || (t[1] = (v) => D.value = v),
|
|
844
|
+
disabled: V.value || !f.value,
|
|
844
845
|
rules: [d(et)()],
|
|
845
846
|
"label-mark": "required"
|
|
846
847
|
}, {
|
|
847
|
-
"menu-wrapper":
|
|
848
|
-
(_(!0), F(
|
|
848
|
+
"menu-wrapper": T(({ handleItemChange: v }) => [
|
|
849
|
+
(_(!0), F($e, null, ot(c.value, (h) => (_(), W(s, {
|
|
849
850
|
key: h.value,
|
|
850
|
-
"model-value": h.value ===
|
|
851
|
+
"model-value": h.value === D.value,
|
|
851
852
|
disabled: h.disabled,
|
|
852
853
|
label: h.label,
|
|
853
854
|
"onUpdate:modelValue": (pe) => v(pe, h)
|
|
@@ -860,7 +861,7 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
860
861
|
modelValue: i.value.ref,
|
|
861
862
|
"onUpdate:modelValue": t[2] || (t[2] = (v) => i.value.ref = v),
|
|
862
863
|
"label-mark": "optional",
|
|
863
|
-
disabled:
|
|
864
|
+
disabled: V.value || !f.value
|
|
864
865
|
}, null, 8, ["modelValue", "disabled"]),
|
|
865
866
|
u(n, {
|
|
866
867
|
label: "Remark",
|
|
@@ -868,29 +869,29 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
868
869
|
"onUpdate:modelValue": t[3] || (t[3] = (v) => ve.value = v),
|
|
869
870
|
"label-mark": "optional",
|
|
870
871
|
"max-length": 240,
|
|
871
|
-
disabled:
|
|
872
|
+
disabled: V.value || !f.value,
|
|
872
873
|
"show-word-count": ""
|
|
873
874
|
}, null, 8, ["modelValue", "disabled"]),
|
|
874
|
-
d(
|
|
875
|
-
a("div",
|
|
875
|
+
d(U).enableBackdatePo ? (_(), F("div", gs, [
|
|
876
|
+
a("div", ys, [
|
|
876
877
|
u(p, {
|
|
877
878
|
modelValue: lt.value,
|
|
878
879
|
"onUpdate:modelValue": t[4] || (t[4] = (v) => lt.value = v),
|
|
879
880
|
label: "Backdate transfer",
|
|
880
881
|
sublabel: "Apply transfer to older date",
|
|
881
882
|
"label-placement": "right",
|
|
882
|
-
disabled:
|
|
883
|
+
disabled: V.value || !f.value || _t.value && !e.lastClosingDate
|
|
883
884
|
}, null, 8, ["modelValue", "disabled"]),
|
|
884
|
-
|
|
885
|
-
lt.value ? (_(), F("div",
|
|
886
|
-
a("div",
|
|
885
|
+
hs,
|
|
886
|
+
lt.value ? (_(), F("div", bs, [
|
|
887
|
+
a("div", xs, [
|
|
887
888
|
u(x, {
|
|
888
889
|
modelValue: nt.value,
|
|
889
890
|
"onUpdate:modelValue": t[5] || (t[5] = (v) => nt.value = v)
|
|
890
891
|
}, null, 8, ["modelValue"])
|
|
891
892
|
]),
|
|
892
|
-
a("div",
|
|
893
|
-
u(
|
|
893
|
+
a("div", Cs, [
|
|
894
|
+
u(I, {
|
|
894
895
|
modelValue: rt.value,
|
|
895
896
|
"onUpdate:modelValue": t[6] || (t[6] = (v) => rt.value = v)
|
|
896
897
|
}, null, 8, ["modelValue"])
|
|
@@ -901,15 +902,15 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
901
902
|
key: 0,
|
|
902
903
|
modelValue: L.value,
|
|
903
904
|
"onUpdate:modelValue": t[7] || (t[7] = (v) => L.value = v),
|
|
904
|
-
rules: [d(
|
|
905
|
+
rules: [d(zo)(new Date(e.lastClosingDate), /* @__PURE__ */ new Date())]
|
|
905
906
|
}, null, 8, ["modelValue", "rules"])) : B("", !0),
|
|
906
|
-
|
|
907
|
-
u(
|
|
907
|
+
_t.value && !e.lastClosingDate ? (_(), F("div", ks, [
|
|
908
|
+
u(P, {
|
|
908
909
|
name: "error",
|
|
909
910
|
size: "sm",
|
|
910
911
|
class: "text-fm-color-typo-warning"
|
|
911
912
|
}),
|
|
912
|
-
|
|
913
|
+
ws
|
|
913
914
|
])) : B("", !0)
|
|
914
915
|
])) : B("", !0)
|
|
915
916
|
])
|
|
@@ -923,12 +924,12 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
923
924
|
}
|
|
924
925
|
]
|
|
925
926
|
}, {
|
|
926
|
-
default:
|
|
927
|
+
default: T(() => {
|
|
927
928
|
var v;
|
|
928
929
|
return [
|
|
929
|
-
a("div",
|
|
930
|
-
|
|
931
|
-
b.value === d(A).PURCHASE && f.value && d(
|
|
930
|
+
a("div", Ds, [
|
|
931
|
+
Fs,
|
|
932
|
+
b.value === d(A).PURCHASE && f.value && d(U).enableTotalCost ? (_(), F("div", Vs, [
|
|
932
933
|
u(p, {
|
|
933
934
|
label: ze.value ? "Fetching data..." : "Compare price history",
|
|
934
935
|
"prepend-icon": "compare_arrows",
|
|
@@ -945,7 +946,7 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
945
946
|
}, 8, ["model-value", "rules"]),
|
|
946
947
|
a("div", Ps, [
|
|
947
948
|
u(K, {
|
|
948
|
-
disabled:
|
|
949
|
+
disabled: V.value || !f.value,
|
|
949
950
|
label: "Add Item",
|
|
950
951
|
"prepend-icon": "add",
|
|
951
952
|
variant: "plain",
|
|
@@ -954,41 +955,42 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
954
955
|
size: "md"
|
|
955
956
|
}, null, 8, ["disabled"]),
|
|
956
957
|
u(de, {
|
|
958
|
+
disabled: V.value || !f.value,
|
|
957
959
|
class: "flex",
|
|
958
960
|
"show-popover": ie.value,
|
|
959
961
|
onPopoverChanged: t[13] || (t[13] = (v) => ie.value = v)
|
|
960
962
|
}, {
|
|
961
|
-
"popover-button":
|
|
963
|
+
"popover-button": T(() => [
|
|
962
964
|
u(w, {
|
|
963
965
|
class: Je([
|
|
964
966
|
"flex justify-center items-center gap-[8px] border-2 py-1 px-12 rounded-lg cursor-not-allowed",
|
|
965
|
-
|
|
967
|
+
V.value || !f.value ? " border-fm-color-neutral-gray-200" : "border-fm-color-primary"
|
|
966
968
|
]),
|
|
967
969
|
variant: "flat"
|
|
968
970
|
}, {
|
|
969
|
-
default:
|
|
970
|
-
u(
|
|
971
|
+
default: T(() => [
|
|
972
|
+
u(ts, {
|
|
971
973
|
size: 24,
|
|
972
|
-
color:
|
|
974
|
+
color: V.value || !f.value ? "#c7c7cc" : "#ff7823"
|
|
973
975
|
}, null, 8, ["color"]),
|
|
974
976
|
a("button", {
|
|
975
977
|
type: "button",
|
|
976
|
-
disabled:
|
|
978
|
+
disabled: V.value,
|
|
977
979
|
class: Je([
|
|
978
980
|
"fm-typo-cn-body-lg-600",
|
|
979
|
-
|
|
981
|
+
V.value || !f.value ? " text-fm-color-neutral-gray-200 cursor-not-allowed" : "text-fm-color-primary"
|
|
980
982
|
])
|
|
981
|
-
}, " Forecast stock ", 10,
|
|
983
|
+
}, " Forecast stock ", 10, Ts)
|
|
982
984
|
]),
|
|
983
985
|
_: 1
|
|
984
986
|
}, 8, ["class"])
|
|
985
987
|
]),
|
|
986
|
-
default:
|
|
987
|
-
a("div",
|
|
988
|
-
a("div",
|
|
989
|
-
u(
|
|
990
|
-
default:
|
|
991
|
-
|
|
988
|
+
default: T(() => [
|
|
989
|
+
a("div", Us, [
|
|
990
|
+
a("div", Rs, [
|
|
991
|
+
u(Uo, { "z-index": 99 }, {
|
|
992
|
+
default: T(() => [
|
|
993
|
+
As
|
|
992
994
|
]),
|
|
993
995
|
_: 1
|
|
994
996
|
}),
|
|
@@ -1003,22 +1005,22 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
1003
1005
|
modelValue: ne.value,
|
|
1004
1006
|
"onUpdate:modelValue": t[11] || (t[11] = (v) => ne.value = v),
|
|
1005
1007
|
label: "Enter day to forecast stock",
|
|
1006
|
-
rules: [d(
|
|
1008
|
+
rules: [d(Lo)(1)]
|
|
1007
1009
|
}, {
|
|
1008
|
-
"helper-text":
|
|
1010
|
+
"helper-text": T(() => [
|
|
1009
1011
|
a("div", $s, [
|
|
1010
|
-
u(
|
|
1012
|
+
u(P, {
|
|
1011
1013
|
name: "warning",
|
|
1012
1014
|
size: "sm",
|
|
1013
1015
|
class: "text-fm-color-system-warning-300"
|
|
1014
1016
|
}),
|
|
1015
|
-
|
|
1017
|
+
Ms
|
|
1016
1018
|
])
|
|
1017
1019
|
]),
|
|
1018
1020
|
_: 1
|
|
1019
1021
|
}, 8, ["modelValue", "rules"]),
|
|
1020
|
-
a("div",
|
|
1021
|
-
|
|
1022
|
+
a("div", Es, [
|
|
1023
|
+
Os,
|
|
1022
1024
|
u(K, {
|
|
1023
1025
|
label: "Cancel",
|
|
1024
1026
|
variant: "tertiary",
|
|
@@ -1032,10 +1034,10 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
1032
1034
|
])
|
|
1033
1035
|
]),
|
|
1034
1036
|
_: 1
|
|
1035
|
-
}, 8, ["show-popover"])
|
|
1037
|
+
}, 8, ["disabled", "show-popover"])
|
|
1036
1038
|
]),
|
|
1037
1039
|
R.value.length ? (_(), F("div", Ns, [
|
|
1038
|
-
(_(), W(
|
|
1040
|
+
(_(), W(Pe, {
|
|
1039
1041
|
"row-data": R.value,
|
|
1040
1042
|
"column-defs": qe.value,
|
|
1041
1043
|
key: b.value,
|
|
@@ -1043,7 +1045,7 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
1043
1045
|
"hide-footer": "",
|
|
1044
1046
|
"page-size": R.value.length
|
|
1045
1047
|
}, {
|
|
1046
|
-
"table-row":
|
|
1048
|
+
"table-row": T((v) => {
|
|
1047
1049
|
var h, pe;
|
|
1048
1050
|
return [
|
|
1049
1051
|
a("tr", {
|
|
@@ -1051,21 +1053,21 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
1051
1053
|
"bg-fm-color-neutral-gray-100": v.getIsSelected()
|
|
1052
1054
|
}])
|
|
1053
1055
|
}, [
|
|
1054
|
-
(_(!0), F(
|
|
1055
|
-
var
|
|
1056
|
+
(_(!0), F($e, null, ot(v.getVisibleCells(), (ae) => {
|
|
1057
|
+
var Te, fe, Ue, Re;
|
|
1056
1058
|
return _(), F("td", {
|
|
1057
1059
|
key: ae.id,
|
|
1058
1060
|
class: Je([
|
|
1059
1061
|
"h-[52px] px-16 text-fm-color-typo-primary",
|
|
1060
|
-
((
|
|
1062
|
+
((Te = Le(ae)) == null ? void 0 : Te.cellClass) ?? "px-16"
|
|
1061
1063
|
]),
|
|
1062
|
-
style:
|
|
1064
|
+
style: lo({
|
|
1063
1065
|
width: (fe = Le(ae)) == null ? void 0 : fe.width,
|
|
1064
1066
|
maxWidth: (Ue = Le(ae)) == null ? void 0 : Ue.maxWidth,
|
|
1065
1067
|
textAlign: ((Re = Le(ae)) == null ? void 0 : Re.textAlign) ?? "left"
|
|
1066
1068
|
})
|
|
1067
1069
|
}, [
|
|
1068
|
-
a("span",
|
|
1070
|
+
a("span", Hs, [
|
|
1069
1071
|
u(d(ee), {
|
|
1070
1072
|
render: ae.column.columnDef.cell,
|
|
1071
1073
|
props: ae.getContext()
|
|
@@ -1074,79 +1076,79 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
1074
1076
|
], 6);
|
|
1075
1077
|
}), 128))
|
|
1076
1078
|
], 2),
|
|
1077
|
-
b.value === d(A).PURCHASE && he.value && Object.keys(
|
|
1079
|
+
b.value === d(A).PURCHASE && he.value && Object.keys(Ve.value[(h = v.original.sku) == null ? void 0 : h._id] ?? {}).length > 0 ? (_(), F("tr", Is, [
|
|
1078
1080
|
a("td", {
|
|
1079
1081
|
colspan: v.getVisibleCells().length
|
|
1080
1082
|
}, [
|
|
1081
|
-
u(
|
|
1082
|
-
prices:
|
|
1083
|
+
u(so, {
|
|
1084
|
+
prices: Ve.value[(pe = v.original.sku) == null ? void 0 : pe._id]
|
|
1083
1085
|
}, null, 8, ["prices"])
|
|
1084
|
-
], 8,
|
|
1086
|
+
], 8, Ys)
|
|
1085
1087
|
])) : B("", !0)
|
|
1086
1088
|
];
|
|
1087
1089
|
}),
|
|
1088
|
-
"list-row":
|
|
1089
|
-
u(
|
|
1090
|
-
default:
|
|
1091
|
-
var pe, ae,
|
|
1090
|
+
"list-row": T((v) => [
|
|
1091
|
+
u(ro, { row: v }, {
|
|
1092
|
+
default: T((h) => {
|
|
1093
|
+
var pe, ae, Te, fe, Ue, Re, ht, bt, Qe, xt, Ct, kt, wt, Ke, St, Dt, Ft, Vt, Be, Pt, Tt, Ut, Rt, Ge, At, $t, Mt, Et, Ot, Nt, We, Ht, It, Yt, qt, zt, Ze, Lt, jt, Qt;
|
|
1092
1094
|
return [
|
|
1093
|
-
a("div",
|
|
1094
|
-
a("div",
|
|
1095
|
-
a("div",
|
|
1095
|
+
a("div", qs, [
|
|
1096
|
+
a("div", zs, [
|
|
1097
|
+
a("div", Ls, Z(v.original.sku.name), 1),
|
|
1096
1098
|
a("div", null, [
|
|
1097
1099
|
u(d(ee), {
|
|
1098
|
-
render: (
|
|
1100
|
+
render: (Te = (ae = (pe = h.Delete) == null ? void 0 : pe.column) == null ? void 0 : ae.columnDef) == null ? void 0 : Te.cell,
|
|
1099
1101
|
props: (Ue = (fe = h.Delete) == null ? void 0 : fe.getContext) == null ? void 0 : Ue.call(fe)
|
|
1100
1102
|
}, null, 8, ["render", "props"])
|
|
1101
1103
|
])
|
|
1102
1104
|
]),
|
|
1103
|
-
a("div",
|
|
1104
|
-
a("div",
|
|
1105
|
-
u(
|
|
1105
|
+
a("div", js, [
|
|
1106
|
+
a("div", Qs, [
|
|
1107
|
+
u(N, { label: "Code" }),
|
|
1106
1108
|
u(d(ee), {
|
|
1107
|
-
render: (
|
|
1108
|
-
props: (
|
|
1109
|
+
render: (bt = (ht = (Re = h.code) == null ? void 0 : Re.column) == null ? void 0 : ht.columnDef) == null ? void 0 : bt.cell,
|
|
1110
|
+
props: (xt = (Qe = h.code) == null ? void 0 : Qe.getContext) == null ? void 0 : xt.call(Qe)
|
|
1109
1111
|
}, null, 8, ["render", "props"])
|
|
1110
1112
|
]),
|
|
1111
|
-
a("div",
|
|
1112
|
-
u(
|
|
1113
|
+
a("div", Ks, [
|
|
1114
|
+
u(N, { label: "Name" }),
|
|
1113
1115
|
u(d(ee), {
|
|
1114
|
-
render: (
|
|
1115
|
-
props: (
|
|
1116
|
+
render: (wt = (kt = (Ct = h.Name) == null ? void 0 : Ct.column) == null ? void 0 : kt.columnDef) == null ? void 0 : wt.cell,
|
|
1117
|
+
props: (St = (Ke = h.Name) == null ? void 0 : Ke.getContext) == null ? void 0 : St.call(Ke)
|
|
1116
1118
|
}, null, 8, ["render", "props"])
|
|
1117
1119
|
]),
|
|
1118
|
-
a("div",
|
|
1119
|
-
u(
|
|
1120
|
+
a("div", Bs, [
|
|
1121
|
+
u(N, { label: "Amount" }),
|
|
1120
1122
|
u(d(ee), {
|
|
1121
|
-
render: (
|
|
1122
|
-
props: (
|
|
1123
|
+
render: (Vt = (Ft = (Dt = h.Amount) == null ? void 0 : Dt.column) == null ? void 0 : Ft.columnDef) == null ? void 0 : Vt.cell,
|
|
1124
|
+
props: (Pt = (Be = h.Amount) == null ? void 0 : Be.getContext) == null ? void 0 : Pt.call(Be)
|
|
1123
1125
|
}, null, 8, ["render", "props"])
|
|
1124
1126
|
]),
|
|
1125
|
-
a("div",
|
|
1126
|
-
u(
|
|
1127
|
+
a("div", Gs, [
|
|
1128
|
+
u(N, { label: "Unit" }),
|
|
1127
1129
|
u(d(ee), {
|
|
1128
|
-
render: (
|
|
1129
|
-
props: (
|
|
1130
|
+
render: (Rt = (Ut = (Tt = h.Unit) == null ? void 0 : Tt.column) == null ? void 0 : Ut.columnDef) == null ? void 0 : Rt.cell,
|
|
1131
|
+
props: (At = (Ge = h.Unit) == null ? void 0 : Ge.getContext) == null ? void 0 : At.call(Ge)
|
|
1130
1132
|
}, null, 8, ["render", "props"])
|
|
1131
1133
|
]),
|
|
1132
|
-
b.value === d(A).PURCHASE && h.Cost ? (_(), F("div",
|
|
1133
|
-
typeof ((
|
|
1134
|
-
(_(), W(
|
|
1135
|
-
(
|
|
1134
|
+
b.value === d(A).PURCHASE && h.Cost ? (_(), F("div", Ws, [
|
|
1135
|
+
typeof ((Et = (Mt = ($t = h.Cost) == null ? void 0 : $t.column) == null ? void 0 : Mt.columnDef) == null ? void 0 : Et.header) == "function" ? (_(), F("div", Zs, [
|
|
1136
|
+
(_(), W(vo(
|
|
1137
|
+
(It = (Nt = (Ot = h.Cost) == null ? void 0 : Ot.column) == null ? void 0 : Nt.columnDef) == null ? void 0 : It.header(
|
|
1136
1138
|
(Ht = (We = h.Cost) == null ? void 0 : We.getContext) == null ? void 0 : Ht.call(We)
|
|
1137
1139
|
)
|
|
1138
1140
|
)))
|
|
1139
1141
|
])) : B("", !0),
|
|
1140
1142
|
u(d(ee), {
|
|
1141
|
-
render: (
|
|
1142
|
-
props: (
|
|
1143
|
+
render: (zt = (qt = (Yt = h.Cost) == null ? void 0 : Yt.column) == null ? void 0 : qt.columnDef) == null ? void 0 : zt.cell,
|
|
1144
|
+
props: (Lt = (Ze = h.Cost) == null ? void 0 : Ze.getContext) == null ? void 0 : Lt.call(Ze)
|
|
1143
1145
|
}, null, 8, ["render", "props"])
|
|
1144
1146
|
])) : B("", !0)
|
|
1145
1147
|
]),
|
|
1146
|
-
b.value === d(A).PURCHASE && he.value && Object.keys(
|
|
1148
|
+
b.value === d(A).PURCHASE && he.value && Object.keys(Ve.value[(jt = v.original.sku) == null ? void 0 : jt._id] ?? {}).length > 0 ? (_(), F($e, { key: 0 }, [
|
|
1147
1149
|
u(be, { class: "h-8" }),
|
|
1148
|
-
u(
|
|
1149
|
-
prices:
|
|
1150
|
+
u(so, {
|
|
1151
|
+
prices: Ve.value[(Qt = v.original.sku) == null ? void 0 : Qt._id]
|
|
1150
1152
|
}, null, 8, ["prices"])
|
|
1151
1153
|
], 64)) : B("", !0)
|
|
1152
1154
|
])
|
|
@@ -1166,7 +1168,7 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
1166
1168
|
}, 8, ["disabled"]);
|
|
1167
1169
|
};
|
|
1168
1170
|
}
|
|
1169
|
-
}),
|
|
1171
|
+
}), Xs = { class: "flex items-center" }, ea = { class: "fm-typo-en-title-md-800" }, ta = { class: "flex gap-4" }, oa = /* @__PURE__ */ ke({
|
|
1170
1172
|
__name: "TransferDialog",
|
|
1171
1173
|
props: {
|
|
1172
1174
|
mode: {},
|
|
@@ -1176,14 +1178,14 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
1176
1178
|
},
|
|
1177
1179
|
emits: ["update:show", "submitted"],
|
|
1178
1180
|
setup(q, { expose: te, emit: J }) {
|
|
1179
|
-
const k = q,
|
|
1181
|
+
const k = q, M = J, C = no(), y = vt(), U = io(), z = bo(), g = ft();
|
|
1180
1182
|
async function f(m) {
|
|
1181
1183
|
if (m) {
|
|
1182
1184
|
i.value = !0;
|
|
1183
1185
|
try {
|
|
1184
|
-
await
|
|
1186
|
+
await U.readSuppliers(), i.value = !1;
|
|
1185
1187
|
} catch {
|
|
1186
|
-
|
|
1188
|
+
y.open({
|
|
1187
1189
|
title: "Unable to fetch list of suppliers",
|
|
1188
1190
|
message: "Try to refresh page to retry operation",
|
|
1189
1191
|
type: "error"
|
|
@@ -1191,12 +1193,12 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
1191
1193
|
}
|
|
1192
1194
|
}
|
|
1193
1195
|
}
|
|
1194
|
-
|
|
1196
|
+
g.watchLocation(f);
|
|
1195
1197
|
const oe = No(k, "show"), se = j(k.modelValue ?? {});
|
|
1196
1198
|
ue([() => k.modelValue], () => {
|
|
1197
1199
|
se.value = k.modelValue ?? {};
|
|
1198
1200
|
});
|
|
1199
|
-
const i = j(!1), ve =
|
|
1201
|
+
const i = j(!1), ve = $(() => {
|
|
1200
1202
|
switch (k.mode) {
|
|
1201
1203
|
case Ae.CREATE:
|
|
1202
1204
|
return "Add transfer";
|
|
@@ -1206,32 +1208,32 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
1206
1208
|
return "Edit transfer";
|
|
1207
1209
|
}
|
|
1208
1210
|
return "";
|
|
1209
|
-
}),
|
|
1211
|
+
}), V = j();
|
|
1210
1212
|
te({
|
|
1211
1213
|
validateInputs: () => {
|
|
1212
1214
|
var m, c;
|
|
1213
|
-
(c = (m =
|
|
1215
|
+
(c = (m = V.value) == null ? void 0 : m.validateInputs) == null || c.call(m);
|
|
1214
1216
|
},
|
|
1215
1217
|
resetInputsValidation: () => {
|
|
1216
1218
|
var m, c;
|
|
1217
|
-
(c = (m =
|
|
1219
|
+
(c = (m = V.value) == null ? void 0 : m.resetInputsValidation) == null || c.call(m);
|
|
1218
1220
|
},
|
|
1219
1221
|
resetInputs: () => {
|
|
1220
1222
|
var m, c;
|
|
1221
|
-
(c = (m =
|
|
1223
|
+
(c = (m = V.value) == null ? void 0 : m.resetInputs) == null || c.call(m);
|
|
1222
1224
|
}
|
|
1223
1225
|
});
|
|
1224
1226
|
async function R() {
|
|
1225
1227
|
const m = se.value;
|
|
1226
|
-
i.value = !0, (m.supplier.internal === "warehouse" || m.supplier.internal === "restaurant") && (m.items = m.items.map(({ totalCost: c, ...
|
|
1228
|
+
i.value = !0, (m.supplier.internal === "warehouse" || m.supplier.internal === "restaurant") && (m.items = m.items.map(({ totalCost: c, ...D }) => D));
|
|
1227
1229
|
try {
|
|
1228
|
-
await C.createPurchaseOrder(m), await new Promise((c) => setTimeout(c, 1e3)),
|
|
1230
|
+
await C.createPurchaseOrder(m), await new Promise((c) => setTimeout(c, 1e3)), y.open({
|
|
1229
1231
|
title: "Created",
|
|
1230
1232
|
message: "Your transfer draft has been created!",
|
|
1231
1233
|
type: "success"
|
|
1232
|
-
}),
|
|
1234
|
+
}), M("update:show", !1), M("submitted");
|
|
1233
1235
|
} catch (c) {
|
|
1234
|
-
|
|
1236
|
+
y.open({
|
|
1235
1237
|
title: "Cannot create purchase order",
|
|
1236
1238
|
message: "Report to system administrator for troubleshooting.",
|
|
1237
1239
|
type: "error"
|
|
@@ -1242,15 +1244,15 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
1242
1244
|
}
|
|
1243
1245
|
async function E() {
|
|
1244
1246
|
const m = se.value;
|
|
1245
|
-
i.value = !0, (m.supplier.internal === "warehouse" || m.supplier.internal === "restaurant") && (m.items = m.items.map(({ totalCost: c, ...
|
|
1247
|
+
i.value = !0, (m.supplier.internal === "warehouse" || m.supplier.internal === "restaurant") && (m.items = m.items.map(({ totalCost: c, ...D }) => D));
|
|
1246
1248
|
try {
|
|
1247
|
-
await C.updatePurchaseOrder(m), await new Promise((c) => setTimeout(c, 1e3)),
|
|
1249
|
+
await C.updatePurchaseOrder(m), await new Promise((c) => setTimeout(c, 1e3)), y.open({
|
|
1248
1250
|
title: "Updated",
|
|
1249
1251
|
message: "Your transfer draft has been updated!",
|
|
1250
1252
|
type: "success"
|
|
1251
|
-
}),
|
|
1253
|
+
}), M("update:show", !1), M("submitted");
|
|
1252
1254
|
} catch (c) {
|
|
1253
|
-
|
|
1255
|
+
y.open({
|
|
1254
1256
|
title: "Cannot update purchase order",
|
|
1255
1257
|
message: "Report to system administrator for troubleshooting.",
|
|
1256
1258
|
type: "error"
|
|
@@ -1269,49 +1271,49 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
1269
1271
|
}
|
|
1270
1272
|
function b() {
|
|
1271
1273
|
var m, c;
|
|
1272
|
-
(c = (m =
|
|
1274
|
+
(c = (m = V.value) == null ? void 0 : m.validateInputs) == null || c.call(m);
|
|
1273
1275
|
}
|
|
1274
1276
|
return (m, c) => {
|
|
1275
|
-
const
|
|
1277
|
+
const D = S("FmButton"), X = S("FmSideSheet");
|
|
1276
1278
|
return _(), W(X, {
|
|
1277
1279
|
modelValue: d(oe),
|
|
1278
|
-
"onUpdate:modelValue": c[2] || (c[2] = (
|
|
1280
|
+
"onUpdate:modelValue": c[2] || (c[2] = (H) => _o(oe) ? oe.value = H : null),
|
|
1279
1281
|
"dismiss-away": "",
|
|
1280
1282
|
"close-button": "",
|
|
1281
1283
|
"max-width": 900
|
|
1282
1284
|
}, {
|
|
1283
|
-
"side-sheet-header":
|
|
1284
|
-
a("div",
|
|
1285
|
-
a("div",
|
|
1285
|
+
"side-sheet-header": T(() => [
|
|
1286
|
+
a("div", Xs, [
|
|
1287
|
+
a("div", ea, Z(ve.value), 1)
|
|
1286
1288
|
])
|
|
1287
1289
|
]),
|
|
1288
|
-
default:
|
|
1289
|
-
(_(), W(
|
|
1290
|
+
default: T(() => [
|
|
1291
|
+
(_(), W(Js, {
|
|
1290
1292
|
class: "w-full",
|
|
1291
1293
|
ref_key: "formRef",
|
|
1292
|
-
ref:
|
|
1294
|
+
ref: V,
|
|
1293
1295
|
onValidationSuccess: Q,
|
|
1294
1296
|
modelValue: se.value,
|
|
1295
|
-
"onUpdate:modelValue": c[0] || (c[0] = (
|
|
1297
|
+
"onUpdate:modelValue": c[0] || (c[0] = (H) => se.value = H),
|
|
1296
1298
|
disabled: i.value,
|
|
1297
|
-
suppliers: d(
|
|
1299
|
+
suppliers: d(U).suppliers,
|
|
1298
1300
|
skus: d(z).skus,
|
|
1299
1301
|
key: se.value._id ?? "",
|
|
1300
1302
|
"last-closing-date": m.lastClosingDate
|
|
1301
1303
|
}, null, 8, ["modelValue", "disabled", "suppliers", "skus", "last-closing-date"]))
|
|
1302
1304
|
]),
|
|
1303
|
-
"side-sheet-footer":
|
|
1304
|
-
a("div",
|
|
1305
|
-
u(
|
|
1305
|
+
"side-sheet-footer": T(() => [
|
|
1306
|
+
a("div", ta, [
|
|
1307
|
+
u(D, {
|
|
1306
1308
|
loading: i.value,
|
|
1307
1309
|
label: "Save",
|
|
1308
1310
|
onClick: b
|
|
1309
1311
|
}, null, 8, ["loading"]),
|
|
1310
|
-
u(
|
|
1312
|
+
u(D, {
|
|
1311
1313
|
disabled: i.value,
|
|
1312
1314
|
variant: "tertiary",
|
|
1313
1315
|
label: "Close",
|
|
1314
|
-
onClick: c[1] || (c[1] = (
|
|
1316
|
+
onClick: c[1] || (c[1] = (H) => M("update:show", !1))
|
|
1315
1317
|
}, null, 8, ["disabled"])
|
|
1316
1318
|
])
|
|
1317
1319
|
]),
|
|
@@ -1319,24 +1321,24 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
1319
1321
|
}, 8, ["modelValue"]);
|
|
1320
1322
|
};
|
|
1321
1323
|
}
|
|
1322
|
-
}),
|
|
1324
|
+
}), sa = { class: "px-24 xs:p-0 sm:p-0 flex flex-col gap-8 max-h-full" }, aa = { class: "px-8 flex gap-8 items-center xs:gap-0 xs:flex-col-reverse sm:gap-0 sm:flex-col-reverse" }, la = { class: "xs:w-full sm:w-full flex gap-8 items-center overflow-x-auto no-scrollbar py-8" }, na = { class: "flex-1 w-full" }, ra = { class: "flex flex-col py-8" }, ia = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ua = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, ca = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1" }, da = {
|
|
1323
1325
|
key: 0,
|
|
1324
1326
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1"
|
|
1325
|
-
},
|
|
1327
|
+
}, ma = { class: "pt-8" }, ao = "ReceiveRequestViewSearchCriteria", Ta = /* @__PURE__ */ ke({
|
|
1326
1328
|
__name: "ReceiveRequestView",
|
|
1327
1329
|
setup(q) {
|
|
1328
|
-
const te =
|
|
1330
|
+
const te = vt();
|
|
1329
1331
|
Xe.object({
|
|
1330
1332
|
name: Xe.string().optional().nullable(),
|
|
1331
1333
|
startDate: Xe.string().optional().nullable(),
|
|
1332
1334
|
endDate: Xe.string().optional().nullable()
|
|
1333
1335
|
});
|
|
1334
|
-
const J =
|
|
1336
|
+
const J = xo();
|
|
1335
1337
|
function k() {
|
|
1336
1338
|
const R = {
|
|
1337
1339
|
name: "",
|
|
1338
1340
|
...st()
|
|
1339
|
-
}, E = J.getItem(
|
|
1341
|
+
}, E = J.getItem(ao);
|
|
1340
1342
|
if (!E)
|
|
1341
1343
|
return R;
|
|
1342
1344
|
try {
|
|
@@ -1345,16 +1347,16 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
1345
1347
|
return R;
|
|
1346
1348
|
}
|
|
1347
1349
|
}
|
|
1348
|
-
function
|
|
1349
|
-
J.setItem(
|
|
1350
|
+
function M() {
|
|
1351
|
+
J.setItem(ao, JSON.stringify(C.value));
|
|
1350
1352
|
}
|
|
1351
|
-
const C = j(k()),
|
|
1352
|
-
async function
|
|
1353
|
-
const R = `inventory-record_${
|
|
1353
|
+
const C = j(k()), y = Co("receive/request", C.value), { columnDefs: U } = ko("receive/request", y), z = ft();
|
|
1354
|
+
async function g() {
|
|
1355
|
+
const R = `inventory-record_${mt(C.value.startDate).format("DD-MM-YYYY_HH-mm")}-${mt(C.value.endDate).format("DD-MM-YYYY_HH-mm")}.xlsx`, E = y.purchaseOrders.value.flatMap(
|
|
1354
1356
|
(Q) => Q.items.map((b) => {
|
|
1355
|
-
const m =
|
|
1356
|
-
|
|
1357
|
-
),
|
|
1357
|
+
const m = mt(Ao(Q._id)).format("DD MMM YYYY"), c = G(
|
|
1358
|
+
So(b.sku, Q.deliveryOrder || [])
|
|
1359
|
+
), D = G(b.quantity);
|
|
1358
1360
|
return {
|
|
1359
1361
|
"SKU Code": b.code,
|
|
1360
1362
|
"SKU Name": b.name,
|
|
@@ -1363,7 +1365,7 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
1363
1365
|
Status: Q.status,
|
|
1364
1366
|
Reference: Q.ref,
|
|
1365
1367
|
"Received Quantity": c,
|
|
1366
|
-
"Ordered Quantity":
|
|
1368
|
+
"Ordered Quantity": D,
|
|
1367
1369
|
Unit: b.sku.unit.abbrev
|
|
1368
1370
|
};
|
|
1369
1371
|
})
|
|
@@ -1395,88 +1397,88 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
1395
1397
|
}
|
|
1396
1398
|
const f = j(st()), oe = j("");
|
|
1397
1399
|
ue([() => f.value], ([R]) => {
|
|
1398
|
-
!R.startDate || !R.endDate || (C.value.startDate = R.startDate, C.value.endDate = R.endDate,
|
|
1400
|
+
!R.startDate || !R.endDate || (C.value.startDate = R.startDate, C.value.endDate = R.endDate, y.updateDateRange(
|
|
1399
1401
|
C.value.startDate,
|
|
1400
1402
|
C.value.endDate
|
|
1401
|
-
),
|
|
1403
|
+
), M());
|
|
1402
1404
|
}), ue([() => oe.value], () => {
|
|
1403
|
-
|
|
1405
|
+
M();
|
|
1404
1406
|
});
|
|
1405
1407
|
function se(R) {
|
|
1406
|
-
R === "create" &&
|
|
1408
|
+
R === "create" && y.promptCreateTransferDialog();
|
|
1407
1409
|
}
|
|
1408
|
-
const { breakpoints: i } =
|
|
1410
|
+
const { breakpoints: i } = Ho(), ve = $(() => i.value.xs || i.value.sm ? 10 : 20), V = qo();
|
|
1409
1411
|
return (R, E) => {
|
|
1410
|
-
const Q =
|
|
1411
|
-
return _(), W(
|
|
1412
|
+
const Q = S("FmTableToolbar"), b = S("FmTable");
|
|
1413
|
+
return _(), W(Mo, {
|
|
1412
1414
|
title: "Receive and Request",
|
|
1413
1415
|
actions: [{ label: "Create transfer", value: "create", isPrimary: !0, prependIcon: "add" }],
|
|
1414
1416
|
"onClick:action": se
|
|
1415
1417
|
}, {
|
|
1416
|
-
default:
|
|
1418
|
+
default: T(() => {
|
|
1417
1419
|
var m;
|
|
1418
1420
|
return [
|
|
1419
|
-
a("div",
|
|
1420
|
-
a("div",
|
|
1421
|
-
a("div",
|
|
1422
|
-
u(
|
|
1423
|
-
u(
|
|
1421
|
+
a("div", sa, [
|
|
1422
|
+
a("div", aa, [
|
|
1423
|
+
a("div", la, [
|
|
1424
|
+
u(Eo),
|
|
1425
|
+
u(Go, {
|
|
1424
1426
|
"model-value": f.value,
|
|
1425
1427
|
"onUpdate:modelValue": E[0] || (E[0] = (c) => f.value = c)
|
|
1426
1428
|
}, null, 8, ["model-value"])
|
|
1427
1429
|
]),
|
|
1428
|
-
a("div",
|
|
1430
|
+
a("div", na, [
|
|
1429
1431
|
u(Q, {
|
|
1430
1432
|
searchable: "",
|
|
1431
1433
|
"search-model": oe.value,
|
|
1432
1434
|
"onUpdate:searchModel": E[1] || (E[1] = (c) => oe.value = c),
|
|
1433
1435
|
actions: [{ label: "Export", icon: "ios_share", key: "export" }],
|
|
1434
|
-
"onClick:actionExport":
|
|
1436
|
+
"onClick:actionExport": g
|
|
1435
1437
|
}, null, 8, ["search-model"])
|
|
1436
1438
|
])
|
|
1437
1439
|
]),
|
|
1438
1440
|
(_(), W(b, {
|
|
1439
|
-
style:
|
|
1440
|
-
"column-defs": d(
|
|
1441
|
-
"row-data": d(
|
|
1441
|
+
style: lo(d(V).tableHeight),
|
|
1442
|
+
"column-defs": d(U),
|
|
1443
|
+
"row-data": d(y).purchaseOrders.value,
|
|
1442
1444
|
"search-value": oe.value,
|
|
1443
|
-
loading: !d(z)._currentLocation || d(
|
|
1444
|
-
onRowClick: E[2] || (E[2] = (c) => d(
|
|
1445
|
+
loading: !d(z)._currentLocation || d(y).loading.value,
|
|
1446
|
+
onRowClick: E[2] || (E[2] = (c) => d(y).promptShowTransferDetails(c.original)),
|
|
1445
1447
|
key: (m = d(z)._currentLocation) == null ? void 0 : m.dbName,
|
|
1446
1448
|
"page-size": ve.value
|
|
1447
1449
|
}, {
|
|
1448
|
-
"list-row":
|
|
1449
|
-
u(
|
|
1450
|
+
"list-row": T((c) => [
|
|
1451
|
+
u(ro, {
|
|
1450
1452
|
row: c,
|
|
1451
|
-
onRowClick: d(
|
|
1453
|
+
onRowClick: d(y).promptShowTransferDetails
|
|
1452
1454
|
}, {
|
|
1453
|
-
default:
|
|
1454
|
-
var X,
|
|
1455
|
+
default: T((D) => {
|
|
1456
|
+
var X, H, Me, ne, ie, we, Ee, Oe, _e, Se, De, Ne, He, ge, Ie, Ye, at, Fe, ce, qe;
|
|
1455
1457
|
return [
|
|
1456
|
-
a("div",
|
|
1457
|
-
a("div",
|
|
1458
|
+
a("div", ra, [
|
|
1459
|
+
a("div", ia, [
|
|
1458
1460
|
u(d(ee), {
|
|
1459
|
-
render: (
|
|
1460
|
-
props: (ie = (ne =
|
|
1461
|
+
render: (Me = (H = (X = D._id) == null ? void 0 : X.column) == null ? void 0 : H.columnDef) == null ? void 0 : Me.cell,
|
|
1462
|
+
props: (ie = (ne = D._id) == null ? void 0 : ne.getContext) == null ? void 0 : ie.call(ne)
|
|
1461
1463
|
}, null, 8, ["render", "props"])
|
|
1462
1464
|
]),
|
|
1463
|
-
a("div",
|
|
1465
|
+
a("div", ua, [
|
|
1464
1466
|
u(d(ee), {
|
|
1465
|
-
render: (Oe = (Ee = (we =
|
|
1466
|
-
props: (
|
|
1467
|
+
render: (Oe = (Ee = (we = D.supplier_name) == null ? void 0 : we.column) == null ? void 0 : Ee.columnDef) == null ? void 0 : Oe.cell,
|
|
1468
|
+
props: (Se = (_e = D.supplier_name) == null ? void 0 : _e.getContext) == null ? void 0 : Se.call(_e)
|
|
1467
1469
|
}, null, 8, ["render", "props"])
|
|
1468
1470
|
]),
|
|
1469
|
-
a("div",
|
|
1470
|
-
c.original.ref ? (_(), F("div",
|
|
1471
|
+
a("div", ca, Z(c.original.items.map((ye) => `${ye.name}`).join(", ")), 1),
|
|
1472
|
+
c.original.ref ? (_(), F("div", da, [
|
|
1471
1473
|
u(d(ee), {
|
|
1472
|
-
render: (
|
|
1473
|
-
props: (
|
|
1474
|
+
render: (He = (Ne = (De = D.ref) == null ? void 0 : De.column) == null ? void 0 : Ne.columnDef) == null ? void 0 : He.cell,
|
|
1475
|
+
props: (Ie = (ge = D.ref) == null ? void 0 : ge.getContext) == null ? void 0 : Ie.call(ge)
|
|
1474
1476
|
}, null, 8, ["render", "props"])
|
|
1475
1477
|
])) : B("", !0),
|
|
1476
|
-
a("div",
|
|
1478
|
+
a("div", ma, [
|
|
1477
1479
|
u(d(ee), {
|
|
1478
|
-
render: (Fe = (at = (
|
|
1479
|
-
props: (qe = (ce =
|
|
1480
|
+
render: (Fe = (at = (Ye = D.status) == null ? void 0 : Ye.column) == null ? void 0 : at.columnDef) == null ? void 0 : Fe.cell,
|
|
1481
|
+
props: (qe = (ce = D.status) == null ? void 0 : ce.getContext) == null ? void 0 : qe.call(ce)
|
|
1480
1482
|
}, null, 8, ["render", "props"])
|
|
1481
1483
|
])
|
|
1482
1484
|
])
|
|
@@ -1488,12 +1490,12 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
1488
1490
|
_: 1
|
|
1489
1491
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
1490
1492
|
]),
|
|
1491
|
-
(_(), W(
|
|
1492
|
-
u(
|
|
1493
|
-
onSubmitted: d(
|
|
1493
|
+
(_(), W(go, { to: "body" }, [
|
|
1494
|
+
u(oa, Bt(d(y).transferDialogProps.value, {
|
|
1495
|
+
onSubmitted: d(y).fetchData
|
|
1494
1496
|
}), null, 16, ["onSubmitted"]),
|
|
1495
|
-
u(
|
|
1496
|
-
onSubmitted: d(
|
|
1497
|
+
u(wo, Bt(d(y).transferDetailsProps.value, {
|
|
1498
|
+
onSubmitted: d(y).fetchData
|
|
1497
1499
|
}), null, 16, ["onSubmitted"])
|
|
1498
1500
|
]))
|
|
1499
1501
|
];
|
|
@@ -1504,5 +1506,5 @@ const Bo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-
|
|
|
1504
1506
|
}
|
|
1505
1507
|
});
|
|
1506
1508
|
export {
|
|
1507
|
-
|
|
1509
|
+
Ta as default
|
|
1508
1510
|
};
|