@feedmepos/mf-inventory-portal 1.6.2 → 1.6.3
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-C61RakQ7.js → App-C9leB4t0.js} +4 -4
- package/dist/{ApprovalView-Cc1iYZqD.js → ApprovalView-CqOXr5Hw.js} +8 -8
- package/dist/{BindingsDialog-Chd2EdfO.js → BindingsDialog-DRalvlwp.js} +2 -2
- package/dist/{BindingsPicker-CXXnZKq5.js → BindingsPicker-zXli3Z1x.js} +2 -2
- package/dist/{BindingsTable-C5migJtC.js → BindingsTable--VoNPh7F.js} +3 -3
- package/dist/{BulkReceiveRequestView-9MSE2YVv.js → BulkReceiveRequestView-Bon7uDCJ.js} +19 -19
- package/dist/{ClosingDraftView-C4XBYgez.js → ClosingDraftView-CdxQiwuz.js} +195 -195
- package/dist/{ClosingHistoryView-C_OtcjwH.js → ClosingHistoryView-CTkdBXBa.js} +5 -5
- package/dist/{ClosingTemplateView-BZpuwhWe.js → ClosingTemplateView-h9ohxtwI.js} +14 -14
- package/dist/{DefaultView-Dnub2r0C.js → DefaultView-CLRzOH5K.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-U8g2O_pt.js → DeliveryOrderPrintPreview-vgPmHbtx.js} +2 -2
- package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-D3tETd4M.js → EmailDialog.vue_vue_type_script_setup_true_lang-CE9wwNB_.js} +23 -23
- package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-DPVkPshX.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-DTeWGr5O.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CCl3KLFs.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DaXycWeg.js} +2 -2
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BgR0wjB0.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CL9YNazx.js} +2 -2
- package/dist/{FmMultiselectDialog-DX3xMRs8.js → FmMultiselectDialog-BAMaksR7.js} +1 -1
- package/dist/{FmMultiselectDialog-BplRH37N.js → FmMultiselectDialog-Bnouf9vX.js} +2 -2
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-fKDQGIyW.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DnfFPNWn.js} +5 -5
- package/dist/{ImportView-BYQcNVFt.js → ImportView-DYhLRkQA.js} +51 -51
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-Bj3Bgpix.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-B4n5-iRK.js} +1 -1
- package/dist/{IngredientGroupView-B52_Gj1M.js → IngredientGroupView-Dn15H-1E.js} +5 -5
- package/dist/{IngredientsView-dp1q1202.js → IngredientsView-9sp4RWOF.js} +15 -15
- package/dist/{IntegrationExplorerView-CFDjUZ1x.js → IntegrationExplorerView-DSj9e9rb.js} +352 -352
- package/dist/{IntegrationView-WxvHYqrr.js → IntegrationView-DbcMnd4z.js} +13 -13
- package/dist/{InventoryBindingForm-CgsJGTLO.js → InventoryBindingForm-6OXalr29.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DoDwQAGq.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-6-CNpE55.js} +5 -5
- package/dist/{InventoryBindingSummary-CJPi-O24.js → InventoryBindingSummary-h7b4l6Wb.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-6WGw2Tnv.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Cq_SuRtd.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-D8iVxQQI.js → PremiumBadge.vue_vue_type_script_setup_true_lang-7CXXGTvk.js} +1 -1
- package/dist/{PublishView-DQxvMoL9.js → PublishView-BNml0c7h.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-YN89wJJe.js → PurchaseOrderPrintPreview-DMQ4-abx.js} +2 -2
- package/dist/{ReceiveRequestView-Dld-AD3X.js → ReceiveRequestView-BTHWRSHt.js} +13 -13
- package/dist/{RecipeView-DTeYl1vN.js → RecipeView-D7pdeDlr.js} +17 -17
- package/dist/{SettingsView-ZKDeU7-t.js → SettingsView-Ce3Fbejt.js} +4 -4
- package/dist/{StockView-iWDV-4Em.js → StockView-BGH5uWNi.js} +20 -20
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DKQR-Oe-.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BegeXje7.js} +1 -1
- package/dist/{SupplierView-DIFYaNh0.js → SupplierView-BuyycuNM.js} +12 -12
- package/dist/{SurchargeView-Dg744-lq.js → SurchargeView-B3O9a7WC.js} +6 -6
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-a1NAKsHT.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-TJ4VhnI3.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BiMBRYQP.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BgkgLkWo.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BNb64xXp.js → TransferDetails.vue_vue_type_script_setup_true_lang-CwY2xCQV.js} +1315 -1315
- package/dist/{TransferTemplateView-OKkFfbJr.js → TransferTemplateView-CehWEgcU.js} +20 -20
- package/dist/{UnitCostHistoryView-BQD8QfVO.js → UnitCostHistoryView-N9UZOJVt.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-DrZ0DaVk.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-DpVe38HB.js} +4 -4
- package/dist/{UnitView-WB01UGKV.js → UnitView-YB56lxTp.js} +7 -7
- package/dist/{WarehouseView-xzBYaKJc.js → WarehouseView-DtBYtULO.js} +5 -5
- package/dist/{WastageTemplateView-HQpsfs5m.js → WastageTemplateView-BJQ94zo8.js} +14 -14
- package/dist/{app-jwcH8Mn8.js → app-CnwVdB-r.js} +33 -33
- package/dist/app.js +1 -1
- package/dist/{closing-template-nSKzJbXQ.js → closing-template-B0GQRFlS.js} +1 -1
- package/dist/{date2-CcBFYPpF.js → date2-CaCMUbxN.js} +1 -1
- package/dist/{dayjs.min-CArZjoIW.js → dayjs.min-C413l7qz.js} +1 -1
- package/dist/{decimal-kAd3KrAk.js → decimal-dpWXqHCT.js} +2 -2
- package/dist/{defineDeepModel-DW3GGnCB.js → defineDeepModel-wTAgCIGa.js} +1 -1
- package/dist/{duplicate-template-Dju7ozO-.js → duplicate-template-DTkeAcof.js} +1 -1
- package/dist/{feature-Dwlpa3ga.js → feature-CSsMjXm4.js} +2 -2
- package/dist/{format-time-from-id-C8qHJtCE.js → format-time-from-id-A1BqDOzj.js} +1 -1
- package/dist/{format-unit-display-DW_s2GAu.js → format-unit-display-CHS1Vvqm.js} +12 -12
- package/dist/{import-export.helper-BLEUR_2a.js → import-export.helper-C8qIeMrV.js} +49 -49
- package/dist/{index-CQqLXfqq.js → index-CCdOkfwD.js} +3 -3
- package/dist/{index-DeMIqTWp.js → index-CEbJe2zv.js} +1 -1
- package/dist/{index-DX29MkLw.js → index-dgiwVVtQ.js} +1 -1
- package/dist/{inventory-core-dart.default-BOlwkIOh.js → inventory-core-dart.default-CBuBQE02.js} +1 -1
- package/dist/{jszip.min-UvNpneu6.js → jszip.min-k8R8v9tK.js} +127 -127
- package/dist/{lz-string-BJjf0Fvk.js → lz-string-OLkSz-NK.js} +1 -1
- package/dist/{netsuite-ojatCiHQ.js → netsuite-Cm4tUcLt.js} +2 -2
- package/dist/{number-PbBeNwvZ.js → number-CF9W8sDX.js} +3 -3
- package/dist/{predefined-templates-C11X8192.js → predefined-templates-DmBAGnMN.js} +1 -1
- package/dist/{purchase-order-template-CMQsOjp6.js → purchase-order-template-C0ynPqX6.js} +1 -1
- package/dist/{recalculationUtils-DOIaJCEk.js → recalculationUtils-pDs8JNho.js} +1 -1
- package/dist/{rules-iqyXkujx.js → rules-CYCN4sgu.js} +2 -2
- package/dist/{stock-BhMYoMNR.js → stock-D8S1alJa.js} +1 -1
- package/dist/{supplier-XEzdhDaU.js → supplier-CiPnrjsq.js} +2 -2
- package/dist/{surcharge-Ors_mdMv.js → surcharge-CanooUK6.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-BQohyyG-.js → uom-rules-eVbKU0_1.js} +1 -1
- package/dist/{use-ingredient-select-dialog-DJ-u5t4P.js → use-ingredient-select-dialog-Lpcjl8Ws.js} +2 -2
- package/dist/{use-inventory-binding-dialog-D3W-HnQ8.js → use-inventory-binding-dialog-CA_03e_q.js} +2 -2
- package/dist/{use-template-enabled-locations-DVF4RYya.js → use-template-enabled-locations-CWMCe4nl.js} +2 -2
- package/dist/{use-transfer-locations-vRfZN9tb.js → use-transfer-locations-rvGiFI0e.js} +2 -2
- package/dist/{useHrmPermission-z87O-oAT.js → useHrmPermission-wOFwl59u.js} +1 -1
- package/dist/{useNavigationMenu-DMRHryMp.js → useNavigationMenu-BoDv65KI.js} +2 -2
- package/dist/{useSseClient-6AYDEsLw.js → useSseClient-DbWYwuT8.js} +3 -3
- package/dist/views/closing-draft/helpers/get-calculated-total.helper.spec.d.ts +1 -0
- package/dist/{vue-i18n-nOka-XyP.js → vue-i18n-Bov_Y0eC.js} +111 -111
- package/dist/{xlsx.util-DDX-Y6FY.js → xlsx.util-0_Y_Q66v.js} +397 -397
- package/package.json +5 -5
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { defineComponent as De, ref as Q, computed as S, onMounted as
|
|
2
|
-
import { u as
|
|
3
|
-
import { useCoreStore as
|
|
4
|
-
import { useSnackbar as ze, useDialog as
|
|
5
|
-
import { m as
|
|
6
|
-
import { defineStore as
|
|
7
|
-
import { b as
|
|
8
|
-
import { R as
|
|
9
|
-
import { e as yt,
|
|
10
|
-
import { b as Zn, d as Xn, c as eo, u as
|
|
11
|
-
import { i as
|
|
12
|
-
import { u as no, a as oo } from "./useSseClient-
|
|
13
|
-
import { u as gt } from "./stock-
|
|
14
|
-
import { D as
|
|
1
|
+
import { defineComponent as De, ref as Q, computed as S, onMounted as tn, resolveComponent as J, openBlock as p, createElementBlock as C, Fragment as re, createTextVNode as fe, createBlock as ne, withCtx as te, createElementVNode as a, toDisplayString as N, unref as f, createVNode as D, createCommentVNode as H, h as _, watch as Be, renderList as ge, onUnmounted as Un, withModifiers as Nn, normalizeStyle as mt, normalizeClass as he, isRef as vt, reactive as Zt, createSlots as Vn, Teleport as En, mergeProps as Ln } from "vue";
|
|
2
|
+
import { u as zn, _ as On } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DGlWE5I8.js";
|
|
3
|
+
import { useCoreStore as nn, useI18n as Je } from "@feedmepos/mf-common";
|
|
4
|
+
import { useSnackbar as ze, useDialog as on, components as ye, useProxiedModel as St, useBreakpoints as Gn } from "@feedmepos/ui-library";
|
|
5
|
+
import { m as Hn, u as Oe, M as de, w as oe, q as an, s as Ae, O as _e, B as Re, c as Yn, a as Ft, j as Kn } from "./app-CnwVdB-r.js";
|
|
6
|
+
import { defineStore as sn, storeToRefs as Wn } from "pinia";
|
|
7
|
+
import { b as ft, e as rn, f as qn, a as $e } from "./date2-CaCMUbxN.js";
|
|
8
|
+
import { R as ln } from "./rules-CYCN4sgu.js";
|
|
9
|
+
import { e as yt, j as qe, c as Qe, l as cn, m as un, a as Qn, k as dn, o as ie, t as Jn } from "./number-CF9W8sDX.js";
|
|
10
|
+
import { b as Zn, d as Xn, c as eo, u as dt, w as to } from "./xlsx.util-0_Y_Q66v.js";
|
|
11
|
+
import { i as It, u as Bt } from "./uom-rules-eVbKU0_1.js";
|
|
12
|
+
import { u as no, a as oo } from "./useSseClient-DbWYwuT8.js";
|
|
13
|
+
import { u as gt } from "./stock-D8S1alJa.js";
|
|
14
|
+
import { D as Xt, R as Ve } from "./row-action.enum-DQ9bJ_uv.js";
|
|
15
15
|
import { c as ao } from "./component-kqxARxvM.js";
|
|
16
|
-
import { f as so } from "./format-time-from-id-
|
|
17
|
-
import { f as ro } from "./recalculationUtils-
|
|
18
|
-
import { _ as lo } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-
|
|
19
|
-
import { _ as
|
|
16
|
+
import { f as so } from "./format-time-from-id-A1BqDOzj.js";
|
|
17
|
+
import { f as ro } from "./recalculationUtils-pDs8JNho.js";
|
|
18
|
+
import { _ as lo } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CL9YNazx.js";
|
|
19
|
+
import { _ as mn } from "./empty-placeholder-B0QU467o.js";
|
|
20
20
|
import { F as $t } from "./FmAdminBadge-DjnBAgyv.js";
|
|
21
|
-
import { u as io } from "./vue-i18n-
|
|
22
|
-
import { F as co } from "./decimal-
|
|
23
|
-
import { d as uo } from "./dayjs.min-
|
|
21
|
+
import { u as io } from "./vue-i18n-Bov_Y0eC.js";
|
|
22
|
+
import { F as co } from "./decimal-dpWXqHCT.js";
|
|
23
|
+
import { d as uo } from "./dayjs.min-C413l7qz.js";
|
|
24
24
|
import { F as mo } from "./FmDroppableField-J0xUsOTV.js";
|
|
25
25
|
import { _ as fo } from "./FmConfirmationButton.vue_vue_type_script_setup_true_lang-DLrMEGFR.js";
|
|
26
26
|
import { F as Ye, _ as po } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js";
|
|
27
|
-
const Me =
|
|
27
|
+
const Me = Hn((t, n) => {
|
|
28
28
|
function e() {
|
|
29
29
|
return Oe().currentLocation.dbName;
|
|
30
30
|
}
|
|
@@ -118,7 +118,7 @@ const Me = Kn((t, n) => {
|
|
|
118
118
|
}
|
|
119
119
|
throw new Error(`Unknown action: ${n.action}`);
|
|
120
120
|
});
|
|
121
|
-
|
|
121
|
+
tn(() => {
|
|
122
122
|
if (n.draft.effectiveAt)
|
|
123
123
|
r.value = new Date(n.draft.effectiveAt);
|
|
124
124
|
else {
|
|
@@ -129,7 +129,7 @@ const Me = Kn((t, n) => {
|
|
|
129
129
|
});
|
|
130
130
|
const y = S({
|
|
131
131
|
get() {
|
|
132
|
-
return r.value === null ? "" :
|
|
132
|
+
return r.value === null ? "" : ft(r.value);
|
|
133
133
|
},
|
|
134
134
|
set(R) {
|
|
135
135
|
if (R) {
|
|
@@ -140,7 +140,7 @@ const Me = Kn((t, n) => {
|
|
|
140
140
|
}
|
|
141
141
|
}), I = S({
|
|
142
142
|
get() {
|
|
143
|
-
return r.value === null ? "" :
|
|
143
|
+
return r.value === null ? "" : rn(r.value);
|
|
144
144
|
},
|
|
145
145
|
set(R) {
|
|
146
146
|
if (R) {
|
|
@@ -208,7 +208,7 @@ const Me = Kn((t, n) => {
|
|
|
208
208
|
D(K, {
|
|
209
209
|
modelValue: y.value,
|
|
210
210
|
"onUpdate:modelValue": F[0] || (F[0] = (d) => y.value = d),
|
|
211
|
-
max: f(
|
|
211
|
+
max: f(ft)(/* @__PURE__ */ new Date())
|
|
212
212
|
}, null, 8, ["modelValue", "max"]),
|
|
213
213
|
D(L, { class: "fm-typo-en-body-lg-600" }, {
|
|
214
214
|
default: te(() => F[7] || (F[7] = [
|
|
@@ -227,7 +227,7 @@ const Me = Kn((t, n) => {
|
|
|
227
227
|
"onUpdate:modelValue": F[2] || (F[2] = (d) => e.value = d),
|
|
228
228
|
label: "Remark",
|
|
229
229
|
"label-mark": "required",
|
|
230
|
-
rules: [f(
|
|
230
|
+
rules: [f(ln)()]
|
|
231
231
|
}, null, 8, ["modelValue", "rules"]),
|
|
232
232
|
a("div", ho, [
|
|
233
233
|
D(A, {
|
|
@@ -249,19 +249,19 @@ const Me = Kn((t, n) => {
|
|
|
249
249
|
], 64));
|
|
250
250
|
};
|
|
251
251
|
}
|
|
252
|
-
}), _o =
|
|
252
|
+
}), _o = Qe(0);
|
|
253
253
|
function bt(t) {
|
|
254
|
-
const n = t.measurementsAmounts.groupBy((
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
254
|
+
const n = t.measurementsAmounts.groupBy((e) => e.measurement.id);
|
|
255
|
+
return t.sku.unit.measurements.reduce((e, o) => {
|
|
256
|
+
var r, u;
|
|
257
|
+
const i = ((u = (r = n.get(o.id)) == null ? void 0 : r[0]) == null ? void 0 : u.amount) ?? _o, s = yt(o.conversion, i);
|
|
258
|
+
return qe(e, s);
|
|
259
|
+
}, t.baseAmount);
|
|
260
260
|
}
|
|
261
|
-
const ko =
|
|
261
|
+
const ko = Qe(0), xo = Qe(100);
|
|
262
262
|
function wo(t, n, e, o, i, s, r, u) {
|
|
263
263
|
var O, g, k, x, ee;
|
|
264
|
-
const c = bt(t), b = o ?? c, y =
|
|
264
|
+
const c = bt(t), b = o ?? c, y = cn(b, n), I = n.amount === 0 ? null : un(y, {
|
|
265
265
|
...n,
|
|
266
266
|
amount: Math.abs(n.amount)
|
|
267
267
|
}), E = I ? yt(I, xo) : null, U = ((O = t.sku.defaultCost) == null ? void 0 : O.costPerUnit) ?? { amount: 0, precision: 0 }, R = Number(oe.toFormatString({ value: U })), F = ((k = (g = t.sku.defaultCost) == null ? void 0 : g.measurement) == null ? void 0 : k.conversion) ?? {
|
|
@@ -273,8 +273,8 @@ function wo(t, n, e, o, i, s, r, u) {
|
|
|
273
273
|
return r && s && r.forEach((X) => {
|
|
274
274
|
const T = { amount: 0, precision: 0 }, G = s[X];
|
|
275
275
|
if (G) {
|
|
276
|
-
const $ =
|
|
277
|
-
B[`adjustment_${X}`] =
|
|
276
|
+
const $ = qe(T, G);
|
|
277
|
+
B[`adjustment_${X}`] = Qn($);
|
|
278
278
|
} else
|
|
279
279
|
B[`adjustment_${X}`] = "0";
|
|
280
280
|
}), {
|
|
@@ -295,7 +295,7 @@ function wo(t, n, e, o, i, s, r, u) {
|
|
|
295
295
|
adjustedAmount: Number(oe.toFormatString({ value: y })),
|
|
296
296
|
adjustedDiffPercentage: E ? Number(
|
|
297
297
|
oe.toFormatString({
|
|
298
|
-
value:
|
|
298
|
+
value: dn(E, 2)
|
|
299
299
|
})
|
|
300
300
|
) : null,
|
|
301
301
|
costPerUnit: R,
|
|
@@ -336,7 +336,7 @@ function $o(t, n) {
|
|
|
336
336
|
abbrev: u.abbrev,
|
|
337
337
|
conversion: u.conversion,
|
|
338
338
|
amount: c,
|
|
339
|
-
inactive:
|
|
339
|
+
inactive: It(u, n),
|
|
340
340
|
orphan: !1
|
|
341
341
|
});
|
|
342
342
|
}
|
|
@@ -354,7 +354,7 @@ function $o(t, n) {
|
|
|
354
354
|
return e;
|
|
355
355
|
}
|
|
356
356
|
function Co(t, n = [], e = []) {
|
|
357
|
-
const o =
|
|
357
|
+
const o = an(), i = o === "MYR" ? "RM" : o;
|
|
358
358
|
return [
|
|
359
359
|
{
|
|
360
360
|
id: "code",
|
|
@@ -454,7 +454,7 @@ function Ao(t, n, e, o = [], i) {
|
|
|
454
454
|
y.forEach((T) => {
|
|
455
455
|
c.has(T) && (I.push(T), c.delete(T));
|
|
456
456
|
});
|
|
457
|
-
const E = Array.from(c).sort(), U = [...I, ...E], R = [...t.items, ...t.negativeStockItems ?? []], L =
|
|
457
|
+
const E = Array.from(c).sort(), U = [...I, ...E], R = [...t.items, ...t.negativeStockItems ?? []], L = nn().currentBusiness.value, K = $o(R, i), j = R.map((T) => {
|
|
458
458
|
var ae, ce;
|
|
459
459
|
const G = ((ae = s.get(T.sku._id)) == null ? void 0 : ae[0]) ?? ko, $ = K.get(T.sku._id) ?? [], Y = u.get(T.sku._id), me = b.get(T.sku._id);
|
|
460
460
|
return wo(
|
|
@@ -491,7 +491,7 @@ function Ao(t, n, e, o = [], i) {
|
|
|
491
491
|
[],
|
|
492
492
|
A.map((T) => T.name),
|
|
493
493
|
...j.map((T) => A.map((G) => T[G.id]))
|
|
494
|
-
], d = A.map((T) => `system:${T.id}`), h = Zn(w, d), B = `[${L == null ? void 0 : L.name}] closing draft (${
|
|
494
|
+
], d = A.map((T) => `system:${T.id}`), h = Zn(w, d), B = `[${L == null ? void 0 : L.name}] closing draft (${qn(new Date(t.updatedAt))}).xlsx`;
|
|
495
495
|
return Xn(h, B), B;
|
|
496
496
|
}
|
|
497
497
|
const So = { class: "flex flex-col" }, Fo = {
|
|
@@ -508,7 +508,7 @@ const So = { class: "flex flex-col" }, Fo = {
|
|
|
508
508
|
const n = t;
|
|
509
509
|
gt();
|
|
510
510
|
const e = Q(!1), o = Q(null), i = Q(!1);
|
|
511
|
-
|
|
511
|
+
tn(() => {
|
|
512
512
|
if (n.draft.effectiveAt)
|
|
513
513
|
o.value = new Date(n.draft.effectiveAt);
|
|
514
514
|
else {
|
|
@@ -519,7 +519,7 @@ const So = { class: "flex flex-col" }, Fo = {
|
|
|
519
519
|
});
|
|
520
520
|
const s = S({
|
|
521
521
|
get() {
|
|
522
|
-
return o.value === null ? "" :
|
|
522
|
+
return o.value === null ? "" : ft(o.value);
|
|
523
523
|
},
|
|
524
524
|
set(b) {
|
|
525
525
|
if (b) {
|
|
@@ -530,7 +530,7 @@ const So = { class: "flex flex-col" }, Fo = {
|
|
|
530
530
|
}
|
|
531
531
|
}), r = S({
|
|
532
532
|
get() {
|
|
533
|
-
return o.value === null ? "" :
|
|
533
|
+
return o.value === null ? "" : rn(o.value);
|
|
534
534
|
},
|
|
535
535
|
set(b) {
|
|
536
536
|
if (b) {
|
|
@@ -574,7 +574,7 @@ const So = { class: "flex flex-col" }, Fo = {
|
|
|
574
574
|
D(E, {
|
|
575
575
|
modelValue: s.value,
|
|
576
576
|
"onUpdate:modelValue": y[0] || (y[0] = (L) => s.value = L),
|
|
577
|
-
max: f(
|
|
577
|
+
max: f(ft)(/* @__PURE__ */ new Date())
|
|
578
578
|
}, null, 8, ["modelValue", "max"]),
|
|
579
579
|
D(I, { class: "fm-typo-en-body-lg-600" }, {
|
|
580
580
|
default: te(() => y[4] || (y[4] = [
|
|
@@ -609,10 +609,10 @@ const So = { class: "flex flex-col" }, Fo = {
|
|
|
609
609
|
], 64));
|
|
610
610
|
};
|
|
611
611
|
}
|
|
612
|
-
}), pt =
|
|
612
|
+
}), pt = sn(
|
|
613
613
|
"closingDraftActions",
|
|
614
614
|
function() {
|
|
615
|
-
const n =
|
|
615
|
+
const n = on(), e = ze(), o = gt(), i = Me(), s = no(), r = Bt(), u = Q(!1), c = Q();
|
|
616
616
|
function b(A) {
|
|
617
617
|
const w = {
|
|
618
618
|
draft: A
|
|
@@ -818,7 +818,7 @@ function Ro(t) {
|
|
|
818
818
|
const n = (e = t.usingTemplates) == null ? void 0 : e[0];
|
|
819
819
|
return n != null && n.ref ? n.ref : ht(t).replace(/[^a-z0-9]/gi, "").slice(0, 6).toUpperCase() || "GROUP";
|
|
820
820
|
}
|
|
821
|
-
function
|
|
821
|
+
function At(t) {
|
|
822
822
|
var r, u, c;
|
|
823
823
|
const n = [...t.items, ...t.negativeStockItems ?? []], e = n.filter(To).length, o = Po(t, e), i = n.reduce((b, y) => b + jo(y), 0), s = ((r = t.updatedBy) == null ? void 0 : r.name) || ((u = t.createdBy) == null ? void 0 : u.name) || void 0;
|
|
824
824
|
return {
|
|
@@ -849,10 +849,10 @@ function Mo(t) {
|
|
|
849
849
|
}
|
|
850
850
|
);
|
|
851
851
|
}
|
|
852
|
-
const
|
|
852
|
+
const fn = sn(
|
|
853
853
|
"closingDraftTable",
|
|
854
854
|
function() {
|
|
855
|
-
const { t: n } =
|
|
855
|
+
const { t: n } = Je(), e = nn(), o = pt(), i = Q(new Array()), s = Q(0), r = Q(!1), u = Oe(), c = Me(), b = Q({}), y = Q({});
|
|
856
856
|
async function I() {
|
|
857
857
|
if (i.value = [], !!u._currentLocation) {
|
|
858
858
|
r.value = !0;
|
|
@@ -905,12 +905,12 @@ const vn = rn(
|
|
|
905
905
|
return Object.fromEntries(k);
|
|
906
906
|
}
|
|
907
907
|
function F(g, k) {
|
|
908
|
-
y.value = { ...y.value, [g]: k }, b.value = { ...b.value, [g]: k.map(
|
|
908
|
+
y.value = { ...y.value, [g]: k }, b.value = { ...b.value, [g]: k.map(At) };
|
|
909
909
|
}
|
|
910
910
|
async function L(g) {
|
|
911
911
|
const k = await R(g);
|
|
912
912
|
y.value = k, b.value = Object.fromEntries(
|
|
913
|
-
Object.entries(k).map(([x, ee]) => [x, ee.map(
|
|
913
|
+
Object.entries(k).map(([x, ee]) => [x, ee.map(At)])
|
|
914
914
|
), s.value++;
|
|
915
915
|
}
|
|
916
916
|
async function K(g) {
|
|
@@ -970,7 +970,7 @@ const vn = rn(
|
|
|
970
970
|
o.closeDraftDialog(), I();
|
|
971
971
|
}
|
|
972
972
|
function M(g, k) {
|
|
973
|
-
switch (k =
|
|
973
|
+
switch (k = Yn(k), g) {
|
|
974
974
|
case Ve.Details:
|
|
975
975
|
return o.viewDraft(k);
|
|
976
976
|
case Ve.Export:
|
|
@@ -1125,8 +1125,8 @@ const vn = rn(
|
|
|
1125
1125
|
cell(g) {
|
|
1126
1126
|
var G;
|
|
1127
1127
|
const k = g.row.original, x = ((G = e.sessionUser.value) == null ? void 0 : G.role.isAdmin) ?? !1, ee = [
|
|
1128
|
-
|
|
1129
|
-
|
|
1128
|
+
Xt[Ve.Details],
|
|
1129
|
+
Xt[Ve.Export]
|
|
1130
1130
|
], X = [
|
|
1131
1131
|
{
|
|
1132
1132
|
translationKey: "inventory.closing.draft.approveDraft",
|
|
@@ -1195,12 +1195,12 @@ function Uo(t) {
|
|
|
1195
1195
|
});
|
|
1196
1196
|
continue;
|
|
1197
1197
|
}
|
|
1198
|
-
i.baseAmount =
|
|
1198
|
+
i.baseAmount = qe(i.baseAmount, o.baseAmount);
|
|
1199
1199
|
for (const s of o.measurementsAmounts) {
|
|
1200
1200
|
const r = i.measurementsAmounts.findIndex(
|
|
1201
1201
|
(u) => u.measurement.id === s.measurement.id
|
|
1202
1202
|
);
|
|
1203
|
-
r > -1 ? i.measurementsAmounts[r].amount =
|
|
1203
|
+
r > -1 ? i.measurementsAmounts[r].amount = qe(
|
|
1204
1204
|
i.measurementsAmounts[r].amount,
|
|
1205
1205
|
s.amount
|
|
1206
1206
|
) : i.measurementsAmounts.push({ ...s, amount: { ...s.amount } });
|
|
@@ -1237,7 +1237,7 @@ const No = { class: "fm-typo-en-heading-lg-600" }, Vo = { class: "py-4" }, Eo =
|
|
|
1237
1237
|
},
|
|
1238
1238
|
emits: ["update:show", "refresh", "approve"],
|
|
1239
1239
|
setup(t, { emit: n }) {
|
|
1240
|
-
const { FmStepper: e, FmStep: o, FmDialog: i, FmButton: s } = ye, { t: r } = io(), u =
|
|
1240
|
+
const { FmStepper: e, FmStep: o, FmDialog: i, FmButton: s } = ye, { t: r } = io(), u = Ft(), c = t, b = n, y = S(
|
|
1241
1241
|
() => {
|
|
1242
1242
|
var $, Y;
|
|
1243
1243
|
return (($ = c.draft) == null ? void 0 : $.stockSnapshot) && ((Y = c.draft) == null ? void 0 : Y.stockSnapshot) !== void 0;
|
|
@@ -1515,7 +1515,7 @@ const No = { class: "fm-typo-en-heading-lg-600" }, Vo = { class: "py-4" }, Eo =
|
|
|
1515
1515
|
}
|
|
1516
1516
|
});
|
|
1517
1517
|
function ia(t) {
|
|
1518
|
-
const n = Me(), e = oo(), o = ze(), { t: i } =
|
|
1518
|
+
const n = Me(), e = oo(), o = ze(), { t: i } = Je(), s = Q(!1), r = Q(null);
|
|
1519
1519
|
let u = !1, c = null, b = !1, y = !1;
|
|
1520
1520
|
function I() {
|
|
1521
1521
|
L();
|
|
@@ -1622,7 +1622,7 @@ function ia(t) {
|
|
|
1622
1622
|
([z, A], [w, d]) => {
|
|
1623
1623
|
y && (z === w && A === d || I());
|
|
1624
1624
|
}
|
|
1625
|
-
),
|
|
1625
|
+
), Un(() => {
|
|
1626
1626
|
j();
|
|
1627
1627
|
}), {
|
|
1628
1628
|
refreshing: s,
|
|
@@ -1662,14 +1662,14 @@ const ua = { class: "flex items-start justify-between gap-8" }, da = { class: "f
|
|
|
1662
1662
|
});
|
|
1663
1663
|
return (u, c) => (p(), C("div", {
|
|
1664
1664
|
class: "flex flex-col gap-8 rounded-lg border border-fm-color-neutral-gray-200 bg-white p-16 cursor-pointer hover:border-fm-color-primary",
|
|
1665
|
-
onClick: c[0] || (c[0] =
|
|
1665
|
+
onClick: c[0] || (c[0] = Nn((b) => o("select", u.group.id), ["stop"]))
|
|
1666
1666
|
}, [
|
|
1667
1667
|
a("div", ua, [
|
|
1668
1668
|
a("div", da, [
|
|
1669
1669
|
u.group.color ? (p(), C("span", {
|
|
1670
1670
|
key: 0,
|
|
1671
1671
|
class: "w-8 h-8 rounded-full shrink-0",
|
|
1672
|
-
style:
|
|
1672
|
+
style: mt({ backgroundColor: u.group.color })
|
|
1673
1673
|
}, null, 4)) : H("", !0),
|
|
1674
1674
|
a("span", ma, N(u.group.name), 1)
|
|
1675
1675
|
]),
|
|
@@ -1708,7 +1708,7 @@ const ua = { class: "flex items-start justify-between gap-8" }, da = { class: "f
|
|
|
1708
1708
|
])) : (p(), C("div", ba, "No closing groups"));
|
|
1709
1709
|
}
|
|
1710
1710
|
});
|
|
1711
|
-
function
|
|
1711
|
+
function pn(t, n) {
|
|
1712
1712
|
const e = t.sku, o = [], i = Number(oe.toFormatString({ value: t.baseAmount }));
|
|
1713
1713
|
i && o.push({
|
|
1714
1714
|
label: "Base",
|
|
@@ -1741,20 +1741,20 @@ function yn(t, n) {
|
|
|
1741
1741
|
};
|
|
1742
1742
|
for (const c of e.unit.measurements) {
|
|
1743
1743
|
const b = s.get(c.id);
|
|
1744
|
-
b && u(c.abbrev, c.conversion, b,
|
|
1744
|
+
b && u(c.abbrev, c.conversion, b, It(c, n), !1);
|
|
1745
1745
|
}
|
|
1746
1746
|
for (const c of t.measurementsAmounts)
|
|
1747
1747
|
r.has(c.measurement.id) || u(c.measurement.abbrev, c.measurement.conversion, c.amount, !1, !0);
|
|
1748
1748
|
return o;
|
|
1749
1749
|
}
|
|
1750
|
-
const
|
|
1750
|
+
const ut = (t) => ie(t, { minPrecision: 0, maxPrecision: 3 });
|
|
1751
1751
|
function _a(t, n) {
|
|
1752
1752
|
return n ? "text-fm-color-system-error-300" : t ? "text-purple-500" : "";
|
|
1753
1753
|
}
|
|
1754
1754
|
function ka(t, n) {
|
|
1755
1755
|
return n ? _(ye.FmIcon, { name: "warning", size: "sm", color: "system-error-300" }) : t ? _(ye.FmIcon, { name: "rule", size: "sm" }) : null;
|
|
1756
1756
|
}
|
|
1757
|
-
function
|
|
1757
|
+
function vn(t, n, e) {
|
|
1758
1758
|
return _(
|
|
1759
1759
|
"div",
|
|
1760
1760
|
{
|
|
@@ -1772,19 +1772,19 @@ function gn(t, n, e) {
|
|
|
1772
1772
|
_(
|
|
1773
1773
|
"div",
|
|
1774
1774
|
{ class: o.counted ? "" : "line-through text-fm-color-typo-tertiary" },
|
|
1775
|
-
o.orphan ? `${
|
|
1775
|
+
o.orphan ? `${ut(o.amount)} ${o.abbrev} (no valid conversion)` : o.counted ? `${ut(o.subtotal)} ${e}` : `${ut(o.subtotal)} ${e} (ignored)`
|
|
1776
1776
|
)
|
|
1777
1777
|
])
|
|
1778
1778
|
),
|
|
1779
1779
|
_("hr", { class: "border-fm-color-typo-secondary my-4" }),
|
|
1780
1780
|
_("div", { class: "flex justify-between fm-typo-en-body-lg-600" }, [
|
|
1781
1781
|
_("span", "Total"),
|
|
1782
|
-
_("span", `${
|
|
1782
|
+
_("span", `${ut(n)} ${e}`)
|
|
1783
1783
|
])
|
|
1784
1784
|
]
|
|
1785
1785
|
);
|
|
1786
1786
|
}
|
|
1787
|
-
function
|
|
1787
|
+
function Tt(t, n) {
|
|
1788
1788
|
const e = t.sku, o = Number(oe.toFormatString({ value: t.baseAmount })), i = new Map(
|
|
1789
1789
|
t.measurementsAmounts.map((c) => [c.measurement.id, c.amount])
|
|
1790
1790
|
), s = new Set(e.unit.measurements.map((c) => c.id)), r = [], u = (c, b, y, I, E) => {
|
|
@@ -1797,14 +1797,14 @@ function jt(t, n) {
|
|
|
1797
1797
|
};
|
|
1798
1798
|
for (const c of e.unit.measurements) {
|
|
1799
1799
|
const b = i.get(c.id);
|
|
1800
|
-
b && u(c.abbrev, c.conversion, b,
|
|
1800
|
+
b && u(c.abbrev, c.conversion, b, It(c, n), !1);
|
|
1801
1801
|
}
|
|
1802
1802
|
for (const c of t.measurementsAmounts)
|
|
1803
1803
|
s.has(c.measurement.id) || u(c.measurement.abbrev, c.measurement.conversion, c.amount, !1, !0);
|
|
1804
1804
|
return { baseUnitAmount: o, measurements: r };
|
|
1805
1805
|
}
|
|
1806
|
-
function
|
|
1807
|
-
const o = t.sku, { baseUnitAmount: i, measurements: s } =
|
|
1806
|
+
function en(t, n, e) {
|
|
1807
|
+
const o = t.sku, { baseUnitAmount: i, measurements: s } = Tt(t, e);
|
|
1808
1808
|
return {
|
|
1809
1809
|
id: o._id,
|
|
1810
1810
|
code: o.code,
|
|
@@ -1814,17 +1814,17 @@ function tn(t, n, e) {
|
|
|
1814
1814
|
isTemplateItem: n,
|
|
1815
1815
|
measurements: s,
|
|
1816
1816
|
physicalBalance: Number(oe.toFormatString({ value: bt(t) })),
|
|
1817
|
-
breakdown:
|
|
1817
|
+
breakdown: pn(t, e)
|
|
1818
1818
|
};
|
|
1819
1819
|
}
|
|
1820
1820
|
function xa(t, n) {
|
|
1821
1821
|
const e = [
|
|
1822
|
-
...t.items.map((o) =>
|
|
1823
|
-
...(t.negativeStockItems ?? []).map((o) =>
|
|
1822
|
+
...t.items.map((o) => en(o, !0, n)),
|
|
1823
|
+
...(t.negativeStockItems ?? []).map((o) => en(o, !1, n))
|
|
1824
1824
|
];
|
|
1825
1825
|
return e.sort((o, i) => o.code.localeCompare(i.code)), e;
|
|
1826
1826
|
}
|
|
1827
|
-
function
|
|
1827
|
+
function jt(t, n, e) {
|
|
1828
1828
|
const o = (r, u, c = "normal") => _(
|
|
1829
1829
|
ye.FmTooltip,
|
|
1830
1830
|
{ zIndex: 50 },
|
|
@@ -1864,7 +1864,7 @@ function wa(t, n, e) {
|
|
|
1864
1864
|
for (const i of n) {
|
|
1865
1865
|
const s = i.items.find((b) => b.sku._id === t);
|
|
1866
1866
|
if (!s) continue;
|
|
1867
|
-
const { baseUnitAmount: r, measurements: u } =
|
|
1867
|
+
const { baseUnitAmount: r, measurements: u } = Tt(s, e);
|
|
1868
1868
|
(r !== 0 || u.some((b) => b.amount !== 0)) && o.push({ label: i.label, isSub: i.isSub, baseUnitAmount: r, measurements: u });
|
|
1869
1869
|
}
|
|
1870
1870
|
return o;
|
|
@@ -1880,13 +1880,13 @@ function Da(t, n) {
|
|
|
1880
1880
|
{ class: "fm-typo-en-body-sm-600 text-fm-color-typo-tertiary uppercase" },
|
|
1881
1881
|
e.label
|
|
1882
1882
|
),
|
|
1883
|
-
|
|
1883
|
+
jt(e.baseUnitAmount, n, e.measurements)
|
|
1884
1884
|
])
|
|
1885
1885
|
)
|
|
1886
1886
|
);
|
|
1887
1887
|
}
|
|
1888
1888
|
const $a = "N/A";
|
|
1889
|
-
function
|
|
1889
|
+
function yn(t, n) {
|
|
1890
1890
|
var o, i;
|
|
1891
1891
|
const e = t.approvedAt ? {
|
|
1892
1892
|
action: `Approve at ${$e(t.approvedAt)}`,
|
|
@@ -1975,7 +1975,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
1975
1975
|
"onUpdate:modelValue": I[0] || (I[0] = (F) => i.value = F),
|
|
1976
1976
|
label: "Remark",
|
|
1977
1977
|
"label-mark": "required",
|
|
1978
|
-
rules: [f(
|
|
1978
|
+
rules: [f(ln)()]
|
|
1979
1979
|
}, null, 8, ["modelValue", "rules"]),
|
|
1980
1980
|
a("div", Sa, [
|
|
1981
1981
|
D(U, {
|
|
@@ -2028,7 +2028,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2028
2028
|
},
|
|
2029
2029
|
emits: ["update:show", "updated"],
|
|
2030
2030
|
setup(t, { emit: n }) {
|
|
2031
|
-
const e = t, o = n, i =
|
|
2031
|
+
const e = t, o = n, i = St(e, "show"), s = Bt(), r = Oe(), u = on(), c = S(() => {
|
|
2032
2032
|
var d, h, B;
|
|
2033
2033
|
return ((B = (h = (d = e.group) == null ? void 0 : d.usingTemplates) == null ? void 0 : h.find((M) => M)) == null ? void 0 : B.name) ?? "Group";
|
|
2034
2034
|
}), b = S(() => {
|
|
@@ -2051,7 +2051,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2051
2051
|
}
|
|
2052
2052
|
const I = S(() => {
|
|
2053
2053
|
var d;
|
|
2054
|
-
return e.group ?
|
|
2054
|
+
return e.group ? yn(e.group, {
|
|
2055
2055
|
locationName: (d = r._currentLocation) == null ? void 0 : d.name
|
|
2056
2056
|
}) : [];
|
|
2057
2057
|
}), E = [
|
|
@@ -2134,7 +2134,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2134
2134
|
},
|
|
2135
2135
|
[B, _(ye.FmIcon, { name: "info", size: "sm", outline: !0 })]
|
|
2136
2136
|
),
|
|
2137
|
-
default: () =>
|
|
2137
|
+
default: () => vn(h.breakdown, h.physicalBalance, h.baseUnit)
|
|
2138
2138
|
}
|
|
2139
2139
|
) : B;
|
|
2140
2140
|
},
|
|
@@ -2146,7 +2146,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2146
2146
|
enableSorting: !1,
|
|
2147
2147
|
cell(d) {
|
|
2148
2148
|
const h = d.row.original;
|
|
2149
|
-
return
|
|
2149
|
+
return jt(h.baseUnitAmount, h.baseUnit, h.measurements);
|
|
2150
2150
|
}
|
|
2151
2151
|
}
|
|
2152
2152
|
]), w = S(() => {
|
|
@@ -2366,7 +2366,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2366
2366
|
D(ee),
|
|
2367
2367
|
a("div", null, [
|
|
2368
2368
|
a("img", {
|
|
2369
|
-
src: f(
|
|
2369
|
+
src: f(mn),
|
|
2370
2370
|
alt: "List is empty"
|
|
2371
2371
|
}, null, 8, Ha)
|
|
2372
2372
|
]),
|
|
@@ -2430,12 +2430,12 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2430
2430
|
emits: ["submitted", "refresh"],
|
|
2431
2431
|
setup(t, { emit: n }) {
|
|
2432
2432
|
const e = t, o = S(() => {
|
|
2433
|
-
const m =
|
|
2433
|
+
const m = an();
|
|
2434
2434
|
return m === "MYR" ? "RM" : m;
|
|
2435
|
-
}), i =
|
|
2435
|
+
}), i = fn(), s = S(() => {
|
|
2436
2436
|
var m, l;
|
|
2437
2437
|
return (m = e.draft) != null && m.closingId ? ((l = i.drafts.find((v) => v._id === e.draft._id)) == null ? void 0 : l.closingIdDisplay) ?? null : null;
|
|
2438
|
-
}), r = pt(), u = Me(), c =
|
|
2438
|
+
}), r = pt(), u = Me(), c = St(e, "show"), b = Q(!1), y = Q(!1), I = Q([]);
|
|
2439
2439
|
let E = 0;
|
|
2440
2440
|
async function U() {
|
|
2441
2441
|
var v;
|
|
@@ -2451,7 +2451,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2451
2451
|
console.error("Failed to fetch closing groups", V);
|
|
2452
2452
|
}
|
|
2453
2453
|
}
|
|
2454
|
-
const R = S(() => I.value.map(
|
|
2454
|
+
const R = S(() => I.value.map(At)), F = S(() => {
|
|
2455
2455
|
var m, l, v;
|
|
2456
2456
|
return (v = (l = (m = e.draft) == null ? void 0 : m.usingTemplates) == null ? void 0 : l.find((V) => V)) == null ? void 0 : v.name;
|
|
2457
2457
|
}), L = Q(null), K = Q(!1);
|
|
@@ -2478,7 +2478,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2478
2478
|
W.adjustmentsByType && Object.keys(W.adjustmentsByType).forEach((P) => m.add(P));
|
|
2479
2479
|
const v = ["receive", "sales", "wastage"].filter((W) => m.has(W));
|
|
2480
2480
|
return v.forEach((W) => m.delete(W)), [...v, ...Array.from(m).sort()];
|
|
2481
|
-
}), M = gt(), O = ze(), g =
|
|
2481
|
+
}), M = gt(), O = ze(), g = Ft(), k = Oe(), x = Zt({}), ee = S(() => new Set(
|
|
2482
2482
|
g.skus.filter((m) => {
|
|
2483
2483
|
var l;
|
|
2484
2484
|
return x[(l = m.customAttributes) == null ? void 0 : l.tag];
|
|
@@ -2507,7 +2507,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2507
2507
|
function Te(m, l) {
|
|
2508
2508
|
pe.value = l ? m : pe.value === m ? null : pe.value;
|
|
2509
2509
|
}
|
|
2510
|
-
const
|
|
2510
|
+
const Ze = S(() => {
|
|
2511
2511
|
var m, l;
|
|
2512
2512
|
return [
|
|
2513
2513
|
{
|
|
@@ -2534,7 +2534,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2534
2534
|
}), Se = S(() => {
|
|
2535
2535
|
const m = Ge.value.map((l) => l.sku);
|
|
2536
2536
|
return m.sort((l, v) => l.code.localeCompare(v.code)), m;
|
|
2537
|
-
}), Fe =
|
|
2537
|
+
}), Fe = Bt();
|
|
2538
2538
|
Be(
|
|
2539
2539
|
() => e.show,
|
|
2540
2540
|
async (m) => {
|
|
@@ -2551,12 +2551,12 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2551
2551
|
), Be(
|
|
2552
2552
|
[() => e.show, T],
|
|
2553
2553
|
([m]) => {
|
|
2554
|
-
m && (U(),
|
|
2554
|
+
m && (U(), bn());
|
|
2555
2555
|
},
|
|
2556
2556
|
{ immediate: !0 }
|
|
2557
2557
|
);
|
|
2558
|
-
const
|
|
2559
|
-
async function
|
|
2558
|
+
const Xe = S(() => tt.value.reduce((m, l) => m + Number(l.stockTakeValue), 0)), et = Qe(0), gn = Qe(100);
|
|
2559
|
+
async function bn() {
|
|
2560
2560
|
var m, l;
|
|
2561
2561
|
if (k._currentLocation) {
|
|
2562
2562
|
b.value = !0, z.value = [], A.value = [];
|
|
@@ -2595,7 +2595,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2595
2595
|
}
|
|
2596
2596
|
}
|
|
2597
2597
|
}
|
|
2598
|
-
async function
|
|
2598
|
+
async function Pt() {
|
|
2599
2599
|
var l, v;
|
|
2600
2600
|
if ($.value)
|
|
2601
2601
|
return;
|
|
@@ -2616,7 +2616,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2616
2616
|
}
|
|
2617
2617
|
);
|
|
2618
2618
|
}
|
|
2619
|
-
async function
|
|
2619
|
+
async function hn() {
|
|
2620
2620
|
var l, v;
|
|
2621
2621
|
if (!(((l = e.draft) == null ? void 0 : l.effectiveAt) ?? (e.draft ? Re((v = e.draft) == null ? void 0 : v._id) : null))) {
|
|
2622
2622
|
O.open({
|
|
@@ -2628,15 +2628,15 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2628
2628
|
}
|
|
2629
2629
|
await r.invalidateDraftCache(e.draft);
|
|
2630
2630
|
}
|
|
2631
|
-
const
|
|
2631
|
+
const _n = S(
|
|
2632
2632
|
() => d.value.groupBy(
|
|
2633
2633
|
(m) => m.id,
|
|
2634
2634
|
(m) => m.balance
|
|
2635
2635
|
)
|
|
2636
|
-
),
|
|
2636
|
+
), kn = S(() => Ge.value.groupBy((m) => m.sku._id)), xn = S(() => {
|
|
2637
2637
|
var m;
|
|
2638
2638
|
return (m = e.draft) != null && m.adjustmentSnapshot ? new Map(e.draft.adjustmentSnapshot.map((l) => [l.skuId, l.adjustmentsByType])) : /* @__PURE__ */ new Map();
|
|
2639
|
-
}),
|
|
2639
|
+
}), wn = S(() => {
|
|
2640
2640
|
var m;
|
|
2641
2641
|
return (m = e.draft) != null && m.opening ? new Map(e.draft.opening.map((l) => [l.skuId, l.balance])) : /* @__PURE__ */ new Map();
|
|
2642
2642
|
});
|
|
@@ -2654,7 +2654,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2654
2654
|
}
|
|
2655
2655
|
);
|
|
2656
2656
|
}
|
|
2657
|
-
const
|
|
2657
|
+
const Rt = S(() => [
|
|
2658
2658
|
{
|
|
2659
2659
|
id: "sku",
|
|
2660
2660
|
accessorFn: (l) => `${l.code} ${l.name}`,
|
|
@@ -2714,7 +2714,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2714
2714
|
}
|
|
2715
2715
|
},
|
|
2716
2716
|
// Dynamic custom attribute columns (toggled by user)
|
|
2717
|
-
...
|
|
2717
|
+
...Nt.value.map(
|
|
2718
2718
|
(l) => ({
|
|
2719
2719
|
id: `customAttr_${l}`,
|
|
2720
2720
|
accessorFn: (v) => v.customAttributeValues[l],
|
|
@@ -2860,7 +2860,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2860
2860
|
_(ye.FmIcon, { name: "info", size: "sm", outline: !0 })
|
|
2861
2861
|
]
|
|
2862
2862
|
),
|
|
2863
|
-
default: () =>
|
|
2863
|
+
default: () => vn(v.breakdown, v.physicalBalance, v.baseUnit)
|
|
2864
2864
|
}
|
|
2865
2865
|
) : le;
|
|
2866
2866
|
},
|
|
@@ -3036,10 +3036,10 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3036
3036
|
enableSorting: !1,
|
|
3037
3037
|
cell(l) {
|
|
3038
3038
|
const v = l.row.original;
|
|
3039
|
-
return I.value.length && v.sourceBuckets.length ? Da(v.sourceBuckets, v.baseUnit) :
|
|
3039
|
+
return I.value.length && v.sourceBuckets.length ? Da(v.sourceBuckets, v.baseUnit) : jt(v.baseUnitAmount, v.baseUnit, v.measurements);
|
|
3040
3040
|
}
|
|
3041
3041
|
}
|
|
3042
|
-
]),
|
|
3042
|
+
]), Dn = S(() => Rt.value.map((m) => m.size ?? 0).reduce((m, l) => m + l)), _t = Q(""), $n = S(() => {
|
|
3043
3043
|
var V, W;
|
|
3044
3044
|
const m = ((W = (V = e.draft) == null ? void 0 : V.negativeStockItems) == null ? void 0 : W.reduce(
|
|
3045
3045
|
(P, Z) => (P[Z.sku._id] = Z, P),
|
|
@@ -3048,23 +3048,23 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3048
3048
|
h.value.map((P) => [P.id, P.balance])
|
|
3049
3049
|
);
|
|
3050
3050
|
return Se.value.map((P) => {
|
|
3051
|
-
var Gt, Ht, Yt, Kt, Wt, qt, Qt, Jt
|
|
3052
|
-
const Z = (
|
|
3051
|
+
var Ot, Gt, Ht, Yt, Kt, Wt, qt, Qt, Jt;
|
|
3052
|
+
const Z = (Ot = kn.value.get(P._id)) == null ? void 0 : Ot[0], le = ((Gt = _n.value.get(P._id)) == null ? void 0 : Gt[0]) ?? et, ue = ((Ht = P.defaultCost) == null ? void 0 : Ht.costPerUnit) ?? et, se = Number(oe.toFormatString({ value: ue })), je = ((Kt = (Yt = P.defaultCost) == null ? void 0 : Yt.measurement) == null ? void 0 : Kt.conversion) ?? {
|
|
3053
3053
|
amount: 1,
|
|
3054
3054
|
precision: 0
|
|
3055
3055
|
}, Ce = Number(
|
|
3056
3056
|
oe.toFormatString({ value: je })
|
|
3057
|
-
),
|
|
3057
|
+
), st = wn.value.get(P._id), rt = st ? Number(oe.toFormatString({ value: st })) : 0, q = xn.value.get(P._id), ve = {};
|
|
3058
3058
|
if (B.value.forEach((ke) => {
|
|
3059
|
-
const
|
|
3060
|
-
|
|
3059
|
+
const it = ve[ke] ?? { amount: 0, precision: 0 }, ct = q == null ? void 0 : q[ke];
|
|
3060
|
+
ct && (ve[ke] = qe(it, ct));
|
|
3061
3061
|
}), !Z) {
|
|
3062
|
-
const ke = Number(oe.toFormatString({ value: le })),
|
|
3062
|
+
const ke = Number(oe.toFormatString({ value: le })), it = 0 - ke, ct = it * se / Ce, Rn = 0, Mn = ke * se / Ce;
|
|
3063
3063
|
return {
|
|
3064
3064
|
id: P._id,
|
|
3065
3065
|
code: P.code,
|
|
3066
3066
|
name: P.name,
|
|
3067
|
-
costUnit: ((
|
|
3067
|
+
costUnit: ((qt = (Wt = P.defaultCost) == null ? void 0 : Wt.measurement) == null ? void 0 : qt.abbrev) ?? null,
|
|
3068
3068
|
baseUnit: P.unit.abbrev,
|
|
3069
3069
|
baseUnitAmount: 0,
|
|
3070
3070
|
systemBalance: ke,
|
|
@@ -3073,11 +3073,11 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3073
3073
|
adjustedDiffPercentage: -100,
|
|
3074
3074
|
isTemplateItem: !m[P._id],
|
|
3075
3075
|
costPerUnit: se,
|
|
3076
|
-
opening:
|
|
3077
|
-
varianceQty:
|
|
3078
|
-
varianceInCost:
|
|
3079
|
-
stockTakeValue:
|
|
3080
|
-
systemValue:
|
|
3076
|
+
opening: rt,
|
|
3077
|
+
varianceQty: it,
|
|
3078
|
+
varianceInCost: ct,
|
|
3079
|
+
stockTakeValue: Rn,
|
|
3080
|
+
systemValue: Mn,
|
|
3081
3081
|
adjustmentAmounts: ve,
|
|
3082
3082
|
customAttributeValues: P.customAttributes ?? {},
|
|
3083
3083
|
measurements: [],
|
|
@@ -3086,49 +3086,49 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3086
3086
|
subSources: []
|
|
3087
3087
|
};
|
|
3088
3088
|
}
|
|
3089
|
-
const be = bt(Z), Ie = l.get(P._id), Ne =
|
|
3089
|
+
const be = bt(Z), Ie = l.get(P._id), Ne = cn(
|
|
3090
3090
|
Ie ?? be,
|
|
3091
3091
|
le
|
|
3092
|
-
),
|
|
3092
|
+
), lt = le.amount === 0 ? null : un(Ne, {
|
|
3093
3093
|
...le,
|
|
3094
3094
|
amount: Math.abs(le.amount)
|
|
3095
|
-
}),
|
|
3095
|
+
}), Et = lt ? yt(lt, gn) : null, wt = Number(oe.toFormatString({ value: le })), Dt = Number(oe.toFormatString({ value: be })), Lt = Dt - wt, Fn = Lt * se / Ce, In = Dt * se / Ce, Bn = wt * se / Ce, { baseUnitAmount: Tn, measurements: jn } = Tt(Z, Fe.value), Pn = pn(Z, Fe.value), zt = wa(P._id, Ze.value, Fe.value);
|
|
3096
3096
|
return {
|
|
3097
3097
|
id: P._id,
|
|
3098
3098
|
code: P.code,
|
|
3099
3099
|
name: P.name,
|
|
3100
|
-
costUnit: ((
|
|
3100
|
+
costUnit: ((Jt = (Qt = P.defaultCost) == null ? void 0 : Qt.measurement) == null ? void 0 : Jt.abbrev) ?? null,
|
|
3101
3101
|
baseUnit: P.unit.abbrev,
|
|
3102
|
-
baseUnitAmount:
|
|
3103
|
-
measurements:
|
|
3104
|
-
breakdown:
|
|
3102
|
+
baseUnitAmount: Tn,
|
|
3103
|
+
measurements: jn,
|
|
3104
|
+
breakdown: Pn,
|
|
3105
3105
|
systemBalance: wt,
|
|
3106
3106
|
physicalBalance: Dt,
|
|
3107
3107
|
adjustedAmount: Number(oe.toFormatString({ value: Ne })),
|
|
3108
|
-
adjustedDiffPercentage:
|
|
3108
|
+
adjustedDiffPercentage: Et ? Number(
|
|
3109
3109
|
oe.toFormatString({
|
|
3110
|
-
value:
|
|
3110
|
+
value: dn(Et, 2)
|
|
3111
3111
|
})
|
|
3112
3112
|
) : null,
|
|
3113
3113
|
isTemplateItem: !m[P._id],
|
|
3114
3114
|
costPerUnit: se,
|
|
3115
|
-
opening:
|
|
3116
|
-
varianceQty:
|
|
3117
|
-
varianceInCost:
|
|
3118
|
-
stockTakeValue:
|
|
3119
|
-
systemValue:
|
|
3115
|
+
opening: rt,
|
|
3116
|
+
varianceQty: Lt,
|
|
3117
|
+
varianceInCost: Fn,
|
|
3118
|
+
stockTakeValue: In,
|
|
3119
|
+
systemValue: Bn,
|
|
3120
3120
|
adjustmentAmounts: ve,
|
|
3121
3121
|
customAttributeValues: P.customAttributes ?? {},
|
|
3122
|
-
sourceBuckets:
|
|
3123
|
-
subSources:
|
|
3122
|
+
sourceBuckets: zt,
|
|
3123
|
+
subSources: zt.filter((ke) => ke.isSub).map((ke) => ke.label)
|
|
3124
3124
|
};
|
|
3125
3125
|
});
|
|
3126
|
-
}),
|
|
3127
|
-
() =>
|
|
3128
|
-
),
|
|
3129
|
-
() =>
|
|
3130
|
-
),
|
|
3131
|
-
() =>
|
|
3126
|
+
}), tt = S(() => $n.value.filter((m) => !!(m.isTemplateItem && ce.value.templateItem || !m.isTemplateItem && ce.value.nonTemplateItem))), Mt = S(
|
|
3127
|
+
() => tt.value.some((m) => m.measurements.some((l) => l.variant === "inactive"))
|
|
3128
|
+
), Ut = S(
|
|
3129
|
+
() => tt.value.some((m) => m.measurements.some((l) => l.variant === "orphan"))
|
|
3130
|
+
), Cn = S(
|
|
3131
|
+
() => Mt.value || Ut.value
|
|
3132
3132
|
), kt = S(() => {
|
|
3133
3133
|
const m = /* @__PURE__ */ new Set();
|
|
3134
3134
|
for (const l of Se.value)
|
|
@@ -3136,11 +3136,11 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3136
3136
|
for (const v of Object.keys(l.customAttributes))
|
|
3137
3137
|
v !== "tag" && m.add(v);
|
|
3138
3138
|
return Array.from(m).sort();
|
|
3139
|
-
}),
|
|
3140
|
-
() => kt.value.filter((m) =>
|
|
3141
|
-
),
|
|
3139
|
+
}), nt = Zt({}), Nt = S(
|
|
3140
|
+
() => kt.value.filter((m) => nt[m])
|
|
3141
|
+
), An = S(() => {
|
|
3142
3142
|
var m;
|
|
3143
|
-
return e.draft ?
|
|
3143
|
+
return e.draft ? yn(e.draft, {
|
|
3144
3144
|
idDisplay: s.value,
|
|
3145
3145
|
locationName: (m = k._currentLocation) == null ? void 0 : m.name
|
|
3146
3146
|
}) : [];
|
|
@@ -3191,25 +3191,25 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3191
3191
|
]
|
|
3192
3192
|
})
|
|
3193
3193
|
);
|
|
3194
|
-
}),
|
|
3194
|
+
}), ot = Q(!1), at = Q(!1), Vt = S(() => {
|
|
3195
3195
|
var m;
|
|
3196
3196
|
return ((m = e.draft) == null ? void 0 : m.status) !== _e.enum.DRAFT ? "Status is not draft." : null;
|
|
3197
3197
|
});
|
|
3198
|
-
function
|
|
3199
|
-
e.draft && (
|
|
3198
|
+
function Sn() {
|
|
3199
|
+
e.draft && (at.value = !0, r.approveDraft(
|
|
3200
3200
|
e.draft,
|
|
3201
3201
|
() => {
|
|
3202
|
-
|
|
3202
|
+
at.value = !1, ot.value = !1, X("submitted");
|
|
3203
3203
|
},
|
|
3204
3204
|
() => {
|
|
3205
|
-
|
|
3205
|
+
at.value = !1;
|
|
3206
3206
|
}
|
|
3207
3207
|
));
|
|
3208
3208
|
}
|
|
3209
3209
|
return (m, l) => {
|
|
3210
|
-
const v = J("FmButtonGroup"), V = J("FmMenuDivider"), W = J("FmCard"), P = J("FmIcon"), Z = J("FmButton"), le = J("FmCircularProgress"), ue = J("FmChip"), se = J("FmTextField"), je = J("FmTable"), Ce = J("FmSpacer"),
|
|
3210
|
+
const v = J("FmButtonGroup"), V = J("FmMenuDivider"), W = J("FmCard"), P = J("FmIcon"), Z = J("FmButton"), le = J("FmCircularProgress"), ue = J("FmChip"), se = J("FmTextField"), je = J("FmTable"), Ce = J("FmSpacer"), st = J("FmTooltip"), rt = J("FmSideSheet");
|
|
3211
3211
|
return p(), C(re, null, [
|
|
3212
|
-
D(
|
|
3212
|
+
D(rt, {
|
|
3213
3213
|
"dismiss-away": "",
|
|
3214
3214
|
"max-width": 9999,
|
|
3215
3215
|
"model-value": f(c),
|
|
@@ -3222,13 +3222,13 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3222
3222
|
a("div", Zs, [
|
|
3223
3223
|
a("div", Xs, [
|
|
3224
3224
|
((q = e.draft) == null ? void 0 : q.status) === f(_e).enum.DRAFT ? (p(), C(re, { key: 0 }, [
|
|
3225
|
-
|
|
3225
|
+
Vt.value ? (p(), ne(st, {
|
|
3226
3226
|
key: 0,
|
|
3227
3227
|
"z-index": 51,
|
|
3228
3228
|
placement: "right"
|
|
3229
3229
|
}, {
|
|
3230
3230
|
content: te(() => [
|
|
3231
|
-
fe(N(
|
|
3231
|
+
fe(N(Vt.value), 1)
|
|
3232
3232
|
]),
|
|
3233
3233
|
default: te(() => [
|
|
3234
3234
|
D(Z, {
|
|
@@ -3241,7 +3241,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3241
3241
|
})) : (p(), ne(Z, {
|
|
3242
3242
|
key: "approve key",
|
|
3243
3243
|
label: "Approve",
|
|
3244
|
-
onClick: l[5] || (l[5] = (Ne) =>
|
|
3244
|
+
onClick: l[5] || (l[5] = (Ne) => ot.value = !0)
|
|
3245
3245
|
}))
|
|
3246
3246
|
], 64)) : H("", !0),
|
|
3247
3247
|
((ve = e.draft) == null ? void 0 : ve.status) === f(_e).enum.DRAFT ? (p(), ne(Z, {
|
|
@@ -3272,7 +3272,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3272
3272
|
]),
|
|
3273
3273
|
a("div", er, [
|
|
3274
3274
|
l[25] || (l[25] = a("div", { class: "text-xs text-gray-500 uppercase tracking-wide" }, "Total stock take value", -1)),
|
|
3275
|
-
a("div", tr, N(o.value) + " " + N(
|
|
3275
|
+
a("div", tr, N(o.value) + " " + N(Xe.value.toFixed(2)), 1)
|
|
3276
3276
|
])
|
|
3277
3277
|
])
|
|
3278
3278
|
];
|
|
@@ -3318,7 +3318,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3318
3318
|
]),
|
|
3319
3319
|
D(V),
|
|
3320
3320
|
a("div", fs, [
|
|
3321
|
-
(p(!0), C(re, null, ge(
|
|
3321
|
+
(p(!0), C(re, null, ge(An.value, (be, Ie) => (p(), C("div", {
|
|
3322
3322
|
class: "flex flex-col gap-4",
|
|
3323
3323
|
key: Ie
|
|
3324
3324
|
}, [
|
|
@@ -3350,7 +3350,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3350
3350
|
]),
|
|
3351
3351
|
_: 1
|
|
3352
3352
|
})) : H("", !0),
|
|
3353
|
-
|
|
3353
|
+
Cn.value ? (p(), C("div", hs, [
|
|
3354
3354
|
D(P, {
|
|
3355
3355
|
name: "rule",
|
|
3356
3356
|
size: "sm"
|
|
@@ -3358,12 +3358,12 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3358
3358
|
a("div", _s, [
|
|
3359
3359
|
l[16] || (l[16] = a("div", { class: "fm-typo-en-body-md-600" }, "UOM notes", -1)),
|
|
3360
3360
|
a("ul", ks, [
|
|
3361
|
-
|
|
3361
|
+
Mt.value ? (p(), C("li", xs, l[15] || (l[15] = [
|
|
3362
3362
|
fe(" Measurements highlighted in "),
|
|
3363
3363
|
a("span", { class: "font-bold" }, "purple", -1),
|
|
3364
3364
|
fe(" are NetSuite-inactive UOMs (surfaced for audit; their amounts are part of the base total). ")
|
|
3365
3365
|
]))) : H("", !0),
|
|
3366
|
-
|
|
3366
|
+
Ut.value ? (p(), C("li", ws, " Red highlights are UOMs not on the SKU (ignored). ")) : H("", !0)
|
|
3367
3367
|
])
|
|
3368
3368
|
])
|
|
3369
3369
|
])) : H("", !0),
|
|
@@ -3381,7 +3381,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3381
3381
|
"border-color": "primary",
|
|
3382
3382
|
loading: f($),
|
|
3383
3383
|
disabled: f($),
|
|
3384
|
-
onClick:
|
|
3384
|
+
onClick: Pt
|
|
3385
3385
|
}, null, 8, ["loading", "disabled"])) : H("", !0),
|
|
3386
3386
|
D($t, null, {
|
|
3387
3387
|
default: te(() => [
|
|
@@ -3393,7 +3393,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3393
3393
|
"bg-color": "transparent",
|
|
3394
3394
|
"border-color": "primary",
|
|
3395
3395
|
loading: f($),
|
|
3396
|
-
onClick:
|
|
3396
|
+
onClick: hn
|
|
3397
3397
|
}, null, 8, ["loading"])
|
|
3398
3398
|
]),
|
|
3399
3399
|
_: 1
|
|
@@ -3409,7 +3409,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3409
3409
|
m.draft,
|
|
3410
3410
|
d.value,
|
|
3411
3411
|
h.value,
|
|
3412
|
-
|
|
3412
|
+
Nt.value
|
|
3413
3413
|
) : null)
|
|
3414
3414
|
})
|
|
3415
3415
|
]))
|
|
@@ -3477,17 +3477,17 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3477
3477
|
key: q,
|
|
3478
3478
|
label: q,
|
|
3479
3479
|
selectable: "",
|
|
3480
|
-
selected:
|
|
3481
|
-
onClick: (ve) =>
|
|
3480
|
+
selected: nt[q],
|
|
3481
|
+
onClick: (ve) => nt[q] = !nt[q]
|
|
3482
3482
|
}, null, 8, ["label", "selected", "onClick"]))), 128))
|
|
3483
3483
|
])) : H("", !0),
|
|
3484
3484
|
a("div", js, [
|
|
3485
3485
|
a("div", {
|
|
3486
|
-
style:
|
|
3486
|
+
style: mt({ height: "600px", minWidth: `${Dn.value}px` })
|
|
3487
3487
|
}, [
|
|
3488
3488
|
D(je, {
|
|
3489
|
-
"column-defs":
|
|
3490
|
-
"row-data":
|
|
3489
|
+
"column-defs": Rt.value,
|
|
3490
|
+
"row-data": tt.value,
|
|
3491
3491
|
"search-value": _t.value
|
|
3492
3492
|
}, null, 8, ["column-defs", "row-data", "search-value"])
|
|
3493
3493
|
], 4)
|
|
@@ -3556,8 +3556,8 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3556
3556
|
}, [
|
|
3557
3557
|
a("div", Qs, N(be == null ? void 0 : be.label), 1),
|
|
3558
3558
|
a("div", Js, [
|
|
3559
|
-
(p(!0), C(re, null, ge(be == null ? void 0 : be.values, (Ne,
|
|
3560
|
-
key:
|
|
3559
|
+
(p(!0), C(re, null, ge(be == null ? void 0 : be.values, (Ne, lt) => (p(), C("div", {
|
|
3560
|
+
key: lt,
|
|
3561
3561
|
class: "fm-typo-en-body-lg-600"
|
|
3562
3562
|
}, N(Ne), 1))), 128))
|
|
3563
3563
|
])
|
|
@@ -3573,7 +3573,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3573
3573
|
D(Ce),
|
|
3574
3574
|
a("div", null, [
|
|
3575
3575
|
a("img", {
|
|
3576
|
-
src: f(
|
|
3576
|
+
src: f(mn),
|
|
3577
3577
|
alt: "List is empty"
|
|
3578
3578
|
}, null, 8, Ms)
|
|
3579
3579
|
]),
|
|
@@ -3589,14 +3589,14 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3589
3589
|
}, 8, ["model-value"]),
|
|
3590
3590
|
f(c) && e.draft ? (p(), ne(la, {
|
|
3591
3591
|
key: 0,
|
|
3592
|
-
show:
|
|
3593
|
-
"onUpdate:show": l[10] || (l[10] = (q) =>
|
|
3592
|
+
show: ot.value,
|
|
3593
|
+
"onUpdate:show": l[10] || (l[10] = (q) => ot.value = q),
|
|
3594
3594
|
refreshing: f($),
|
|
3595
|
-
approving:
|
|
3595
|
+
approving: at.value,
|
|
3596
3596
|
draft: e.draft,
|
|
3597
3597
|
groups: I.value,
|
|
3598
|
-
onRefresh:
|
|
3599
|
-
onApprove:
|
|
3598
|
+
onRefresh: Pt,
|
|
3599
|
+
onApprove: Sn
|
|
3600
3600
|
}, null, 8, ["show", "refreshing", "approving", "draft", "groups"])) : H("", !0),
|
|
3601
3601
|
D(is, {
|
|
3602
3602
|
show: K.value,
|
|
@@ -3616,7 +3616,7 @@ async function ar(t) {
|
|
|
3616
3616
|
o.onload = (i) => {
|
|
3617
3617
|
var s;
|
|
3618
3618
|
try {
|
|
3619
|
-
const r = (s = i.target) == null ? void 0 : s.result, u = eo(r, { type: "array" }), c = u.SheetNames[0], b = u.Sheets[c], y =
|
|
3619
|
+
const r = (s = i.target) == null ? void 0 : s.result, u = eo(r, { type: "array" }), c = u.SheetNames[0], b = u.Sheets[c], y = dt.sheet_to_json(b, {
|
|
3620
3620
|
header: 1,
|
|
3621
3621
|
defval: ""
|
|
3622
3622
|
}), I = (j) => String(j).trim().toLowerCase().replace(/^\uFEFF/, ""), E = y.findIndex(
|
|
@@ -3677,11 +3677,11 @@ function lr(t, n) {
|
|
|
3677
3677
|
const e = t.filter((c) => !c.isInactive), o = uo().format("YYYY-MM-DD"), i = `${n} - ${o}.csv`, s = [
|
|
3678
3678
|
["Code", "Name", "Balance"],
|
|
3679
3679
|
...e.map((c) => [c.code, c.name, ""])
|
|
3680
|
-
], r =
|
|
3681
|
-
|
|
3680
|
+
], r = dt.aoa_to_sheet(s), u = dt.book_new();
|
|
3681
|
+
dt.book_append_sheet(u, r, "Template"), to(u, i, { bookType: "csv" });
|
|
3682
3682
|
}
|
|
3683
3683
|
function ir() {
|
|
3684
|
-
const t = Q([]), n = Q([]), e = Q(!1), o =
|
|
3684
|
+
const t = Q([]), n = Q([]), e = Q(!1), o = Ft(), i = Oe(), s = gt(), r = S(
|
|
3685
3685
|
() => t.value.some((y) => y.status === xe.negative)
|
|
3686
3686
|
);
|
|
3687
3687
|
async function u(y) {
|
|
@@ -3734,7 +3734,7 @@ function ir() {
|
|
|
3734
3734
|
name: K.sku.name,
|
|
3735
3735
|
unit: K.sku.unit
|
|
3736
3736
|
},
|
|
3737
|
-
baseAmount:
|
|
3737
|
+
baseAmount: Jn(K.physicalCount, K.sku.unit.precision),
|
|
3738
3738
|
measurementsAmounts: []
|
|
3739
3739
|
}), R = I.map(U), F = E.map(U), L = {
|
|
3740
3740
|
effectiveAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -3760,7 +3760,7 @@ const cr = { class: "flex flex-col gap-16" }, ur = {
|
|
|
3760
3760
|
unrecognisedItemCodes: {}
|
|
3761
3761
|
},
|
|
3762
3762
|
setup(t) {
|
|
3763
|
-
const n = t, { t: e } =
|
|
3763
|
+
const n = t, { t: e } = Je(), o = S(
|
|
3764
3764
|
() => n.items.filter((u) => u.status === xe.negative)
|
|
3765
3765
|
), i = S(
|
|
3766
3766
|
() => n.items.filter((u) => u.status === xe.systemNegative)
|
|
@@ -3908,7 +3908,7 @@ const cr = { class: "flex flex-col gap-16" }, ur = {
|
|
|
3908
3908
|
},
|
|
3909
3909
|
emits: ["update:show", "submitted"],
|
|
3910
3910
|
setup(t, { emit: n }) {
|
|
3911
|
-
const e = t, o = n, i =
|
|
3911
|
+
const e = t, o = n, i = St(e, "show"), { t: s } = Je(), r = ze(), u = Q("upload"), c = Q(null), b = Q(!1), { mergedItems: y, unrecognisedItemCodes: I, hasBlockingErrors: E, isLoading: U, onFileUpload: R, submit: F, downloadTemplate: L } = ir(), K = S(
|
|
3912
3912
|
() => c.value && !U.value && y.value.length > 0
|
|
3913
3913
|
), j = S(() => {
|
|
3914
3914
|
const d = y.value.filter(
|
|
@@ -3982,7 +3982,7 @@ const cr = { class: "flex flex-col gap-16" }, ur = {
|
|
|
3982
3982
|
accept: ".csv",
|
|
3983
3983
|
disabled: f(U),
|
|
3984
3984
|
onFileUpload: z
|
|
3985
|
-
},
|
|
3985
|
+
}, Vn({ _: 2 }, [
|
|
3986
3986
|
c.value ? {
|
|
3987
3987
|
name: "default",
|
|
3988
3988
|
fn: te(({ openFileDialog: x }) => [
|
|
@@ -4122,12 +4122,12 @@ const cr = { class: "flex flex-col gap-16" }, ur = {
|
|
|
4122
4122
|
}, hl = /* @__PURE__ */ De({
|
|
4123
4123
|
__name: "ClosingDraftView",
|
|
4124
4124
|
setup(t) {
|
|
4125
|
-
const { t: n } =
|
|
4125
|
+
const { t: n } = Je(), { viewDraft: e } = pt(), { viewClosingDraftProps: o, viewClosingDraftShow: i } = Wn(pt()), s = Oe(), r = fn(), u = zn(), { breakpoints: c } = Gn();
|
|
4126
4126
|
s.watchLocation(r.fetchDrafts);
|
|
4127
4127
|
const b = S(() => r.loading), y = Q(""), I = Q(!1), E = S(() => c.value.xs || c.value.sm), U = S(() => E.value ? 10 : 20), R = S(
|
|
4128
4128
|
() => {
|
|
4129
4129
|
var w;
|
|
4130
|
-
return ((w = s._currentLocation) == null ? void 0 : w.type) ===
|
|
4130
|
+
return ((w = s._currentLocation) == null ? void 0 : w.type) === Kn.enum.warehouse;
|
|
4131
4131
|
}
|
|
4132
4132
|
);
|
|
4133
4133
|
function F(w) {
|
|
@@ -4178,7 +4178,7 @@ const cr = { class: "flex flex-col gap-16" }, ur = {
|
|
|
4178
4178
|
return (w, d) => {
|
|
4179
4179
|
const h = J("FmTable");
|
|
4180
4180
|
return p(), C(re, null, [
|
|
4181
|
-
D(
|
|
4181
|
+
D(On, {
|
|
4182
4182
|
title: f(n)("inventory.closing.draft.title"),
|
|
4183
4183
|
actions: A.value,
|
|
4184
4184
|
"onClick:action": F
|
|
@@ -4201,7 +4201,7 @@ const cr = { class: "flex flex-col gap-16" }, ur = {
|
|
|
4201
4201
|
}, null, 8, ["search"]),
|
|
4202
4202
|
(p(), ne(h, {
|
|
4203
4203
|
key: f(r).tableKey,
|
|
4204
|
-
style:
|
|
4204
|
+
style: mt(f(u).tableHeight),
|
|
4205
4205
|
"column-defs": f(r).columnDefs,
|
|
4206
4206
|
"row-data": f(r).drafts,
|
|
4207
4207
|
"search-value": y.value,
|
|
@@ -4222,7 +4222,7 @@ const cr = { class: "flex flex-col gap-16" }, ur = {
|
|
|
4222
4222
|
"h-[56px] text-fm-color-typo-primary align-top",
|
|
4223
4223
|
((O = j(M)) == null ? void 0 : O.cellClass) ?? "px-16 py-12"
|
|
4224
4224
|
]),
|
|
4225
|
-
style:
|
|
4225
|
+
style: mt({
|
|
4226
4226
|
width: (g = j(M)) == null ? void 0 : g.width,
|
|
4227
4227
|
maxWidth: (k = j(M)) == null ? void 0 : k.maxWidth,
|
|
4228
4228
|
textAlign: ((x = j(M)) == null ? void 0 : x.textAlign) ?? "left"
|
|
@@ -4249,7 +4249,7 @@ const cr = { class: "flex flex-col gap-16" }, ur = {
|
|
|
4249
4249
|
onRowClick: (M) => f(e)(M)
|
|
4250
4250
|
}, {
|
|
4251
4251
|
default: te((M) => {
|
|
4252
|
-
var O, g, k, x, ee, X, T, G, $, Y, me, ae, ce, pe, Te,
|
|
4252
|
+
var O, g, k, x, ee, X, T, G, $, Y, me, ae, ce, pe, Te, Ze, Ge, Se, Fe, Xe;
|
|
4253
4253
|
return [
|
|
4254
4254
|
a("div", Nr, [
|
|
4255
4255
|
a("div", Vr, [
|
|
@@ -4266,7 +4266,7 @@ const cr = { class: "flex flex-col gap-16" }, ur = {
|
|
|
4266
4266
|
}, null, 8, ["render", "props"])
|
|
4267
4267
|
]),
|
|
4268
4268
|
a("div", zr, N([
|
|
4269
|
-
...B.original.items.slice(0, 3).map((
|
|
4269
|
+
...B.original.items.slice(0, 3).map((et) => et.sku.name),
|
|
4270
4270
|
...B.original.items.length >= 3 ? [`and ${B.original.items.length - 3} more items`] : []
|
|
4271
4271
|
].join(", ")), 1),
|
|
4272
4272
|
a("div", Or, [
|
|
@@ -4279,8 +4279,8 @@ const cr = { class: "flex flex-col gap-16" }, ur = {
|
|
|
4279
4279
|
K(B).length ? (p(), C("div", Gr, N(z(B)), 1)) : H("", !0),
|
|
4280
4280
|
a("div", null, [
|
|
4281
4281
|
D(f(Ye), {
|
|
4282
|
-
render: (Se = (Ge = (
|
|
4283
|
-
props: (
|
|
4282
|
+
render: (Se = (Ge = (Ze = M.status) == null ? void 0 : Ze.column) == null ? void 0 : Ge.columnDef) == null ? void 0 : Se.cell,
|
|
4283
|
+
props: (Xe = (Fe = M.status) == null ? void 0 : Fe.getContext) == null ? void 0 : Xe.call(Fe)
|
|
4284
4284
|
}, null, 8, ["render", "props"])
|
|
4285
4285
|
])
|
|
4286
4286
|
])
|
|
@@ -4302,8 +4302,8 @@ const cr = { class: "flex flex-col gap-16" }, ur = {
|
|
|
4302
4302
|
"onUpdate:show": d[2] || (d[2] = (B) => I.value = B),
|
|
4303
4303
|
onSubmitted: f(r).fetchDrafts
|
|
4304
4304
|
}, null, 8, ["show", "onSubmitted"]),
|
|
4305
|
-
(p(), ne(
|
|
4306
|
-
D(or,
|
|
4305
|
+
(p(), ne(En, { to: "body" }, [
|
|
4306
|
+
D(or, Ln(f(o), {
|
|
4307
4307
|
show: f(i),
|
|
4308
4308
|
"onUpdate:show": d[3] || (d[3] = (B) => vt(i) ? i.value = B : null),
|
|
4309
4309
|
onSubmitted: d[4] || (d[4] = () => (i.value = !1, f(r).fetchDrafts())),
|