@feedmepos/mf-inventory-portal 1.5.9 → 1.5.11-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 (92) hide show
  1. package/dist/{App-D_elK-3W.js → App-D4rysNfh.js} +4 -4
  2. package/dist/{ApprovalView-WdSQEpGQ.js → ApprovalView-DpYJmgiG.js} +7 -7
  3. package/dist/{BindingsDialog-CkqhKrrD.js → BindingsDialog-C7z0HH48.js} +2 -2
  4. package/dist/{BindingsPicker-HPjbSTJd.js → BindingsPicker-C5IKp9CT.js} +2 -2
  5. package/dist/{BindingsTable-BF4WTUsf.js → BindingsTable-BRDooCs4.js} +3 -3
  6. package/dist/{ClosingDraftView-CTEaBuhS.js → ClosingDraftView-CSCbfIFE.js} +159 -158
  7. package/dist/ClosingHistoryView-DCIJ5ONT.js +1114 -0
  8. package/dist/{ClosingTemplateView-DMtIj04r.js → ClosingTemplateView-D1n9_dFc.js} +14 -14
  9. package/dist/{DefaultView-v-32G42G.js → DefaultView-Llrh9ufI.js} +2 -2
  10. package/dist/{DeliveryOrderPrintPreview-DHD9kykc.js → DeliveryOrderPrintPreview-DSkU-sqv.js} +2 -2
  11. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-FRe1RX5T.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DL6AKT9H.js} +2 -2
  12. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-KTtYD7qS.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-JHabBWJb.js} +2 -2
  13. package/dist/{FmMultiselectDialog-BTNJvhnt.js → FmMultiselectDialog-BWujDEnX.js} +2 -2
  14. package/dist/{FmMultiselectDialog-LmjSdrn3.js → FmMultiselectDialog-C0lCYHla.js} +1 -1
  15. package/dist/FmUnitInput.vue_vue_type_script_setup_true_lang-CjCNHugK.js +388 -0
  16. package/dist/{ImportView-DoHL35I-.js → ImportView-C6q4gB3S.js} +6 -6
  17. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-D8JocFRD.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-Df7B8ZEG.js} +1 -1
  18. package/dist/{IngredientGroupView-CVhShbuq.js → IngredientGroupView-DO8OKEVU.js} +5 -5
  19. package/dist/{IngredientsView-XOTuP5ZI.js → IngredientsView-CD2YtXPJ.js} +15 -15
  20. package/dist/{IntegrationExplorerView-BsY4Ca2E.js → IntegrationExplorerView-CZCMnwZG.js} +352 -352
  21. package/dist/{IntegrationView-C_Y3_I_8.js → IntegrationView--3nVS_X6.js} +13 -13
  22. package/dist/{InventoryBindingForm-CHsrJSnp.js → InventoryBindingForm-FjFTiN7R.js} +1 -1
  23. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-CcF5cko8.js +441 -0
  24. package/dist/{InventoryBindingSummary-C9UE6Zh2.js → InventoryBindingSummary-D90hAi96.js} +1 -1
  25. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DFj3HtnZ.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-1iDUXU2T.js} +1 -1
  26. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-oNk0zO9K.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DTYnX8kn.js} +1 -1
  27. package/dist/{PublishView-DVk0ZUlG.js → PublishView-BtcGl7zM.js} +3 -3
  28. package/dist/{PurchaseOrderPrintPreview-poHk4RMP.js → PurchaseOrderPrintPreview-DvkMQv1w.js} +2 -2
  29. package/dist/{ReceiveRequestView-CaPoxKBs.js → ReceiveRequestView-DSfj36r3.js} +9631 -9552
  30. package/dist/{RecipeView-bbhd-mNL.js → RecipeView-DkDSr3LN.js} +1304 -1267
  31. package/dist/{SettingsView-DxiMiFpz.js → SettingsView-iRqUoEPg.js} +4 -4
  32. package/dist/{StockView-Dc4ICHq3.js → StockView-DxUXHYD_.js} +279 -278
  33. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Cn3NL6mQ.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-WJ0Fz21v.js} +1 -1
  34. package/dist/{SupplierView-6fETAO2h.js → SupplierView-BYQjWeU7.js} +12 -12
  35. package/dist/{SurchargeView-7ucdobpg.js → SurchargeView-CyhTe1B8.js} +6 -6
  36. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-C4EeNPwc.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-CBM8jJqP.js} +2 -2
  37. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-D-PqQ3Mi.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DM9Cg0uk.js} +1 -1
  38. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-D-nG9kcq.js → TransferDetails.vue_vue_type_script_setup_true_lang-D2MztVse.js} +20 -20
  39. package/dist/{TransferTemplateView-CDD_5s5s.js → TransferTemplateView-FNI6jVh0.js} +18 -18
  40. package/dist/{UnitCostHistoryView-BrYXJWz0.js → UnitCostHistoryView-sGxNtk0Y.js} +4 -4
  41. package/dist/UnitDisplayControl.vue_vue_type_script_setup_true_lang-Cn6q11Ts.js +160 -0
  42. package/dist/{UnitView-CMXUZZvZ.js → UnitView-P8jU14k8.js} +7 -7
  43. package/dist/{WarehouseView-CUgJ4YGF.js → WarehouseView-NILk42Zj.js} +5 -5
  44. package/dist/{WastageTemplateView-Di6ffpTU.js → WastageTemplateView-DNrKoK3S.js} +14 -14
  45. package/dist/{app-D3gm3Lsw.js → app-DIOXPCfI.js} +23 -11
  46. package/dist/app.d.ts +12 -0
  47. package/dist/app.js +1 -1
  48. package/dist/{closing-template-BiSW9398.js → closing-template-DAlwSsqC.js} +1 -1
  49. package/dist/{date2-DJotzNeB.js → date2-DBIy5hnh.js} +1 -1
  50. package/dist/{dayjs.min-DxOA6M7_.js → dayjs.min-B2EqUP7W.js} +1 -1
  51. package/dist/{decimal-BPZo97WQ.js → decimal-e6enR5yT.js} +2 -2
  52. package/dist/{defineDeepModel-BMU9Poed.js → defineDeepModel-CwqnmttS.js} +1 -1
  53. package/dist/{duplicate-template-4bkTBQu0.js → duplicate-template-DRtq-b-P.js} +1 -1
  54. package/dist/{feature-WVA_2Jx-.js → feature-BCSp38rL.js} +2 -2
  55. package/dist/{format-time-from-id-gcRrHjjv.js → format-time-from-id-CTWNRFSC.js} +1 -1
  56. package/dist/{format-unit-display-BXkR_Hu0.js → format-unit-display-BFP12VU7.js} +11 -11
  57. package/dist/{import-export.helper-5AEiNKim.js → import-export.helper-Dr7R0Zql.js} +6 -6
  58. package/dist/{index-DkCy3EG9.js → index-BhS1AhF-.js} +1 -1
  59. package/dist/{index-YVMa0U0j.js → index-C2MhE26a.js} +3 -3
  60. package/dist/{index-DU4iyU3D.js → index-Df-NlbKu.js} +1 -1
  61. package/dist/{inventory-core-dart.default-B7xHV5Y6.js → inventory-core-dart.default-CW9d8gJh.js} +1 -1
  62. package/dist/{lz-string-BtgOc0yQ.js → lz-string-BHfmMoLE.js} +1 -1
  63. package/dist/{netsuite-DmXOUJo-.js → netsuite-BSEnJOMn.js} +2 -2
  64. package/dist/{number-BfNWSAkN.js → number-B1buZ_S4.js} +3 -3
  65. package/dist/{predefined-templates-BKxLIZg6.js → predefined-templates-BIFClpKf.js} +1 -1
  66. package/dist/{purchase-order-template-7iNDStWd.js → purchase-order-template-BCt-pDW-.js} +1 -1
  67. package/dist/{recalculationUtils-BVuC0H2j.js → recalculationUtils-CASVCqt7.js} +1 -1
  68. package/dist/{rules-BK8yTx5p.js → rules-C60UHyIn.js} +2 -2
  69. package/dist/{stock-BSA86fOX.js → stock-CkWMLoi7.js} +1 -1
  70. package/dist/{supplier-DA3y7WoU.js → supplier-CiW6zfX_.js} +2 -2
  71. package/dist/{surcharge-BiYvWPv-.js → surcharge-B9FUKx0L.js} +1 -1
  72. package/dist/tsconfig.app.tsbuildinfo +1 -1
  73. package/dist/{uom-rules-BxHGqiP7.js → uom-rules-DXiQ0ZIA.js} +1 -1
  74. package/dist/{use-ingredient-select-dialog-CPiX95uf.js → use-ingredient-select-dialog-Bn8C8IG1.js} +2 -2
  75. package/dist/{use-inventory-binding-dialog-CxKLW2Xh.js → use-inventory-binding-dialog-DZQ1WG1S.js} +2 -2
  76. package/dist/{use-template-enabled-locations-CrwOCxDu.js → use-template-enabled-locations-B9YKq5YY.js} +2 -2
  77. package/dist/{use-transfer-locations-CNY1m-5P.js → use-transfer-locations-D0mDjUMQ.js} +2 -2
  78. package/dist/{useHrmPermission-YEdf2QFW.js → useHrmPermission-BTkOHa4h.js} +1 -1
  79. package/dist/{useNavigationMenu-Bz5AabkY.js → useNavigationMenu-CSfM_5Wy.js} +2 -2
  80. package/dist/{useSseClient-BWrz2czP.js → useSseClient-DwJXBOEF.js} +3 -3
  81. package/dist/views/receive-request/components/transfer-form/TransferFormProps.d.ts +2 -0
  82. package/dist/views/receive-request/components/transfer-form/composables/use-stock-balance-toggle.d.ts +3 -0
  83. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +4 -0
  84. package/dist/{vue-i18n-DyHvEzel.js → vue-i18n-BWe-vqm2.js} +287 -287
  85. package/dist/{xlsx-DQfBpM_Q.js → xlsx-BT7Z_gt_.js} +1 -1
  86. package/dist/{xlsx.util-XLH11fha.js → xlsx.util-Bm6lJRyh.js} +3 -3
  87. package/package.json +5 -5
  88. package/dist/ClosingHistoryView-DL9g4naX.js +0 -1108
  89. package/dist/FmUnitInput.vue_vue_type_script_setup_true_lang-CvUDKcli.js +0 -362
  90. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-DMGMZ556.js +0 -404
  91. package/dist/UnitDisplayControl.vue_vue_type_script_setup_true_lang-Cj15fCG9.js +0 -137
  92. package/dist/export-BS0TrI3Q.js +0 -26
