@feedmepos/mf-inventory-portal 1.2.11 → 1.2.12-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-BCVrJ7-x.js → App-T4sL7Sy4.js} +44 -40
- package/dist/{ApprovalView-BMEzgj9q.js → ApprovalView-CfmNwkYs.js} +30 -30
- package/dist/{BindingsDialog-Do_UsSE4.js → BindingsDialog-DDYAQsNs.js} +2 -2
- package/dist/{BindingsPicker-CFUwkcKX.js → BindingsPicker-CXZhlZ4b.js} +1 -1
- package/dist/{BindingsTable-a7rhi6MZ.js → BindingsTable-LQ59h-NA.js} +1 -1
- package/dist/{ClosingDraftView-Dv4lj9E7.js → ClosingDraftView-B1J4RCvY.js} +180 -180
- package/dist/{ClosingTemplateView-BRX45M7h.js → ClosingTemplateView-6NoqcDMF.js} +3 -3
- package/dist/{DeliveryOrderPrintPreview-CwMX74nM.js → DeliveryOrderPrintPreview--XMB1yg_.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CL3yU8XA.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BXxGymbF.js} +3 -3
- package/dist/{FmMultiselectDialog-BiLym6fH.js → FmMultiselectDialog-DPPNjHO8.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BAGo4_1C.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CSgYZv-j.js} +39 -39
- package/dist/ImportView-ClHIcxRw.js +1195 -0
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BIImtfdR.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-tUefDFh2.js} +1 -1
- package/dist/{IngredientGroupView-CLVfJFTD.js → IngredientGroupView-BjtjeGay.js} +16 -17
- package/dist/IngredientsView-BA6Y-uhX.js +2240 -0
- package/dist/{IntegrationView-Crm8R-cF.js → IntegrationView-D8HiAM5K.js} +57 -57
- package/dist/{InventoryBindingForm-DQeaxeQX.js → InventoryBindingForm-DCtBdWkM.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-yQZC9peR.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-RxoPehX0.js} +31 -31
- package/dist/{InventoryBindingSummary-DUiYadJR.js → InventoryBindingSummary-DGLMoDKd.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DOpF4cSz.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-D0ElZcnn.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DFjhh2P6.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BNm3V8o4.js} +1 -1
- package/dist/{PublishView-D3FS3ioY.js → PublishView-DQcrQkVJ.js} +16 -16
- package/dist/{PurchaseOrderPrintPreview-ByURcesK.js → PurchaseOrderPrintPreview-1NMEozJD.js} +1 -1
- package/dist/{ReceiveRequestView-mt0ja21g.js → ReceiveRequestView-BFs8VYre.js} +193 -194
- package/dist/RecipeView-DgF_kShy.js +636 -0
- package/dist/{StockView-C9erE0Vu.js → StockView-B80E0r1r.js} +165 -166
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BC1mwDJX.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CFFDw9Mj.js} +1 -1
- package/dist/{SupplierView-C_NMItXg.js → SupplierView-E_fX8cgQ.js} +52 -52
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-Bxl2Gege.js +3221 -0
- package/dist/{TransferTemplateView-DOVDiF7-.js → TransferTemplateView-B-uBdQgp.js} +97 -97
- package/dist/UnitView-DOIy_8oz.js +674 -0
- package/dist/{WarehouseView-lz2uVygR.js → WarehouseView-DZSetx-S.js} +32 -32
- package/dist/api/inventory.d.ts +306 -0
- package/dist/api/purchase-order.d.ts +1 -0
- package/dist/{app-D0bYbsGd.js → app-CLG8lnmY.js} +8810 -8475
- package/dist/app.d.ts +169 -0
- package/dist/app.js +1 -1
- package/dist/{closing-template-CrxsMQM1.js → closing-template-CHz79DOu.js} +1 -1
- package/dist/{decimal-OP8pLXox.js → decimal-BNFgzHyV.js} +1 -1
- package/dist/{format-unit-display-AxULhwcM.js → format-unit-display-DYY0F6KV.js} +25 -25
- package/dist/helper/number.d.ts +1 -0
- package/dist/import-export.helper-uZNU9S1q.js +243 -0
- package/dist/{index-BZumsz4L.js → index-Bu7FmfHi.js} +1 -1
- package/dist/{index-DwPtx2QV.js → index-DiYSFnk1.js} +1 -1
- package/dist/{purchase-order-template-BO_iyudu.js → purchase-order-template-DtfKTZLV.js} +1 -1
- package/dist/router/name.d.ts +1 -0
- package/dist/{stock-DZbjPfvD.js → stock-RE6RExO9.js} +1 -1
- package/dist/stores/feature.d.ts +2 -0
- package/dist/stores/inventory.d.ts +26 -199
- package/dist/{supplier-CcKZR4JV.js → supplier-DkLAGLl7.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-DgZXbr91.js → use-ingredient-select-dialog-Bg_kT9z-.js} +1 -1
- package/dist/{use-inventory-binding-dialog-xJk-GAkH.js → use-inventory-binding-dialog-CpS4GfwM.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/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 +1 -1
- package/dist/IngredientsView-DETE0BaL.js +0 -2475
- package/dist/RecipeView-B04R5lQ1.js +0 -621
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-Cts9z9LO.js +0 -3057
- package/dist/UnitView-BVOtZ1eJ.js +0 -667
- package/dist/array-Ca8T3f_G.js +0 -44
package/dist/app.d.ts
CHANGED
|
@@ -347,6 +347,13 @@ export declare const i18nMessages: {
|
|
|
347
347
|
selectFile: string;
|
|
348
348
|
replaceFile: string;
|
|
349
349
|
summary: string;
|
|
350
|
+
multiUploadTemplateInstruction: string;
|
|
351
|
+
importInstructions: {
|
|
352
|
+
step1: string;
|
|
353
|
+
step2: string;
|
|
354
|
+
step3: string;
|
|
355
|
+
step4: string;
|
|
356
|
+
};
|
|
350
357
|
fileError: {
|
|
351
358
|
noSheet: string;
|
|
352
359
|
invalidExcel: string;
|
|
@@ -496,6 +503,10 @@ export declare const i18nMessages: {
|
|
|
496
503
|
message: string;
|
|
497
504
|
};
|
|
498
505
|
};
|
|
506
|
+
import: {
|
|
507
|
+
title: string;
|
|
508
|
+
uploadDescription: string;
|
|
509
|
+
};
|
|
499
510
|
};
|
|
500
511
|
unit: {
|
|
501
512
|
title: string;
|
|
@@ -535,6 +546,50 @@ export declare const i18nMessages: {
|
|
|
535
546
|
message: string;
|
|
536
547
|
};
|
|
537
548
|
};
|
|
549
|
+
export: {
|
|
550
|
+
success: string;
|
|
551
|
+
filename: string;
|
|
552
|
+
};
|
|
553
|
+
import: {
|
|
554
|
+
title: string;
|
|
555
|
+
description: string;
|
|
556
|
+
actions: {
|
|
557
|
+
downloadTemplate: string;
|
|
558
|
+
};
|
|
559
|
+
template: {
|
|
560
|
+
success: string;
|
|
561
|
+
filename: string;
|
|
562
|
+
};
|
|
563
|
+
dropzone: {
|
|
564
|
+
label: string;
|
|
565
|
+
helperText: string;
|
|
566
|
+
selectFile: string;
|
|
567
|
+
};
|
|
568
|
+
fileError: {
|
|
569
|
+
title: string;
|
|
570
|
+
noSheet: string;
|
|
571
|
+
invalidExcel: string;
|
|
572
|
+
parseError: string;
|
|
573
|
+
};
|
|
574
|
+
summary: {
|
|
575
|
+
title: string;
|
|
576
|
+
create: string;
|
|
577
|
+
update: string;
|
|
578
|
+
error: string;
|
|
579
|
+
};
|
|
580
|
+
success: {
|
|
581
|
+
title: string;
|
|
582
|
+
message: string;
|
|
583
|
+
};
|
|
584
|
+
error: {
|
|
585
|
+
noData: string;
|
|
586
|
+
invalidContent: string;
|
|
587
|
+
noImportData: string;
|
|
588
|
+
hasErrors: string;
|
|
589
|
+
failed: string;
|
|
590
|
+
systemMessage: string;
|
|
591
|
+
};
|
|
592
|
+
};
|
|
538
593
|
};
|
|
539
594
|
transfer: {
|
|
540
595
|
title: string;
|
|
@@ -1258,6 +1313,13 @@ export declare const i18nMessages: {
|
|
|
1258
1313
|
selectFile: string;
|
|
1259
1314
|
replaceFile: string;
|
|
1260
1315
|
summary: string;
|
|
1316
|
+
multiUploadTemplateInstruction: string;
|
|
1317
|
+
importInstructions: {
|
|
1318
|
+
step1: string;
|
|
1319
|
+
step2: string;
|
|
1320
|
+
step3: string;
|
|
1321
|
+
step4: string;
|
|
1322
|
+
};
|
|
1261
1323
|
fileError: {
|
|
1262
1324
|
noSheet: string;
|
|
1263
1325
|
invalidExcel: string;
|
|
@@ -1407,6 +1469,10 @@ export declare const i18nMessages: {
|
|
|
1407
1469
|
message: string;
|
|
1408
1470
|
};
|
|
1409
1471
|
};
|
|
1472
|
+
import: {
|
|
1473
|
+
title: string;
|
|
1474
|
+
uploadDescription: string;
|
|
1475
|
+
};
|
|
1410
1476
|
};
|
|
1411
1477
|
unit: {
|
|
1412
1478
|
title: string;
|
|
@@ -1446,6 +1512,50 @@ export declare const i18nMessages: {
|
|
|
1446
1512
|
message: string;
|
|
1447
1513
|
};
|
|
1448
1514
|
};
|
|
1515
|
+
export: {
|
|
1516
|
+
success: string;
|
|
1517
|
+
filename: string;
|
|
1518
|
+
};
|
|
1519
|
+
import: {
|
|
1520
|
+
title: string;
|
|
1521
|
+
description: string;
|
|
1522
|
+
actions: {
|
|
1523
|
+
downloadTemplate: string;
|
|
1524
|
+
};
|
|
1525
|
+
template: {
|
|
1526
|
+
success: string;
|
|
1527
|
+
filename: string;
|
|
1528
|
+
};
|
|
1529
|
+
dropzone: {
|
|
1530
|
+
label: string;
|
|
1531
|
+
helperText: string;
|
|
1532
|
+
selectFile: string;
|
|
1533
|
+
};
|
|
1534
|
+
fileError: {
|
|
1535
|
+
title: string;
|
|
1536
|
+
noSheet: string;
|
|
1537
|
+
invalidExcel: string;
|
|
1538
|
+
parseError: string;
|
|
1539
|
+
};
|
|
1540
|
+
summary: {
|
|
1541
|
+
title: string;
|
|
1542
|
+
create: string;
|
|
1543
|
+
update: string;
|
|
1544
|
+
error: string;
|
|
1545
|
+
};
|
|
1546
|
+
success: {
|
|
1547
|
+
title: string;
|
|
1548
|
+
message: string;
|
|
1549
|
+
};
|
|
1550
|
+
error: {
|
|
1551
|
+
noData: string;
|
|
1552
|
+
invalidContent: string;
|
|
1553
|
+
noImportData: string;
|
|
1554
|
+
hasErrors: string;
|
|
1555
|
+
failed: string;
|
|
1556
|
+
systemMessage: string;
|
|
1557
|
+
};
|
|
1558
|
+
};
|
|
1449
1559
|
};
|
|
1450
1560
|
transfer: {
|
|
1451
1561
|
title: string;
|
|
@@ -2372,6 +2482,10 @@ export declare const i18nMessages: {
|
|
|
2372
2482
|
message: string;
|
|
2373
2483
|
};
|
|
2374
2484
|
};
|
|
2485
|
+
import: {
|
|
2486
|
+
title: string;
|
|
2487
|
+
uploadDescription: string;
|
|
2488
|
+
};
|
|
2375
2489
|
};
|
|
2376
2490
|
unit: {
|
|
2377
2491
|
title: string;
|
|
@@ -2411,6 +2525,50 @@ export declare const i18nMessages: {
|
|
|
2411
2525
|
message: string;
|
|
2412
2526
|
};
|
|
2413
2527
|
};
|
|
2528
|
+
export: {
|
|
2529
|
+
success: string;
|
|
2530
|
+
filename: string;
|
|
2531
|
+
};
|
|
2532
|
+
import: {
|
|
2533
|
+
title: string;
|
|
2534
|
+
description: string;
|
|
2535
|
+
actions: {
|
|
2536
|
+
downloadTemplate: string;
|
|
2537
|
+
};
|
|
2538
|
+
template: {
|
|
2539
|
+
success: string;
|
|
2540
|
+
filename: string;
|
|
2541
|
+
};
|
|
2542
|
+
dropzone: {
|
|
2543
|
+
label: string;
|
|
2544
|
+
helperText: string;
|
|
2545
|
+
selectFile: string;
|
|
2546
|
+
};
|
|
2547
|
+
fileError: {
|
|
2548
|
+
title: string;
|
|
2549
|
+
noSheet: string;
|
|
2550
|
+
invalidExcel: string;
|
|
2551
|
+
parseError: string;
|
|
2552
|
+
};
|
|
2553
|
+
summary: {
|
|
2554
|
+
title: string;
|
|
2555
|
+
create: string;
|
|
2556
|
+
update: string;
|
|
2557
|
+
error: string;
|
|
2558
|
+
};
|
|
2559
|
+
success: {
|
|
2560
|
+
title: string;
|
|
2561
|
+
message: string;
|
|
2562
|
+
};
|
|
2563
|
+
error: {
|
|
2564
|
+
noData: string;
|
|
2565
|
+
invalidContent: string;
|
|
2566
|
+
noImportData: string;
|
|
2567
|
+
hasErrors: string;
|
|
2568
|
+
failed: string;
|
|
2569
|
+
systemMessage: string;
|
|
2570
|
+
};
|
|
2571
|
+
};
|
|
2414
2572
|
};
|
|
2415
2573
|
transfer: {
|
|
2416
2574
|
title: string;
|
|
@@ -2905,6 +3063,13 @@ export declare const i18nMessages: {
|
|
|
2905
3063
|
selectFile: string;
|
|
2906
3064
|
replaceFile: string;
|
|
2907
3065
|
summary: string;
|
|
3066
|
+
multiUploadTemplateInstruction: string;
|
|
3067
|
+
importInstructions: {
|
|
3068
|
+
step1: string;
|
|
3069
|
+
step2: string;
|
|
3070
|
+
step3: string;
|
|
3071
|
+
step4: string;
|
|
3072
|
+
};
|
|
2908
3073
|
fileError: {
|
|
2909
3074
|
noSheet: string;
|
|
2910
3075
|
invalidExcel: string;
|
|
@@ -3039,6 +3204,10 @@ export declare const i18nMessages: {
|
|
|
3039
3204
|
message: string;
|
|
3040
3205
|
};
|
|
3041
3206
|
};
|
|
3207
|
+
import: {
|
|
3208
|
+
title: string;
|
|
3209
|
+
uploadDescription: string;
|
|
3210
|
+
};
|
|
3042
3211
|
};
|
|
3043
3212
|
unit: {
|
|
3044
3213
|
title: string;
|
package/dist/app.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { a as q,
|
|
1
|
+
import { a as q, Z as Ie, an as U, W as Ne, ao as ye, V as he, u as Z, l as L, ap as De, y as le, aq as ve, b as te, t as G, x as J, aS as Oe, aK as Fe, a4 as Pe, z as Me, B as Ue, ar as Le, e as ce, f as re, R as me, v as Be, al as Qe, D as j, j as N, i as He } from "./app-CLG8lnmY.js";
|
|
2
2
|
import { useCoreStore as ge, useI18n as ne } from "@feedmepos/mf-common";
|
|
3
3
|
import { useDialogChild as Ve, useSnackbar as be, useDialog as qe, FmButtonVariant as z, components as X } 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-DtfKTZLV.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-DkLAGLl7.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 Ze() {
|
|
113
|
+
const e = ge(), t = ae(), a = Z(), u = q(), i = e.currentBusiness.value, s = _e({
|
|
114
114
|
sku: {
|
|
115
115
|
unit: {
|
|
116
116
|
_id: "",
|
|
@@ -220,8 +220,8 @@ function Je() {
|
|
|
220
220
|
}), b = `${i == null ? void 0 : i.name} transfer templates import.xlsx`;
|
|
221
221
|
return he(v, b), b;
|
|
222
222
|
}
|
|
223
|
-
function
|
|
224
|
-
const a = new Array(), u = /(.*) \(((supplier_|warehouse_|restaurant_).{24,})\)/, s =
|
|
223
|
+
function Je(e, t) {
|
|
224
|
+
const a = new Array(), u = /(.*) \(((supplier_|warehouse_|restaurant_).{24,})\)/, s = Z().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
|
|
@@ -265,7 +265,7 @@ function Ze(e, t) {
|
|
|
265
265
|
function Xe(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 = Z().locationByDbName;
|
|
269
269
|
return e.map((i) => {
|
|
270
270
|
const s = new Array(), f = i.trim(), l = t.exec(f);
|
|
271
271
|
if (!l)
|
|
@@ -397,18 +397,18 @@ function nt(e, t, a) {
|
|
|
397
397
|
}
|
|
398
398
|
const c = G(
|
|
399
399
|
e.quantityStep,
|
|
400
|
-
|
|
400
|
+
J(l, o)
|
|
401
401
|
);
|
|
402
402
|
(Number.isNaN(Number(e.quantityStep)) || Number(e.quantityStep) <= 0) && f.push("Amount step must be more than 0");
|
|
403
403
|
const h = Oe(c), d = rt(
|
|
404
404
|
e.minimumQuantity,
|
|
405
405
|
e.maximumQuantity,
|
|
406
|
-
|
|
406
|
+
J(l, o)
|
|
407
407
|
), m = d.min, v = d.max;
|
|
408
408
|
d.compareError && f.push(d.compareError);
|
|
409
409
|
const b = Fe(+e.minimumQuantity, +e.maximumQuantity), r = G(
|
|
410
410
|
e.defaultQuantity,
|
|
411
|
-
|
|
411
|
+
J(l, o)
|
|
412
412
|
), x = h(r);
|
|
413
413
|
typeof x == "string" && f.push(`Default amount: ${x}`);
|
|
414
414
|
const w = d.min && d.max ? b(`${e.defaultQuantity}`) : null;
|
|
@@ -437,7 +437,7 @@ function ot(e) {
|
|
|
437
437
|
return t.reduce(
|
|
438
438
|
(s, f) => {
|
|
439
439
|
var p;
|
|
440
|
-
const l = new Array(), o = e.Sheets[f], c = et(o), h =
|
|
440
|
+
const l = new Array(), o = e.Sheets[f], c = et(o), h = Je(c.transferFrom, c.type);
|
|
441
441
|
l.push(...h.errors);
|
|
442
442
|
const d = h.from, m = Xe(c.locations), v = m.filter((n) => n.location).map((n) => n.location);
|
|
443
443
|
l.push(...m.flatMap((n) => n.errors));
|
|
@@ -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 = Z(), 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(X.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(Ze);
|
|
1037
1037
|
}
|
|
1038
1038
|
async function S(n) {
|
|
1039
1039
|
try {
|
|
@@ -1175,8 +1175,8 @@ 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
|
-
|
|
1178
|
+
return m === 0 || v ? Y("div", { class: "flex justify-end gap-4 items-center" }, [
|
|
1179
|
+
Y(
|
|
1180
1180
|
X.FmTooltip,
|
|
1181
1181
|
{},
|
|
1182
1182
|
{
|
|
@@ -1184,7 +1184,7 @@ const Ce = xe(
|
|
|
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(X.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 b, T as U, W as E, V as $, l as T, m as N, ap as _, c as H, aq as I, o as C, t as j, L as O } from "./app-CLG8lnmY.js";
|
|
2
|
+
import { useCoreStore as y } 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 P() {
|
|
11
|
+
return `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${D()}`;
|
|
12
|
+
}
|
|
13
|
+
const B = {
|
|
14
|
+
_id: "",
|
|
15
|
+
name: "",
|
|
16
|
+
abbrev: "",
|
|
17
|
+
precision: 0,
|
|
18
|
+
measurements: []
|
|
19
|
+
};
|
|
20
|
+
function V(e) {
|
|
21
|
+
return !e || Object.keys(e).length === 0 ? "" : Object.entries(e).map(([t, a]) => `${t}: ${a}`).join(", ");
|
|
22
|
+
}
|
|
23
|
+
function w(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 L(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 ? +T((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: V(e.customAttributes)
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function A() {
|
|
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 = H(), a = y(), 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 = b().skus.map(L), n = y().currentBusiness.value, s = A(), 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 = y().currentBusiness.value, a = A(), 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 Y(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 = b().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 = y().currentCountry.value, p = (i) => `${i}`.length && O()(i) === !0, f = p(`${e.pricePerUnit}`) === !0 ? {
|
|
171
|
+
costPerUnit: {
|
|
172
|
+
...j(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 ? w(e.customAttributes) : null;
|
|
180
|
+
return {
|
|
181
|
+
type: "create",
|
|
182
|
+
sku: {
|
|
183
|
+
_id: P(),
|
|
184
|
+
code: e.code,
|
|
185
|
+
name: e.name,
|
|
186
|
+
unit: d ?? c.find((i) => i) ?? B,
|
|
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 = Y(e).filter((o) => o.data.code), n = b().skus, s = _(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 = w(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
|
+
A as b,
|
|
239
|
+
k as d,
|
|
240
|
+
J as e,
|
|
241
|
+
Q as g,
|
|
242
|
+
w as s
|
|
243
|
+
};
|
|
@@ -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-CLG8lnmY.js";
|
|
2
2
|
function vl(t, e) {
|
|
3
3
|
for (var r = 0; r < e.length; r++) {
|
|
4
4
|
const n = e[r];
|