@feedmepos/mf-inventory-portal 1.2.59 → 1.2.60-dev.1

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.
Files changed (128) hide show
  1. package/dist/{App-Nwc0Ha2r.js → App-Dgk5k8U-.js} +82 -78
  2. package/dist/{ApprovalView-Y5f915s3.js → ApprovalView-CU2YMuZb.js} +5 -5
  3. package/dist/{BindingsDialog-5N7R_u4c.js → BindingsDialog-Cu0AR6jW.js} +5 -5
  4. package/dist/{BindingsPicker-BJwvLu2s.js → BindingsPicker-DyycJJ6i.js} +3 -3
  5. package/dist/{BindingsTable-B8sq-qXH.js → BindingsTable-wFAnOCdU.js} +5 -5
  6. package/dist/{ClosingDraftView-BsyYOZsz.js → ClosingDraftView-C01bZNv_.js} +891 -893
  7. package/dist/{ClosingHistoryView-BNpsMNy1.js → ClosingHistoryView-Bwjadf1x.js} +36 -36
  8. package/dist/{ClosingTemplateView-BBqbq07d.js → ClosingTemplateView-BAalivwa.js} +14 -14
  9. package/dist/{DeliveryOrderPrintPreview-CmOO7wuE.js → DeliveryOrderPrintPreview-CaEmXkPV.js} +7 -7
  10. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BXlY-Gu1.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-D7J8uo_B.js} +17 -17
  11. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CAMkZRFI.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DU4I0imJ.js} +2 -2
  12. package/dist/{FmMultiselectDialog-LagHyTQP.js → FmMultiselectDialog-CdhcCzVw.js} +1 -1
  13. package/dist/{FmMultiselectDialog-CwJUv9tG.js → FmMultiselectDialog-v004bPKF.js} +16 -16
  14. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BmHFIkt1.js → FmUnitInput.vue_vue_type_script_setup_true_lang-C756UIBL.js} +16 -15
  15. package/dist/{ImportView-wQ_bNesb.js → ImportView-WyG44i3g.js} +6 -6
  16. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DtMrJIVs.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-Y74PdyhQ.js} +1 -1
  17. package/dist/{IngredientGroupView-DsGMhdwu.js → IngredientGroupView-7bkBWvrQ.js} +5 -5
  18. package/dist/{IngredientsView-JdjcLdOx.js → IngredientsView-BDgOWARl.js} +25 -24
  19. package/dist/{IntegrationView-CMmSIRUk.js → IntegrationView-BB7asiWy.js} +18 -17
  20. package/dist/{InventoryBindingForm-UL-UKtYW.js → InventoryBindingForm-CU9dnGdy.js} +1 -1
  21. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-r875PDKP.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BmlVB1SU.js} +17 -16
  22. package/dist/{InventoryBindingSummary-BDAuT62b.js → InventoryBindingSummary-D2W_WcLV.js} +1 -1
  23. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-C5zOYiqR.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CVfShkXe.js} +5 -5
  24. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-B2zppgqk.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CC4jkZg4.js} +2 -2
  25. package/dist/{PublishView-CSoZCSHT.js → PublishView-DR_TwAkf.js} +8 -8
  26. package/dist/{PurchaseOrderPrintPreview-D5Qw44xo.js → PurchaseOrderPrintPreview-CoX0u7jn.js} +11 -11
  27. package/dist/{ReceiveRequestView-Chntp08E.js → ReceiveRequestView-VBePJl-U.js} +34 -33
  28. package/dist/RecipeView-CiZw14m_.js +1558 -0
  29. package/dist/{StockView-CuCK7tD2.js → StockView-BFv_Tl8E.js} +122 -122
  30. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-fMji2qKG.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BMEsUpAC.js} +1 -1
  31. package/dist/{SupplierView-CA17Tz02.js → SupplierView-PSGUQEzz.js} +20 -19
  32. package/dist/{SurchargeView-EIftjMCa.js → SurchargeView-B7qTXk1L.js} +6 -6
  33. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-CqA6RmPy.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-CxEeb4BW.js} +2 -2
  34. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CYXsAP0i.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Dxg6HaiQ.js} +1 -1
  35. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BbbAEIcW.js → TransferDetails.vue_vue_type_script_setup_true_lang-CAviJscD.js} +77 -78
  36. package/dist/{TransferTemplateView-CYfbm9aS.js → TransferTemplateView-CsRPCwN_.js} +22 -21
  37. package/dist/UnitCostHistoryView-Byd2FHbH.js +651 -0
  38. package/dist/{UnitView-6s5CsGEQ.js → UnitView-CdZ_GaUr.js} +9 -9
  39. package/dist/{WarehouseView-BXDQOyFZ.js → WarehouseView-DQGYq00N.js} +5 -5
  40. package/dist/{WastageTemplateView-Cq92TiRs.js → WastageTemplateView-CE7aiWUH.js} +14 -14
  41. package/dist/api/inventory.d.ts +126 -36
  42. package/dist/api/netsuite.d.ts +8 -1
  43. package/dist/api/unit-cost-history.d.ts +28 -0
  44. package/dist/{app-DJuq_faF.js → app-CpEqZK89.js} +7453 -6448
  45. package/dist/app.d.ts +228 -0
  46. package/dist/app.js +1 -1
  47. package/dist/{closing-template-D_zbp5V1.js → closing-template-C20qxOGw.js} +1 -1
  48. package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +37 -1
  49. package/dist/components/shell/inventory/binding-dialog.vue.d.ts +14 -0
  50. package/dist/components/shell/inventory/binding-ui.vue.d.ts +16 -1
  51. package/dist/{date2-4vrHarNG.js → date2-C37x5LGh.js} +1 -1
  52. package/dist/{dayjs.min-Dwp8614O.js → dayjs.min-C5A6b5Ut.js} +16 -16
  53. package/dist/{defineDeepModel-DVt2Wz9r.js → defineDeepModel-btW96tVp.js} +1 -1
  54. package/dist/{duplicate-template-CkYWeFtL.js → duplicate-template-BPduDL4a.js} +1 -1
  55. package/dist/{feature-Beh-qc03.js → feature-Cu77Fha2.js} +784 -779
  56. package/dist/{format-time-from-id-84iLSxVu.js → format-time-from-id-ULW7QQVk.js} +1 -1
  57. package/dist/{format-unit-display-DfeNpWk4.js → format-unit-display-CeyXEKCV.js} +16 -15
  58. package/dist/helper/number.d.ts +2 -0
  59. package/dist/helper/type.d.ts +5 -0
  60. package/dist/{import-export.helper-fAVzQM2q.js → import-export.helper-DpgGeeZ4.js} +17 -16
  61. package/dist/{index-CoEqhZLm.js → index-6Is7orHh.js} +1 -1
  62. package/dist/{index-B2_16R5E.js → index-Cl2lmtBz.js} +1471 -1412
  63. package/dist/{index-Chogzhcq.js → index-DKDWBhbI.js} +3 -3
  64. package/dist/{lodash-Cx8BU1GH.js → lodash-BS2snJNb.js} +1 -1
  65. package/dist/{netsuite-C1bml-v1.js → netsuite-B5YYhPhU.js} +60 -60
  66. package/dist/number-DgdltWRu.js +232 -0
  67. package/dist/{purchase-order-template-BqFnJ-6B.js → purchase-order-template-DVz_OXJ7.js} +1 -1
  68. package/dist/router/name.d.ts +1 -0
  69. package/dist/rules-BPG3Fjva.js +98 -0
  70. package/dist/stock-BXorYvfp.js +75 -0
  71. package/dist/{stock-KxT4JbNf.js → stock-D9iwDDOz.js} +1 -1
  72. package/dist/stores/feature.d.ts +2 -0
  73. package/dist/stores/integration/netsuite.d.ts +8 -1
  74. package/dist/stores/inventory.d.ts +119 -30
  75. package/dist/{supplier-C7wUB1zT.js → supplier-UJg1gtQ8.js} +2 -2
  76. package/dist/{surcharge-CjB_Qtbv.js → surcharge-CcJatYN4.js} +1 -1
  77. package/dist/tsconfig.app.tsbuildinfo +1 -1
  78. package/dist/{use-ingredient-select-dialog-D5KSqA4Z.js → use-ingredient-select-dialog-C--_de2u.js} +2 -2
  79. package/dist/{use-inventory-binding-dialog-eGOvztV3.js → use-inventory-binding-dialog-JsmcY8OK.js} +2 -2
  80. package/dist/{use-template-enabled-locations-2-3kcVWPQm.js → use-template-enabled-locations-2-Ce6Y0gQ_.js} +2 -2
  81. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +64 -8
  82. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +192 -24
  83. package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +8 -1
  84. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +96 -12
  85. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +96 -12
  86. package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +18 -18
  87. package/dist/views/ingredients/components/convert/ConvertForm.vue.d.ts +14 -0
  88. package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +32 -4
  89. package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +28 -0
  90. package/dist/views/ingredients/components/inventory-binding/v2/InventoryBindingFormV2.vue.d.ts +169 -0
  91. package/dist/views/ingredients/components/inventory-binding/v2/components/InventoryBindingAlternative.vue.d.ts +43 -0
  92. package/dist/views/ingredients/components/inventory-binding/v2/components/InventoryBindingRule.vue.d.ts +25 -0
  93. package/dist/views/ingredients/components/inventory-binding/v2/components/InventoryRecipeBindingV2Field.vue.d.ts +125 -0
  94. package/dist/views/ingredients/components/inventory-binding/v2/components/InventorySkuBindingV2Field.vue.d.ts +129 -0
  95. package/dist/views/ingredients/components/inventory-binding/v2/composables/use-inventory-binding-alternative-table.d.ts +30 -0
  96. package/dist/views/ingredients/components/inventory-binding/v2/composables/use-inventory-binding-dialog.d.ts +4 -0
  97. package/dist/views/ingredients/composables/use-ingredient-table.d.ts +8 -1
  98. package/dist/views/integration/components/netsuite/InventoryTransferIngredientTable.vue.d.ts +16 -2
  99. package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +33 -5
  100. package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +16 -2
  101. package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +32 -4
  102. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +8 -1
  103. package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +41 -6
  104. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +246 -36
  105. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +287 -42
  106. package/dist/views/recipe/components/recipe-form/RecipeForm.vue.d.ts +16 -0
  107. package/dist/views/stock/components/StockRecordCard.vue.d.ts +1 -0
  108. package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +16 -2
  109. package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +16 -2
  110. package/dist/views/transfer-template/components/transfer-template-form/components/NetSuiteCustomCodeSelection.vue.d.ts +16 -2
  111. package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItemTable.vue.d.ts +16 -2
  112. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +8 -1
  113. package/dist/views/transfer-template/composables/use-netsuite-custom-field.d.ts +24 -3
  114. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +96 -12
  115. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +96 -12
  116. package/dist/views/unit-cost-history/UnitCostHistoryView.vue.d.ts +2 -0
  117. package/dist/views/unit-cost-history/components/UnitCostDetailsSideSheet.vue.d.ts +19 -0
  118. package/dist/views/unit-cost-history/components/UnitCostRecalculationDialog.vue.d.ts +11 -0
  119. package/dist/views/unit-cost-history/composables/use-unit-cost-history.d.ts +65 -0
  120. package/dist/vue-i18n-Cv_EPb3h.js +2365 -0
  121. package/dist/{xlsx-BwNUbN_O.js → xlsx-DuXSmSdO.js} +1 -1
  122. package/dist/{xlsx.util-B_DE3inS.js → xlsx.util-B75iIY7V.js} +1 -1
  123. package/package.json +2 -2
  124. package/dist/RecipeView-Ck3Pa4fg.js +0 -646
  125. package/dist/decimal-Bf6AG_d3.js +0 -99
  126. package/dist/rules-y2OYGOro.js +0 -201
  127. package/dist/stock-BWUzlDTa.js +0 -75
  128. package/dist/vue-i18n-C6XNfngV.js +0 -2365