@@ -1,404 +0,0 @@
1
- import { defineComponent as ne, computed as g, reactive as oe, resolveComponent as B, openBlock as a, createElementBlock as y, createVNode as m, withCtx as k, createElementVNode as n, toDisplayString as p, unref as i, createBlock as I, createCommentVNode as v, Fragment as E, renderList as C, nextTick as te } from "vue";
2
- import { a as le, t as ie, v as se, F as de } from "./app-D3gm3Lsw.js";
3
- import { a as h, c as re } from "./number-BfNWSAkN.js";
4
- import { u as ae } from "./use-inventory-binding-dialog-CxKLW2Xh.js";
5
- import { b as D, c as G } from "./rules-BK8yTx5p.js";
6
- import { _ as ue, c as me, d as ce } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-CvUDKcli.js";
7
- import { useI18n as pe } from "@feedmepos/mf-common";
8
- const ye = { class: "flex flex-col gap-24" }, fe = { class: "flex flex-col gap-16" }, ve = { class: "flex items-center" }, be = { class: "flex-1 fm-typo-en-title-sm-600" }, _e = { class: "flex flex-col" }, ge = { class: "flex py-8 px-12 border-b border-fm-color-neutral-gray-200 bg-fm-color-neutral-gray-100 h-[44px] items-center" }, xe = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, he = { class: "flex flex-col w-full border-b border-fm-color-neutral-gray-100" }, Ve = {
9
- class: "flex items-center",
10
- style: { "min-height": "48px" }
11
- }, Be = { class: "flex-1 fm-typo-en-body-md-400 py-8 px-12" }, ke = { class: "flex flex-col" }, Ie = { class: "line-clamp-1" }, we = { class: "w-[200px]" }, Fe = {
12
- key: 0,
13
- class: "w-[52px]"
14
- }, Ue = {
15
- key: 0,
16
- class: "flex gap-4 text-fm-color-system-error-400 fm-typo-en-body-sm-400 px-8"
17
- }, Ee = {
18
- key: 0,
19
- class: "flex flex-col gap-16"
20
- }, Ce = { class: "flex items-center" }, Ge = { class: "flex-1 fm-typo-en-title-sm-600" }, Ae = { class: "flex flex-col" }, Re = { class: "flex py-8 px-12 border-b border-fm-color-neutral-gray-200 bg-fm-color-neutral-gray-100 h-[44px] items-center" }, Se = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Pe = { class: "flex flex-col w-full border-b border-fm-color-neutral-gray-100" }, Te = {
21
- key: 0,
22
- class: "flex gap-4 text-fm-color-system-error-400 fm-typo-en-body-sm-400"
23
- }, Ne = {
24
- class: "flex items-center",
25
- style: { "min-height": "48px" }
26
- }, Me = { class: "flex-1 fm-typo-en-body-md-400 py-8 px-12" }, De = { class: "flex flex-col" }, Ke = { class: "w-[200px]" }, $e = {
27
- key: 0,
28
- class: "w-[52px]"
29
- }, ze = { class: "flex flex-col gap-16" }, je = { class: "flex items-center" }, Le = { class: "flex-1 fm-typo-en-title-sm-600" }, Oe = { class: "flex flex-col" }, Ye = { class: "flex py-8 px-12 border-b border-fm-color-neutral-gray-200 bg-fm-color-neutral-gray-100 h-[44px] items-center" }, We = { class: "flex-1 fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, qe = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary w-[150px] px-16" }, He = {
30
- class: "flex items-center w-full",
31
- style: { "min-height": "48px" }
32
- }, Je = { class: "flex-1 fm-typo-en-body-md-400 py-8 px-12" }, Qe = { class: "line-clamp-1 w-full" }, Xe = { class: "w-[150px]" }, Ze = {
33
- key: 0,
34
- class: "w-[52px]"
35
- }, en = { class: "flex flex-col px-12 pb-4" }, an = /* @__PURE__ */ ne({
36
- __name: "InventoryBindingForm",
37
- props: {
38
- id: {},
39
- modelValue: { default: () => [] },
40
- excludeBindingId: {},
41
- rules: { default: () => [] },
42
- iframeMode: { type: Boolean },
43
- disabled: { type: Boolean },
44
- readonly: { type: Boolean },
45
- enableIngredientGroup: { type: Boolean }
46
- },
47
- emits: ["update:modelValue", "click:pick-inventory-bindings"],
48
- setup(K, { emit: $ }) {
49
- const { t: u } = pe(), x = le(), A = g(() => x.recipeById), w = g(() => x.skuById), z = g(() => x.skuGroupById), s = K, b = $, R = g(() => ie({
50
- parentId: s.id,
51
- bindings: s.modelValue,
52
- recipes: x.recipes.map((o) => o._id === s.id ? {
53
- ...o,
54
- contains: s.modelValue
55
- } : o),
56
- skus: x.skus.map((o) => o._id === s.id ? {
57
- ...o,
58
- convert: {
59
- inventoryBindings: s.modelValue
60
- }
61
- } : o),
62
- skuGroups: x.skuGroups
63
- }).inventoryBindings.filter((o) => "error" in o && o.error).map((o) => o).filter((o) => o.reason === se.enum.circularDependency)), F = g(
64
- () => new Set(R.value.map((e) => {
65
- var l;
66
- return (l = e.bindingPaths[0]) == null ? void 0 : l.id;
67
- }))
68
- ), j = g(() => s.modelValue.filter((e) => e.type === "RECIPE")), { promptIngredientsBinding: L, promptRecipesBinding: O, promptIngredientGroupsBinding: Y } = ae();
69
- async function W() {
70
- if (s.iframeMode) {
71
- b("click:pick-inventory-bindings", "RECIPE");
72
- return;
73
- }
74
- O(
75
- s.modelValue,
76
- (e) => b("update:modelValue", e),
77
- s.id ? [s.id] : []
78
- );
79
- }
80
- const q = g(() => s.modelValue.filter((e) => e.type === "SKU_GROUP"));
81
- async function H() {
82
- Y(
83
- s.modelValue,
84
- (e) => b("update:modelValue", e),
85
- s.id ? [s.id] : []
86
- );
87
- }
88
- const S = g(() => s.modelValue.filter((e) => e.type === "SKU") ?? []);
89
- async function J() {
90
- if (s.iframeMode) {
91
- b("click:pick-inventory-bindings", "SKU");
92
- return;
93
- }
94
- L(
95
- s.modelValue,
96
- (e) => b("update:modelValue", e),
97
- s.excludeBindingId,
98
- s.id ? [s.id] : []
99
- );
100
- }
101
- function P(e, l, o) {
102
- const r = +l;
103
- let f = o;
104
- l.length > 0 && isFinite(r) ? f = o.map((c) => (c.id !== e || (c.amount = re(r)), c)) : f = o.map((c) => (c.id !== e || (c.amount = { amount: 0, precision: 0 }), c)), b("update:modelValue", f);
105
- }
106
- function U(e, l) {
107
- const o = l.filter((r) => r.id !== e);
108
- b("update:modelValue", o);
109
- }
110
- function T(e) {
111
- var o, r;
112
- if (e.type !== de.enum.SKU)
113
- throw new Error("Non-SKU binding does not have unit");
114
- if (!((o = w.value[e.id]) == null ? void 0 : o.unit))
115
- throw new Error(`Cannot find ingredient: ${e.id}`);
116
- return (r = w.value[e.id]) == null ? void 0 : r.unit;
117
- }
118
- function Q(e) {
119
- return { amount: e.amount, measurement: e.measurement };
120
- }
121
- function X(e, l, o) {
122
- const r = o.map((f) => f.id !== e ? f : {
123
- ...f,
124
- amount: l.amount,
125
- measurement: l.measurement
126
- });
127
- b("update:modelValue", r);
128
- }
129
- const N = oe({});
130
- function Z(e) {
131
- return N[e.id] ?? {
132
- modelValue: {
133
- amount: e.amount,
134
- measurement: e.measurement
135
- },
136
- amountAsString: h(e.amount)
137
- };
138
- }
139
- function ee(e, l) {
140
- te(() => {
141
- N[e.id] = {
142
- modelValue: {
143
- amount: e.amount,
144
- measurement: e.measurement
145
- },
146
- amountAsString: l
147
- };
148
- });
149
- }
150
- return (e, l) => {
151
- const o = B("FmFormGroup"), r = B("FmButton"), f = B("FmTooltip"), c = B("FmTextField"), M = B("FmIcon");
152
- return a(), y("div", ye, [
153
- m(o, {
154
- disabled: e.disabled,
155
- "model-value": e.modelValue,
156
- rules: [
157
- ...e.rules,
158
- () => R.value.length ? "There is a binding error in your configuration" : !0
159
- ]
160
- }, {
161
- label: k(() => l[0] || (l[0] = [
162
- n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Define the inventory bindings for this recipe or ingredient. ", -1)
163
- ])),
164
- _: 1
165
- }, 8, ["disabled", "model-value", "rules"]),
166
- n("div", fe, [
167
- n("div", ve, [
168
- n("div", be, p(i(u)("inventory.inventoryBindings.recipe")), 1),
169
- e.readonly ? v("", !0) : (a(), I(r, {
170
- key: 0,
171
- variant: "secondary",
172
- "text-color": "primary",
173
- "border-color": "primary",
174
- label: i(u)("inventory.inventoryBindings.linkRecipe"),
175
- "prepend-icon": "link",
176
- onClick: W
177
- }, null, 8, ["label"]))
178
- ]),
179
- n("div", _e, [
180
- n("div", ge, [
181
- n("div", xe, p(i(u)("inventory.inventoryBindings.recipe")), 1),
182
- l[1] || (l[1] = n("div", { class: "w-[200px]" }, null, -1)),
183
- l[2] || (l[2] = n("div", { class: "w-[52px]" }, null, -1))
184
- ]),
185
- (a(!0), y(E, null, C(j.value, (t) => (a(), I(o, {
186
- key: t.id,
187
- disabled: e.disabled,
188
- modelValue: +i(h)(t.amount ?? { amount: 1, precision: 0 }),
189
- rules: [i(D)(0), i(G)(-1)]
190
- }, {
191
- default: k(({ invalid: V }) => {
192
- var _;
193
- return [
194
- n("div", he, [
195
- n("div", Ve, [
196
- n("div", Be, [
197
- n("div", ke, [
198
- m(f, {
199
- zIndex: 51,
200
- variant: "plain",
201
- placement: "top",
202
- content: (_ = A.value[t.id]) == null ? void 0 : _.name
203
- }, {
204
- default: k(() => {
205
- var d;
206
- return [
207
- n("span", Ie, p((d = A.value[t.id]) == null ? void 0 : d.name), 1)
208
- ];
209
- }),
210
- _: 2
211
- }, 1032, ["content"])
212
- ])
213
- ]),
214
- n("div", we, [
215
- m(c, {
216
- class: "w-full",
217
- disabled: e.disabled,
218
- modelValue: +i(h)(t.amount ?? { amount: 1, precision: 0 }),
219
- "onUpdate:modelValue": (d) => P(t.id, d, e.modelValue),
220
- invalid: V
221
- }, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "invalid"])
222
- ]),
223
- e.readonly ? v("", !0) : (a(), y("div", Fe, [
224
- m(r, {
225
- disabled: e.disabled,
226
- type: "button",
227
- variant: "plain",
228
- icon: "delete",
229
- "icon-color": "#000000",
230
- onClick: (d) => U(t.id, e.modelValue)
231
- }, null, 8, ["disabled", "onClick"])
232
- ]))
233
- ]),
234
- F.value.has(t.id) ? (a(), y("div", Ue, [
235
- m(M, {
236
- name: "error",
237
- color: "system-error-300",
238
- size: "sm"
239
- }),
240
- n("div", null, p(i(u)("inventory.inventoryBindings.circularError")), 1)
241
- ])) : v("", !0)
242
- ])
243
- ];
244
- }),
245
- _: 2
246
- }, 1032, ["disabled", "modelValue", "rules"]))), 128))
247
- ])
248
- ]),
249
- e.enableIngredientGroup ? (a(), y("div", Ee, [
250
- n("div", Ce, [
251
- n("div", Ge, p(i(u)("inventory.inventoryBindings.ingredientGroup")), 1),
252
- e.readonly ? v("", !0) : (a(), I(r, {
253
- key: 0,
254
- variant: "secondary",
255
- "text-color": "primary",
256
- "border-color": "primary",
257
- label: i(u)("inventory.inventoryBindings.linkIngredientGroup"),
258
- "prepend-icon": "link",
259
- onClick: H
260
- }, null, 8, ["label"]))
261
- ]),
262
- n("div", Ae, [
263
- n("div", Re, [
264
- n("div", Se, p(i(u)("inventory.inventoryBindings.ingredientGroup")), 1),
265
- l[3] || (l[3] = n("div", { class: "w-[200px]" }, null, -1)),
266
- l[4] || (l[4] = n("div", { class: "w-[52px]" }, null, -1))
267
- ]),
268
- (a(!0), y(E, null, C(q.value, (t) => (a(), I(o, {
269
- key: t.id,
270
- disabled: e.disabled,
271
- modelValue: +i(h)(t.amount ?? { amount: 1, precision: 0 }),
272
- rules: [i(D)(0), i(G)(0)]
273
- }, {
274
- default: k(({ invalid: V }) => {
275
- var _;
276
- return [
277
- n("div", Pe, [
278
- F.value.has(t.id) ? (a(), y("div", Te, [
279
- m(M, {
280
- name: "error",
281
- color: "system-error-300",
282
- size: "sm"
283
- }),
284
- n("div", null, p(i(u)("inventory.inventoryBindings.circularError")), 1)
285
- ])) : v("", !0),
286
- n("div", Ne, [
287
- n("div", Me, [
288
- n("div", De, p((_ = z.value[t.id]) == null ? void 0 : _.name), 1)
289
- ]),
290
- n("div", Ke, [
291
- m(c, {
292
- class: "w-full",
293
- disabled: e.disabled,
294
- modelValue: +i(h)(t.amount ?? { amount: 1, precision: 0 }),
295
- "onUpdate:modelValue": (d) => P(t.id, d, e.modelValue),
296
- invalid: V
297
- }, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "invalid"])
298
- ]),
299
- e.readonly ? v("", !0) : (a(), y("div", $e, [
300
- m(r, {
301
- disabled: e.disabled,
302
- type: "button",
303
- variant: "plain",
304
- icon: "delete",
305
- "icon-color": "#000000",
306
- onClick: (d) => U(t.id, e.modelValue)
307
- }, null, 8, ["disabled", "onClick"])
308
- ]))
309
- ])
310
- ])
311
- ];
312
- }),
313
- _: 2
314
- }, 1032, ["disabled", "modelValue", "rules"]))), 128))
315
- ])
316
- ])) : v("", !0),
317
- n("div", ze, [
318
- n("div", je, [
319
- n("div", Le, p(i(u)("inventory.inventoryBindings.ingredient")), 1),
320
- e.readonly ? v("", !0) : (a(), I(r, {
321
- key: 0,
322
- variant: "secondary",
323
- "text-color": "primary",
324
- "border-color": "primary",
325
- label: i(u)("inventory.inventoryBindings.linkIngredient"),
326
- "prepend-icon": "link",
327
- onClick: J
328
- }, null, 8, ["label"]))
329
- ]),
330
- n("div", Oe, [
331
- n("div", Ye, [
332
- n("div", We, p(i(u)("inventory.inventoryBindings.ingredient")), 1),
333
- n("div", qe, p(i(u)("inventory.inventoryBindings.amount")), 1),
334
- l[5] || (l[5] = n("div", { class: "w-[52px]" }, null, -1))
335
- ]),
336
- (a(!0), y(E, null, C(S.value, (t, V) => {
337
- var _;
338
- return a(), y("div", {
339
- key: t.id,
340
- class: "flex flex-col border-b border-fm-color-neutral-gray-100"
341
- }, [
342
- n("div", He, [
343
- n("div", Je, [
344
- m(f, {
345
- zIndex: 51,
346
- variant: "plain",
347
- placement: "top",
348
- content: (_ = w.value[t.id]) == null ? void 0 : _.name
349
- }, {
350
- default: k(() => {
351
- var d;
352
- return [
353
- n("span", Qe, p((d = w.value[t.id]) == null ? void 0 : d.name), 1)
354
- ];
355
- }),
356
- _: 2
357
- }, 1032, ["content"])
358
- ]),
359
- n("div", Xe, [
360
- m(ue, {
361
- "model-value": Q(t),
362
- "onUpdate:modelValue": (d) => d && X(t.id, d, e.modelValue),
363
- "onUpdate:amount": (d) => ee(t, d),
364
- unit: T(t),
365
- placement: V === S.value.length - 1 ? "top" : "bottom",
366
- "convert-amount-on-change-unit": "",
367
- disabled: e.readonly
368
- }, null, 8, ["model-value", "onUpdate:modelValue", "onUpdate:amount", "unit", "placement", "disabled"])
369
- ]),
370
- e.readonly ? v("", !0) : (a(), y("div", Ze, [
371
- m(r, {
372
- disabled: e.disabled,
373
- type: "button",
374
- variant: "tertiary",
375
- icon: "delete",
376
- onClick: (d) => U(t.id, e.modelValue)
377
- }, null, 8, ["disabled", "onClick"])
378
- ]))
379
- ]),
380
- n("div", en, [
381
- m(o, {
382
- modelValue: +i(h)(t.amount ?? { amount: 1, precision: 0 }),
383
- rules: [i(G)(0)]
384
- }, null, 8, ["modelValue", "rules"]),
385
- m(o, {
386
- modelValue: Z(t),
387
- rules: [
388
- i(me)(),
389
- i(ce)(T(t)),
390
- () => F.value.has(t.id) ? i(u)("inventory.inventoryBindings.invalidWarning") : !0
391
- ]
392
- }, null, 8, ["modelValue", "rules"])
393
- ])
394
- ]);
395
- }), 128))
396
- ])
397
- ])
398
- ]);
399
- };
400
- }
401
- });
402
- export {
403
- an as _
404
- };
@@ -1,137 +0,0 @@
1
- import { defineComponent as U, ref as y, computed as v, resolveComponent as p, openBlock as d, createBlock as _, withCtx as g, createElementVNode as b, normalizeClass as D, toDisplayString as F, createVNode as I, createElementBlock as $, Fragment as E, renderList as B, unref as k } from "vue";
2
- import { g as m } from "./decimal-BPZo97WQ.js";
3
- import { d as L } from "./dayjs.min-DxOA6M7_.js";
4
- import { e as Y } from "./export-BS0TrI3Q.js";
5
- import { u as h } from "./app-D3gm3Lsw.js";
6
- async function z(o) {
7
- const r = `${(h().currentLocation.name || "").replace(
8
- / /g,
9
- "_"
10
- )}_${L().format("DD_MM_YYYY_HHmm")}.xlsx`;
11
- await Y(
12
- [
13
- {
14
- name: "stock",
15
- data: o,
16
- columns: [
17
- {
18
- name: "Code",
19
- selector: "code"
20
- },
21
- {
22
- name: "Name",
23
- selector: "name"
24
- },
25
- {
26
- name: "Balance",
27
- selector: (e) => {
28
- const a = c(e, e.unit);
29
- return a.type === "unit" ? m(e.balance, e.unit, null, !1) : m(e.balance, e.unit, a.measurement, !1);
30
- }
31
- },
32
- {
33
- name: "Unit",
34
- selector: (e) => {
35
- var s;
36
- const a = c(e, e.unit);
37
- return a.type === "unit" ? e.unit.abbrev : ((s = e.unit.measurements.find((i) => i.id === a.measurement)) == null ? void 0 : s.abbrev) || "";
38
- }
39
- }
40
- ]
41
- }
42
- ],
43
- r
44
- );
45
- }
46
- function c(o, u) {
47
- const r = localStorage.getItem(`uom:${o._id}`);
48
- return r ? r === u._id ? {
49
- type: "unit"
50
- } : u.measurements.find((e) => e.id === r) ? {
51
- type: "measurement",
52
- measurement: r
53
- } : {
54
- type: "unit"
55
- } : o.trackingMeasurement && u.measurements.find((e) => e.id === o.trackingMeasurement) ? {
56
- type: "measurement",
57
- measurement: o.trackingMeasurement
58
- } : {
59
- type: "unit"
60
- };
61
- }
62
- const N = { class: "fm-typo-en-body-md-400 flex-grow" }, A = /* @__PURE__ */ U({
63
- __name: "UnitDisplayControl",
64
- props: {
65
- unit: {},
66
- sku: {},
67
- amount: {},
68
- defaultTrackingMeasurement: {}
69
- },
70
- setup(o) {
71
- function u(t) {
72
- return `uom:${t._id}`;
73
- }
74
- function r(t) {
75
- const n = u(e.sku);
76
- t ? localStorage.setItem(n, t) : localStorage.setItem(n, e.unit._id), a.value = c(e.sku, e.unit);
77
- }
78
- const e = o, a = y(c(e.sku, e.unit)), s = v(() => {
79
- const { measurements: t } = e.unit;
80
- return [
81
- {
82
- label: `${m(e.amount, e.unit)}`,
83
- value: null
84
- },
85
- ...t.map(({ id: n }) => ({
86
- label: `${m(e.amount, e.unit, n)}`,
87
- value: n
88
- }))
89
- ];
90
- });
91
- function i({ value: t }) {
92
- return k(a).type === "unit" ? t === null : t === k(a).measurement;
93
- }
94
- const x = v(
95
- () => {
96
- var t;
97
- return ((t = s.value.find((n) => i(n))) == null ? void 0 : t.label) ?? "";
98
- }
99
- ), f = y(!1);
100
- return (t, n) => {
101
- const M = p("FmIcon"), C = p("FmMenuItem"), S = p("FmMenu");
102
- return d(), _(S, {
103
- "stop-click-propagation": "",
104
- onMenuChanged: n[0] || (n[0] = (l) => f.value = l)
105
- }, {
106
- "menu-button": g(() => [
107
- b("button", {
108
- type: "button",
109
- class: D([
110
- "w-full text-left flex items-center gap-8 cursor-pointer fm-corner-radius-sm px-8 py-4 border bg-white",
111
- f.value ? "border-fm-color-primary" : "border-fm-color-neutral-gray-100"
112
- ])
113
- }, [
114
- b("div", N, F(x.value), 1),
115
- I(M, {
116
- class: "text-fm-color-neutral-gray-400",
117
- name: "expand_more"
118
- })
119
- ], 2)
120
- ]),
121
- default: g(() => [
122
- (d(!0), $(E, null, B(s.value, (l) => (d(), _(C, {
123
- key: l.value ?? 0,
124
- label: l.label,
125
- "model-value": i(l),
126
- onClick: (O) => r(l.value)
127
- }, null, 8, ["label", "model-value", "onClick"]))), 128))
128
- ]),
129
- _: 1
130
- });
131
- };
132
- }
133
- });
134
- export {
135
- A as _,
136
- z as o
137
- };
@@ -1,26 +0,0 @@
1
- import { u as s, w as i } from "./xlsx-DQfBpM_Q.js";
2
- import { u } from "./xlsx.util-XLH11fha.js";
3
- function p(o, a) {
4
- return a.map((e) => typeof e.selector == "function" ? e.selector(o) : o[e.selector]);
5
- }
6
- function f(o, a) {
7
- const e = a.map((t) => t.name), n = o.map((t) => p(t, a));
8
- return s.aoa_to_sheet([e, ...n]);
9
- }
10
- async function d(o, a) {
11
- const e = s.book_new(), n = /* @__PURE__ */ new Set();
12
- for (const t of o) {
13
- const c = f(
14
- t.data,
15
- t.columns.map((r) => typeof r == "string" ? {
16
- name: r,
17
- selector: r
18
- } : r)
19
- );
20
- s.book_append_sheet(e, c, u(t.name, n));
21
- }
22
- await i(e, a);
23
- }
24
- export {
25
- d as e
26
- };