@feedmepos/mf-inventory-portal 1.6.2 → 1.7.0-dev.0
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-DaAOxELy.js} +4 -4
- package/dist/{ApprovalView-Cc1iYZqD.js → ApprovalView-CxJ79rW7.js} +8 -8
- package/dist/{BindingsDialog-Chd2EdfO.js → BindingsDialog-CZhCQoLO.js} +2 -2
- package/dist/{BindingsPicker-CXXnZKq5.js → BindingsPicker-BWRMxgYR.js} +2 -2
- package/dist/{BindingsTable-C5migJtC.js → BindingsTable-fvBa1dHb.js} +3 -3
- package/dist/{BulkReceiveRequestView-9MSE2YVv.js → BulkReceiveRequestView-Bq7_r-qY.js} +19 -19
- package/dist/ChangeLocationComponent.vue_vue_type_script_setup_true_lang-CKM48Ktp.js +126 -0
- package/dist/{ClosingDraftView-C4XBYgez.js → ClosingDraftView-DdMr571D.js} +204 -203
- package/dist/{ClosingHistoryView-C_OtcjwH.js → ClosingHistoryView-BIpPvvzQ.js} +5 -5
- package/dist/{ClosingTemplateView-BZpuwhWe.js → ClosingTemplateView-IlV4hRZ7.js} +14 -14
- package/dist/{DefaultView-Dnub2r0C.js → DefaultView-TKUUG9_5.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-U8g2O_pt.js → DeliveryOrderPrintPreview-DTjC7-Op.js} +2 -2
- package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-D3tETd4M.js → EmailDialog.vue_vue_type_script_setup_true_lang-DeFiuGtR.js} +23 -23
- package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-DPVkPshX.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-NtqJm53P.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CCl3KLFs.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CzHFzHXg.js} +2 -2
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CiMEAtPb.js +118 -0
- package/dist/{FmMultiselectDialog-BplRH37N.js → FmMultiselectDialog-BdXOoS6z.js} +2 -2
- package/dist/{FmMultiselectDialog-DX3xMRs8.js → FmMultiselectDialog-D_4f9sXH.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-fKDQGIyW.js → FmUnitInput.vue_vue_type_script_setup_true_lang-D_MOm5kW.js} +5 -5
- package/dist/{ImportView-BYQcNVFt.js → ImportView-BnL6y68X.js} +51 -51
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-Bj3Bgpix.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-g-g6qaNU.js} +1 -1
- package/dist/{IngredientGroupView-B52_Gj1M.js → IngredientGroupView-Du0iICme.js} +5 -5
- package/dist/{IngredientsView-dp1q1202.js → IngredientsView-m2Rtn_F_.js} +15 -15
- package/dist/{IntegrationExplorerView-CFDjUZ1x.js → IntegrationExplorerView-J5BtpWN_.js} +352 -352
- package/dist/{IntegrationView-WxvHYqrr.js → IntegrationView-BMQj8wg-.js} +13 -13
- package/dist/{InventoryBindingForm-CgsJGTLO.js → InventoryBindingForm-D_KFXokV.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DoDwQAGq.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-B7GjOoZh.js} +5 -5
- package/dist/{InventoryBindingSummary-CJPi-O24.js → InventoryBindingSummary-9TWMG5bm.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-6WGw2Tnv.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DYXtIoll.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-D8iVxQQI.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CGJ_uWzF.js} +1 -1
- package/dist/ProductionView-CI07S6oW.js +1330 -0
- package/dist/{PublishView-DQxvMoL9.js → PublishView-CWMdUnaY.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-YN89wJJe.js → PurchaseOrderPrintPreview-B5XJcf8G.js} +2 -2
- package/dist/{ReceiveRequestView-Dld-AD3X.js → ReceiveRequestView-st3jdG9W.js} +13 -13
- package/dist/{RecipeView-DTeYl1vN.js → RecipeView-D9ZVbmtm.js} +17 -17
- package/dist/{SettingsView-ZKDeU7-t.js → SettingsView-CUS0aMbf.js} +4 -4
- package/dist/{StockView-iWDV-4Em.js → StockView-Co4DOixF.js} +55 -54
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DKQR-Oe-.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Dt6XECIc.js} +1 -1
- package/dist/{SupplierView-DIFYaNh0.js → SupplierView-DXw6V-uS.js} +12 -12
- package/dist/{SurchargeView-Dg744-lq.js → SurchargeView-C-Bg7UsR.js} +6 -6
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-a1NAKsHT.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-D6_M-pbk.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BiMBRYQP.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-D7NrX7HR.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BNb64xXp.js → TransferDetails.vue_vue_type_script_setup_true_lang-D9Fl_xAx.js} +1315 -1315
- package/dist/{TransferTemplateView-OKkFfbJr.js → TransferTemplateView-CP7ia82t.js} +20 -20
- package/dist/{UnitCostHistoryView-BQD8QfVO.js → UnitCostHistoryView-xe5q6105.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-DrZ0DaVk.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-_Eax2wkO.js} +4 -4
- package/dist/{UnitView-WB01UGKV.js → UnitView-1e6MQ-Vu.js} +7 -7
- package/dist/{WarehouseView-xzBYaKJc.js → WarehouseView-DXB6Ygwb.js} +5 -5
- package/dist/{WastageTemplateView-HQpsfs5m.js → WastageTemplateView-CWGNtaZJ.js} +14 -14
- package/dist/api/production.d.ts +29 -0
- package/dist/{app-jwcH8Mn8.js → app-DXqwG4b3.js} +1930 -1854
- package/dist/app.js +1 -1
- package/dist/{closing-template-nSKzJbXQ.js → closing-template-CCY6fg4v.js} +1 -1
- package/dist/{date2-CcBFYPpF.js → date2-BWfUJajP.js} +1 -1
- package/dist/{dayjs.min-CArZjoIW.js → dayjs.min-BqAOh_2L.js} +1 -1
- package/dist/{decimal-kAd3KrAk.js → decimal-DmkQg2_J.js} +2 -2
- package/dist/{defineDeepModel-DW3GGnCB.js → defineDeepModel-D9smHIGg.js} +1 -1
- package/dist/{duplicate-template-Dju7ozO-.js → duplicate-template-Ebdaehmw.js} +1 -1
- package/dist/{feature-Dwlpa3ga.js → feature-CD2ndvWN.js} +2 -2
- package/dist/{format-time-from-id-C8qHJtCE.js → format-time-from-id-BtUh8UMO.js} +1 -1
- package/dist/{format-unit-display-DW_s2GAu.js → format-unit-display-DLoTr1Hz.js} +12 -12
- package/dist/{import-export.helper-BLEUR_2a.js → import-export.helper-DYgr7Lvo.js} +49 -49
- package/dist/{index-DX29MkLw.js → index-CnuWmvgF.js} +1 -1
- package/dist/{index-CQqLXfqq.js → index-DmdqVO9N.js} +3 -3
- package/dist/{index-DeMIqTWp.js → index-z_cku6cd.js} +1 -1
- package/dist/inventory-core-dart.default-CEnDozvp.js +22707 -0
- package/dist/{jszip.min-UvNpneu6.js → jszip.min-DKMvkIMM.js} +220 -220
- package/dist/{lz-string-BJjf0Fvk.js → lz-string-BH6J5xxX.js} +1 -1
- package/dist/{netsuite-ojatCiHQ.js → netsuite-kR1AFzO9.js} +2 -2
- package/dist/{number-PbBeNwvZ.js → number-CRrcUtSg.js} +3 -3
- package/dist/{predefined-templates-C11X8192.js → predefined-templates-DbAHazbJ.js} +1 -1
- package/dist/{purchase-order-template-CMQsOjp6.js → purchase-order-template-DoEJEwqG.js} +1 -1
- package/dist/{recalculationUtils-DOIaJCEk.js → recalculationUtils-hk2PE0q1.js} +1 -1
- package/dist/router/name.d.ts +1 -0
- package/dist/{rules-iqyXkujx.js → rules-BPXgi6ZE.js} +2 -2
- package/dist/stock-CJAv4fTu.js +75 -0
- package/dist/{stock-BhMYoMNR.js → stock-qAhTEKrH.js} +1 -1
- package/dist/{supplier-XEzdhDaU.js → supplier-BvzIGpwW.js} +2 -2
- package/dist/{surcharge-Ors_mdMv.js → surcharge-BhLHJ3gK.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-BQohyyG-.js → uom-rules-B1s74P9M.js} +1 -1
- package/dist/{use-ingredient-select-dialog-DJ-u5t4P.js → use-ingredient-select-dialog-aAPbd5cS.js} +2 -2
- package/dist/{use-inventory-binding-dialog-D3W-HnQ8.js → use-inventory-binding-dialog-CTjQzuV7.js} +2 -2
- package/dist/{use-template-enabled-locations-DVF4RYya.js → use-template-enabled-locations-Brw80-tj.js} +2 -2
- package/dist/{use-transfer-locations-vRfZN9tb.js → use-transfer-locations-BF7CKYpr.js} +2 -2
- package/dist/{useHrmPermission-z87O-oAT.js → useHrmPermission-Csjov-cy.js} +1 -1
- package/dist/{useNavigationMenu-DMRHryMp.js → useNavigationMenu-D8BERWXB.js} +12 -7
- package/dist/useSseClient-Cen-cw5C.js +453 -0
- package/dist/views/closing-draft/helpers/get-calculated-total.helper.spec.d.ts +1 -0
- package/dist/views/production/ProductionBindingsCell.vue.d.ts +29 -0
- package/dist/views/production/ProductionCompletionDialog.vue.d.ts +32 -0
- package/dist/views/production/ProductionDetailSheet.vue.d.ts +38 -0
- package/dist/views/production/ProductionDuplicateDialog.vue.d.ts +280 -0
- package/dist/views/production/ProductionPrepareBuilder.vue.d.ts +6 -0
- package/dist/views/production/ProductionView.vue.d.ts +2 -0
- package/dist/{vue-i18n-nOka-XyP.js → vue-i18n-lC_mdXT4.js} +176 -176
- package/dist/{xlsx.util-DDX-Y6FY.js → xlsx.util-DxgWqaTd.js} +3 -3
- package/package.json +5 -5
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BgR0wjB0.js +0 -237
- package/dist/inventory-core-dart.default-BOlwkIOh.js +0 -18716
- package/dist/useSseClient-6AYDEsLw.js +0 -524
|
@@ -1,30 +1,31 @@
|
|
|
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
|
|
13
|
-
import { u as gt } from "./stock-
|
|
14
|
-
import { D as
|
|
15
|
-
import { c as
|
|
16
|
-
import { f as
|
|
17
|
-
import { f as
|
|
18
|
-
import { _ as
|
|
19
|
-
import { _ 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-DXqwG4b3.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-BWfUJajP.js";
|
|
8
|
+
import { R as ln } from "./rules-BPXgi6ZE.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-CRrcUtSg.js";
|
|
10
|
+
import { b as Zn, d as Xn, c as eo, u as dt, w as to } from "./xlsx.util-DxgWqaTd.js";
|
|
11
|
+
import { i as It, u as Bt } from "./uom-rules-B1s74P9M.js";
|
|
12
|
+
import { u as no } from "./stock-CJAv4fTu.js";
|
|
13
|
+
import { u as gt } from "./stock-qAhTEKrH.js";
|
|
14
|
+
import { D as Xt, R as Ve } from "./row-action.enum-DQ9bJ_uv.js";
|
|
15
|
+
import { c as oo } from "./component-kqxARxvM.js";
|
|
16
|
+
import { f as ao } from "./format-time-from-id-BtUh8UMO.js";
|
|
17
|
+
import { f as so } from "./recalculationUtils-hk2PE0q1.js";
|
|
18
|
+
import { _ as ro } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CiMEAtPb.js";
|
|
19
|
+
import { _ as mn } from "./empty-placeholder-B0QU467o.js";
|
|
20
20
|
import { F as $t } from "./FmAdminBadge-DjnBAgyv.js";
|
|
21
|
-
import { u as
|
|
22
|
-
import { F as
|
|
23
|
-
import {
|
|
21
|
+
import { u as lo } from "./vue-i18n-lC_mdXT4.js";
|
|
22
|
+
import { F as io } from "./decimal-DmkQg2_J.js";
|
|
23
|
+
import { u as co } from "./useSseClient-Cen-cw5C.js";
|
|
24
|
+
import { d as uo } from "./dayjs.min-BqAOh_2L.js";
|
|
24
25
|
import { F as mo } from "./FmDroppableField-J0xUsOTV.js";
|
|
25
26
|
import { _ as fo } from "./FmConfirmationButton.vue_vue_type_script_setup_true_lang-DLrMEGFR.js";
|
|
26
27
|
import { F as Ye, _ as po } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js";
|
|
27
|
-
const Me =
|
|
28
|
+
const Me = Hn((t, n) => {
|
|
28
29
|
function e() {
|
|
29
30
|
return Oe().currentLocation.dbName;
|
|
30
31
|
}
|
|
@@ -118,7 +119,7 @@ const Me = Kn((t, n) => {
|
|
|
118
119
|
}
|
|
119
120
|
throw new Error(`Unknown action: ${n.action}`);
|
|
120
121
|
});
|
|
121
|
-
|
|
122
|
+
tn(() => {
|
|
122
123
|
if (n.draft.effectiveAt)
|
|
123
124
|
r.value = new Date(n.draft.effectiveAt);
|
|
124
125
|
else {
|
|
@@ -129,7 +130,7 @@ const Me = Kn((t, n) => {
|
|
|
129
130
|
});
|
|
130
131
|
const y = S({
|
|
131
132
|
get() {
|
|
132
|
-
return r.value === null ? "" :
|
|
133
|
+
return r.value === null ? "" : ft(r.value);
|
|
133
134
|
},
|
|
134
135
|
set(R) {
|
|
135
136
|
if (R) {
|
|
@@ -140,7 +141,7 @@ const Me = Kn((t, n) => {
|
|
|
140
141
|
}
|
|
141
142
|
}), I = S({
|
|
142
143
|
get() {
|
|
143
|
-
return r.value === null ? "" :
|
|
144
|
+
return r.value === null ? "" : rn(r.value);
|
|
144
145
|
},
|
|
145
146
|
set(R) {
|
|
146
147
|
if (R) {
|
|
@@ -208,7 +209,7 @@ const Me = Kn((t, n) => {
|
|
|
208
209
|
D(K, {
|
|
209
210
|
modelValue: y.value,
|
|
210
211
|
"onUpdate:modelValue": F[0] || (F[0] = (d) => y.value = d),
|
|
211
|
-
max: f(
|
|
212
|
+
max: f(ft)(/* @__PURE__ */ new Date())
|
|
212
213
|
}, null, 8, ["modelValue", "max"]),
|
|
213
214
|
D(L, { class: "fm-typo-en-body-lg-600" }, {
|
|
214
215
|
default: te(() => F[7] || (F[7] = [
|
|
@@ -227,7 +228,7 @@ const Me = Kn((t, n) => {
|
|
|
227
228
|
"onUpdate:modelValue": F[2] || (F[2] = (d) => e.value = d),
|
|
228
229
|
label: "Remark",
|
|
229
230
|
"label-mark": "required",
|
|
230
|
-
rules: [f(
|
|
231
|
+
rules: [f(ln)()]
|
|
231
232
|
}, null, 8, ["modelValue", "rules"]),
|
|
232
233
|
a("div", ho, [
|
|
233
234
|
D(A, {
|
|
@@ -249,19 +250,19 @@ const Me = Kn((t, n) => {
|
|
|
249
250
|
], 64));
|
|
250
251
|
};
|
|
251
252
|
}
|
|
252
|
-
}), _o =
|
|
253
|
+
}), _o = Qe(0);
|
|
253
254
|
function bt(t) {
|
|
254
|
-
const n = t.measurementsAmounts.groupBy((
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
255
|
+
const n = t.measurementsAmounts.groupBy((e) => e.measurement.id);
|
|
256
|
+
return t.sku.unit.measurements.reduce((e, o) => {
|
|
257
|
+
var r, u;
|
|
258
|
+
const i = ((u = (r = n.get(o.id)) == null ? void 0 : r[0]) == null ? void 0 : u.amount) ?? _o, s = yt(o.conversion, i);
|
|
259
|
+
return qe(e, s);
|
|
260
|
+
}, t.baseAmount);
|
|
260
261
|
}
|
|
261
|
-
const ko =
|
|
262
|
+
const ko = Qe(0), xo = Qe(100);
|
|
262
263
|
function wo(t, n, e, o, i, s, r, u) {
|
|
263
264
|
var O, g, k, x, ee;
|
|
264
|
-
const c = bt(t), b = o ?? c, y =
|
|
265
|
+
const c = bt(t), b = o ?? c, y = cn(b, n), I = n.amount === 0 ? null : un(y, {
|
|
265
266
|
...n,
|
|
266
267
|
amount: Math.abs(n.amount)
|
|
267
268
|
}), 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 +274,8 @@ function wo(t, n, e, o, i, s, r, u) {
|
|
|
273
274
|
return r && s && r.forEach((X) => {
|
|
274
275
|
const T = { amount: 0, precision: 0 }, G = s[X];
|
|
275
276
|
if (G) {
|
|
276
|
-
const $ =
|
|
277
|
-
B[`adjustment_${X}`] =
|
|
277
|
+
const $ = qe(T, G);
|
|
278
|
+
B[`adjustment_${X}`] = Qn($);
|
|
278
279
|
} else
|
|
279
280
|
B[`adjustment_${X}`] = "0";
|
|
280
281
|
}), {
|
|
@@ -295,7 +296,7 @@ function wo(t, n, e, o, i, s, r, u) {
|
|
|
295
296
|
adjustedAmount: Number(oe.toFormatString({ value: y })),
|
|
296
297
|
adjustedDiffPercentage: E ? Number(
|
|
297
298
|
oe.toFormatString({
|
|
298
|
-
value:
|
|
299
|
+
value: dn(E, 2)
|
|
299
300
|
})
|
|
300
301
|
) : null,
|
|
301
302
|
costPerUnit: R,
|
|
@@ -336,7 +337,7 @@ function $o(t, n) {
|
|
|
336
337
|
abbrev: u.abbrev,
|
|
337
338
|
conversion: u.conversion,
|
|
338
339
|
amount: c,
|
|
339
|
-
inactive:
|
|
340
|
+
inactive: It(u, n),
|
|
340
341
|
orphan: !1
|
|
341
342
|
});
|
|
342
343
|
}
|
|
@@ -354,7 +355,7 @@ function $o(t, n) {
|
|
|
354
355
|
return e;
|
|
355
356
|
}
|
|
356
357
|
function Co(t, n = [], e = []) {
|
|
357
|
-
const o =
|
|
358
|
+
const o = an(), i = o === "MYR" ? "RM" : o;
|
|
358
359
|
return [
|
|
359
360
|
{
|
|
360
361
|
id: "code",
|
|
@@ -454,7 +455,7 @@ function Ao(t, n, e, o = [], i) {
|
|
|
454
455
|
y.forEach((T) => {
|
|
455
456
|
c.has(T) && (I.push(T), c.delete(T));
|
|
456
457
|
});
|
|
457
|
-
const E = Array.from(c).sort(), U = [...I, ...E], R = [...t.items, ...t.negativeStockItems ?? []], L =
|
|
458
|
+
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
459
|
var ae, ce;
|
|
459
460
|
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
461
|
return wo(
|
|
@@ -491,7 +492,7 @@ function Ao(t, n, e, o = [], i) {
|
|
|
491
492
|
[],
|
|
492
493
|
A.map((T) => T.name),
|
|
493
494
|
...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 (${
|
|
495
|
+
], 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
496
|
return Xn(h, B), B;
|
|
496
497
|
}
|
|
497
498
|
const So = { class: "flex flex-col" }, Fo = {
|
|
@@ -508,7 +509,7 @@ const So = { class: "flex flex-col" }, Fo = {
|
|
|
508
509
|
const n = t;
|
|
509
510
|
gt();
|
|
510
511
|
const e = Q(!1), o = Q(null), i = Q(!1);
|
|
511
|
-
|
|
512
|
+
tn(() => {
|
|
512
513
|
if (n.draft.effectiveAt)
|
|
513
514
|
o.value = new Date(n.draft.effectiveAt);
|
|
514
515
|
else {
|
|
@@ -519,7 +520,7 @@ const So = { class: "flex flex-col" }, Fo = {
|
|
|
519
520
|
});
|
|
520
521
|
const s = S({
|
|
521
522
|
get() {
|
|
522
|
-
return o.value === null ? "" :
|
|
523
|
+
return o.value === null ? "" : ft(o.value);
|
|
523
524
|
},
|
|
524
525
|
set(b) {
|
|
525
526
|
if (b) {
|
|
@@ -530,7 +531,7 @@ const So = { class: "flex flex-col" }, Fo = {
|
|
|
530
531
|
}
|
|
531
532
|
}), r = S({
|
|
532
533
|
get() {
|
|
533
|
-
return o.value === null ? "" :
|
|
534
|
+
return o.value === null ? "" : rn(o.value);
|
|
534
535
|
},
|
|
535
536
|
set(b) {
|
|
536
537
|
if (b) {
|
|
@@ -574,7 +575,7 @@ const So = { class: "flex flex-col" }, Fo = {
|
|
|
574
575
|
D(E, {
|
|
575
576
|
modelValue: s.value,
|
|
576
577
|
"onUpdate:modelValue": y[0] || (y[0] = (L) => s.value = L),
|
|
577
|
-
max: f(
|
|
578
|
+
max: f(ft)(/* @__PURE__ */ new Date())
|
|
578
579
|
}, null, 8, ["modelValue", "max"]),
|
|
579
580
|
D(I, { class: "fm-typo-en-body-lg-600" }, {
|
|
580
581
|
default: te(() => y[4] || (y[4] = [
|
|
@@ -609,10 +610,10 @@ const So = { class: "flex flex-col" }, Fo = {
|
|
|
609
610
|
], 64));
|
|
610
611
|
};
|
|
611
612
|
}
|
|
612
|
-
}), pt =
|
|
613
|
+
}), pt = sn(
|
|
613
614
|
"closingDraftActions",
|
|
614
615
|
function() {
|
|
615
|
-
const n =
|
|
616
|
+
const n = on(), e = ze(), o = gt(), i = Me(), s = no(), r = Bt(), u = Q(!1), c = Q();
|
|
616
617
|
function b(A) {
|
|
617
618
|
const w = {
|
|
618
619
|
draft: A
|
|
@@ -818,7 +819,7 @@ function Ro(t) {
|
|
|
818
819
|
const n = (e = t.usingTemplates) == null ? void 0 : e[0];
|
|
819
820
|
return n != null && n.ref ? n.ref : ht(t).replace(/[^a-z0-9]/gi, "").slice(0, 6).toUpperCase() || "GROUP";
|
|
820
821
|
}
|
|
821
|
-
function
|
|
822
|
+
function At(t) {
|
|
822
823
|
var r, u, c;
|
|
823
824
|
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
825
|
return {
|
|
@@ -849,10 +850,10 @@ function Mo(t) {
|
|
|
849
850
|
}
|
|
850
851
|
);
|
|
851
852
|
}
|
|
852
|
-
const
|
|
853
|
+
const fn = sn(
|
|
853
854
|
"closingDraftTable",
|
|
854
855
|
function() {
|
|
855
|
-
const { t: n } =
|
|
856
|
+
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
857
|
async function I() {
|
|
857
858
|
if (i.value = [], !!u._currentLocation) {
|
|
858
859
|
r.value = !0;
|
|
@@ -883,7 +884,7 @@ const vn = rn(
|
|
|
883
884
|
}
|
|
884
885
|
}
|
|
885
886
|
function U(g) {
|
|
886
|
-
const k =
|
|
887
|
+
const k = so(
|
|
887
888
|
g.filter((x) => !!x.closingId).map((x) => ({ closingId: x.closingId, draftCreatedAt: new Date(Re(x._id)) }))
|
|
888
889
|
);
|
|
889
890
|
return g.map((x) => ({
|
|
@@ -905,12 +906,12 @@ const vn = rn(
|
|
|
905
906
|
return Object.fromEntries(k);
|
|
906
907
|
}
|
|
907
908
|
function F(g, k) {
|
|
908
|
-
y.value = { ...y.value, [g]: k }, b.value = { ...b.value, [g]: k.map(
|
|
909
|
+
y.value = { ...y.value, [g]: k }, b.value = { ...b.value, [g]: k.map(At) };
|
|
909
910
|
}
|
|
910
911
|
async function L(g) {
|
|
911
912
|
const k = await R(g);
|
|
912
913
|
y.value = k, b.value = Object.fromEntries(
|
|
913
|
-
Object.entries(k).map(([x, ee]) => [x, ee.map(
|
|
914
|
+
Object.entries(k).map(([x, ee]) => [x, ee.map(At)])
|
|
914
915
|
), s.value++;
|
|
915
916
|
}
|
|
916
917
|
async function K(g) {
|
|
@@ -970,7 +971,7 @@ const vn = rn(
|
|
|
970
971
|
o.closeDraftDialog(), I();
|
|
971
972
|
}
|
|
972
973
|
function M(g, k) {
|
|
973
|
-
switch (k =
|
|
974
|
+
switch (k = Yn(k), g) {
|
|
974
975
|
case Ve.Details:
|
|
975
976
|
return o.viewDraft(k);
|
|
976
977
|
case Ve.Export:
|
|
@@ -992,7 +993,7 @@ const vn = rn(
|
|
|
992
993
|
accessorKey: "_id",
|
|
993
994
|
header: () => n("inventory.closing.table.createdAt"),
|
|
994
995
|
cell(g) {
|
|
995
|
-
return
|
|
996
|
+
return ao(`${g.getValue()}`);
|
|
996
997
|
},
|
|
997
998
|
sortingFn: (g, k) => new Date(Re(g.original._id)).getTime() - new Date(Re(k.original._id)).getTime(),
|
|
998
999
|
enableSorting: !0
|
|
@@ -1125,8 +1126,8 @@ const vn = rn(
|
|
|
1125
1126
|
cell(g) {
|
|
1126
1127
|
var G;
|
|
1127
1128
|
const k = g.row.original, x = ((G = e.sessionUser.value) == null ? void 0 : G.role.isAdmin) ?? !1, ee = [
|
|
1128
|
-
|
|
1129
|
-
|
|
1129
|
+
Xt[Ve.Details],
|
|
1130
|
+
Xt[Ve.Export]
|
|
1130
1131
|
], X = [
|
|
1131
1132
|
{
|
|
1132
1133
|
translationKey: "inventory.closing.draft.approveDraft",
|
|
@@ -1150,7 +1151,7 @@ const vn = rn(
|
|
|
1150
1151
|
value: Ve.Duplicate
|
|
1151
1152
|
}
|
|
1152
1153
|
] : [];
|
|
1153
|
-
return
|
|
1154
|
+
return oo(
|
|
1154
1155
|
[
|
|
1155
1156
|
...ee,
|
|
1156
1157
|
...k.status === _e.enum.DRAFT ? X : []
|
|
@@ -1195,12 +1196,12 @@ function Uo(t) {
|
|
|
1195
1196
|
});
|
|
1196
1197
|
continue;
|
|
1197
1198
|
}
|
|
1198
|
-
i.baseAmount =
|
|
1199
|
+
i.baseAmount = qe(i.baseAmount, o.baseAmount);
|
|
1199
1200
|
for (const s of o.measurementsAmounts) {
|
|
1200
1201
|
const r = i.measurementsAmounts.findIndex(
|
|
1201
1202
|
(u) => u.measurement.id === s.measurement.id
|
|
1202
1203
|
);
|
|
1203
|
-
r > -1 ? i.measurementsAmounts[r].amount =
|
|
1204
|
+
r > -1 ? i.measurementsAmounts[r].amount = qe(
|
|
1204
1205
|
i.measurementsAmounts[r].amount,
|
|
1205
1206
|
s.amount
|
|
1206
1207
|
) : i.measurementsAmounts.push({ ...s, amount: { ...s.amount } });
|
|
@@ -1237,7 +1238,7 @@ const No = { class: "fm-typo-en-heading-lg-600" }, Vo = { class: "py-4" }, Eo =
|
|
|
1237
1238
|
},
|
|
1238
1239
|
emits: ["update:show", "refresh", "approve"],
|
|
1239
1240
|
setup(t, { emit: n }) {
|
|
1240
|
-
const { FmStepper: e, FmStep: o, FmDialog: i, FmButton: s } = ye, { t: r } =
|
|
1241
|
+
const { FmStepper: e, FmStep: o, FmDialog: i, FmButton: s } = ye, { t: r } = lo(), u = Ft(), c = t, b = n, y = S(
|
|
1241
1242
|
() => {
|
|
1242
1243
|
var $, Y;
|
|
1243
1244
|
return (($ = c.draft) == null ? void 0 : $.stockSnapshot) && ((Y = c.draft) == null ? void 0 : Y.stockSnapshot) !== void 0;
|
|
@@ -1515,7 +1516,7 @@ const No = { class: "fm-typo-en-heading-lg-600" }, Vo = { class: "py-4" }, Eo =
|
|
|
1515
1516
|
}
|
|
1516
1517
|
});
|
|
1517
1518
|
function ia(t) {
|
|
1518
|
-
const n = Me(), e =
|
|
1519
|
+
const n = Me(), e = co(), o = ze(), { t: i } = Je(), s = Q(!1), r = Q(null);
|
|
1519
1520
|
let u = !1, c = null, b = !1, y = !1;
|
|
1520
1521
|
function I() {
|
|
1521
1522
|
L();
|
|
@@ -1622,7 +1623,7 @@ function ia(t) {
|
|
|
1622
1623
|
([z, A], [w, d]) => {
|
|
1623
1624
|
y && (z === w && A === d || I());
|
|
1624
1625
|
}
|
|
1625
|
-
),
|
|
1626
|
+
), Un(() => {
|
|
1626
1627
|
j();
|
|
1627
1628
|
}), {
|
|
1628
1629
|
refreshing: s,
|
|
@@ -1662,14 +1663,14 @@ const ua = { class: "flex items-start justify-between gap-8" }, da = { class: "f
|
|
|
1662
1663
|
});
|
|
1663
1664
|
return (u, c) => (p(), C("div", {
|
|
1664
1665
|
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] =
|
|
1666
|
+
onClick: c[0] || (c[0] = Nn((b) => o("select", u.group.id), ["stop"]))
|
|
1666
1667
|
}, [
|
|
1667
1668
|
a("div", ua, [
|
|
1668
1669
|
a("div", da, [
|
|
1669
1670
|
u.group.color ? (p(), C("span", {
|
|
1670
1671
|
key: 0,
|
|
1671
1672
|
class: "w-8 h-8 rounded-full shrink-0",
|
|
1672
|
-
style:
|
|
1673
|
+
style: mt({ backgroundColor: u.group.color })
|
|
1673
1674
|
}, null, 4)) : H("", !0),
|
|
1674
1675
|
a("span", ma, N(u.group.name), 1)
|
|
1675
1676
|
]),
|
|
@@ -1708,7 +1709,7 @@ const ua = { class: "flex items-start justify-between gap-8" }, da = { class: "f
|
|
|
1708
1709
|
])) : (p(), C("div", ba, "No closing groups"));
|
|
1709
1710
|
}
|
|
1710
1711
|
});
|
|
1711
|
-
function
|
|
1712
|
+
function pn(t, n) {
|
|
1712
1713
|
const e = t.sku, o = [], i = Number(oe.toFormatString({ value: t.baseAmount }));
|
|
1713
1714
|
i && o.push({
|
|
1714
1715
|
label: "Base",
|
|
@@ -1741,20 +1742,20 @@ function yn(t, n) {
|
|
|
1741
1742
|
};
|
|
1742
1743
|
for (const c of e.unit.measurements) {
|
|
1743
1744
|
const b = s.get(c.id);
|
|
1744
|
-
b && u(c.abbrev, c.conversion, b,
|
|
1745
|
+
b && u(c.abbrev, c.conversion, b, It(c, n), !1);
|
|
1745
1746
|
}
|
|
1746
1747
|
for (const c of t.measurementsAmounts)
|
|
1747
1748
|
r.has(c.measurement.id) || u(c.measurement.abbrev, c.measurement.conversion, c.amount, !1, !0);
|
|
1748
1749
|
return o;
|
|
1749
1750
|
}
|
|
1750
|
-
const
|
|
1751
|
+
const ut = (t) => ie(t, { minPrecision: 0, maxPrecision: 3 });
|
|
1751
1752
|
function _a(t, n) {
|
|
1752
1753
|
return n ? "text-fm-color-system-error-300" : t ? "text-purple-500" : "";
|
|
1753
1754
|
}
|
|
1754
1755
|
function ka(t, n) {
|
|
1755
1756
|
return n ? _(ye.FmIcon, { name: "warning", size: "sm", color: "system-error-300" }) : t ? _(ye.FmIcon, { name: "rule", size: "sm" }) : null;
|
|
1756
1757
|
}
|
|
1757
|
-
function
|
|
1758
|
+
function vn(t, n, e) {
|
|
1758
1759
|
return _(
|
|
1759
1760
|
"div",
|
|
1760
1761
|
{
|
|
@@ -1772,19 +1773,19 @@ function gn(t, n, e) {
|
|
|
1772
1773
|
_(
|
|
1773
1774
|
"div",
|
|
1774
1775
|
{ class: o.counted ? "" : "line-through text-fm-color-typo-tertiary" },
|
|
1775
|
-
o.orphan ? `${
|
|
1776
|
+
o.orphan ? `${ut(o.amount)} ${o.abbrev} (no valid conversion)` : o.counted ? `${ut(o.subtotal)} ${e}` : `${ut(o.subtotal)} ${e} (ignored)`
|
|
1776
1777
|
)
|
|
1777
1778
|
])
|
|
1778
1779
|
),
|
|
1779
1780
|
_("hr", { class: "border-fm-color-typo-secondary my-4" }),
|
|
1780
1781
|
_("div", { class: "flex justify-between fm-typo-en-body-lg-600" }, [
|
|
1781
1782
|
_("span", "Total"),
|
|
1782
|
-
_("span", `${
|
|
1783
|
+
_("span", `${ut(n)} ${e}`)
|
|
1783
1784
|
])
|
|
1784
1785
|
]
|
|
1785
1786
|
);
|
|
1786
1787
|
}
|
|
1787
|
-
function
|
|
1788
|
+
function Tt(t, n) {
|
|
1788
1789
|
const e = t.sku, o = Number(oe.toFormatString({ value: t.baseAmount })), i = new Map(
|
|
1789
1790
|
t.measurementsAmounts.map((c) => [c.measurement.id, c.amount])
|
|
1790
1791
|
), s = new Set(e.unit.measurements.map((c) => c.id)), r = [], u = (c, b, y, I, E) => {
|
|
@@ -1797,14 +1798,14 @@ function jt(t, n) {
|
|
|
1797
1798
|
};
|
|
1798
1799
|
for (const c of e.unit.measurements) {
|
|
1799
1800
|
const b = i.get(c.id);
|
|
1800
|
-
b && u(c.abbrev, c.conversion, b,
|
|
1801
|
+
b && u(c.abbrev, c.conversion, b, It(c, n), !1);
|
|
1801
1802
|
}
|
|
1802
1803
|
for (const c of t.measurementsAmounts)
|
|
1803
1804
|
s.has(c.measurement.id) || u(c.measurement.abbrev, c.measurement.conversion, c.amount, !1, !0);
|
|
1804
1805
|
return { baseUnitAmount: o, measurements: r };
|
|
1805
1806
|
}
|
|
1806
|
-
function
|
|
1807
|
-
const o = t.sku, { baseUnitAmount: i, measurements: s } =
|
|
1807
|
+
function en(t, n, e) {
|
|
1808
|
+
const o = t.sku, { baseUnitAmount: i, measurements: s } = Tt(t, e);
|
|
1808
1809
|
return {
|
|
1809
1810
|
id: o._id,
|
|
1810
1811
|
code: o.code,
|
|
@@ -1814,17 +1815,17 @@ function tn(t, n, e) {
|
|
|
1814
1815
|
isTemplateItem: n,
|
|
1815
1816
|
measurements: s,
|
|
1816
1817
|
physicalBalance: Number(oe.toFormatString({ value: bt(t) })),
|
|
1817
|
-
breakdown:
|
|
1818
|
+
breakdown: pn(t, e)
|
|
1818
1819
|
};
|
|
1819
1820
|
}
|
|
1820
1821
|
function xa(t, n) {
|
|
1821
1822
|
const e = [
|
|
1822
|
-
...t.items.map((o) =>
|
|
1823
|
-
...(t.negativeStockItems ?? []).map((o) =>
|
|
1823
|
+
...t.items.map((o) => en(o, !0, n)),
|
|
1824
|
+
...(t.negativeStockItems ?? []).map((o) => en(o, !1, n))
|
|
1824
1825
|
];
|
|
1825
1826
|
return e.sort((o, i) => o.code.localeCompare(i.code)), e;
|
|
1826
1827
|
}
|
|
1827
|
-
function
|
|
1828
|
+
function jt(t, n, e) {
|
|
1828
1829
|
const o = (r, u, c = "normal") => _(
|
|
1829
1830
|
ye.FmTooltip,
|
|
1830
1831
|
{ zIndex: 50 },
|
|
@@ -1864,7 +1865,7 @@ function wa(t, n, e) {
|
|
|
1864
1865
|
for (const i of n) {
|
|
1865
1866
|
const s = i.items.find((b) => b.sku._id === t);
|
|
1866
1867
|
if (!s) continue;
|
|
1867
|
-
const { baseUnitAmount: r, measurements: u } =
|
|
1868
|
+
const { baseUnitAmount: r, measurements: u } = Tt(s, e);
|
|
1868
1869
|
(r !== 0 || u.some((b) => b.amount !== 0)) && o.push({ label: i.label, isSub: i.isSub, baseUnitAmount: r, measurements: u });
|
|
1869
1870
|
}
|
|
1870
1871
|
return o;
|
|
@@ -1880,13 +1881,13 @@ function Da(t, n) {
|
|
|
1880
1881
|
{ class: "fm-typo-en-body-sm-600 text-fm-color-typo-tertiary uppercase" },
|
|
1881
1882
|
e.label
|
|
1882
1883
|
),
|
|
1883
|
-
|
|
1884
|
+
jt(e.baseUnitAmount, n, e.measurements)
|
|
1884
1885
|
])
|
|
1885
1886
|
)
|
|
1886
1887
|
);
|
|
1887
1888
|
}
|
|
1888
1889
|
const $a = "N/A";
|
|
1889
|
-
function
|
|
1890
|
+
function yn(t, n) {
|
|
1890
1891
|
var o, i;
|
|
1891
1892
|
const e = t.approvedAt ? {
|
|
1892
1893
|
action: `Approve at ${$e(t.approvedAt)}`,
|
|
@@ -1975,7 +1976,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
1975
1976
|
"onUpdate:modelValue": I[0] || (I[0] = (F) => i.value = F),
|
|
1976
1977
|
label: "Remark",
|
|
1977
1978
|
"label-mark": "required",
|
|
1978
|
-
rules: [f(
|
|
1979
|
+
rules: [f(ln)()]
|
|
1979
1980
|
}, null, 8, ["modelValue", "rules"]),
|
|
1980
1981
|
a("div", Sa, [
|
|
1981
1982
|
D(U, {
|
|
@@ -2028,7 +2029,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2028
2029
|
},
|
|
2029
2030
|
emits: ["update:show", "updated"],
|
|
2030
2031
|
setup(t, { emit: n }) {
|
|
2031
|
-
const e = t, o = n, i =
|
|
2032
|
+
const e = t, o = n, i = St(e, "show"), s = Bt(), r = Oe(), u = on(), c = S(() => {
|
|
2032
2033
|
var d, h, B;
|
|
2033
2034
|
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
2035
|
}), b = S(() => {
|
|
@@ -2051,7 +2052,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2051
2052
|
}
|
|
2052
2053
|
const I = S(() => {
|
|
2053
2054
|
var d;
|
|
2054
|
-
return e.group ?
|
|
2055
|
+
return e.group ? yn(e.group, {
|
|
2055
2056
|
locationName: (d = r._currentLocation) == null ? void 0 : d.name
|
|
2056
2057
|
}) : [];
|
|
2057
2058
|
}), E = [
|
|
@@ -2134,7 +2135,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2134
2135
|
},
|
|
2135
2136
|
[B, _(ye.FmIcon, { name: "info", size: "sm", outline: !0 })]
|
|
2136
2137
|
),
|
|
2137
|
-
default: () =>
|
|
2138
|
+
default: () => vn(h.breakdown, h.physicalBalance, h.baseUnit)
|
|
2138
2139
|
}
|
|
2139
2140
|
) : B;
|
|
2140
2141
|
},
|
|
@@ -2146,7 +2147,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2146
2147
|
enableSorting: !1,
|
|
2147
2148
|
cell(d) {
|
|
2148
2149
|
const h = d.row.original;
|
|
2149
|
-
return
|
|
2150
|
+
return jt(h.baseUnitAmount, h.baseUnit, h.measurements);
|
|
2150
2151
|
}
|
|
2151
2152
|
}
|
|
2152
2153
|
]), w = S(() => {
|
|
@@ -2366,7 +2367,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2366
2367
|
D(ee),
|
|
2367
2368
|
a("div", null, [
|
|
2368
2369
|
a("img", {
|
|
2369
|
-
src: f(
|
|
2370
|
+
src: f(mn),
|
|
2370
2371
|
alt: "List is empty"
|
|
2371
2372
|
}, null, 8, Ha)
|
|
2372
2373
|
]),
|
|
@@ -2430,12 +2431,12 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2430
2431
|
emits: ["submitted", "refresh"],
|
|
2431
2432
|
setup(t, { emit: n }) {
|
|
2432
2433
|
const e = t, o = S(() => {
|
|
2433
|
-
const m =
|
|
2434
|
+
const m = an();
|
|
2434
2435
|
return m === "MYR" ? "RM" : m;
|
|
2435
|
-
}), i =
|
|
2436
|
+
}), i = fn(), s = S(() => {
|
|
2436
2437
|
var m, l;
|
|
2437
2438
|
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 =
|
|
2439
|
+
}), r = pt(), u = Me(), c = St(e, "show"), b = Q(!1), y = Q(!1), I = Q([]);
|
|
2439
2440
|
let E = 0;
|
|
2440
2441
|
async function U() {
|
|
2441
2442
|
var v;
|
|
@@ -2451,7 +2452,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2451
2452
|
console.error("Failed to fetch closing groups", V);
|
|
2452
2453
|
}
|
|
2453
2454
|
}
|
|
2454
|
-
const R = S(() => I.value.map(
|
|
2455
|
+
const R = S(() => I.value.map(At)), F = S(() => {
|
|
2455
2456
|
var m, l, v;
|
|
2456
2457
|
return (v = (l = (m = e.draft) == null ? void 0 : m.usingTemplates) == null ? void 0 : l.find((V) => V)) == null ? void 0 : v.name;
|
|
2457
2458
|
}), L = Q(null), K = Q(!1);
|
|
@@ -2478,7 +2479,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2478
2479
|
W.adjustmentsByType && Object.keys(W.adjustmentsByType).forEach((P) => m.add(P));
|
|
2479
2480
|
const v = ["receive", "sales", "wastage"].filter((W) => m.has(W));
|
|
2480
2481
|
return v.forEach((W) => m.delete(W)), [...v, ...Array.from(m).sort()];
|
|
2481
|
-
}), M = gt(), O = ze(), g =
|
|
2482
|
+
}), M = gt(), O = ze(), g = Ft(), k = Oe(), x = Zt({}), ee = S(() => new Set(
|
|
2482
2483
|
g.skus.filter((m) => {
|
|
2483
2484
|
var l;
|
|
2484
2485
|
return x[(l = m.customAttributes) == null ? void 0 : l.tag];
|
|
@@ -2507,7 +2508,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2507
2508
|
function Te(m, l) {
|
|
2508
2509
|
pe.value = l ? m : pe.value === m ? null : pe.value;
|
|
2509
2510
|
}
|
|
2510
|
-
const
|
|
2511
|
+
const Ze = S(() => {
|
|
2511
2512
|
var m, l;
|
|
2512
2513
|
return [
|
|
2513
2514
|
{
|
|
@@ -2534,7 +2535,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2534
2535
|
}), Se = S(() => {
|
|
2535
2536
|
const m = Ge.value.map((l) => l.sku);
|
|
2536
2537
|
return m.sort((l, v) => l.code.localeCompare(v.code)), m;
|
|
2537
|
-
}), Fe =
|
|
2538
|
+
}), Fe = Bt();
|
|
2538
2539
|
Be(
|
|
2539
2540
|
() => e.show,
|
|
2540
2541
|
async (m) => {
|
|
@@ -2551,12 +2552,12 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2551
2552
|
), Be(
|
|
2552
2553
|
[() => e.show, T],
|
|
2553
2554
|
([m]) => {
|
|
2554
|
-
m && (U(),
|
|
2555
|
+
m && (U(), bn());
|
|
2555
2556
|
},
|
|
2556
2557
|
{ immediate: !0 }
|
|
2557
2558
|
);
|
|
2558
|
-
const
|
|
2559
|
-
async function
|
|
2559
|
+
const Xe = S(() => tt.value.reduce((m, l) => m + Number(l.stockTakeValue), 0)), et = Qe(0), gn = Qe(100);
|
|
2560
|
+
async function bn() {
|
|
2560
2561
|
var m, l;
|
|
2561
2562
|
if (k._currentLocation) {
|
|
2562
2563
|
b.value = !0, z.value = [], A.value = [];
|
|
@@ -2595,7 +2596,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2595
2596
|
}
|
|
2596
2597
|
}
|
|
2597
2598
|
}
|
|
2598
|
-
async function
|
|
2599
|
+
async function Pt() {
|
|
2599
2600
|
var l, v;
|
|
2600
2601
|
if ($.value)
|
|
2601
2602
|
return;
|
|
@@ -2616,7 +2617,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2616
2617
|
}
|
|
2617
2618
|
);
|
|
2618
2619
|
}
|
|
2619
|
-
async function
|
|
2620
|
+
async function hn() {
|
|
2620
2621
|
var l, v;
|
|
2621
2622
|
if (!(((l = e.draft) == null ? void 0 : l.effectiveAt) ?? (e.draft ? Re((v = e.draft) == null ? void 0 : v._id) : null))) {
|
|
2622
2623
|
O.open({
|
|
@@ -2628,15 +2629,15 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2628
2629
|
}
|
|
2629
2630
|
await r.invalidateDraftCache(e.draft);
|
|
2630
2631
|
}
|
|
2631
|
-
const
|
|
2632
|
+
const _n = S(
|
|
2632
2633
|
() => d.value.groupBy(
|
|
2633
2634
|
(m) => m.id,
|
|
2634
2635
|
(m) => m.balance
|
|
2635
2636
|
)
|
|
2636
|
-
),
|
|
2637
|
+
), kn = S(() => Ge.value.groupBy((m) => m.sku._id)), xn = S(() => {
|
|
2637
2638
|
var m;
|
|
2638
2639
|
return (m = e.draft) != null && m.adjustmentSnapshot ? new Map(e.draft.adjustmentSnapshot.map((l) => [l.skuId, l.adjustmentsByType])) : /* @__PURE__ */ new Map();
|
|
2639
|
-
}),
|
|
2640
|
+
}), wn = S(() => {
|
|
2640
2641
|
var m;
|
|
2641
2642
|
return (m = e.draft) != null && m.opening ? new Map(e.draft.opening.map((l) => [l.skuId, l.balance])) : /* @__PURE__ */ new Map();
|
|
2642
2643
|
});
|
|
@@ -2654,7 +2655,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2654
2655
|
}
|
|
2655
2656
|
);
|
|
2656
2657
|
}
|
|
2657
|
-
const
|
|
2658
|
+
const Rt = S(() => [
|
|
2658
2659
|
{
|
|
2659
2660
|
id: "sku",
|
|
2660
2661
|
accessorFn: (l) => `${l.code} ${l.name}`,
|
|
@@ -2714,7 +2715,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2714
2715
|
}
|
|
2715
2716
|
},
|
|
2716
2717
|
// Dynamic custom attribute columns (toggled by user)
|
|
2717
|
-
...
|
|
2718
|
+
...Nt.value.map(
|
|
2718
2719
|
(l) => ({
|
|
2719
2720
|
id: `customAttr_${l}`,
|
|
2720
2721
|
accessorFn: (v) => v.customAttributeValues[l],
|
|
@@ -2818,7 +2819,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2818
2819
|
accessorFn: (l) => {
|
|
2819
2820
|
var V;
|
|
2820
2821
|
const v = (V = h.value.find((W) => W.id === l.id)) == null ? void 0 : V.balance;
|
|
2821
|
-
return v ?
|
|
2822
|
+
return v ? io.toDouble(v) : l.physicalBalance;
|
|
2822
2823
|
},
|
|
2823
2824
|
header: () => we("Stock Take balance", "The physical balance recorded during stock take."),
|
|
2824
2825
|
cell(l) {
|
|
@@ -2860,7 +2861,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
2860
2861
|
_(ye.FmIcon, { name: "info", size: "sm", outline: !0 })
|
|
2861
2862
|
]
|
|
2862
2863
|
),
|
|
2863
|
-
default: () =>
|
|
2864
|
+
default: () => vn(v.breakdown, v.physicalBalance, v.baseUnit)
|
|
2864
2865
|
}
|
|
2865
2866
|
) : le;
|
|
2866
2867
|
},
|
|
@@ -3036,10 +3037,10 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3036
3037
|
enableSorting: !1,
|
|
3037
3038
|
cell(l) {
|
|
3038
3039
|
const v = l.row.original;
|
|
3039
|
-
return I.value.length && v.sourceBuckets.length ? Da(v.sourceBuckets, v.baseUnit) :
|
|
3040
|
+
return I.value.length && v.sourceBuckets.length ? Da(v.sourceBuckets, v.baseUnit) : jt(v.baseUnitAmount, v.baseUnit, v.measurements);
|
|
3040
3041
|
}
|
|
3041
3042
|
}
|
|
3042
|
-
]),
|
|
3043
|
+
]), Dn = S(() => Rt.value.map((m) => m.size ?? 0).reduce((m, l) => m + l)), _t = Q(""), $n = S(() => {
|
|
3043
3044
|
var V, W;
|
|
3044
3045
|
const m = ((W = (V = e.draft) == null ? void 0 : V.negativeStockItems) == null ? void 0 : W.reduce(
|
|
3045
3046
|
(P, Z) => (P[Z.sku._id] = Z, P),
|
|
@@ -3048,23 +3049,23 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3048
3049
|
h.value.map((P) => [P.id, P.balance])
|
|
3049
3050
|
);
|
|
3050
3051
|
return Se.value.map((P) => {
|
|
3051
|
-
var Gt, Ht, Yt, Kt, Wt, qt, Qt, Jt
|
|
3052
|
-
const Z = (
|
|
3052
|
+
var Ot, Gt, Ht, Yt, Kt, Wt, qt, Qt, Jt;
|
|
3053
|
+
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
3054
|
amount: 1,
|
|
3054
3055
|
precision: 0
|
|
3055
3056
|
}, Ce = Number(
|
|
3056
3057
|
oe.toFormatString({ value: je })
|
|
3057
|
-
),
|
|
3058
|
+
), st = wn.value.get(P._id), rt = st ? Number(oe.toFormatString({ value: st })) : 0, q = xn.value.get(P._id), ve = {};
|
|
3058
3059
|
if (B.value.forEach((ke) => {
|
|
3059
|
-
const
|
|
3060
|
-
|
|
3060
|
+
const it = ve[ke] ?? { amount: 0, precision: 0 }, ct = q == null ? void 0 : q[ke];
|
|
3061
|
+
ct && (ve[ke] = qe(it, ct));
|
|
3061
3062
|
}), !Z) {
|
|
3062
|
-
const ke = Number(oe.toFormatString({ value: le })),
|
|
3063
|
+
const ke = Number(oe.toFormatString({ value: le })), it = 0 - ke, ct = it * se / Ce, Rn = 0, Mn = ke * se / Ce;
|
|
3063
3064
|
return {
|
|
3064
3065
|
id: P._id,
|
|
3065
3066
|
code: P.code,
|
|
3066
3067
|
name: P.name,
|
|
3067
|
-
costUnit: ((
|
|
3068
|
+
costUnit: ((qt = (Wt = P.defaultCost) == null ? void 0 : Wt.measurement) == null ? void 0 : qt.abbrev) ?? null,
|
|
3068
3069
|
baseUnit: P.unit.abbrev,
|
|
3069
3070
|
baseUnitAmount: 0,
|
|
3070
3071
|
systemBalance: ke,
|
|
@@ -3073,11 +3074,11 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3073
3074
|
adjustedDiffPercentage: -100,
|
|
3074
3075
|
isTemplateItem: !m[P._id],
|
|
3075
3076
|
costPerUnit: se,
|
|
3076
|
-
opening:
|
|
3077
|
-
varianceQty:
|
|
3078
|
-
varianceInCost:
|
|
3079
|
-
stockTakeValue:
|
|
3080
|
-
systemValue:
|
|
3077
|
+
opening: rt,
|
|
3078
|
+
varianceQty: it,
|
|
3079
|
+
varianceInCost: ct,
|
|
3080
|
+
stockTakeValue: Rn,
|
|
3081
|
+
systemValue: Mn,
|
|
3081
3082
|
adjustmentAmounts: ve,
|
|
3082
3083
|
customAttributeValues: P.customAttributes ?? {},
|
|
3083
3084
|
measurements: [],
|
|
@@ -3086,49 +3087,49 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3086
3087
|
subSources: []
|
|
3087
3088
|
};
|
|
3088
3089
|
}
|
|
3089
|
-
const be = bt(Z), Ie = l.get(P._id), Ne =
|
|
3090
|
+
const be = bt(Z), Ie = l.get(P._id), Ne = cn(
|
|
3090
3091
|
Ie ?? be,
|
|
3091
3092
|
le
|
|
3092
|
-
),
|
|
3093
|
+
), lt = le.amount === 0 ? null : un(Ne, {
|
|
3093
3094
|
...le,
|
|
3094
3095
|
amount: Math.abs(le.amount)
|
|
3095
|
-
}),
|
|
3096
|
+
}), 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
3097
|
return {
|
|
3097
3098
|
id: P._id,
|
|
3098
3099
|
code: P.code,
|
|
3099
3100
|
name: P.name,
|
|
3100
|
-
costUnit: ((
|
|
3101
|
+
costUnit: ((Jt = (Qt = P.defaultCost) == null ? void 0 : Qt.measurement) == null ? void 0 : Jt.abbrev) ?? null,
|
|
3101
3102
|
baseUnit: P.unit.abbrev,
|
|
3102
|
-
baseUnitAmount:
|
|
3103
|
-
measurements:
|
|
3104
|
-
breakdown:
|
|
3103
|
+
baseUnitAmount: Tn,
|
|
3104
|
+
measurements: jn,
|
|
3105
|
+
breakdown: Pn,
|
|
3105
3106
|
systemBalance: wt,
|
|
3106
3107
|
physicalBalance: Dt,
|
|
3107
3108
|
adjustedAmount: Number(oe.toFormatString({ value: Ne })),
|
|
3108
|
-
adjustedDiffPercentage:
|
|
3109
|
+
adjustedDiffPercentage: Et ? Number(
|
|
3109
3110
|
oe.toFormatString({
|
|
3110
|
-
value:
|
|
3111
|
+
value: dn(Et, 2)
|
|
3111
3112
|
})
|
|
3112
3113
|
) : null,
|
|
3113
3114
|
isTemplateItem: !m[P._id],
|
|
3114
3115
|
costPerUnit: se,
|
|
3115
|
-
opening:
|
|
3116
|
-
varianceQty:
|
|
3117
|
-
varianceInCost:
|
|
3118
|
-
stockTakeValue:
|
|
3119
|
-
systemValue:
|
|
3116
|
+
opening: rt,
|
|
3117
|
+
varianceQty: Lt,
|
|
3118
|
+
varianceInCost: Fn,
|
|
3119
|
+
stockTakeValue: In,
|
|
3120
|
+
systemValue: Bn,
|
|
3120
3121
|
adjustmentAmounts: ve,
|
|
3121
3122
|
customAttributeValues: P.customAttributes ?? {},
|
|
3122
|
-
sourceBuckets:
|
|
3123
|
-
subSources:
|
|
3123
|
+
sourceBuckets: zt,
|
|
3124
|
+
subSources: zt.filter((ke) => ke.isSub).map((ke) => ke.label)
|
|
3124
3125
|
};
|
|
3125
3126
|
});
|
|
3126
|
-
}),
|
|
3127
|
-
() =>
|
|
3128
|
-
),
|
|
3129
|
-
() =>
|
|
3130
|
-
),
|
|
3131
|
-
() =>
|
|
3127
|
+
}), tt = S(() => $n.value.filter((m) => !!(m.isTemplateItem && ce.value.templateItem || !m.isTemplateItem && ce.value.nonTemplateItem))), Mt = S(
|
|
3128
|
+
() => tt.value.some((m) => m.measurements.some((l) => l.variant === "inactive"))
|
|
3129
|
+
), Ut = S(
|
|
3130
|
+
() => tt.value.some((m) => m.measurements.some((l) => l.variant === "orphan"))
|
|
3131
|
+
), Cn = S(
|
|
3132
|
+
() => Mt.value || Ut.value
|
|
3132
3133
|
), kt = S(() => {
|
|
3133
3134
|
const m = /* @__PURE__ */ new Set();
|
|
3134
3135
|
for (const l of Se.value)
|
|
@@ -3136,11 +3137,11 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3136
3137
|
for (const v of Object.keys(l.customAttributes))
|
|
3137
3138
|
v !== "tag" && m.add(v);
|
|
3138
3139
|
return Array.from(m).sort();
|
|
3139
|
-
}),
|
|
3140
|
-
() => kt.value.filter((m) =>
|
|
3141
|
-
),
|
|
3140
|
+
}), nt = Zt({}), Nt = S(
|
|
3141
|
+
() => kt.value.filter((m) => nt[m])
|
|
3142
|
+
), An = S(() => {
|
|
3142
3143
|
var m;
|
|
3143
|
-
return e.draft ?
|
|
3144
|
+
return e.draft ? yn(e.draft, {
|
|
3144
3145
|
idDisplay: s.value,
|
|
3145
3146
|
locationName: (m = k._currentLocation) == null ? void 0 : m.name
|
|
3146
3147
|
}) : [];
|
|
@@ -3191,25 +3192,25 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3191
3192
|
]
|
|
3192
3193
|
})
|
|
3193
3194
|
);
|
|
3194
|
-
}),
|
|
3195
|
+
}), ot = Q(!1), at = Q(!1), Vt = S(() => {
|
|
3195
3196
|
var m;
|
|
3196
3197
|
return ((m = e.draft) == null ? void 0 : m.status) !== _e.enum.DRAFT ? "Status is not draft." : null;
|
|
3197
3198
|
});
|
|
3198
|
-
function
|
|
3199
|
-
e.draft && (
|
|
3199
|
+
function Sn() {
|
|
3200
|
+
e.draft && (at.value = !0, r.approveDraft(
|
|
3200
3201
|
e.draft,
|
|
3201
3202
|
() => {
|
|
3202
|
-
|
|
3203
|
+
at.value = !1, ot.value = !1, X("submitted");
|
|
3203
3204
|
},
|
|
3204
3205
|
() => {
|
|
3205
|
-
|
|
3206
|
+
at.value = !1;
|
|
3206
3207
|
}
|
|
3207
3208
|
));
|
|
3208
3209
|
}
|
|
3209
3210
|
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"),
|
|
3211
|
+
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
3212
|
return p(), C(re, null, [
|
|
3212
|
-
D(
|
|
3213
|
+
D(rt, {
|
|
3213
3214
|
"dismiss-away": "",
|
|
3214
3215
|
"max-width": 9999,
|
|
3215
3216
|
"model-value": f(c),
|
|
@@ -3222,13 +3223,13 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3222
3223
|
a("div", Zs, [
|
|
3223
3224
|
a("div", Xs, [
|
|
3224
3225
|
((q = e.draft) == null ? void 0 : q.status) === f(_e).enum.DRAFT ? (p(), C(re, { key: 0 }, [
|
|
3225
|
-
|
|
3226
|
+
Vt.value ? (p(), ne(st, {
|
|
3226
3227
|
key: 0,
|
|
3227
3228
|
"z-index": 51,
|
|
3228
3229
|
placement: "right"
|
|
3229
3230
|
}, {
|
|
3230
3231
|
content: te(() => [
|
|
3231
|
-
fe(N(
|
|
3232
|
+
fe(N(Vt.value), 1)
|
|
3232
3233
|
]),
|
|
3233
3234
|
default: te(() => [
|
|
3234
3235
|
D(Z, {
|
|
@@ -3241,7 +3242,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3241
3242
|
})) : (p(), ne(Z, {
|
|
3242
3243
|
key: "approve key",
|
|
3243
3244
|
label: "Approve",
|
|
3244
|
-
onClick: l[5] || (l[5] = (Ne) =>
|
|
3245
|
+
onClick: l[5] || (l[5] = (Ne) => ot.value = !0)
|
|
3245
3246
|
}))
|
|
3246
3247
|
], 64)) : H("", !0),
|
|
3247
3248
|
((ve = e.draft) == null ? void 0 : ve.status) === f(_e).enum.DRAFT ? (p(), ne(Z, {
|
|
@@ -3272,7 +3273,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3272
3273
|
]),
|
|
3273
3274
|
a("div", er, [
|
|
3274
3275
|
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(
|
|
3276
|
+
a("div", tr, N(o.value) + " " + N(Xe.value.toFixed(2)), 1)
|
|
3276
3277
|
])
|
|
3277
3278
|
])
|
|
3278
3279
|
];
|
|
@@ -3318,7 +3319,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3318
3319
|
]),
|
|
3319
3320
|
D(V),
|
|
3320
3321
|
a("div", fs, [
|
|
3321
|
-
(p(!0), C(re, null, ge(
|
|
3322
|
+
(p(!0), C(re, null, ge(An.value, (be, Ie) => (p(), C("div", {
|
|
3322
3323
|
class: "flex flex-col gap-4",
|
|
3323
3324
|
key: Ie
|
|
3324
3325
|
}, [
|
|
@@ -3350,7 +3351,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3350
3351
|
]),
|
|
3351
3352
|
_: 1
|
|
3352
3353
|
})) : H("", !0),
|
|
3353
|
-
|
|
3354
|
+
Cn.value ? (p(), C("div", hs, [
|
|
3354
3355
|
D(P, {
|
|
3355
3356
|
name: "rule",
|
|
3356
3357
|
size: "sm"
|
|
@@ -3358,12 +3359,12 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3358
3359
|
a("div", _s, [
|
|
3359
3360
|
l[16] || (l[16] = a("div", { class: "fm-typo-en-body-md-600" }, "UOM notes", -1)),
|
|
3360
3361
|
a("ul", ks, [
|
|
3361
|
-
|
|
3362
|
+
Mt.value ? (p(), C("li", xs, l[15] || (l[15] = [
|
|
3362
3363
|
fe(" Measurements highlighted in "),
|
|
3363
3364
|
a("span", { class: "font-bold" }, "purple", -1),
|
|
3364
3365
|
fe(" are NetSuite-inactive UOMs (surfaced for audit; their amounts are part of the base total). ")
|
|
3365
3366
|
]))) : H("", !0),
|
|
3366
|
-
|
|
3367
|
+
Ut.value ? (p(), C("li", ws, " Red highlights are UOMs not on the SKU (ignored). ")) : H("", !0)
|
|
3367
3368
|
])
|
|
3368
3369
|
])
|
|
3369
3370
|
])) : H("", !0),
|
|
@@ -3381,7 +3382,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3381
3382
|
"border-color": "primary",
|
|
3382
3383
|
loading: f($),
|
|
3383
3384
|
disabled: f($),
|
|
3384
|
-
onClick:
|
|
3385
|
+
onClick: Pt
|
|
3385
3386
|
}, null, 8, ["loading", "disabled"])) : H("", !0),
|
|
3386
3387
|
D($t, null, {
|
|
3387
3388
|
default: te(() => [
|
|
@@ -3393,7 +3394,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3393
3394
|
"bg-color": "transparent",
|
|
3394
3395
|
"border-color": "primary",
|
|
3395
3396
|
loading: f($),
|
|
3396
|
-
onClick:
|
|
3397
|
+
onClick: hn
|
|
3397
3398
|
}, null, 8, ["loading"])
|
|
3398
3399
|
]),
|
|
3399
3400
|
_: 1
|
|
@@ -3409,7 +3410,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3409
3410
|
m.draft,
|
|
3410
3411
|
d.value,
|
|
3411
3412
|
h.value,
|
|
3412
|
-
|
|
3413
|
+
Nt.value
|
|
3413
3414
|
) : null)
|
|
3414
3415
|
})
|
|
3415
3416
|
]))
|
|
@@ -3477,17 +3478,17 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3477
3478
|
key: q,
|
|
3478
3479
|
label: q,
|
|
3479
3480
|
selectable: "",
|
|
3480
|
-
selected:
|
|
3481
|
-
onClick: (ve) =>
|
|
3481
|
+
selected: nt[q],
|
|
3482
|
+
onClick: (ve) => nt[q] = !nt[q]
|
|
3482
3483
|
}, null, 8, ["label", "selected", "onClick"]))), 128))
|
|
3483
3484
|
])) : H("", !0),
|
|
3484
3485
|
a("div", js, [
|
|
3485
3486
|
a("div", {
|
|
3486
|
-
style:
|
|
3487
|
+
style: mt({ height: "600px", minWidth: `${Dn.value}px` })
|
|
3487
3488
|
}, [
|
|
3488
3489
|
D(je, {
|
|
3489
|
-
"column-defs":
|
|
3490
|
-
"row-data":
|
|
3490
|
+
"column-defs": Rt.value,
|
|
3491
|
+
"row-data": tt.value,
|
|
3491
3492
|
"search-value": _t.value
|
|
3492
3493
|
}, null, 8, ["column-defs", "row-data", "search-value"])
|
|
3493
3494
|
], 4)
|
|
@@ -3556,8 +3557,8 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3556
3557
|
}, [
|
|
3557
3558
|
a("div", Qs, N(be == null ? void 0 : be.label), 1),
|
|
3558
3559
|
a("div", Js, [
|
|
3559
|
-
(p(!0), C(re, null, ge(be == null ? void 0 : be.values, (Ne,
|
|
3560
|
-
key:
|
|
3560
|
+
(p(!0), C(re, null, ge(be == null ? void 0 : be.values, (Ne, lt) => (p(), C("div", {
|
|
3561
|
+
key: lt,
|
|
3561
3562
|
class: "fm-typo-en-body-lg-600"
|
|
3562
3563
|
}, N(Ne), 1))), 128))
|
|
3563
3564
|
])
|
|
@@ -3573,7 +3574,7 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3573
3574
|
D(Ce),
|
|
3574
3575
|
a("div", null, [
|
|
3575
3576
|
a("img", {
|
|
3576
|
-
src: f(
|
|
3577
|
+
src: f(mn),
|
|
3577
3578
|
alt: "List is empty"
|
|
3578
3579
|
}, null, 8, Ms)
|
|
3579
3580
|
]),
|
|
@@ -3589,14 +3590,14 @@ const Ca = { class: "fm-typo-en-body-lg-400" }, Aa = { class: "fm-typo-en-body-l
|
|
|
3589
3590
|
}, 8, ["model-value"]),
|
|
3590
3591
|
f(c) && e.draft ? (p(), ne(la, {
|
|
3591
3592
|
key: 0,
|
|
3592
|
-
show:
|
|
3593
|
-
"onUpdate:show": l[10] || (l[10] = (q) =>
|
|
3593
|
+
show: ot.value,
|
|
3594
|
+
"onUpdate:show": l[10] || (l[10] = (q) => ot.value = q),
|
|
3594
3595
|
refreshing: f($),
|
|
3595
|
-
approving:
|
|
3596
|
+
approving: at.value,
|
|
3596
3597
|
draft: e.draft,
|
|
3597
3598
|
groups: I.value,
|
|
3598
|
-
onRefresh:
|
|
3599
|
-
onApprove:
|
|
3599
|
+
onRefresh: Pt,
|
|
3600
|
+
onApprove: Sn
|
|
3600
3601
|
}, null, 8, ["show", "refreshing", "approving", "draft", "groups"])) : H("", !0),
|
|
3601
3602
|
D(is, {
|
|
3602
3603
|
show: K.value,
|
|
@@ -3616,7 +3617,7 @@ async function ar(t) {
|
|
|
3616
3617
|
o.onload = (i) => {
|
|
3617
3618
|
var s;
|
|
3618
3619
|
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 =
|
|
3620
|
+
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
3621
|
header: 1,
|
|
3621
3622
|
defval: ""
|
|
3622
3623
|
}), I = (j) => String(j).trim().toLowerCase().replace(/^\uFEFF/, ""), E = y.findIndex(
|
|
@@ -3677,11 +3678,11 @@ function lr(t, n) {
|
|
|
3677
3678
|
const e = t.filter((c) => !c.isInactive), o = uo().format("YYYY-MM-DD"), i = `${n} - ${o}.csv`, s = [
|
|
3678
3679
|
["Code", "Name", "Balance"],
|
|
3679
3680
|
...e.map((c) => [c.code, c.name, ""])
|
|
3680
|
-
], r =
|
|
3681
|
-
|
|
3681
|
+
], r = dt.aoa_to_sheet(s), u = dt.book_new();
|
|
3682
|
+
dt.book_append_sheet(u, r, "Template"), to(u, i, { bookType: "csv" });
|
|
3682
3683
|
}
|
|
3683
3684
|
function ir() {
|
|
3684
|
-
const t = Q([]), n = Q([]), e = Q(!1), o =
|
|
3685
|
+
const t = Q([]), n = Q([]), e = Q(!1), o = Ft(), i = Oe(), s = gt(), r = S(
|
|
3685
3686
|
() => t.value.some((y) => y.status === xe.negative)
|
|
3686
3687
|
);
|
|
3687
3688
|
async function u(y) {
|
|
@@ -3734,7 +3735,7 @@ function ir() {
|
|
|
3734
3735
|
name: K.sku.name,
|
|
3735
3736
|
unit: K.sku.unit
|
|
3736
3737
|
},
|
|
3737
|
-
baseAmount:
|
|
3738
|
+
baseAmount: Jn(K.physicalCount, K.sku.unit.precision),
|
|
3738
3739
|
measurementsAmounts: []
|
|
3739
3740
|
}), R = I.map(U), F = E.map(U), L = {
|
|
3740
3741
|
effectiveAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -3760,7 +3761,7 @@ const cr = { class: "flex flex-col gap-16" }, ur = {
|
|
|
3760
3761
|
unrecognisedItemCodes: {}
|
|
3761
3762
|
},
|
|
3762
3763
|
setup(t) {
|
|
3763
|
-
const n = t, { t: e } =
|
|
3764
|
+
const n = t, { t: e } = Je(), o = S(
|
|
3764
3765
|
() => n.items.filter((u) => u.status === xe.negative)
|
|
3765
3766
|
), i = S(
|
|
3766
3767
|
() => n.items.filter((u) => u.status === xe.systemNegative)
|
|
@@ -3908,7 +3909,7 @@ const cr = { class: "flex flex-col gap-16" }, ur = {
|
|
|
3908
3909
|
},
|
|
3909
3910
|
emits: ["update:show", "submitted"],
|
|
3910
3911
|
setup(t, { emit: n }) {
|
|
3911
|
-
const e = t, o = n, i =
|
|
3912
|
+
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
3913
|
() => c.value && !U.value && y.value.length > 0
|
|
3913
3914
|
), j = S(() => {
|
|
3914
3915
|
const d = y.value.filter(
|
|
@@ -3982,7 +3983,7 @@ const cr = { class: "flex flex-col gap-16" }, ur = {
|
|
|
3982
3983
|
accept: ".csv",
|
|
3983
3984
|
disabled: f(U),
|
|
3984
3985
|
onFileUpload: z
|
|
3985
|
-
},
|
|
3986
|
+
}, Vn({ _: 2 }, [
|
|
3986
3987
|
c.value ? {
|
|
3987
3988
|
name: "default",
|
|
3988
3989
|
fn: te(({ openFileDialog: x }) => [
|
|
@@ -4119,15 +4120,15 @@ const cr = { class: "flex flex-col gap-16" }, ur = {
|
|
|
4119
4120
|
}), jr = ["onClick"], Pr = { class: "flex items-start gap-8" }, Rr = { class: "fm-typo-body-md-400 line-clamp-3 w-full" }, Mr = { class: "flex flex-col gap-8" }, Ur = { class: "flex items-start gap-4" }, Nr = { class: "flex-1 flex flex-col gap-8" }, Vr = { class: "flex flex-col" }, Er = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Lr = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, zr = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Or = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, Gr = {
|
|
4120
4121
|
key: 0,
|
|
4121
4122
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
4122
|
-
},
|
|
4123
|
+
}, _l = /* @__PURE__ */ De({
|
|
4123
4124
|
__name: "ClosingDraftView",
|
|
4124
4125
|
setup(t) {
|
|
4125
|
-
const { t: n } =
|
|
4126
|
+
const { t: n } = Je(), { viewDraft: e } = pt(), { viewClosingDraftProps: o, viewClosingDraftShow: i } = Wn(pt()), s = Oe(), r = fn(), u = zn(), { breakpoints: c } = Gn();
|
|
4126
4127
|
s.watchLocation(r.fetchDrafts);
|
|
4127
4128
|
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
4129
|
() => {
|
|
4129
4130
|
var w;
|
|
4130
|
-
return ((w = s._currentLocation) == null ? void 0 : w.type) ===
|
|
4131
|
+
return ((w = s._currentLocation) == null ? void 0 : w.type) === Kn.enum.warehouse;
|
|
4131
4132
|
}
|
|
4132
4133
|
);
|
|
4133
4134
|
function F(w) {
|
|
@@ -4178,7 +4179,7 @@ const cr = { class: "flex flex-col gap-16" }, ur = {
|
|
|
4178
4179
|
return (w, d) => {
|
|
4179
4180
|
const h = J("FmTable");
|
|
4180
4181
|
return p(), C(re, null, [
|
|
4181
|
-
D(
|
|
4182
|
+
D(On, {
|
|
4182
4183
|
title: f(n)("inventory.closing.draft.title"),
|
|
4183
4184
|
actions: A.value,
|
|
4184
4185
|
"onClick:action": F
|
|
@@ -4193,7 +4194,7 @@ const cr = { class: "flex flex-col gap-16" }, ur = {
|
|
|
4193
4194
|
}
|
|
4194
4195
|
])
|
|
4195
4196
|
}, [
|
|
4196
|
-
D(
|
|
4197
|
+
D(ro, {
|
|
4197
4198
|
"change-location": "",
|
|
4198
4199
|
searchable: "",
|
|
4199
4200
|
search: y.value,
|
|
@@ -4201,7 +4202,7 @@ const cr = { class: "flex flex-col gap-16" }, ur = {
|
|
|
4201
4202
|
}, null, 8, ["search"]),
|
|
4202
4203
|
(p(), ne(h, {
|
|
4203
4204
|
key: f(r).tableKey,
|
|
4204
|
-
style:
|
|
4205
|
+
style: mt(f(u).tableHeight),
|
|
4205
4206
|
"column-defs": f(r).columnDefs,
|
|
4206
4207
|
"row-data": f(r).drafts,
|
|
4207
4208
|
"search-value": y.value,
|
|
@@ -4222,7 +4223,7 @@ const cr = { class: "flex flex-col gap-16" }, ur = {
|
|
|
4222
4223
|
"h-[56px] text-fm-color-typo-primary align-top",
|
|
4223
4224
|
((O = j(M)) == null ? void 0 : O.cellClass) ?? "px-16 py-12"
|
|
4224
4225
|
]),
|
|
4225
|
-
style:
|
|
4226
|
+
style: mt({
|
|
4226
4227
|
width: (g = j(M)) == null ? void 0 : g.width,
|
|
4227
4228
|
maxWidth: (k = j(M)) == null ? void 0 : k.maxWidth,
|
|
4228
4229
|
textAlign: ((x = j(M)) == null ? void 0 : x.textAlign) ?? "left"
|
|
@@ -4249,7 +4250,7 @@ const cr = { class: "flex flex-col gap-16" }, ur = {
|
|
|
4249
4250
|
onRowClick: (M) => f(e)(M)
|
|
4250
4251
|
}, {
|
|
4251
4252
|
default: te((M) => {
|
|
4252
|
-
var O, g, k, x, ee, X, T, G, $, Y, me, ae, ce, pe, Te,
|
|
4253
|
+
var O, g, k, x, ee, X, T, G, $, Y, me, ae, ce, pe, Te, Ze, Ge, Se, Fe, Xe;
|
|
4253
4254
|
return [
|
|
4254
4255
|
a("div", Nr, [
|
|
4255
4256
|
a("div", Vr, [
|
|
@@ -4266,7 +4267,7 @@ const cr = { class: "flex flex-col gap-16" }, ur = {
|
|
|
4266
4267
|
}, null, 8, ["render", "props"])
|
|
4267
4268
|
]),
|
|
4268
4269
|
a("div", zr, N([
|
|
4269
|
-
...B.original.items.slice(0, 3).map((
|
|
4270
|
+
...B.original.items.slice(0, 3).map((et) => et.sku.name),
|
|
4270
4271
|
...B.original.items.length >= 3 ? [`and ${B.original.items.length - 3} more items`] : []
|
|
4271
4272
|
].join(", ")), 1),
|
|
4272
4273
|
a("div", Or, [
|
|
@@ -4279,8 +4280,8 @@ const cr = { class: "flex flex-col gap-16" }, ur = {
|
|
|
4279
4280
|
K(B).length ? (p(), C("div", Gr, N(z(B)), 1)) : H("", !0),
|
|
4280
4281
|
a("div", null, [
|
|
4281
4282
|
D(f(Ye), {
|
|
4282
|
-
render: (Se = (Ge = (
|
|
4283
|
-
props: (
|
|
4283
|
+
render: (Se = (Ge = (Ze = M.status) == null ? void 0 : Ze.column) == null ? void 0 : Ge.columnDef) == null ? void 0 : Se.cell,
|
|
4284
|
+
props: (Xe = (Fe = M.status) == null ? void 0 : Fe.getContext) == null ? void 0 : Xe.call(Fe)
|
|
4284
4285
|
}, null, 8, ["render", "props"])
|
|
4285
4286
|
])
|
|
4286
4287
|
])
|
|
@@ -4302,8 +4303,8 @@ const cr = { class: "flex flex-col gap-16" }, ur = {
|
|
|
4302
4303
|
"onUpdate:show": d[2] || (d[2] = (B) => I.value = B),
|
|
4303
4304
|
onSubmitted: f(r).fetchDrafts
|
|
4304
4305
|
}, null, 8, ["show", "onSubmitted"]),
|
|
4305
|
-
(p(), ne(
|
|
4306
|
-
D(or,
|
|
4306
|
+
(p(), ne(En, { to: "body" }, [
|
|
4307
|
+
D(or, Ln(f(o), {
|
|
4307
4308
|
show: f(i),
|
|
4308
4309
|
"onUpdate:show": d[3] || (d[3] = (B) => vt(i) ? i.value = B : null),
|
|
4309
4310
|
onSubmitted: d[4] || (d[4] = () => (i.value = !1, f(r).fetchDrafts())),
|
|
@@ -4315,5 +4316,5 @@ const cr = { class: "flex flex-col gap-16" }, ur = {
|
|
|
4315
4316
|
}
|
|
4316
4317
|
});
|
|
4317
4318
|
export {
|
|
4318
|
-
|
|
4319
|
+
_l as default
|
|
4319
4320
|
};
|