@@ -1,99 +0,0 @@
1
- import "./app-DJuq_faF.js";
2
- import "./dayjs.min-Dwp8614O.js";
3
- function m(a) {
4
- function t(o, n = !0) {
5
- const e = Math.round(Math.log10(o));
6
- return isFinite(e) && e >= 0 ? Math.ceil(e) : n ? 0 : Math.floor(e);
7
- }
8
- function r(o) {
9
- const n = o.conversion;
10
- return i - n.precision + t(n.amount);
11
- }
12
- const i = a.precision;
13
- return a.measurements.reduce((o, n) => {
14
- const e = r(n);
15
- return e > o ? e : o;
16
- }, 0);
17
- }
18
- class c {
19
- static toDouble(t) {
20
- return t.amount / Math.pow(10, t.precision);
21
- }
22
- static multiplyDecimal(t, r) {
23
- let i = t.amount * r.amount, o = i == 0 ? 0 : t.precision + r.precision, n = i.toString();
24
- for (; n.length > 0 && n[n.length - 1] == "0" && o > 0; )
25
- i = i / 10, o -= 1, n = i.toString();
26
- return {
27
- amount: i,
28
- precision: o
29
- };
30
- }
31
- static divide(t, r) {
32
- return {
33
- amount: Math.floor(t.amount / r),
34
- precision: t.precision
35
- };
36
- }
37
- /// Adds two decimals and returns result of any max precision from [left] or [right]
38
- static addDecimal(t, r) {
39
- const i = c.normalize([t, r]), o = i[0], n = i[1];
40
- return {
41
- amount: o.amount + n.amount,
42
- precision: o.precision
43
- };
44
- }
45
- /// Multiplies amount if new precision is higher or rounds amount if new precision is lower
46
- ///
47
- /// e.g. 0.4 to 2 precision --> 0.40
48
- /// 0.47 to 1 precision --> 0.5
49
- /// 0.22 to 1 precision --> 0.0
50
- static toPrecision(t, r) {
51
- function i(n, e) {
52
- let s = n.amount;
53
- for (let u = n.precision; u < e; u++)
54
- s *= 10;
55
- return {
56
- amount: s,
57
- precision: e
58
- };
59
- }
60
- function o(n, e) {
61
- let s = n.amount;
62
- for (let u = n.precision; u > e; u--)
63
- s /= 10;
64
- return {
65
- amount: Number(s.toFixed(0)),
66
- precision: e
67
- };
68
- }
69
- return t.precision == r ? t : t.precision < r ? i(t, r) : o(t, r);
70
- }
71
- static equal(t, r) {
72
- const i = c.normalize([t, r]), o = i[0], n = i[1];
73
- return o.amount == n.amount;
74
- }
75
- static normalize(t) {
76
- const r = t.reduce(
77
- (i, o) => Math.max(i, Math.floor(o.precision)),
78
- 0
79
- );
80
- return t.map((i) => c.toPrecision(i, r));
81
- }
82
- }
83
- function f(a, t, r, i = !0) {
84
- let o = {
85
- ...a
86
- };
87
- if (r) {
88
- const n = typeof r == "string" ? t.measurements.find((s) => s.id === r) : r;
89
- if (!n)
90
- return "NaN";
91
- const e = m(t);
92
- return o.precision < e && (o = c.toPrecision(o, m(t))), o = c.divide(o, c.toDouble(n.conversion)), `${c.toDouble(o)} ${n.abbrev}`;
93
- }
94
- return i ? `${c.toDouble(o)} ${t.abbrev}` : c.toDouble(o);
95
- }
96
- export {
97
- c as F,
98
- f as g
99
- };
@@ -1,201 +0,0 @@
1
- import { w as s } from "./app-DJuq_faF.js";
2
- import "./dayjs.min-Dwp8614O.js";
3
- import { d, b } from "./date2-4vrHarNG.js";
4
- function P(t, n) {
5
- return s.convertPrecision({
6
- value: t,
7
- precision: n
8
- });
9
- }
10
- function $(t, n) {
11
- return s.subtract([t, n]);
12
- }
13
- function N(t, n) {
14
- return s.add([t, n]);
15
- }
16
- function D(t, n) {
17
- return s.multiply([t, n]);
18
- }
19
- function F(t, n) {
20
- return s.multiply([t, n]);
21
- }
22
- function l(t, n) {
23
- const r = +u(t), i = +u(n);
24
- return r / i;
25
- }
26
- function T(t, n) {
27
- t = f(t), n = f(n);
28
- const r = l(t, n);
29
- return c(r);
30
- }
31
- function w(t, n) {
32
- return t.precision >= n ? t : s.convertPrecision({ value: t, precision: n });
33
- }
34
- function f(t) {
35
- if (t.amount === 0) return c(0);
36
- const n = y(t.amount), r = t.precision - n;
37
- return s.convertPrecision({ value: t, precision: Math.max(0, r) });
38
- }
39
- function u(t, n = !0) {
40
- return n ? Number(t.amount / Math.pow(10, t.precision)).toFixed(t.precision) : Number(t.amount / Math.pow(10, t.precision)).toString();
41
- }
42
- function x(t, n) {
43
- n = n ?? h(t);
44
- const r = n, i = t.toFixed(r), e = i.includes(".") ? i.replace(/0+$/, "") : i;
45
- return e.endsWith(".") ? e.slice(0, e.length - 1) : e;
46
- }
47
- function O(t, n = !1, r = 2) {
48
- const i = Number(t.amount / Math.pow(10, t.precision)), e = i.toFixed(
49
- Number.isInteger(i) ? 2 : Math.min(4, Math.max(2, r))
50
- );
51
- return n ? `${e} ${t.currency}` : t.currency === "MYR" ? `RM ${e}` : `${t.currency} ${e}`;
52
- }
53
- function R(t) {
54
- return {
55
- ...t,
56
- amount: Math.abs(t.amount)
57
- };
58
- }
59
- function h(t) {
60
- if (!isFinite(t)) return 0;
61
- let n = 1, r = 0;
62
- for (; Math.round(t * n) / n !== t; )
63
- n *= 10, r++;
64
- return r;
65
- }
66
- function c(t) {
67
- const n = h(t);
68
- return {
69
- precision: n,
70
- amount: t * 10 ** n
71
- };
72
- }
73
- function q(t, n = 0, r = !1) {
74
- let i = 0;
75
- return Number.isNaN(Number(t)) || (r || Number(t) >= 0) && (i = Number(t)), {
76
- amount: Number((i * 10 ** n).toFixed(0)),
77
- precision: n
78
- };
79
- }
80
- function y(t) {
81
- const n = `${t}`, r = n.replace(/0*$/g, "");
82
- return n.length - r.length;
83
- }
84
- function M(t, n) {
85
- if (!n)
86
- return t.precision;
87
- const r = y(n.conversion.amount);
88
- return t.precision - n.conversion.precision + r;
89
- }
90
- function B() {
91
- return function(n) {
92
- return !!n || "Required";
93
- };
94
- }
95
- function m(t) {
96
- return t && typeof t == "object" && Object.prototype.hasOwnProperty.call(t, "amount") && Object.prototype.hasOwnProperty.call(t, "precision");
97
- }
98
- function L(t, n) {
99
- const r = typeof t == "object" ? +u(t) : t;
100
- function i(e) {
101
- return Object.prototype.hasOwnProperty.call(e, "length");
102
- }
103
- return function(o) {
104
- return m(o) && (o = +u(o)), Number.isFinite(+o) && (o = +o), i(o) ? o.length >= r ? !0 : typeof n == "function" ? n(o.length) : n ?? `Must be at least ${r}` : typeof o == "number" ? o >= r ? !0 : typeof n == "function" ? n(o) : n ?? `Must be at least ${r}` : `Cannot validate at least ${r}`;
105
- };
106
- }
107
- function C(t) {
108
- const n = typeof t == "object" ? +u(t) : t;
109
- function r(i) {
110
- return Object.prototype.hasOwnProperty.call(i, "length");
111
- }
112
- return function(e, o) {
113
- return m(e) && (e = +u(e)), r(e) ? e.length > n ? !0 : typeof o == "function" ? o(e.length) : o ?? `Must be more than ${n}` : typeof e == "number" ? e > n ? !0 : typeof o == "function" ? o(e) : o ?? `Must be more than ${n}` : `Cannot validate more than ${n}`;
114
- };
115
- }
116
- function V(t, n) {
117
- return t instanceof Date && n instanceof Date ? function(i) {
118
- const e = new Date(i);
119
- return isNaN(e.getTime()) ? "Invalid date" : e.getTime() < t.getTime() ? `Date must be at least ${d(t)} ${b(t)}` : e.getTime() >= n.getTime() ? `Date must be less than ${d(n)} ${b(n)}` : !0;
120
- } : typeof t == "number" && typeof n == "number" ? function(i) {
121
- const e = +i;
122
- return isNaN(e) ? "Invalid number" : e < t ? `Value must be at least ${t}` : e >= n ? `Value must be less than ${n}` : !0;
123
- } : function() {
124
- return "Progamming error: invalid range parameter.";
125
- };
126
- }
127
- function a() {
128
- return function(t) {
129
- if (t = String(t), t.length === 0)
130
- return !0;
131
- const n = +t;
132
- return isFinite(n) || "Must be a number";
133
- };
134
- }
135
- function Y(t, n) {
136
- return typeof t == "number" ? function(i) {
137
- const e = a()(i);
138
- return typeof e == "string" ? e : c(+i).precision > t ? `Precision cannot be more than ${t} decimal point.` : !0;
139
- } : function(i) {
140
- const e = a()(i);
141
- if (typeof e == "string")
142
- return e;
143
- const o = M(t, n);
144
- return c(+i).precision > o ? `Precision cannot be more than ${o} decimal point.` : !0;
145
- };
146
- }
147
- function S(t, n) {
148
- return function(i) {
149
- const e = a()(i);
150
- if (typeof e == "string")
151
- return e;
152
- const o = c(+i);
153
- return o.precision > t ? typeof n == "function" ? n(o.precision) : n ?? `Precision cannot be more than ${t}` : !0;
154
- };
155
- }
156
- function Z(t, n, r) {
157
- return function(e) {
158
- if (e === n) return !0;
159
- const o = t.find((p) => p.value === e);
160
- return o ? r ? r(o) : `Already used in ${o.label}` : !0;
161
- };
162
- }
163
- function U(t) {
164
- let n = typeof t == "number" ? c(t) : t;
165
- n = f(n);
166
- const r = u(n);
167
- return function(e) {
168
- if (!m(e)) {
169
- if (e = +e, Number.isNaN(e)) return !0;
170
- e = c(e);
171
- }
172
- return e = f(e), e.amount % n.amount === 0 && e.precision <= n.precision ? !0 : `${u(e)} must be a multiple of ${r}`;
173
- };
174
- }
175
- export {
176
- L as A,
177
- V as B,
178
- a as I,
179
- Y as M,
180
- B as R,
181
- Z as U,
182
- u as a,
183
- f as b,
184
- U as c,
185
- c as d,
186
- O as e,
187
- F as f,
188
- M as g,
189
- C as h,
190
- h as i,
191
- R as j,
192
- D as k,
193
- N as l,
194
- P as m,
195
- x as n,
196
- $ as o,
197
- T as p,
198
- S as q,
199
- q as t,
200
- w as u
201
- };
@@ -1,75 +0,0 @@
1
- import { u as i } from "./stock-KxT4JbNf.js";
2
- import { a as s, L as p } from "./app-DJuq_faF.js";
3
- import { ref as d, computed as k } from "vue";
4
- import { d as B } from "./rules-y2OYGOro.js";
5
- function m() {
6
- return {
7
- stockBalance: {
8
- _id: "",
9
- items: []
10
- },
11
- productBalance: []
12
- };
13
- }
14
- const v = B(0), f = {
15
- id: "",
16
- balance: v,
17
- closing: null,
18
- costs: null
19
- }, c = d(m()), w = () => {
20
- const r = s(), u = k(() => {
21
- var a;
22
- const o = (a = c.value.stockBalance.skus) == null ? void 0 : a.groupBy((t) => t.id), n = (t) => {
23
- var e;
24
- return ((e = o == null ? void 0 : o.get(t)) == null ? void 0 : e[0]) ?? { ...f, id: t };
25
- };
26
- return r.skus.map((t) => n(t._id));
27
- }), l = i();
28
- return {
29
- // state
30
- get stockBalance() {
31
- return {
32
- ...c.value.stockBalance,
33
- skus: u.value
34
- };
35
- },
36
- set stockBalance(o) {
37
- c.value.stockBalance = o;
38
- },
39
- get productBalance() {
40
- return c.value.productBalance;
41
- },
42
- set productBalance(o) {
43
- c.value.productBalance = o;
44
- },
45
- // actions
46
- async readStockBalance() {
47
- this.stockBalance = await l.readStockBalance();
48
- },
49
- async readProductBalance() {
50
- this.productBalance = [];
51
- const o = s(), n = p({
52
- recipes: o.recipes,
53
- skus: o.skus,
54
- skuGroups: o.skuGroups,
55
- inventoryBindingMapping: {},
56
- stockBalance: this.stockBalance
57
- // silent: true
58
- });
59
- function a(t, e) {
60
- return Object.prototype.hasOwnProperty.call(t, e);
61
- }
62
- for (const t in n.convertCountdown)
63
- if (a(n.convertCountdown, t)) {
64
- const e = n.convertCountdown[t];
65
- this.productBalance.push({
66
- id: t,
67
- count: e
68
- });
69
- }
70
- }
71
- };
72
- };
73
- export {
74
- w as u
75
- };