@feedmepos/mf-inventory-portal 1.2.61 → 1.2.63-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 (124) hide show
  1. package/dist/{App-BqScGtJx.js → App-BHssUobV.js} +82 -78
  2. package/dist/{ApprovalView-BFdlYIot.js → ApprovalView-DRGCQeGY.js} +5 -5
  3. package/dist/{BindingsDialog-Dvmrms77.js → BindingsDialog-CWl3LpdO.js} +5 -5
  4. package/dist/{BindingsPicker-fPVSXv-h.js → BindingsPicker-BcASw3JJ.js} +3 -3
  5. package/dist/{BindingsTable-CnUa8VOi.js → BindingsTable-BiKiLiVY.js} +5 -5
  6. package/dist/{ClosingDraftView-10BcpWkm.js → ClosingDraftView-mh5Kw46x.js} +217 -216
  7. package/dist/{ClosingHistoryView-zLh0HCIb.js → ClosingHistoryView-C-ZrFei9.js} +36 -36
  8. package/dist/{ClosingTemplateView-BFupX87V.js → ClosingTemplateView-DBNRH0Tt.js} +14 -14
  9. package/dist/{DeliveryOrderPrintPreview-BLBqmOjw.js → DeliveryOrderPrintPreview-Dv3JZ3yr.js} +7 -7
  10. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DN8ziFA_.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CfL1adhx.js} +16 -16
  11. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DJT_7Uus.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Db0JeXbc.js} +2 -2
  12. package/dist/{FmMultiselectDialog-DmnYEmN1.js → FmMultiselectDialog-D9g07F_c.js} +1 -1
  13. package/dist/{FmMultiselectDialog-B5paZk6T.js → FmMultiselectDialog-DuYKQng9.js} +16 -16
  14. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-MW749j29.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CeXRT7Lf.js} +23 -22
  15. package/dist/{ImportView-BsI1_unJ.js → ImportView-DoMyJ1NE.js} +6 -6
  16. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-D8hvH-4n.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-CqJQcOBK.js} +1 -1
  17. package/dist/{IngredientGroupView-BALVTSwF.js → IngredientGroupView-D_Cl4kJy.js} +5 -5
  18. package/dist/{IngredientsView-C-sauieO.js → IngredientsView-CG6wUGzt.js} +25 -24
  19. package/dist/{IntegrationView-GG2E4Yrl.js → IntegrationView-BIWPp1JH.js} +18 -17
  20. package/dist/{InventoryBindingForm-DCSBFj6b.js → InventoryBindingForm-BrL6-2He.js} +1 -1
  21. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-4_i25unG.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-M3uVquEq.js} +17 -16
  22. package/dist/{InventoryBindingSummary-6dFJPewB.js → InventoryBindingSummary-mnlQU1Mp.js} +1 -1
  23. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CU9mgYbv.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-ByPOKZRm.js} +5 -5
  24. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DC1HpuMm.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DHwXNoTs.js} +2 -2
  25. package/dist/{PublishView-DO7k1AeP.js → PublishView-B4iVMq25.js} +8 -8
  26. package/dist/{PurchaseOrderPrintPreview-C3VqOLCi.js → PurchaseOrderPrintPreview-ws-SKrEC.js} +11 -11
  27. package/dist/{ReceiveRequestView-CpgLQtbw.js → ReceiveRequestView-deSiORNX.js} +143 -142
  28. package/dist/RecipeView-EEK7PiKl.js +1558 -0
  29. package/dist/{StockView-CtC3ldc6.js → StockView-6j_t2Kf1.js} +106 -105
  30. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Cj6cVmd0.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CgAMsW8n.js} +1 -1
  31. package/dist/{SupplierView-DKFtc22j.js → SupplierView-D5tSOECx.js} +20 -19
  32. package/dist/{SurchargeView-B-EYMp6w.js → SurchargeView-CP81Q4dW.js} +6 -6
  33. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-CDeeFvnm.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-Bmuw4PTO.js} +2 -2
  34. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CH3hjFS8.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-D1FuB-kv.js} +1 -1
  35. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-rAyYuhku.js → TransferDetails.vue_vue_type_script_setup_true_lang-Canrz2ri.js} +501 -501
  36. package/dist/{TransferTemplateView-FeC34QoJ.js → TransferTemplateView-CRI_Lexa.js} +22 -21
  37. package/dist/UnitCostHistoryView-CT-4QDK8.js +651 -0
  38. package/dist/{UnitView-BoJisnXd.js → UnitView-BZmfd-aw.js} +11 -10
  39. package/dist/{WarehouseView-s-xF6xJ0.js → WarehouseView-BcmSyjA0.js} +5 -5
  40. package/dist/{WastageTemplateView-BQBlHZLh.js → WastageTemplateView-CNsdu0ga.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-_4kRbuQl.js → app-ayv5Jw7D.js} +8041 -7036
  45. package/dist/app.d.ts +228 -0
  46. package/dist/app.js +1 -1
  47. package/dist/{closing-template-BBWYKm_X.js → closing-template-D9UR8sMo.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-Cd93SZu4.js → date2-GNP-79dA.js} +1 -1
  52. package/dist/{dayjs.min-DeHn_Fz-.js → dayjs.min-Bg_wgP2J.js} +16 -16
  53. package/dist/{defineDeepModel-DUOLQh1E.js → defineDeepModel-Co03tZfS.js} +1 -1
  54. package/dist/{duplicate-template-BgpMF-fd.js → duplicate-template-BiPU4Z2Y.js} +1 -1
  55. package/dist/{feature-DqGkM6Yx.js → feature-BGeFfaiX.js} +95 -90
  56. package/dist/{format-time-from-id-BkH4swoc.js → format-time-from-id-ByV0VX1x.js} +1 -1
  57. package/dist/{format-unit-display-rkrD3WLD.js → format-unit-display-r1Hb4DfH.js} +16 -15
  58. package/dist/{import-export.helper-C8Q4AMQx.js → import-export.helper-PB9pPO3m.js} +16 -15
  59. package/dist/{index-B3m_9m2a.js → index-ClbYCYSU.js} +3 -3
  60. package/dist/{index-O5M93j6z.js → index-DMqOVOHw.js} +1 -1
  61. package/dist/{index-B0WTs-3a.js → index-DWWlEK_r.js} +1471 -1412
  62. package/dist/{lodash-Dj6GdEkm.js → lodash-BbWPSHMM.js} +1 -1
  63. package/dist/{netsuite-DpQxb3vH.js → netsuite-VGghPz8h.js} +92 -92
  64. package/dist/number-DPuTdA-J.js +232 -0
  65. package/dist/{purchase-order-template-DKuo07gT.js → purchase-order-template-BMNxJR59.js} +1 -1
  66. package/dist/router/name.d.ts +1 -0
  67. package/dist/rules-CyF-4tvp.js +98 -0
  68. package/dist/stock-D1SElOsp.js +75 -0
  69. package/dist/{stock-D7HQf4-H.js → stock-b7nNc6ko.js} +1 -1
  70. package/dist/stores/feature.d.ts +2 -0
  71. package/dist/stores/integration/netsuite.d.ts +8 -1
  72. package/dist/stores/inventory.d.ts +119 -30
  73. package/dist/{supplier-B3kE2tbF.js → supplier-Dm-bxVXL.js} +2 -2
  74. package/dist/{surcharge-Cc9vownX.js → surcharge-ZM-_XIvY.js} +1 -1
  75. package/dist/tsconfig.app.tsbuildinfo +1 -1
  76. package/dist/{use-ingredient-select-dialog-MnUTm-3P.js → use-ingredient-select-dialog-BYxTRqif.js} +2 -2
  77. package/dist/{use-inventory-binding-dialog-_J9LNiGo.js → use-inventory-binding-dialog-Dg9Mp0Vk.js} +2 -2
  78. package/dist/{use-template-enabled-locations-2-B9gbuIPM.js → use-template-enabled-locations-2-BmgcViqJ.js} +2 -2
  79. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +64 -8
  80. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +192 -24
  81. package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +8 -1
  82. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +96 -12
  83. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +96 -12
  84. package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +18 -18
  85. package/dist/views/ingredients/components/convert/ConvertForm.vue.d.ts +14 -0
  86. package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +32 -4
  87. package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +28 -0
  88. package/dist/views/ingredients/components/inventory-binding/v2/InventoryBindingFormV2.vue.d.ts +169 -0
  89. package/dist/views/ingredients/components/inventory-binding/v2/components/InventoryBindingAlternative.vue.d.ts +43 -0
  90. package/dist/views/ingredients/components/inventory-binding/v2/components/InventoryBindingRule.vue.d.ts +25 -0
  91. package/dist/views/ingredients/components/inventory-binding/v2/components/InventoryRecipeBindingV2Field.vue.d.ts +125 -0
  92. package/dist/views/ingredients/components/inventory-binding/v2/components/InventorySkuBindingV2Field.vue.d.ts +129 -0
  93. package/dist/views/ingredients/components/inventory-binding/v2/composables/use-inventory-binding-alternative-table.d.ts +30 -0
  94. package/dist/views/ingredients/components/inventory-binding/v2/composables/use-inventory-binding-dialog.d.ts +4 -0
  95. package/dist/views/ingredients/composables/use-ingredient-table.d.ts +8 -1
  96. package/dist/views/integration/components/netsuite/InventoryTransferIngredientTable.vue.d.ts +16 -2
  97. package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +33 -5
  98. package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +16 -2
  99. package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +32 -4
  100. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +8 -1
  101. package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +41 -6
  102. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +246 -36
  103. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +287 -42
  104. package/dist/views/recipe/components/recipe-form/RecipeForm.vue.d.ts +16 -0
  105. package/dist/views/stock/components/StockRecordCard.vue.d.ts +1 -0
  106. package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +16 -2
  107. package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +16 -2
  108. package/dist/views/transfer-template/components/transfer-template-form/components/NetSuiteCustomCodeSelection.vue.d.ts +16 -2
  109. package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItemTable.vue.d.ts +16 -2
  110. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +8 -1
  111. package/dist/views/transfer-template/composables/use-netsuite-custom-field.d.ts +24 -3
  112. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +96 -12
  113. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +96 -12
  114. package/dist/views/unit-cost-history/UnitCostHistoryView.vue.d.ts +2 -0
  115. package/dist/views/unit-cost-history/components/UnitCostDetailsSideSheet.vue.d.ts +19 -0
  116. package/dist/views/unit-cost-history/components/UnitCostRecalculationDialog.vue.d.ts +11 -0
  117. package/dist/views/unit-cost-history/composables/use-unit-cost-history.d.ts +65 -0
  118. package/dist/{vue-i18n-BvsTy4Fg.js → vue-i18n-BwxQzDKn.js} +535 -535
  119. package/dist/{xlsx-BvjocXXw.js → xlsx-dJMIfias.js} +1 -1
  120. package/dist/{xlsx.util-D65Nsat4.js → xlsx.util-dclbjq8C.js} +1 -1
  121. package/package.json +3 -3
  122. package/dist/RecipeView-C2D7FdzN.js +0 -646
  123. package/dist/rules-D6o4zK8x.js +0 -327
  124. package/dist/stock-DLFjfcAv.js +0 -75
