@feedmepos/mf-inventory-portal 1.2.12 → 1.2.14-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App-BsAX8Df8.js +286 -0
- package/dist/{ApprovalView-D8_PzEpZ.js → ApprovalView-BT-A6f4_.js} +26 -26
- package/dist/{BindingsDialog-BbpKhb0L.js → BindingsDialog-CNpvAGHr.js} +2 -2
- package/dist/{BindingsPicker-DzDxisHj.js → BindingsPicker-D-vmVplT.js} +10 -10
- package/dist/{BindingsTable-DCXXSY8e.js → BindingsTable-Z7PTxSy6.js} +1 -1
- package/dist/{ClosingDraftView-CkF-9An8.js → ClosingDraftView-C_3P7kh0.js} +44 -44
- package/dist/{ClosingTemplateView-Ce1l7n0x.js → ClosingTemplateView-CimxBGT-.js} +26 -26
- package/dist/{DeliveryOrderPrintPreview-CFzsECiK.js → DeliveryOrderPrintPreview-CMTO9y6R.js} +10 -10
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-ZSERZzyn.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DMK3P4pu.js} +15 -15
- package/dist/{FmMultiselectDialog-DP992D0Q.js → FmMultiselectDialog-D6f0A92U.js} +4 -4
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CzUvuj_c.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CJvnR-aO.js} +54 -54
- package/dist/ImportView-CTYLH5Mz.js +1303 -0
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DsYwSn0d.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-BbmtJ6Ge.js} +1 -1
- package/dist/{IngredientGroupView-DUiKKpvF.js → IngredientGroupView-wygIXAKy.js} +19 -20
- package/dist/IngredientsView-Ct3eNIqS.js +2240 -0
- package/dist/{IntegrationView-CydpIwrf.js → IntegrationView-CKA76Mi6.js} +3 -3
- package/dist/{InventoryBindingForm-BVd2FzOW.js → InventoryBindingForm-CdK2Ujur.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CYp_JSBb.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-B-O0bjxU.js} +12 -12
- package/dist/{InventoryBindingSummary-Dthool-6.js → InventoryBindingSummary-DN6sSW2u.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DR0_Qtyc.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BK65pQy4.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BLfGb7mm.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DrFtLYGt.js} +1 -1
- package/dist/{PublishView-BE_aIhZ6.js → PublishView-LJA3-Xmq.js} +25 -25
- package/dist/{PurchaseOrderPrintPreview-CGeqqFg-.js → PurchaseOrderPrintPreview-CpnoNRcV.js} +12 -12
- package/dist/{ReceiveRequestView-Bul9Esf1.js → ReceiveRequestView-d7KmB_XN.js} +131 -132
- package/dist/RecipeView-B7PtWfJ-.js +636 -0
- package/dist/{StockView-fpJrx4Bd.js → StockView-DoataAnD.js} +165 -166
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DeOEgJ1N.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BZNMBDJ7.js} +1 -1
- package/dist/{SupplierView-cfZTJqef.js → SupplierView-D9Kb7rAO.js} +4 -4
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-CfnN-1oC.js +3385 -0
- package/dist/{TransferTemplateView-PZ8Mad4D.js → TransferTemplateView-D9mrfBH5.js} +166 -166
- package/dist/UnitView-BP5IzLw2.js +674 -0
- package/dist/{WarehouseView-CWGQjwJm.js → WarehouseView-B-qnAHv5.js} +32 -32
- package/dist/api/inventory.d.ts +306 -0
- package/dist/api/purchase-order.d.ts +1 -0
- package/dist/{app-D5PlbdVa.js → app-DDKw9H3a.js} +11730 -11115
- package/dist/app.d.ts +421 -0
- package/dist/app.js +1 -1
- package/dist/{closing-template-C4FizLUw.js → closing-template-BYCZ8etT.js} +1 -1
- package/dist/{decimal-Cv7FZ14q.js → decimal-DMb7zEqx.js} +1 -1
- package/dist/{format-unit-display-B0NO6FLh.js → format-unit-display-BCTXGGeT.js} +24 -24
- package/dist/helper/number.d.ts +1 -0
- package/dist/import-export.helper-B4JVPOJK.js +243 -0
- package/dist/{index-DaJ92t7D.js → index-BZIogw8R.js} +1 -1
- package/dist/{index-BCo2jtpG.js → index-B__hxI_k.js} +1 -1
- package/dist/{purchase-order-template-DLkR7Mva.js → purchase-order-template-Duc9oBWo.js} +1 -1
- package/dist/router/name.d.ts +1 -0
- package/dist/{stock-AUSAF9Ij.js → stock-cFTv_nsm.js} +1 -1
- package/dist/stores/feature.d.ts +2 -0
- package/dist/stores/inventory.d.ts +26 -199
- package/dist/{supplier-DBXoP2UX.js → supplier-CESqvbEF.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-DZQR6jfi.js → use-ingredient-select-dialog-DRJNoQTb.js} +4 -4
- package/dist/{use-inventory-binding-dialog-8PZ37vLV.js → use-inventory-binding-dialog-DTK5yRv9.js} +1 -1
- package/dist/views/import/ImportView.vue.d.ts +3 -0
- package/dist/views/import/components/ImportDialog.vue.d.ts +2 -0
- package/dist/views/import/helper/import-export.helper.d.ts +4 -0
- package/dist/views/ingredients/helper/import-export.helper.d.ts +3 -1
- package/dist/views/receive-request/components/delivery-order-form/SystemTrailDialog.vue.d.ts +17 -0
- package/dist/views/receive-request/components/netsuite/NetSuiteTransactionChangeLog.vue.d.ts +15 -0
- package/dist/views/recipe/RecipeView.vue.d.ts +1 -0
- package/dist/views/recipe/components/import-recipes/ImportRecipeItem.vue.d.ts +16 -0
- package/dist/views/recipe/components/import-recipes/ImportRecipes.vue.d.ts +2 -0
- package/dist/views/recipe/helper/import-recipe.d.ts +48 -0
- package/dist/views/unit/UnitView.vue.d.ts +1 -0
- package/dist/views/unit/components/import-units/ImportUnitItem.vue.d.ts +12 -0
- package/dist/views/unit/components/import-units/ImportUnitItemProps.d.ts +6 -0
- package/dist/views/unit/components/import-units/ImportUnits.vue.d.ts +9 -0
- package/dist/views/unit/components/import-units/ImportUnitsProps.d.ts +5 -0
- package/dist/views/unit/helper/import-export.helper.d.ts +40 -0
- package/package.json +2 -2
- package/dist/App-CP0Qx_82.js +0 -276
- package/dist/IngredientsView-C3ozIXV8.js +0 -2475
- package/dist/RecipeView-B9AGELV7.js +0 -621
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-m5o77oG-.js +0 -3057
- package/dist/UnitView-C3gJq1Mt.js +0 -667
- package/dist/array-Ca8T3f_G.js +0 -44
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { a as q,
|
|
1
|
+
import { a as q, $ as Ie, ao as U, X as Ne, ap as ye, W as he, u as X, l as L, aq as De, z as le, ar as ve, b as te, t as G, y as Z, aS as Oe, aL as Fe, a5 as Pe, B as Me, C as Ue, as as Le, e as ce, f as re, R as me, w as Be, am as Qe, D as j, j as N, i as He } from "./app-DDKw9H3a.js";
|
|
2
2
|
import { useCoreStore as ge, useI18n as ne } from "@feedmepos/mf-common";
|
|
3
|
-
import { useDialogChild as Ve, useSnackbar as be, useDialog as qe, FmButtonVariant as z, components as
|
|
3
|
+
import { useDialogChild as Ve, useSnackbar as be, useDialog as qe, FmButtonVariant as z, components as J } from "@feedmepos/ui-library";
|
|
4
4
|
import { defineStore as xe } from "pinia";
|
|
5
|
-
import { u as Se } from "./purchase-order-template-
|
|
6
|
-
import { defineComponent as oe, resolveComponent as Q, openBlock as _, createElementBlock as E, createElementVNode as C, normalizeClass as H, createTextVNode as je, toDisplayString as D, unref as I, createCommentVNode as V, createVNode as P, withCtx as ee, Fragment as B, renderList as
|
|
7
|
-
import { useRouter as
|
|
8
|
-
import { u as ae } from "./supplier-
|
|
5
|
+
import { u as Se } from "./purchase-order-template-Duc9oBWo.js";
|
|
6
|
+
import { defineComponent as oe, resolveComponent as Q, openBlock as _, createElementBlock as E, createElementVNode as C, normalizeClass as H, createTextVNode as je, toDisplayString as D, unref as I, createCommentVNode as V, createVNode as P, withCtx as ee, Fragment as B, renderList as W, ref as k, onMounted as ze, computed as ue, watch as Ke, createSlots as We, createBlock as K, h as Y } from "vue";
|
|
7
|
+
import { useRouter as Ye } from "vue-router";
|
|
8
|
+
import { u as ae } from "./supplier-CESqvbEF.js";
|
|
9
9
|
function Te(e) {
|
|
10
10
|
const t = q(), a = e.sku, u = t.skuById[a._id];
|
|
11
11
|
if (u.unit._id !== a.unit._id) return !0;
|
|
@@ -109,8 +109,8 @@ function Ge(e) {
|
|
|
109
109
|
)) == null ? void 0 : l.sheets, s = `${a == null ? void 0 : a.name} transfer templates (${Ne(/* @__PURE__ */ new Date())}).xlsx`, f = ye(i);
|
|
110
110
|
return he(f, s), s;
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
const e = ge(), t = ae(), a =
|
|
112
|
+
function Xe() {
|
|
113
|
+
const e = ge(), t = ae(), a = X(), u = q(), i = e.currentBusiness.value, s = _e({
|
|
114
114
|
sku: {
|
|
115
115
|
unit: {
|
|
116
116
|
_id: "",
|
|
@@ -221,7 +221,7 @@ function Je() {
|
|
|
221
221
|
return he(v, b), b;
|
|
222
222
|
}
|
|
223
223
|
function Ze(e, t) {
|
|
224
|
-
const a = new Array(), u = /(.*) \(((supplier_|warehouse_|restaurant_).{24,})\)/, s =
|
|
224
|
+
const a = new Array(), u = /(.*) \(((supplier_|warehouse_|restaurant_).{24,})\)/, s = X().locationByDbName, l = ae().supplierById, o = e.trim(), c = u.exec(o);
|
|
225
225
|
if (!c)
|
|
226
226
|
return a.push(`Transfer from location value of ${o} cannot be read.`), {
|
|
227
227
|
errors: a
|
|
@@ -262,10 +262,10 @@ function Ze(e, t) {
|
|
|
262
262
|
errors: a
|
|
263
263
|
};
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function Je(e) {
|
|
266
266
|
if (!e.length || `${e[0]}`.toLocaleLowerCase() === "all")
|
|
267
267
|
return [];
|
|
268
|
-
const t = /(.*) \(((warehouse_|restaurant_).{24,})\)/, u =
|
|
268
|
+
const t = /(.*) \(((warehouse_|restaurant_).{24,})\)/, u = X().locationByDbName;
|
|
269
269
|
return e.map((i) => {
|
|
270
270
|
const s = new Array(), f = i.trim(), l = t.exec(f);
|
|
271
271
|
if (!l)
|
|
@@ -439,7 +439,7 @@ function ot(e) {
|
|
|
439
439
|
var p;
|
|
440
440
|
const l = new Array(), o = e.Sheets[f], c = et(o), h = Ze(c.transferFrom, c.type);
|
|
441
441
|
l.push(...h.errors);
|
|
442
|
-
const d = h.from, m =
|
|
442
|
+
const d = h.from, m = Je(c.locations), v = m.filter((n) => n.location).map((n) => n.location);
|
|
443
443
|
l.push(...m.flatMap((n) => n.errors));
|
|
444
444
|
const b = tt(o).filter((n) => n.data.code), r = b.map(
|
|
445
445
|
(n, y) => nt(n.data, y, b)
|
|
@@ -575,7 +575,7 @@ const st = { class: "flex items-center gap-12 pl-8" }, it = { class: "flex flex-
|
|
|
575
575
|
P(i, { "z-index": 50 }, {
|
|
576
576
|
content: ee(() => [
|
|
577
577
|
C("ol", null, [
|
|
578
|
-
(_(!0), E(B, null,
|
|
578
|
+
(_(!0), E(B, null, W(t.errors, (o, c) => (_(), E("li", { key: c }, D(o), 1))), 128))
|
|
579
579
|
])
|
|
580
580
|
]),
|
|
581
581
|
default: ee(() => [
|
|
@@ -701,7 +701,7 @@ const st = { class: "flex items-center gap-12 pl-8" }, it = { class: "flex flex-
|
|
|
701
701
|
onFileUpload: r[0] || (r[0] = (p) => t.value = p),
|
|
702
702
|
label: I(m)("inventory.ingredient.import.uploadTemplate"),
|
|
703
703
|
"button-label": I(m)("inventory.ingredient.import.selectFile")
|
|
704
|
-
},
|
|
704
|
+
}, We({ _: 2 }, [
|
|
705
705
|
t.value ? {
|
|
706
706
|
name: "default",
|
|
707
707
|
fn: ee(({ openFileDialog: p }) => [
|
|
@@ -747,7 +747,7 @@ const st = { class: "flex items-center gap-12 pl-8" }, it = { class: "flex flex-
|
|
|
747
747
|
]))
|
|
748
748
|
], 2),
|
|
749
749
|
l.value.length ? (_(), E("div", vt, [
|
|
750
|
-
(_(!0), E(B, null,
|
|
750
|
+
(_(!0), E(B, null, W(l.value, (n, y) => (_(), E("div", {
|
|
751
751
|
key: y,
|
|
752
752
|
class: "flex gap-8 items-center"
|
|
753
753
|
}, [
|
|
@@ -766,7 +766,7 @@ const st = { class: "flex items-center gap-12 pl-8" }, it = { class: "flex flex-
|
|
|
766
766
|
]), 1032, ["class", "label", "button-label"]),
|
|
767
767
|
d.value ? (_(), E("div", bt, [
|
|
768
768
|
C("div", xt, D(I(m)("inventory.ingredient.import.summary")), 1),
|
|
769
|
-
(_(!0), E(B, null,
|
|
769
|
+
(_(!0), E(B, null, W(o.value, (p, n) => (_(), K(pe, {
|
|
770
770
|
key: n,
|
|
771
771
|
name: p.template.name,
|
|
772
772
|
"transfer-type": typeof p.template.purchaseOrder.supplier.internal == "string" ? I(A).TRANSFER : I(A).PURCHASE,
|
|
@@ -775,7 +775,7 @@ const st = { class: "flex items-center gap-12 pl-8" }, it = { class: "flex flex-
|
|
|
775
775
|
errors: p.errors,
|
|
776
776
|
type: "create"
|
|
777
777
|
}, null, 8, ["name", "transfer-type", "locations", "items", "errors"]))), 128)),
|
|
778
|
-
(_(!0), E(B, null,
|
|
778
|
+
(_(!0), E(B, null, W(c.value, (p) => (_(), K(pe, {
|
|
779
779
|
key: p.template._id,
|
|
780
780
|
name: p.template.name,
|
|
781
781
|
"transfer-type": typeof p.template.purchaseOrder.supplier.internal == "string" ? I(A).TRANSFER : I(A).PURCHASE,
|
|
@@ -802,7 +802,7 @@ function Tt(e) {
|
|
|
802
802
|
return u && u == i;
|
|
803
803
|
}
|
|
804
804
|
const _t = xe("transferTemplateActions", () => {
|
|
805
|
-
const e = qe(), t = be(), a =
|
|
805
|
+
const e = qe(), t = be(), a = X(), u = Ce(), i = Le(), s = Se(), f = te(), l = Ye(), { t: o } = ne(), c = k({});
|
|
806
806
|
function h() {
|
|
807
807
|
c.value = {
|
|
808
808
|
mode: ce.CREATE,
|
|
@@ -882,7 +882,7 @@ const _t = xe("transferTemplateActions", () => {
|
|
|
882
882
|
props: ["modelValue"],
|
|
883
883
|
emits: ["update:modelValue"],
|
|
884
884
|
setup(R) {
|
|
885
|
-
return () =>
|
|
885
|
+
return () => Y(J.FmTextField, {
|
|
886
886
|
modelValue: R.modelValue,
|
|
887
887
|
"onUpdate:modelValue": (g) => $ = g,
|
|
888
888
|
label: "New Template Name",
|
|
@@ -1033,7 +1033,7 @@ const _t = xe("transferTemplateActions", () => {
|
|
|
1033
1033
|
return;
|
|
1034
1034
|
}
|
|
1035
1035
|
e.close(), S(n);
|
|
1036
|
-
}).onTertiary(
|
|
1036
|
+
}).onTertiary(Xe);
|
|
1037
1037
|
}
|
|
1038
1038
|
async function S(n) {
|
|
1039
1039
|
try {
|
|
@@ -1175,16 +1175,16 @@ const Ce = xe(
|
|
|
1175
1175
|
},
|
|
1176
1176
|
cell(d) {
|
|
1177
1177
|
const m = Number(d.getValue()) || 0, v = d.row.original.purchaseOrder.items.some(Te);
|
|
1178
|
-
return m === 0 || v ?
|
|
1179
|
-
|
|
1180
|
-
|
|
1178
|
+
return m === 0 || v ? Y("div", { class: "flex justify-end gap-4 items-center" }, [
|
|
1179
|
+
Y(
|
|
1180
|
+
J.FmTooltip,
|
|
1181
1181
|
{},
|
|
1182
1182
|
{
|
|
1183
1183
|
content() {
|
|
1184
1184
|
return v ? "The template is invalid due to invalid unit on some of the items. Please update this template." : "The template is invalid due to deleted ingredients. Please update this template.";
|
|
1185
1185
|
},
|
|
1186
1186
|
default() {
|
|
1187
|
-
return
|
|
1187
|
+
return Y(J.FmIcon, {
|
|
1188
1188
|
name: "error",
|
|
1189
1189
|
color: "system-error-300",
|
|
1190
1190
|
size: "sm"
|
package/dist/helper/number.d.ts
CHANGED
|
@@ -36,3 +36,4 @@ export declare function countDivisibleByTrailingZero(n: number | BigInt): number
|
|
|
36
36
|
* Documentation at: https://www.notion.so/feedmepos/Precision-Handling-Logic-8e2211106b4a4a0f9fae8ee9c1e897da?pvs=4
|
|
37
37
|
*/
|
|
38
38
|
export declare function getAllowedPrecision(unit: FdoInventoryUnit, measurement?: FdoUnitMeasurement | null): number;
|
|
39
|
+
export declare const isNumeric: (value: any) => boolean | 0;
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { a as y, V as U, X as E, W as $, l as _, n as N, aq as H, c as T, ar as I, p as C, t as O, a3 as P, O as j } from "./app-DDKw9H3a.js";
|
|
2
|
+
import { useCoreStore as b } from "@feedmepos/mf-common";
|
|
3
|
+
import { r as D } from "./random-CSbEbElR.js";
|
|
4
|
+
function k() {
|
|
5
|
+
return {
|
|
6
|
+
low: 6,
|
|
7
|
+
mid: 14
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
function B() {
|
|
11
|
+
return `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${D()}`;
|
|
12
|
+
}
|
|
13
|
+
const V = {
|
|
14
|
+
_id: "",
|
|
15
|
+
name: "",
|
|
16
|
+
abbrev: "",
|
|
17
|
+
precision: 0,
|
|
18
|
+
measurements: []
|
|
19
|
+
};
|
|
20
|
+
function L(e) {
|
|
21
|
+
return !e || Object.keys(e).length === 0 ? "" : Object.entries(e).map(([t, a]) => `${t}: ${a}`).join(", ");
|
|
22
|
+
}
|
|
23
|
+
function A(e) {
|
|
24
|
+
if (!e || e.trim() === "")
|
|
25
|
+
return;
|
|
26
|
+
const t = {}, a = e.split(",").map((n) => n.trim());
|
|
27
|
+
for (const n of a) {
|
|
28
|
+
const s = n.indexOf(":");
|
|
29
|
+
if (s > 0) {
|
|
30
|
+
const c = n.substring(0, s).trim(), r = n.substring(s + 1).trim();
|
|
31
|
+
c && r && (t[c] = r);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return Object.keys(t).length > 0 ? t : void 0;
|
|
35
|
+
}
|
|
36
|
+
function Y(e) {
|
|
37
|
+
var a, n, s, c, r;
|
|
38
|
+
return {
|
|
39
|
+
code: e.code,
|
|
40
|
+
name: e.name,
|
|
41
|
+
unit: e.unit.name,
|
|
42
|
+
baseUnit: e.unit.abbrev,
|
|
43
|
+
measurementName: ((a = e.unit.measurements.find((m) => m.id === e.trackingMeasurement)) == null ? void 0 : a.abbrev) ?? e.unit.abbrev,
|
|
44
|
+
valuationMethod: e.valuation ?? "WAVG",
|
|
45
|
+
pricePerUnit: (n = e.defaultCost) != null && n.costPerUnit ? +_((s = e.defaultCost) == null ? void 0 : s.costPerUnit) : 0,
|
|
46
|
+
thresholdLow: ((c = e.thresholds) == null ? void 0 : c.low) ?? k().low,
|
|
47
|
+
thresholdMid: ((r = e.thresholds) == null ? void 0 : r.mid) ?? k().mid,
|
|
48
|
+
customAttributes: L(e.customAttributes)
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function w() {
|
|
52
|
+
var s;
|
|
53
|
+
const e = [
|
|
54
|
+
{
|
|
55
|
+
id: "code",
|
|
56
|
+
name: "Code"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: "name",
|
|
60
|
+
name: "Name"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: "unit",
|
|
64
|
+
name: "Unit"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: "baseUnit",
|
|
68
|
+
name: "Base unit"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: "measurementName",
|
|
72
|
+
name: "Measurement Name"
|
|
73
|
+
}
|
|
74
|
+
], t = T(), a = b(), n = N(a.currentCountry.value);
|
|
75
|
+
return t.enableTotalCost && e.push(
|
|
76
|
+
{
|
|
77
|
+
id: "valuationMethod",
|
|
78
|
+
name: "Valuation method"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: "pricePerUnit",
|
|
82
|
+
name: `Price per unit (${n == null ? void 0 : n.currency})`
|
|
83
|
+
}
|
|
84
|
+
), ((s = a.currentBusiness.value) == null ? void 0 : s.menuVersion) === "v4" && e.push(
|
|
85
|
+
{
|
|
86
|
+
id: "thresholdLow",
|
|
87
|
+
name: "Show RED when remaining"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: "thresholdMid",
|
|
91
|
+
name: "Show YELLOW when remaining"
|
|
92
|
+
}
|
|
93
|
+
), e.push({
|
|
94
|
+
id: "customAttributes",
|
|
95
|
+
name: "Custom Attributes"
|
|
96
|
+
}), e;
|
|
97
|
+
}
|
|
98
|
+
function J() {
|
|
99
|
+
const t = y().skus.map(Y), n = b().currentBusiness.value, s = w(), c = [
|
|
100
|
+
["Business name:", n == null ? void 0 : n.name],
|
|
101
|
+
["Business ID:", n == null ? void 0 : n._id],
|
|
102
|
+
["Menu version", n == null ? void 0 : n.menuVersion],
|
|
103
|
+
[],
|
|
104
|
+
s.map((o) => o.name),
|
|
105
|
+
...t.map((o) => s.map((u) => o[u.id]))
|
|
106
|
+
], r = s.map((o) => `system:${o.id}`), m = U(c, r), d = `${n == null ? void 0 : n.name} ingredients (${E(/* @__PURE__ */ new Date())}).xlsx`;
|
|
107
|
+
return $(m, d), d;
|
|
108
|
+
}
|
|
109
|
+
function K() {
|
|
110
|
+
const t = b().currentBusiness.value, a = w(), n = [
|
|
111
|
+
["Business name:", t == null ? void 0 : t.name],
|
|
112
|
+
["Business ID:", t == null ? void 0 : t._id],
|
|
113
|
+
["Menu version", t == null ? void 0 : t.menuVersion],
|
|
114
|
+
[],
|
|
115
|
+
a.map((m) => m.name)
|
|
116
|
+
], s = a.map((m) => `system:${m.id}`), c = U(n, s), r = "FeedMe ingredients template.xlsx";
|
|
117
|
+
return $(c, r), r;
|
|
118
|
+
}
|
|
119
|
+
function F(e) {
|
|
120
|
+
const [
|
|
121
|
+
t,
|
|
122
|
+
a,
|
|
123
|
+
n,
|
|
124
|
+
s,
|
|
125
|
+
c,
|
|
126
|
+
r,
|
|
127
|
+
...m
|
|
128
|
+
] = I(e);
|
|
129
|
+
if (!t || !t.length || t.some((l) => l.length && !l.startsWith("system:")))
|
|
130
|
+
throw new Error("Missing meta header. Excel file does not come from the template.");
|
|
131
|
+
const d = t.map((l) => l.split(":")[1]), u = ["code", "name", "unit", "baseUnit", "measurementName"].filter((l) => !d.includes(l));
|
|
132
|
+
if (u.length)
|
|
133
|
+
throw new Error(
|
|
134
|
+
`Missing meta headers (${u.join()}). Excel file does not come from the template.`
|
|
135
|
+
);
|
|
136
|
+
return m.map((l, p) => {
|
|
137
|
+
const f = {};
|
|
138
|
+
for (const v in d) {
|
|
139
|
+
const g = d[v];
|
|
140
|
+
Object.assign(f, { [g]: l[v] });
|
|
141
|
+
}
|
|
142
|
+
return {
|
|
143
|
+
index: p,
|
|
144
|
+
data: f
|
|
145
|
+
};
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
function R(e, t, a, { ignoreErrors: n = !1 } = {}) {
|
|
149
|
+
var M;
|
|
150
|
+
const c = y().units, r = new Array(), m = a.filter((i) => i.data.code === e.code);
|
|
151
|
+
m.length > 1 && r.push(
|
|
152
|
+
`Code ${e.code} is already used in row ${m.map((i) => i.index + 6).join()}.`
|
|
153
|
+
);
|
|
154
|
+
const d = c.find((i) => {
|
|
155
|
+
var S, x;
|
|
156
|
+
return i.abbrev === e.baseUnit && ((S = i.name) == null ? void 0 : S.trim()) === ((x = e.unit) == null ? void 0 : x.trim());
|
|
157
|
+
}), o = d == null ? void 0 : d.measurements.find((i) => i.abbrev === e.measurementName);
|
|
158
|
+
if (!d)
|
|
159
|
+
r.push(`Cannot find base unit of symbol ${e.baseUnit}.`);
|
|
160
|
+
else if (e.baseUnit !== e.measurementName && !o) {
|
|
161
|
+
const i = `Cannot find unit conversion for ${e.baseUnit} with symbol ${e.measurementName || "[empty]"}.`;
|
|
162
|
+
r.push(i);
|
|
163
|
+
}
|
|
164
|
+
const u = C.options.find(
|
|
165
|
+
(i) => i === e.valuationMethod
|
|
166
|
+
);
|
|
167
|
+
e.valuationMethod && !u && r.push(
|
|
168
|
+
`Expected valuation method to be one of ${C.options.join()} but got ${e.valuationMethod} instead.`
|
|
169
|
+
);
|
|
170
|
+
const l = b().currentCountry.value, p = (i) => `${i}`.length && j()(i) === !0, f = p(`${e.pricePerUnit}`) === !0 ? {
|
|
171
|
+
costPerUnit: {
|
|
172
|
+
...O(Number(e.pricePerUnit) || 0, P(Number(e.pricePerUnit) || 0)),
|
|
173
|
+
currency: ((M = N(l)) == null ? void 0 : M.currency) ?? "MYR"
|
|
174
|
+
},
|
|
175
|
+
measurement: o
|
|
176
|
+
} : void 0, v = p(`${e.thresholdLow}`) && p(`${e.thresholdMid}`) ? {
|
|
177
|
+
low: Number(e.thresholdLow) || 0,
|
|
178
|
+
mid: Number(e.thresholdMid) || 0
|
|
179
|
+
} : void 0, g = "customAttributes" in e ? A(e.customAttributes) : null;
|
|
180
|
+
return {
|
|
181
|
+
type: "create",
|
|
182
|
+
sku: {
|
|
183
|
+
_id: B(),
|
|
184
|
+
code: e.code,
|
|
185
|
+
name: e.name,
|
|
186
|
+
unit: d ?? c.find((i) => i) ?? V,
|
|
187
|
+
trackingMeasurement: o == null ? void 0 : o.id,
|
|
188
|
+
valuation: u,
|
|
189
|
+
defaultCost: f,
|
|
190
|
+
thresholds: v,
|
|
191
|
+
...g !== null && { customAttributes: g }
|
|
192
|
+
},
|
|
193
|
+
errors: r,
|
|
194
|
+
excelRowNumber: t + 6
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
function Q(e) {
|
|
198
|
+
try {
|
|
199
|
+
const t = F(e).filter((o) => o.data.code), n = y().skus, s = H(n, "code"), c = t.filter((o) => !s[o.data.code]), r = t.filter((o) => s[o.data.code]), m = c.map(
|
|
200
|
+
(o) => R(o.data, o.index, t)
|
|
201
|
+
), d = r.map((o) => {
|
|
202
|
+
const u = R(o.data, o.index, t), h = s[o.data.code];
|
|
203
|
+
let l = h.customAttributes;
|
|
204
|
+
return "customAttributes" in o.data && (l = A(o.data.customAttributes)), {
|
|
205
|
+
...u,
|
|
206
|
+
type: "update",
|
|
207
|
+
original: h,
|
|
208
|
+
sku: {
|
|
209
|
+
// to maintain original props not in the import excel, e.g. inventory binding, etc...
|
|
210
|
+
...h,
|
|
211
|
+
code: u.sku.code || h.code,
|
|
212
|
+
name: u.sku.name || h.name,
|
|
213
|
+
unit: u.sku.unit || h.unit,
|
|
214
|
+
trackingMeasurement: u.sku.trackingMeasurement || h.trackingMeasurement,
|
|
215
|
+
valuation: u.sku.valuation || h.valuation,
|
|
216
|
+
defaultCost: u.sku.defaultCost || h.defaultCost,
|
|
217
|
+
thresholds: u.sku.thresholds || h.thresholds,
|
|
218
|
+
customAttributes: l
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
});
|
|
222
|
+
return {
|
|
223
|
+
invalidExcel: !1,
|
|
224
|
+
importCreateResult: m,
|
|
225
|
+
importUpdateResult: d
|
|
226
|
+
};
|
|
227
|
+
} catch (t) {
|
|
228
|
+
return {
|
|
229
|
+
invalidExcel: !0,
|
|
230
|
+
invalidExcelMessage: (t == null ? void 0 : t.message) ?? "Invalid excel",
|
|
231
|
+
importCreateResult: [],
|
|
232
|
+
importUpdateResult: []
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
export {
|
|
237
|
+
K as a,
|
|
238
|
+
w as b,
|
|
239
|
+
k as d,
|
|
240
|
+
J as e,
|
|
241
|
+
Q as g,
|
|
242
|
+
A as s
|
|
243
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ref as b, computed as u } from "vue";
|
|
2
|
-
import { u as d,
|
|
2
|
+
import { u as d, b7 as p, aY as v, c as m, b as h } from "./app-DDKw9H3a.js";
|
|
3
3
|
import { useSnackbar as E } from "@feedmepos/ui-library";
|
|
4
4
|
function I() {
|
|
5
5
|
return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b6 as x, be as V, bf as q, bg as Ne, bh as cl, bi as sr, bj as Lt, bk as fl, bl as $l } from "./app-DDKw9H3a.js";
|
|
2
2
|
function vl(t, e) {
|
|
3
3
|
for (var r = 0; r < e.length; r++) {
|
|
4
4
|
const n = e[r];
|
package/dist/router/name.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a7 as m, u as k, a as l, aA as B, $ as p } from "./app-DDKw9H3a.js";
|
|
2
2
|
import { useCoreStore as v } from "@feedmepos/mf-common";
|
|
3
3
|
import { useSnackbar as $ } from "@feedmepos/ui-library";
|
|
4
4
|
import { ref as y, computed as b } from "vue";
|
package/dist/stores/feature.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export interface FeatureState {
|
|
|
27
27
|
inventory_pos_transfer_require_fulfillment: boolean;
|
|
28
28
|
inventory_backdate_receive: boolean;
|
|
29
29
|
inventory_purchase_order_custom_cost: boolean;
|
|
30
|
+
inventory_bulk_import: boolean;
|
|
30
31
|
}
|
|
31
32
|
export declare const useFeatureStore: () => {
|
|
32
33
|
readonly businessDbName: string;
|
|
@@ -58,6 +59,7 @@ export declare const useFeatureStore: () => {
|
|
|
58
59
|
readonly enablePOSTransferRequireFulfillment: boolean;
|
|
59
60
|
readonly enableBackdateReceive: boolean;
|
|
60
61
|
readonly enablePurchaseOrderReceiveWithCustomCost: boolean;
|
|
62
|
+
readonly enableBulkImport: boolean;
|
|
61
63
|
init(): Promise<void>;
|
|
62
64
|
awaitFeatureLoaded(callback: () => boolean): Promise<boolean>;
|
|
63
65
|
};
|