@@ -0,0 +1,232 @@
1
+ import { y as a } from "./app-ayv5Jw7D.js";
2
+ import "./dayjs.min-Bg_wgP2J.js";
3
+ function l(n) {
4
+ function t(o, e = !0) {
5
+ const u = Math.round(Math.log10(o));
6
+ return isFinite(u) && u >= 0 ? Math.ceil(u) : e ? 0 : Math.floor(u);
7
+ }
8
+ function r(o) {
9
+ const e = o.conversion;
10
+ return i - e.precision + t(e.amount);
11
+ }
12
+ const i = n.precision;
13
+ return n.measurements.reduce((o, e) => {
14
+ const u = r(e);
15
+ return u > o ? u : 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, e = i.toString();
24
+ for (; e.length > 0 && e[e.length - 1] == "0" && o > 0; )
25
+ i = i / 10, o -= 1, e = 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], e = i[1];
40
+ return {
41
+ amount: o.amount + e.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(e, u) {
52
+ let s = e.amount;
53
+ for (let m = e.precision; m < u; m++)
54
+ s *= 10;
55
+ return {
56
+ amount: s,
57
+ precision: u
58
+ };
59
+ }
60
+ function o(e, u) {
61
+ let s = e.amount;
62
+ for (let m = e.precision; m > u; m--)
63
+ s /= 10;
64
+ return {
65
+ amount: Number(s.toFixed(0)),
66
+ precision: u
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], e = i[1];
73
+ return o.amount == e.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 N(n, t, r, i = !0) {
84
+ let o = {
85
+ ...n
86
+ };
87
+ if (r) {
88
+ const e = typeof r == "string" ? t.measurements.find((s) => s.id === r) : r;
89
+ if (!e)
90
+ return "NaN";
91
+ const u = l(t);
92
+ return o.precision < u && (o = c.toPrecision(o, l(t))), o = c.divide(o, c.toDouble(e.conversion)), `${c.toDouble(o)} ${e.abbrev}`;
93
+ }
94
+ return i ? `${c.toDouble(o)} ${t.abbrev}` : c.toDouble(o);
95
+ }
96
+ function x(n, t) {
97
+ return a.convertPrecision({
98
+ value: n,
99
+ precision: t
100
+ });
101
+ }
102
+ function M(n, t) {
103
+ return a.subtract([n, t]);
104
+ }
105
+ function j(n, t) {
106
+ return a.add([n, t]);
107
+ }
108
+ function y(n, t) {
109
+ return a.multiply([n, t]);
110
+ }
111
+ function D(n, t) {
112
+ return a.multiply([n, t]);
113
+ }
114
+ function h(n, t) {
115
+ const r = +p(n), i = +p(t);
116
+ return r / i;
117
+ }
118
+ function F(n, t) {
119
+ n = f(n), t = f(t);
120
+ const r = h(n, t);
121
+ return b(r);
122
+ }
123
+ function w(n, t) {
124
+ return n.precision >= t ? n : a.convertPrecision({ value: n, precision: t });
125
+ }
126
+ function f(n) {
127
+ if (n.amount === 0) return b(0);
128
+ const t = g(n.amount), r = n.precision - t;
129
+ return a.convertPrecision({ value: n, precision: Math.max(0, r) });
130
+ }
131
+ function p(n, t = !0) {
132
+ return t ? Number(n.amount / Math.pow(10, n.precision)).toFixed(n.precision) : Number(n.amount / Math.pow(10, n.precision)).toString();
133
+ }
134
+ function $(n, t) {
135
+ t = t ?? d(n);
136
+ const r = t, i = n.toFixed(r), o = i.includes(".") ? i.replace(/0+$/, "") : i;
137
+ return o.endsWith(".") ? o.slice(0, o.length - 1) : o;
138
+ }
139
+ function z(n, t = !1, r = 2) {
140
+ const i = Number(n.amount / Math.pow(10, n.precision)), o = i.toFixed(
141
+ Number.isInteger(i) ? 2 : Math.min(4, Math.max(2, r))
142
+ );
143
+ return t ? `${o} ${n.currency}` : n.currency === "MYR" ? `RM ${o}` : `${n.currency} ${o}`;
144
+ }
145
+ function v(n) {
146
+ return {
147
+ ...n,
148
+ amount: Math.abs(n.amount)
149
+ };
150
+ }
151
+ function d(n) {
152
+ if (!isFinite(n)) return 0;
153
+ let t = 1, r = 0;
154
+ for (; Math.round(n * t) / t !== n; )
155
+ t *= 10, r++;
156
+ return r;
157
+ }
158
+ function b(n) {
159
+ const t = d(n);
160
+ return {
161
+ precision: t,
162
+ amount: n * 10 ** t
163
+ };
164
+ }
165
+ function S(n, t = 0, r = !1) {
166
+ let i = 0;
167
+ return Number.isNaN(Number(n)) || (r || Number(n) >= 0) && (i = Number(n)), {
168
+ amount: Number((i * 10 ** t).toFixed(0)),
169
+ precision: t
170
+ };
171
+ }
172
+ function g(n) {
173
+ const t = `${n}`, r = t.replace(/0*$/g, "");
174
+ return t.length - r.length;
175
+ }
176
+ function E(n, t) {
177
+ if (!t)
178
+ return n.precision;
179
+ const r = g(t.conversion.amount);
180
+ return n.precision - t.conversion.precision + r;
181
+ }
182
+ function k(n, t = {}) {
183
+ if (n == null)
184
+ throw new Error("Value cannot be null or undefined");
185
+ const { minPrecision: r = 2, maxPrecision: i = 2, locale: o = "en-US" } = t;
186
+ if (r > i)
187
+ throw new Error("minPrecision cannot be greater than maxPrecision");
188
+ let e = 0;
189
+ switch (typeof n) {
190
+ case "number": {
191
+ e = n;
192
+ break;
193
+ }
194
+ case "string": {
195
+ e = Number(n);
196
+ break;
197
+ }
198
+ case "object": {
199
+ if (n.amount === void 0 || n.precision === void 0)
200
+ throw new Error("Invalid AdjustmentAmount object");
201
+ e = c.toDouble(n);
202
+ break;
203
+ }
204
+ default:
205
+ throw new Error("Invalid value type");
206
+ }
207
+ return e.toLocaleString(o, {
208
+ minimumFractionDigits: r,
209
+ maximumFractionDigits: i
210
+ });
211
+ }
212
+ export {
213
+ c as F,
214
+ p as a,
215
+ f as b,
216
+ b as c,
217
+ z as d,
218
+ D as e,
219
+ N as f,
220
+ E as g,
221
+ d as h,
222
+ v as i,
223
+ y as j,
224
+ j as k,
225
+ x as l,
226
+ M as m,
227
+ $ as n,
228
+ F as o,
229
+ k as p,
230
+ S as t,
231
+ w as u
232
+ };
@@ -1,4 +1,4 @@
1
- import { o as s } from "./app-_4kRbuQl.js";
1
+ import { o as s } from "./app-ayv5Jw7D.js";
2
2
  import { useCoreStore as c } from "@feedmepos/mf-common";
3
3
  const u = s((n, a) => {
4
4
  function o() {
@@ -4,6 +4,7 @@ export declare enum RouteName {
4
4
  RECIPE = "RECIPE",
5
5
  UNIT = "UNIT",
6
6
  STOCK = "STOCK",
7
+ UNIT_COST_HISTORY = "UNIT_COST_HISTORY",
7
8
  CLOSING_TEMPLATE = "CLOSING_TEMPLATE",
8
9
  CLOSING_DRAFT = "CLOSING_DRAFT",
9
10
  CLOSING_HISTORY = "CLOSING_HISTORY",
@@ -0,0 +1,98 @@
1
+ import { a as u, g as d, c as f, b as m } from "./number-DPuTdA-J.js";
2
+ import { d as b, b as p } from "./date2-GNP-79dA.js";
3
+ function M() {
4
+ return function(e) {
5
+ return !!e || "Required";
6
+ };
7
+ }
8
+ function s(n) {
9
+ return n && typeof n == "object" && Object.prototype.hasOwnProperty.call(n, "amount") && Object.prototype.hasOwnProperty.call(n, "precision");
10
+ }
11
+ function A(n, e) {
12
+ const o = typeof n == "object" ? +u(n) : n;
13
+ function i(t) {
14
+ return Object.prototype.hasOwnProperty.call(t, "length");
15
+ }
16
+ return function(r) {
17
+ return s(r) && (r = +u(r)), Number.isFinite(+r) && (r = +r), i(r) ? r.length >= o ? !0 : typeof e == "function" ? e(r.length) : e ?? `Must be at least ${o}` : typeof r == "number" ? r >= o ? !0 : typeof e == "function" ? e(r) : e ?? `Must be at least ${o}` : `Cannot validate at least ${o}`;
18
+ };
19
+ }
20
+ function $(n) {
21
+ const e = typeof n == "object" ? +u(n) : n;
22
+ function o(i) {
23
+ return Object.prototype.hasOwnProperty.call(i, "length");
24
+ }
25
+ return function(t, r) {
26
+ return s(t) && (t = +u(t)), o(t) ? t.length > e ? !0 : typeof r == "function" ? r(t.length) : r ?? `Must be more than ${e}` : typeof t == "number" ? t > e ? !0 : typeof r == "function" ? r(t) : r ?? `Must be more than ${e}` : `Cannot validate more than ${e}`;
27
+ };
28
+ }
29
+ function P(n, e) {
30
+ return n instanceof Date && e instanceof Date ? function(i) {
31
+ const t = new Date(i);
32
+ return isNaN(t.getTime()) ? "Invalid date" : t.getTime() < n.getTime() ? `Date must be at least ${b(n)} ${p(n)}` : t.getTime() >= e.getTime() ? `Date must be less than ${b(e)} ${p(e)}` : !0;
33
+ } : typeof n == "number" && typeof e == "number" ? function(i) {
34
+ const t = +i;
35
+ return isNaN(t) ? "Invalid number" : t < n ? `Value must be at least ${n}` : t >= e ? `Value must be less than ${e}` : !0;
36
+ } : function() {
37
+ return "Progamming error: invalid range parameter.";
38
+ };
39
+ }
40
+ function c() {
41
+ return function(n) {
42
+ if (n = String(n), n.length === 0)
43
+ return !0;
44
+ const e = +n;
45
+ return isFinite(e) || "Must be a number";
46
+ };
47
+ }
48
+ function j(n, e) {
49
+ return typeof n == "number" ? function(i) {
50
+ const t = c()(i);
51
+ return typeof t == "string" ? t : f(+i).precision > n ? `Precision cannot be more than ${n} decimal point.` : !0;
52
+ } : function(i) {
53
+ const t = c()(i);
54
+ if (typeof t == "string")
55
+ return t;
56
+ const r = d(n, e);
57
+ return f(+i).precision > r ? `Precision cannot be more than ${r} decimal point.` : !0;
58
+ };
59
+ }
60
+ function g(n, e) {
61
+ return function(i) {
62
+ const t = c()(i);
63
+ if (typeof t == "string")
64
+ return t;
65
+ const r = f(+i);
66
+ return r.precision > n ? typeof e == "function" ? e(r.precision) : e ?? `Precision cannot be more than ${n}` : !0;
67
+ };
68
+ }
69
+ function D(n, e, o) {
70
+ return function(t) {
71
+ if (t === e) return !0;
72
+ const r = n.find((a) => a.value === t);
73
+ return r ? o ? o(r) : `Already used in ${r.label}` : !0;
74
+ };
75
+ }
76
+ function N(n) {
77
+ let e = typeof n == "number" ? f(n) : n;
78
+ e = m(e);
79
+ const o = u(e);
80
+ return function(t) {
81
+ if (!s(t)) {
82
+ if (t = +t, Number.isNaN(t)) return !0;
83
+ t = f(t);
84
+ }
85
+ return t = m(t), t.amount % e.amount === 0 && t.precision <= e.precision ? !0 : `${u(t)} must be a multiple of ${o}`;
86
+ };
87
+ }
88
+ export {
89
+ A,
90
+ P as B,
91
+ c as I,
92
+ j as M,
93
+ M as R,
94
+ D as U,
95
+ N as a,
96
+ g as b,
97
+ $ as c
98
+ };
@@ -0,0 +1,75 @@
1
+ import { u as i } from "./stock-b7nNc6ko.js";
2
+ import { a as s, M as p } from "./app-ayv5Jw7D.js";
3
+ import { ref as k, computed as B } from "vue";
4
+ import { c as d } from "./number-DPuTdA-J.js";
5
+ function m() {
6
+ return {
7
+ stockBalance: {
8
+ _id: "",
9
+ items: []
10
+ },
11
+ productBalance: []
12
+ };
13
+ }
14
+ const v = d(0), f = {
15
+ id: "",
16
+ balance: v,
17
+ closing: null,
18
+ costs: null
19
+ }, n = k(m()), w = () => {
20
+ const r = s(), u = B(() => {
21
+ var a;
22
+ const o = (a = n.value.stockBalance.skus) == null ? void 0 : a.groupBy((t) => t.id), e = (t) => {
23
+ var c;
24
+ return ((c = o == null ? void 0 : o.get(t)) == null ? void 0 : c[0]) ?? { ...f, id: t };
25
+ };
26
+ return r.skus.map((t) => e(t._id));
27
+ }), l = i();
28
+ return {
29
+ // state
30
+ get stockBalance() {
31
+ return {
32
+ ...n.value.stockBalance,
33
+ skus: u.value
34
+ };
35
+ },
36
+ set stockBalance(o) {
37
+ n.value.stockBalance = o;
38
+ },
39
+ get productBalance() {
40
+ return n.value.productBalance;
41
+ },
42
+ set productBalance(o) {
43
+ n.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(), e = 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, c) {
60
+ return Object.prototype.hasOwnProperty.call(t, c);
61
+ }
62
+ for (const t in e.convertCountdown)
63
+ if (a(e.convertCountdown, t)) {
64
+ const c = e.convertCountdown[t];
65
+ this.productBalance.push({
66
+ id: t,
67
+ count: c
68
+ });
69
+ }
70
+ }
71
+ };
72
+ };
73
+ export {
74
+ w as u
75
+ };
@@ -1,4 +1,4 @@
1
- import { o as d, u as l } from "./app-_4kRbuQl.js";
1
+ import { o as d, u as l } from "./app-ayv5Jw7D.js";
2
2
  import { useCoreStore as m } from "@feedmepos/mf-common";
3
3
  import { useSnackbar as $ } from "@feedmepos/ui-library";
4
4
  const y = d((o, a) => {
@@ -31,6 +31,7 @@ export interface FeatureState {
31
31
  inventory_portal_surcharge: boolean;
32
32
  inventory_purchase_order_cost_edit: boolean;
33
33
  inventory_purchase_order_workflow_allow_to_mark_completed: boolean;
34
+ inventory_recipe_v2: boolean;
34
35
  }
35
36
  export declare const useFeatureStore: () => {
36
37
  readonly businessDbName: string;
@@ -66,6 +67,7 @@ export declare const useFeatureStore: () => {
66
67
  readonly enableSurcharge: boolean;
67
68
  readonly enablePurchaseOrderCostEdit: boolean;
68
69
  readonly poWorkflowAllowToMarkCompleted: boolean;
70
+ readonly enableRecipeV2: boolean;
69
71
  init(): Promise<void>;
70
72
  awaitFeatureLoaded(callback: () => boolean): Promise<boolean>;
71
73
  };
@@ -164,8 +164,8 @@ export declare function useNetSuiteStore(): {
164
164
  } | null | undefined;
165
165
  customFields?: Record<string, any> | null | undefined;
166
166
  skuCache?: {
167
- isInactive?: boolean | null | undefined;
168
167
  trackingMeasurement?: string | null | undefined;
168
+ isInactive?: boolean | null | undefined;
169
169
  convert?: {
170
170
  measurement?: string | null | undefined;
171
171
  inventoryBindings?: {
@@ -178,6 +178,13 @@ export declare function useNetSuiteStore(): {
178
178
  precision: number;
179
179
  };
180
180
  } | null | undefined;
181
+ rules?: Record<string, any> | null | undefined;
182
+ alternatives?: {
183
+ priority?: number | null | undefined;
184
+ default?: boolean | null | undefined;
185
+ trackingMeasurement?: string | null | undefined;
186
+ _id: string;
187
+ }[] | null | undefined;
181
188
  id: string;
182
189
  type: "RECIPE" | "SKU" | "SKU_GROUP";
183
190
  amount: {