@feedmepos/mf-inventory-portal 1.5.9 → 1.5.11-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-D_elK-3W.js → App-D4rysNfh.js} +4 -4
- package/dist/{ApprovalView-WdSQEpGQ.js → ApprovalView-DpYJmgiG.js} +7 -7
- package/dist/{BindingsDialog-CkqhKrrD.js → BindingsDialog-C7z0HH48.js} +2 -2
- package/dist/{BindingsPicker-HPjbSTJd.js → BindingsPicker-C5IKp9CT.js} +2 -2
- package/dist/{BindingsTable-BF4WTUsf.js → BindingsTable-BRDooCs4.js} +3 -3
- package/dist/{ClosingDraftView-CTEaBuhS.js → ClosingDraftView-CSCbfIFE.js} +159 -158
- package/dist/ClosingHistoryView-DCIJ5ONT.js +1114 -0
- package/dist/{ClosingTemplateView-DMtIj04r.js → ClosingTemplateView-D1n9_dFc.js} +14 -14
- package/dist/{DefaultView-v-32G42G.js → DefaultView-Llrh9ufI.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-DHD9kykc.js → DeliveryOrderPrintPreview-DSkU-sqv.js} +2 -2
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-FRe1RX5T.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DL6AKT9H.js} +2 -2
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-KTtYD7qS.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-JHabBWJb.js} +2 -2
- package/dist/{FmMultiselectDialog-BTNJvhnt.js → FmMultiselectDialog-BWujDEnX.js} +2 -2
- package/dist/{FmMultiselectDialog-LmjSdrn3.js → FmMultiselectDialog-C0lCYHla.js} +1 -1
- package/dist/FmUnitInput.vue_vue_type_script_setup_true_lang-CjCNHugK.js +388 -0
- package/dist/{ImportView-DoHL35I-.js → ImportView-C6q4gB3S.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-D8JocFRD.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-Df7B8ZEG.js} +1 -1
- package/dist/{IngredientGroupView-CVhShbuq.js → IngredientGroupView-DO8OKEVU.js} +5 -5
- package/dist/{IngredientsView-XOTuP5ZI.js → IngredientsView-CD2YtXPJ.js} +15 -15
- package/dist/{IntegrationExplorerView-BsY4Ca2E.js → IntegrationExplorerView-CZCMnwZG.js} +352 -352
- package/dist/{IntegrationView-C_Y3_I_8.js → IntegrationView--3nVS_X6.js} +13 -13
- package/dist/{InventoryBindingForm-CHsrJSnp.js → InventoryBindingForm-FjFTiN7R.js} +1 -1
- package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-CcF5cko8.js +441 -0
- package/dist/{InventoryBindingSummary-C9UE6Zh2.js → InventoryBindingSummary-D90hAi96.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DFj3HtnZ.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-1iDUXU2T.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-oNk0zO9K.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DTYnX8kn.js} +1 -1
- package/dist/{PublishView-DVk0ZUlG.js → PublishView-BtcGl7zM.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-poHk4RMP.js → PurchaseOrderPrintPreview-DvkMQv1w.js} +2 -2
- package/dist/{ReceiveRequestView-CaPoxKBs.js → ReceiveRequestView-DSfj36r3.js} +9631 -9552
- package/dist/{RecipeView-bbhd-mNL.js → RecipeView-DkDSr3LN.js} +1304 -1267
- package/dist/{SettingsView-DxiMiFpz.js → SettingsView-iRqUoEPg.js} +4 -4
- package/dist/{StockView-Dc4ICHq3.js → StockView-DxUXHYD_.js} +279 -278
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Cn3NL6mQ.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-WJ0Fz21v.js} +1 -1
- package/dist/{SupplierView-6fETAO2h.js → SupplierView-BYQjWeU7.js} +12 -12
- package/dist/{SurchargeView-7ucdobpg.js → SurchargeView-CyhTe1B8.js} +6 -6
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-C4EeNPwc.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-CBM8jJqP.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-D-PqQ3Mi.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DM9Cg0uk.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-D-nG9kcq.js → TransferDetails.vue_vue_type_script_setup_true_lang-D2MztVse.js} +20 -20
- package/dist/{TransferTemplateView-CDD_5s5s.js → TransferTemplateView-FNI6jVh0.js} +18 -18
- package/dist/{UnitCostHistoryView-BrYXJWz0.js → UnitCostHistoryView-sGxNtk0Y.js} +4 -4
- package/dist/UnitDisplayControl.vue_vue_type_script_setup_true_lang-Cn6q11Ts.js +160 -0
- package/dist/{UnitView-CMXUZZvZ.js → UnitView-P8jU14k8.js} +7 -7
- package/dist/{WarehouseView-CUgJ4YGF.js → WarehouseView-NILk42Zj.js} +5 -5
- package/dist/{WastageTemplateView-Di6ffpTU.js → WastageTemplateView-DNrKoK3S.js} +14 -14
- package/dist/{app-D3gm3Lsw.js → app-DIOXPCfI.js} +23 -11
- package/dist/app.d.ts +12 -0
- package/dist/app.js +1 -1
- package/dist/{closing-template-BiSW9398.js → closing-template-DAlwSsqC.js} +1 -1
- package/dist/{date2-DJotzNeB.js → date2-DBIy5hnh.js} +1 -1
- package/dist/{dayjs.min-DxOA6M7_.js → dayjs.min-B2EqUP7W.js} +1 -1
- package/dist/{decimal-BPZo97WQ.js → decimal-e6enR5yT.js} +2 -2
- package/dist/{defineDeepModel-BMU9Poed.js → defineDeepModel-CwqnmttS.js} +1 -1
- package/dist/{duplicate-template-4bkTBQu0.js → duplicate-template-DRtq-b-P.js} +1 -1
- package/dist/{feature-WVA_2Jx-.js → feature-BCSp38rL.js} +2 -2
- package/dist/{format-time-from-id-gcRrHjjv.js → format-time-from-id-CTWNRFSC.js} +1 -1
- package/dist/{format-unit-display-BXkR_Hu0.js → format-unit-display-BFP12VU7.js} +11 -11
- package/dist/{import-export.helper-5AEiNKim.js → import-export.helper-Dr7R0Zql.js} +6 -6
- package/dist/{index-DkCy3EG9.js → index-BhS1AhF-.js} +1 -1
- package/dist/{index-YVMa0U0j.js → index-C2MhE26a.js} +3 -3
- package/dist/{index-DU4iyU3D.js → index-Df-NlbKu.js} +1 -1
- package/dist/{inventory-core-dart.default-B7xHV5Y6.js → inventory-core-dart.default-CW9d8gJh.js} +1 -1
- package/dist/{lz-string-BtgOc0yQ.js → lz-string-BHfmMoLE.js} +1 -1
- package/dist/{netsuite-DmXOUJo-.js → netsuite-BSEnJOMn.js} +2 -2
- package/dist/{number-BfNWSAkN.js → number-B1buZ_S4.js} +3 -3
- package/dist/{predefined-templates-BKxLIZg6.js → predefined-templates-BIFClpKf.js} +1 -1
- package/dist/{purchase-order-template-7iNDStWd.js → purchase-order-template-BCt-pDW-.js} +1 -1
- package/dist/{recalculationUtils-BVuC0H2j.js → recalculationUtils-CASVCqt7.js} +1 -1
- package/dist/{rules-BK8yTx5p.js → rules-C60UHyIn.js} +2 -2
- package/dist/{stock-BSA86fOX.js → stock-CkWMLoi7.js} +1 -1
- package/dist/{supplier-DA3y7WoU.js → supplier-CiW6zfX_.js} +2 -2
- package/dist/{surcharge-BiYvWPv-.js → surcharge-B9FUKx0L.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-BxHGqiP7.js → uom-rules-DXiQ0ZIA.js} +1 -1
- package/dist/{use-ingredient-select-dialog-CPiX95uf.js → use-ingredient-select-dialog-Bn8C8IG1.js} +2 -2
- package/dist/{use-inventory-binding-dialog-CxKLW2Xh.js → use-inventory-binding-dialog-DZQ1WG1S.js} +2 -2
- package/dist/{use-template-enabled-locations-CrwOCxDu.js → use-template-enabled-locations-B9YKq5YY.js} +2 -2
- package/dist/{use-transfer-locations-CNY1m-5P.js → use-transfer-locations-D0mDjUMQ.js} +2 -2
- package/dist/{useHrmPermission-YEdf2QFW.js → useHrmPermission-BTkOHa4h.js} +1 -1
- package/dist/{useNavigationMenu-Bz5AabkY.js → useNavigationMenu-CSfM_5Wy.js} +2 -2
- package/dist/{useSseClient-BWrz2czP.js → useSseClient-DwJXBOEF.js} +3 -3
- package/dist/views/receive-request/components/transfer-form/TransferFormProps.d.ts +2 -0
- package/dist/views/receive-request/components/transfer-form/composables/use-stock-balance-toggle.d.ts +3 -0
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +4 -0
- package/dist/{vue-i18n-DyHvEzel.js → vue-i18n-BWe-vqm2.js} +287 -287
- package/dist/{xlsx-DQfBpM_Q.js → xlsx-BT7Z_gt_.js} +1 -1
- package/dist/{xlsx.util-XLH11fha.js → xlsx.util-Bm6lJRyh.js} +3 -3
- package/package.json +5 -5
- package/dist/ClosingHistoryView-DL9g4naX.js +0 -1108
- package/dist/FmUnitInput.vue_vue_type_script_setup_true_lang-CvUDKcli.js +0 -362
- package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-DMGMZ556.js +0 -404
- package/dist/UnitDisplayControl.vue_vue_type_script_setup_true_lang-Cj15fCG9.js +0 -137
- package/dist/export-BS0TrI3Q.js +0 -26
|
@@ -2,26 +2,26 @@ import { defineComponent as je, ref as W, computed as M, onMounted as kt, resolv
|
|
|
2
2
|
import { u as xn, _ as Dn } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DGlWE5I8.js";
|
|
3
3
|
import { useCoreStore as Yt, useI18n as Ye } from "@feedmepos/mf-common";
|
|
4
4
|
import { useSnackbar as Ke, useDialog as An, components as pe, useProxiedModel as Kt, useBreakpoints as Cn } from "@feedmepos/ui-library";
|
|
5
|
-
import { m as Sn, u as We, L as oe, w as te, q as Wt, s as Be, M as _e, B as Te, c as $n, a as wt, j as In } from "./app-
|
|
5
|
+
import { m as Sn, u as We, L as oe, w as te, q as Wt, s as Be, M as _e, B as Te, c as $n, a as wt, j as In } from "./app-DIOXPCfI.js";
|
|
6
6
|
import { defineStore as qt, storeToRefs as Fn } from "pinia";
|
|
7
|
-
import { b as rt, e as Gt, f as Bn, a as Ce } from "./date2-
|
|
8
|
-
import { R as Tn } from "./rules-
|
|
9
|
-
import { e as lt, a as ht, t as Qt, c as He, l as Zt, m as Jt, j as Xt, k as en, o as ne } from "./number-
|
|
10
|
-
import { b as jn, d as Mn } from "./xlsx.util-
|
|
11
|
-
import { i as tn, u as nn } from "./uom-rules-
|
|
12
|
-
import { u as Un, a as Rn } from "./useSseClient-
|
|
13
|
-
import { u as ct } from "./stock-
|
|
7
|
+
import { b as rt, e as Gt, f as Bn, a as Ce } from "./date2-DBIy5hnh.js";
|
|
8
|
+
import { R as Tn } from "./rules-C60UHyIn.js";
|
|
9
|
+
import { e as lt, a as ht, t as Qt, c as He, l as Zt, m as Jt, j as Xt, k as en, o as ne } from "./number-B1buZ_S4.js";
|
|
10
|
+
import { b as jn, d as Mn } from "./xlsx.util-Bm6lJRyh.js";
|
|
11
|
+
import { i as tn, u as nn } from "./uom-rules-DXiQ0ZIA.js";
|
|
12
|
+
import { u as Un, a as Rn } from "./useSseClient-DwJXBOEF.js";
|
|
13
|
+
import { u as ct } from "./stock-CkWMLoi7.js";
|
|
14
14
|
import { D as Lt, R as Ne } from "./row-action.enum-DQ9bJ_uv.js";
|
|
15
15
|
import { c as Pn } from "./component-kqxARxvM.js";
|
|
16
|
-
import { f as Vn } from "./format-time-from-id-
|
|
17
|
-
import { f as Nn } from "./recalculationUtils-
|
|
18
|
-
import { _ as zn } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-
|
|
16
|
+
import { f as Vn } from "./format-time-from-id-CTWNRFSC.js";
|
|
17
|
+
import { f as Nn } from "./recalculationUtils-CASVCqt7.js";
|
|
18
|
+
import { _ as zn } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-JHabBWJb.js";
|
|
19
19
|
import { _ as En } from "./empty-placeholder-B0QU467o.js";
|
|
20
20
|
import { F as gt } from "./FmAdminBadge-DjnBAgyv.js";
|
|
21
|
-
import { u as Ln } from "./vue-i18n-
|
|
22
|
-
import { F as On } from "./decimal-
|
|
23
|
-
import { r as Hn, u as ot, w as Yn } from "./xlsx-
|
|
24
|
-
import { d as Kn } from "./dayjs.min-
|
|
21
|
+
import { u as Ln } from "./vue-i18n-BWe-vqm2.js";
|
|
22
|
+
import { F as On } from "./decimal-e6enR5yT.js";
|
|
23
|
+
import { r as Hn, u as ot, w as Yn } from "./xlsx-BT7Z_gt_.js";
|
|
24
|
+
import { d as Kn } from "./dayjs.min-B2EqUP7W.js";
|
|
25
25
|
import { F as Wn } from "./FmDroppableField-J0xUsOTV.js";
|
|
26
26
|
import { _ as qn } from "./FmConfirmationButton.vue_vue_type_script_setup_true_lang-DLrMEGFR.js";
|
|
27
27
|
import { _ as Gn, F as at } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js";
|
|
@@ -171,7 +171,7 @@ const qe = Sn((n, l) => {
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
return (F, _) => {
|
|
174
|
-
const R = Z("FmLabel"), p = Z("FmDatePicker"), v = Z("FmTimePicker"),
|
|
174
|
+
const R = Z("FmLabel"), p = Z("FmDatePicker"), v = Z("FmTimePicker"), d = Z("FmTextField"), b = Z("FmButton"), y = Z("FmForm");
|
|
175
175
|
return c.value ? (h(), ae(y, {
|
|
176
176
|
key: 1,
|
|
177
177
|
onValidationSuccess: E,
|
|
@@ -208,7 +208,7 @@ const qe = Sn((n, l) => {
|
|
|
208
208
|
}, null, 8, ["modelValue"]),
|
|
209
209
|
N.value ? (h(), T("div", Xn, " Cannot select future date ")) : K("", !0)
|
|
210
210
|
])) : K("", !0),
|
|
211
|
-
$(
|
|
211
|
+
$(d, {
|
|
212
212
|
modelValue: t.value,
|
|
213
213
|
"onUpdate:modelValue": _[2] || (_[2] = (w) => t.value = w),
|
|
214
214
|
label: "Remark",
|
|
@@ -255,7 +255,7 @@ function oa(n, l, t, s, g, i, r, c) {
|
|
|
255
255
|
precision: 0
|
|
256
256
|
}, R = Number(
|
|
257
257
|
te.toFormatString({ value: _ })
|
|
258
|
-
), p = g ? Number(te.toFormatString({ value: g })) : 0, v = Number(te.toFormatString({ value: l })),
|
|
258
|
+
), p = g ? Number(te.toFormatString({ value: g })) : 0, v = Number(te.toFormatString({ value: l })), d = Number(te.toFormatString({ value: A })), b = d - v, y = b * F / R, w = d * F / R, Y = v * F / R, q = {};
|
|
259
259
|
return r && i && r.forEach((L) => {
|
|
260
260
|
const I = { amount: 0, precision: 0 }, Q = i[L];
|
|
261
261
|
if (Q) {
|
|
@@ -277,7 +277,7 @@ function oa(n, l, t, s, g, i, r, c) {
|
|
|
277
277
|
{}
|
|
278
278
|
),
|
|
279
279
|
systemBalance: v,
|
|
280
|
-
physicalBalance:
|
|
280
|
+
physicalBalance: d,
|
|
281
281
|
adjustedAmount: Number(te.toFormatString({ value: f })),
|
|
282
282
|
adjustedDiffPercentage: N ? Number(
|
|
283
283
|
te.toFormatString({
|
|
@@ -453,7 +453,7 @@ function ia(n, l, t, s = [], g) {
|
|
|
453
453
|
E,
|
|
454
454
|
s
|
|
455
455
|
);
|
|
456
|
-
}),
|
|
456
|
+
}), d = sa(p), b = la(d, E, s), y = [
|
|
457
457
|
["Business name:", R == null ? void 0 : R.name],
|
|
458
458
|
["Business ID:", R == null ? void 0 : R._id],
|
|
459
459
|
["Menu version", R == null ? void 0 : R.menuVersion],
|
|
@@ -730,7 +730,7 @@ const ca = { class: "flex flex-col" }, ua = {
|
|
|
730
730
|
});
|
|
731
731
|
});
|
|
732
732
|
}
|
|
733
|
-
async function
|
|
733
|
+
async function d(b, y) {
|
|
734
734
|
try {
|
|
735
735
|
t.open({
|
|
736
736
|
title: "Cloning",
|
|
@@ -757,7 +757,7 @@ const ca = { class: "flex flex-col" }, ua = {
|
|
|
757
757
|
syncDraft: _,
|
|
758
758
|
exportDraft: B,
|
|
759
759
|
refreshBalance: p,
|
|
760
|
-
cloneDraft:
|
|
760
|
+
cloneDraft: d,
|
|
761
761
|
viewClosingDraftShow: c,
|
|
762
762
|
viewClosingDraftProps: x,
|
|
763
763
|
invalidateDraftCache: v
|
|
@@ -799,7 +799,7 @@ const on = qt(
|
|
|
799
799
|
try {
|
|
800
800
|
const [v] = await Promise.all([
|
|
801
801
|
x.getDraft(p),
|
|
802
|
-
new Promise((
|
|
802
|
+
new Promise((d) => setTimeout(d, 1e3))
|
|
803
803
|
]);
|
|
804
804
|
g.value = B([v]);
|
|
805
805
|
} catch (v) {
|
|
@@ -811,11 +811,11 @@ const on = qt(
|
|
|
811
811
|
}
|
|
812
812
|
function B(p) {
|
|
813
813
|
const v = Nn(
|
|
814
|
-
p.filter((
|
|
814
|
+
p.filter((d) => !!d.closingId).map((d) => ({ closingId: d.closingId, draftCreatedAt: new Date(Te(d._id)) }))
|
|
815
815
|
);
|
|
816
|
-
return p.map((
|
|
817
|
-
...
|
|
818
|
-
closingIdDisplay:
|
|
816
|
+
return p.map((d) => ({
|
|
817
|
+
...d,
|
|
818
|
+
closingIdDisplay: d.closingId ? v.get(d.closingId) ?? null : null
|
|
819
819
|
}));
|
|
820
820
|
}
|
|
821
821
|
function N(p) {
|
|
@@ -827,8 +827,8 @@ const on = qt(
|
|
|
827
827
|
}
|
|
828
828
|
function E(p) {
|
|
829
829
|
var b, y;
|
|
830
|
-
const v = p.items.length + (((b = p.negativeStockItems) == null ? void 0 : b.length) ?? 0),
|
|
831
|
-
return { count: v, remark:
|
|
830
|
+
const v = p.items.length + (((b = p.negativeStockItems) == null ? void 0 : b.length) ?? 0), d = (p == null ? void 0 : p.approveRemark) ?? ((y = p == null ? void 0 : p.rejectionHistory) == null ? void 0 : y.computeFirst((w) => w.rejectRemark)) ?? p.remark ?? "";
|
|
831
|
+
return { count: v, remark: d };
|
|
832
832
|
}
|
|
833
833
|
function F() {
|
|
834
834
|
s.closeDraftDialog(), A();
|
|
@@ -876,8 +876,8 @@ const on = qt(
|
|
|
876
876
|
header: () => l("inventory.closing.draft.table.effectiveAt"),
|
|
877
877
|
cell(p) {
|
|
878
878
|
const v = p.row.original;
|
|
879
|
-
let
|
|
880
|
-
return
|
|
879
|
+
let d = p.getValue();
|
|
880
|
+
return d || (d = Te(v._id)), Ce(d);
|
|
881
881
|
},
|
|
882
882
|
enableSorting: !0,
|
|
883
883
|
size: 230
|
|
@@ -885,14 +885,14 @@ const on = qt(
|
|
|
885
885
|
{
|
|
886
886
|
id: "description",
|
|
887
887
|
accessorFn: (p) => {
|
|
888
|
-
const { count: v, remark:
|
|
889
|
-
return `${v} ${
|
|
888
|
+
const { count: v, remark: d } = E(p);
|
|
889
|
+
return `${v} ${d}`;
|
|
890
890
|
},
|
|
891
891
|
header: () => l("inventory.closing.draft.table.description"),
|
|
892
892
|
enableSorting: !0,
|
|
893
893
|
size: 350,
|
|
894
894
|
cell(p) {
|
|
895
|
-
const { count: v, remark:
|
|
895
|
+
const { count: v, remark: d } = E(p.row.original), b = (y, w) => k("div", { class: "flex gap-4" }, [
|
|
896
896
|
k(
|
|
897
897
|
"span",
|
|
898
898
|
{ class: "fm-typo-en-body-sm-600 text-fm-color-typo-primary" },
|
|
@@ -909,7 +909,7 @@ const on = qt(
|
|
|
909
909
|
]);
|
|
910
910
|
return k("div", { class: "flex flex-col gap-2", style: "width: 300px;" }, [
|
|
911
911
|
b(l("inventory.closing.draft.table.items"), v),
|
|
912
|
-
|
|
912
|
+
d ? b(l("inventory.closing.draft.table.remark"), d) : null
|
|
913
913
|
]);
|
|
914
914
|
}
|
|
915
915
|
},
|
|
@@ -920,8 +920,8 @@ const on = qt(
|
|
|
920
920
|
enableSorting: !1,
|
|
921
921
|
cell(p) {
|
|
922
922
|
var Y;
|
|
923
|
-
const v = p.row.original,
|
|
924
|
-
return
|
|
923
|
+
const v = p.row.original, d = v.status, b = new Date(v.updatedAt), y = (Y = v == null ? void 0 : v.rejectionHistory) == null ? void 0 : Y.computeFirst((q) => q.rejectedAt), w = y ? new Date(y) : null;
|
|
924
|
+
return d === "DRAFT" && w ? w.getTime() > b.getTime() ? k(
|
|
925
925
|
"div",
|
|
926
926
|
{
|
|
927
927
|
class: "flex"
|
|
@@ -953,9 +953,9 @@ const on = qt(
|
|
|
953
953
|
k(
|
|
954
954
|
"div",
|
|
955
955
|
{
|
|
956
|
-
class: ["fm-status-badge", st(
|
|
956
|
+
class: ["fm-status-badge", st(d)]
|
|
957
957
|
},
|
|
958
|
-
Be(
|
|
958
|
+
Be(d)
|
|
959
959
|
)
|
|
960
960
|
);
|
|
961
961
|
}
|
|
@@ -967,13 +967,13 @@ const on = qt(
|
|
|
967
967
|
enableSorting: !0,
|
|
968
968
|
size: 200,
|
|
969
969
|
cell(p) {
|
|
970
|
-
var
|
|
970
|
+
var d;
|
|
971
971
|
const v = p.row.original;
|
|
972
972
|
return k("div", { class: "flex flex-col" }, [
|
|
973
973
|
k(
|
|
974
974
|
"div",
|
|
975
975
|
{ class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" },
|
|
976
|
-
((
|
|
976
|
+
((d = v.updatedBy) == null ? void 0 : d.name) ?? ""
|
|
977
977
|
),
|
|
978
978
|
k(
|
|
979
979
|
"div",
|
|
@@ -987,7 +987,7 @@ const on = qt(
|
|
|
987
987
|
id: "action",
|
|
988
988
|
cell(p) {
|
|
989
989
|
var Y;
|
|
990
|
-
const v = p.row.original,
|
|
990
|
+
const v = p.row.original, d = ((Y = t.sessionUser.value) == null ? void 0 : Y.role.isAdmin) ?? !1, b = [
|
|
991
991
|
Lt[Ne.Details],
|
|
992
992
|
Lt[Ne.Export]
|
|
993
993
|
], y = [
|
|
@@ -1006,7 +1006,7 @@ const on = qt(
|
|
|
1006
1006
|
color: "text-fm-color-typo-error",
|
|
1007
1007
|
value: oe.enum.markAsFailed
|
|
1008
1008
|
}
|
|
1009
|
-
], w =
|
|
1009
|
+
], w = d && v.status !== _e.enum.DRAFT ? [
|
|
1010
1010
|
{
|
|
1011
1011
|
translationKey: "inventory.closing.draft.cloneDraft",
|
|
1012
1012
|
color: "text-fm-color-typo-primary",
|
|
@@ -1099,18 +1099,18 @@ const on = qt(
|
|
|
1099
1099
|
get: () => x.show,
|
|
1100
1100
|
set: (P) => A("update:show", P)
|
|
1101
1101
|
}), _ = W(1), R = () => _.value > 1, p = () => _.value > 2, v = () => !1;
|
|
1102
|
-
function
|
|
1102
|
+
function d(P) {
|
|
1103
1103
|
return P === 1 ? f.value : P === 2 ? E.value.length == 0 : !1;
|
|
1104
1104
|
}
|
|
1105
1105
|
const b = M(() => !f.value || E.value.length > 0);
|
|
1106
1106
|
function y(P) {
|
|
1107
1107
|
let S = P + 1;
|
|
1108
|
-
for (; S <= 3 &&
|
|
1108
|
+
for (; S <= 3 && d(S); ) S++;
|
|
1109
1109
|
return S > 3 ? 3 : S;
|
|
1110
1110
|
}
|
|
1111
1111
|
function w(P) {
|
|
1112
1112
|
let S = P - 1;
|
|
1113
|
-
for (; S >= 1 &&
|
|
1113
|
+
for (; S >= 1 && d(S); ) S--;
|
|
1114
1114
|
return S < 1 ? 1 : S;
|
|
1115
1115
|
}
|
|
1116
1116
|
function Y() {
|
|
@@ -1279,14 +1279,14 @@ function Fa(n) {
|
|
|
1279
1279
|
let c = !1, x = null, A = !1, f = !1;
|
|
1280
1280
|
function B() {
|
|
1281
1281
|
R();
|
|
1282
|
-
const
|
|
1283
|
-
if (!
|
|
1282
|
+
const d = n.closingDraftId.value, b = n.currentRev.value;
|
|
1283
|
+
if (!d || !b)
|
|
1284
1284
|
return;
|
|
1285
1285
|
c = !1;
|
|
1286
1286
|
const y = {
|
|
1287
1287
|
type: "closing-draft",
|
|
1288
1288
|
params: {
|
|
1289
|
-
draftId:
|
|
1289
|
+
draftId: d,
|
|
1290
1290
|
locationId: l.getDbName(),
|
|
1291
1291
|
closingDraftRevision: b
|
|
1292
1292
|
}
|
|
@@ -1300,40 +1300,41 @@ function Fa(n) {
|
|
|
1300
1300
|
function N() {
|
|
1301
1301
|
f = !0, B();
|
|
1302
1302
|
}
|
|
1303
|
-
async function E(
|
|
1304
|
-
var
|
|
1305
|
-
if (c || !
|
|
1306
|
-
r.value =
|
|
1303
|
+
async function E(d) {
|
|
1304
|
+
var y;
|
|
1305
|
+
if (c || !d) {
|
|
1306
|
+
r.value = d, i.value = !1;
|
|
1307
1307
|
return;
|
|
1308
1308
|
}
|
|
1309
|
-
if (
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
}
|
|
1319
|
-
A = !1, await F();
|
|
1309
|
+
if (d.closingDraftId && d.closingDraftId !== n.closingDraftId.value)
|
|
1310
|
+
return;
|
|
1311
|
+
if (r.value = d, d.message === "processing" || !d.completedAt && !d.message) {
|
|
1312
|
+
A = !0, i.value = !0;
|
|
1313
|
+
return;
|
|
1314
|
+
}
|
|
1315
|
+
if (d.message === "completed" || d.completedAt) {
|
|
1316
|
+
if (!A) {
|
|
1317
|
+
i.value = !1;
|
|
1320
1318
|
return;
|
|
1321
1319
|
}
|
|
1322
|
-
A = !1,
|
|
1323
|
-
|
|
1324
|
-
message: g("inventory.stock.stock_balance.refreshBalanceError"),
|
|
1325
|
-
type: "error"
|
|
1326
|
-
}), (b = n.onError) == null || b.call(n, m.message ?? "Unknown error");
|
|
1320
|
+
A = !1, await F();
|
|
1321
|
+
return;
|
|
1327
1322
|
}
|
|
1323
|
+
const b = A;
|
|
1324
|
+
A = !1, i.value = !1, b && (console.log("Closing draft balance refresh error:", d), s.open({
|
|
1325
|
+
title: g("inventory.common.refreshFailed"),
|
|
1326
|
+
message: g("inventory.stock.stock_balance.refreshBalanceError"),
|
|
1327
|
+
type: "error"
|
|
1328
|
+
}), (y = n.onError) == null || y.call(n, d.message ?? "Unknown error"));
|
|
1328
1329
|
}
|
|
1329
1330
|
async function F() {
|
|
1330
|
-
const
|
|
1331
|
-
if (!
|
|
1331
|
+
const d = n.closingDraftId.value;
|
|
1332
|
+
if (!d) {
|
|
1332
1333
|
i.value = !1;
|
|
1333
1334
|
return;
|
|
1334
1335
|
}
|
|
1335
1336
|
try {
|
|
1336
|
-
const b = await l.getDraft(
|
|
1337
|
+
const b = await l.getDraft(d);
|
|
1337
1338
|
i.value = !1, n.onCompleted(b), s.open({
|
|
1338
1339
|
title: "Balance refreshed",
|
|
1339
1340
|
message: "Stock balance has been recalculated.",
|
|
@@ -1347,7 +1348,7 @@ function Fa(n) {
|
|
|
1347
1348
|
});
|
|
1348
1349
|
}
|
|
1349
1350
|
}
|
|
1350
|
-
async function _(
|
|
1351
|
+
async function _(d) {
|
|
1351
1352
|
if (!(!n.closingDraftId.value || i.value || A)) {
|
|
1352
1353
|
i.value = !0, A = !0, r.value = {
|
|
1353
1354
|
requestId: "",
|
|
@@ -1357,7 +1358,7 @@ function Fa(n) {
|
|
|
1357
1358
|
startedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1358
1359
|
};
|
|
1359
1360
|
try {
|
|
1360
|
-
await l.initializeStockSnapshot(n.closingDraftId.value,
|
|
1361
|
+
await l.initializeStockSnapshot(n.closingDraftId.value, d);
|
|
1361
1362
|
} catch (b) {
|
|
1362
1363
|
A = !1, i.value = !1, s.open({
|
|
1363
1364
|
title: g("inventory.common.refreshFailed"),
|
|
@@ -1378,8 +1379,8 @@ function Fa(n) {
|
|
|
1378
1379
|
}
|
|
1379
1380
|
return ze(
|
|
1380
1381
|
[n.closingDraftId, n.currentRev],
|
|
1381
|
-
([
|
|
1382
|
-
f && (
|
|
1382
|
+
([d, b], [y, w]) => {
|
|
1383
|
+
f && (d === y && b === w || B());
|
|
1383
1384
|
}
|
|
1384
1385
|
), hn(() => {
|
|
1385
1386
|
v();
|
|
@@ -1443,13 +1444,13 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
1443
1444
|
return a === "MYR" ? "RM" : a;
|
|
1444
1445
|
}), g = on(), i = M(() => {
|
|
1445
1446
|
var a, e;
|
|
1446
|
-
return (a = t.draft) != null && a.closingId ? ((e = g.drafts.find((
|
|
1447
|
+
return (a = t.draft) != null && a.closingId ? ((e = g.drafts.find((m) => m._id === t.draft._id)) == null ? void 0 : e.closingIdDisplay) ?? null : null;
|
|
1447
1448
|
}), r = it(), c = Kt(t, "show"), x = W(!1), A = W(!1), f = W(new Array()), B = W(new Array()), N = W([]), E = ct(), F = Ke(), _ = wt(), R = We(), p = Et({}), v = M(() => new Set(
|
|
1448
1449
|
_.skus.filter((a) => {
|
|
1449
1450
|
var e;
|
|
1450
1451
|
return p[(e = a.customAttributes) == null ? void 0 : e.tag];
|
|
1451
1452
|
}).map((a) => a._id)
|
|
1452
|
-
)),
|
|
1453
|
+
)), d = l, b = M(() => {
|
|
1453
1454
|
var a;
|
|
1454
1455
|
return (a = t.draft) == null ? void 0 : a._id;
|
|
1455
1456
|
}), y = M(() => {
|
|
@@ -1464,7 +1465,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
1464
1465
|
closingDraftId: b,
|
|
1465
1466
|
currentRev: y,
|
|
1466
1467
|
onCompleted: (a) => {
|
|
1467
|
-
|
|
1468
|
+
d("refresh", a), f.value = a.stockSnapshot ?? [], c.value = !1;
|
|
1468
1469
|
}
|
|
1469
1470
|
}), z = W({
|
|
1470
1471
|
templateItem: !0,
|
|
@@ -1511,12 +1512,12 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
1511
1512
|
);
|
|
1512
1513
|
}
|
|
1513
1514
|
const Q = M(() => {
|
|
1514
|
-
var e,
|
|
1515
|
-
const a = [...((e = t.draft) == null ? void 0 : e.items) ?? [], ...((
|
|
1515
|
+
var e, m;
|
|
1516
|
+
const a = [...((e = t.draft) == null ? void 0 : e.items) ?? [], ...((m = t.draft) == null ? void 0 : m.negativeStockItems) ?? []];
|
|
1516
1517
|
return v.value.size ? a.filter((j) => v.value.has(j.sku._id)) : a;
|
|
1517
1518
|
}), se = M(() => {
|
|
1518
1519
|
const a = Q.value.map((e) => e.sku);
|
|
1519
|
-
return a.sort((e,
|
|
1520
|
+
return a.sort((e, m) => e.code.localeCompare(m.code)), a;
|
|
1520
1521
|
}), we = nn();
|
|
1521
1522
|
kt(Ee), ze(
|
|
1522
1523
|
() => t.show,
|
|
@@ -1534,7 +1535,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
1534
1535
|
);
|
|
1535
1536
|
const xe = M(() => Qe.value.reduce((a, e) => a + Number(e.stockTakeValue), 0)), De = He(0), $e = He(100);
|
|
1536
1537
|
async function Ee() {
|
|
1537
|
-
var e,
|
|
1538
|
+
var e, m, j, D;
|
|
1538
1539
|
if (!R._currentLocation) return;
|
|
1539
1540
|
x.value = !0;
|
|
1540
1541
|
const a = ((e = t.draft) == null ? void 0 : e.status) === _e.enum.COMPLETED;
|
|
@@ -1548,7 +1549,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
1548
1549
|
message: "Closing draft is completed but closing document cannot be found.",
|
|
1549
1550
|
type: "error"
|
|
1550
1551
|
}), console.error("Closing draft is completed but closing document cannot be found.", {
|
|
1551
|
-
draftId: (
|
|
1552
|
+
draftId: (m = t.draft) == null ? void 0 : m._id
|
|
1552
1553
|
});
|
|
1553
1554
|
return;
|
|
1554
1555
|
}
|
|
@@ -1590,10 +1591,10 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
1590
1591
|
}
|
|
1591
1592
|
}
|
|
1592
1593
|
async function Le() {
|
|
1593
|
-
var e,
|
|
1594
|
+
var e, m;
|
|
1594
1595
|
if (w.value)
|
|
1595
1596
|
return;
|
|
1596
|
-
if (!(((e = t.draft) == null ? void 0 : e.effectiveAt) ?? (t.draft ? Te((
|
|
1597
|
+
if (!(((e = t.draft) == null ? void 0 : e.effectiveAt) ?? (t.draft ? Te((m = t.draft) == null ? void 0 : m._id) : null))) {
|
|
1597
1598
|
F.open({
|
|
1598
1599
|
title: "Cannot refresh",
|
|
1599
1600
|
message: "Effective date is not available for this draft.",
|
|
@@ -1611,8 +1612,8 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
1611
1612
|
);
|
|
1612
1613
|
}
|
|
1613
1614
|
async function Me() {
|
|
1614
|
-
var e,
|
|
1615
|
-
if (!(((e = t.draft) == null ? void 0 : e.effectiveAt) ?? (t.draft ? Te((
|
|
1615
|
+
var e, m;
|
|
1616
|
+
if (!(((e = t.draft) == null ? void 0 : e.effectiveAt) ?? (t.draft ? Te((m = t.draft) == null ? void 0 : m._id) : null))) {
|
|
1616
1617
|
F.open({
|
|
1617
1618
|
title: "Cannot refresh",
|
|
1618
1619
|
message: "Effective date is not available for this draft.",
|
|
@@ -1655,7 +1656,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
1655
1656
|
header: () => "Name",
|
|
1656
1657
|
size: 350,
|
|
1657
1658
|
cell(e) {
|
|
1658
|
-
const
|
|
1659
|
+
const m = e.row.original, j = m.adjustedDiffPercentage, D = typeof j == "number" && Math.abs(j) > 10, V = k("div", { class: "flex flex-col gap-4" }, [
|
|
1659
1660
|
k(
|
|
1660
1661
|
"div",
|
|
1661
1662
|
{
|
|
@@ -1664,7 +1665,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
1664
1665
|
D ? " text-fm-color-system-error-300" : "text-fm-color-typo-primary"
|
|
1665
1666
|
]
|
|
1666
1667
|
},
|
|
1667
|
-
|
|
1668
|
+
m.name
|
|
1668
1669
|
),
|
|
1669
1670
|
k(
|
|
1670
1671
|
"div",
|
|
@@ -1674,7 +1675,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
1674
1675
|
D ? " text-fm-color-system-error-300" : "text-fm-color-typo-secondary"
|
|
1675
1676
|
]
|
|
1676
1677
|
},
|
|
1677
|
-
|
|
1678
|
+
m.code
|
|
1678
1679
|
)
|
|
1679
1680
|
]);
|
|
1680
1681
|
return k(
|
|
@@ -1684,7 +1685,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
1684
1685
|
},
|
|
1685
1686
|
{
|
|
1686
1687
|
content() {
|
|
1687
|
-
return D ? "Adjustment difference is more than 10%." : `${
|
|
1688
|
+
return D ? "Adjustment difference is more than 10%." : `${m.code} - ${m.name}`;
|
|
1688
1689
|
},
|
|
1689
1690
|
default() {
|
|
1690
1691
|
return k("div", { class: "flex items-center gap-4 justify-start w-full" }, [
|
|
@@ -1699,11 +1700,11 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
1699
1700
|
...Ct.value.map(
|
|
1700
1701
|
(e) => ({
|
|
1701
1702
|
id: `customAttr_${e}`,
|
|
1702
|
-
accessorFn: (
|
|
1703
|
+
accessorFn: (m) => m.customAttributeValues[e],
|
|
1703
1704
|
header: () => ye(Be(e)),
|
|
1704
1705
|
size: 160,
|
|
1705
|
-
cell(
|
|
1706
|
-
const j =
|
|
1706
|
+
cell(m) {
|
|
1707
|
+
const j = m.row.original.customAttributeValues[e];
|
|
1707
1708
|
return j == null ? "N/A" : typeof j == "number" ? k("div", { class: "text-right fm-typo-en-body-lg-400" }, ne(j)) : k("div", { class: "text-right fm-typo-en-body-lg-400" }, String(j));
|
|
1708
1709
|
},
|
|
1709
1710
|
meta: {
|
|
@@ -1717,8 +1718,8 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
1717
1718
|
header: () => ye("Cost per unit"),
|
|
1718
1719
|
size: 160,
|
|
1719
1720
|
cell(e) {
|
|
1720
|
-
const
|
|
1721
|
-
return k("div", { class: "text-right fm-typo-en-body-lg-400" }, ne(
|
|
1721
|
+
const m = e.row.original.costPerUnit;
|
|
1722
|
+
return k("div", { class: "text-right fm-typo-en-body-lg-400" }, ne(m));
|
|
1722
1723
|
},
|
|
1723
1724
|
meta: {
|
|
1724
1725
|
textAlign: "right"
|
|
@@ -1730,9 +1731,9 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
1730
1731
|
size: 120,
|
|
1731
1732
|
cell(e) {
|
|
1732
1733
|
var C;
|
|
1733
|
-
const
|
|
1734
|
+
const m = e.row.original, j = m.costUnit, D = m.baseUnit, V = j ?? D;
|
|
1734
1735
|
if (j && j !== D) {
|
|
1735
|
-
const J = se.value.find((G) => G._id ===
|
|
1736
|
+
const J = se.value.find((G) => G._id === m.id), O = (C = J == null ? void 0 : J.defaultCost) == null ? void 0 : C.measurement;
|
|
1736
1737
|
if (O) {
|
|
1737
1738
|
const G = O.conversion.amount / Math.pow(10, O.conversion.precision);
|
|
1738
1739
|
return k("div", { class: "flex flex-col" }, [
|
|
@@ -1759,8 +1760,8 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
1759
1760
|
header: () => ye("Opening (B/F)", "The opening balance brought forward from previous period."),
|
|
1760
1761
|
size: 150,
|
|
1761
1762
|
cell(e) {
|
|
1762
|
-
const
|
|
1763
|
-
return k("div", { class: "text-right fm-typo-en-body-lg-400" }, ne(
|
|
1763
|
+
const m = e.row.original.opening;
|
|
1764
|
+
return k("div", { class: "text-right fm-typo-en-body-lg-400" }, ne(m));
|
|
1764
1765
|
},
|
|
1765
1766
|
meta: {
|
|
1766
1767
|
textAlign: "right"
|
|
@@ -1770,11 +1771,11 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
1770
1771
|
...N.value.map(
|
|
1771
1772
|
(e) => ({
|
|
1772
1773
|
id: `adjustment_${e}`,
|
|
1773
|
-
accessorFn: (
|
|
1774
|
+
accessorFn: (m) => m.adjustmentAmounts[e] ?? { amount: 0, precision: 0 },
|
|
1774
1775
|
header: () => ye(Be(e)),
|
|
1775
1776
|
size: 150,
|
|
1776
|
-
cell(
|
|
1777
|
-
const j =
|
|
1777
|
+
cell(m) {
|
|
1778
|
+
const j = m.row.original.adjustmentAmounts[e] ?? { amount: 0, precision: 0 };
|
|
1778
1779
|
return k("div", { class: "text-right fm-typo-en-body-lg-400" }, ne(j));
|
|
1779
1780
|
},
|
|
1780
1781
|
meta: {
|
|
@@ -1788,8 +1789,8 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
1788
1789
|
header: () => ye("System Balance", "The system calculated balance before stock take."),
|
|
1789
1790
|
size: 200,
|
|
1790
1791
|
cell(e) {
|
|
1791
|
-
const
|
|
1792
|
-
return k("div", { class: "text-right fm-typo-en-body-lg-400" }, ne(
|
|
1792
|
+
const m = e.row.original.systemBalance;
|
|
1793
|
+
return k("div", { class: "text-right fm-typo-en-body-lg-400" }, ne(m));
|
|
1793
1794
|
},
|
|
1794
1795
|
meta: {
|
|
1795
1796
|
textAlign: "right"
|
|
@@ -1799,17 +1800,17 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
1799
1800
|
id: "physicalBalance",
|
|
1800
1801
|
accessorFn: (e) => {
|
|
1801
1802
|
var j;
|
|
1802
|
-
const
|
|
1803
|
-
return
|
|
1803
|
+
const m = (j = B.value.find((D) => D.id === e.id)) == null ? void 0 : j.balance;
|
|
1804
|
+
return m ? On.toDouble(m) : e.physicalBalance;
|
|
1804
1805
|
},
|
|
1805
1806
|
header: () => ye("Stock Take balance", "The physical balance recorded during stock take."),
|
|
1806
1807
|
cell(e) {
|
|
1807
1808
|
var O;
|
|
1808
|
-
const
|
|
1809
|
+
const m = e.row.original, j = te.fromNumber(m.physicalBalance);
|
|
1809
1810
|
let D = !0;
|
|
1810
|
-
const V = (O = B.value.find((G) => G.id ===
|
|
1811
|
+
const V = (O = B.value.find((G) => G.id === m.id)) == null ? void 0 : O.balance;
|
|
1811
1812
|
let C;
|
|
1812
|
-
V && !te.equals({ a: j, b: V }) ? (D = !1, C = ne(V)) : C = ne(
|
|
1813
|
+
V && !te.equals({ a: j, b: V }) ? (D = !1, C = ne(V)) : C = ne(m.physicalBalance);
|
|
1813
1814
|
const J = k("div", { class: "flex flex-col items-end" }, [
|
|
1814
1815
|
k(
|
|
1815
1816
|
"span",
|
|
@@ -1819,16 +1820,16 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
1819
1820
|
D ? null : k(
|
|
1820
1821
|
"span",
|
|
1821
1822
|
{ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
|
|
1822
|
-
`Draft: ${ne(
|
|
1823
|
+
`Draft: ${ne(m.physicalBalance)}`
|
|
1823
1824
|
)
|
|
1824
1825
|
]);
|
|
1825
|
-
return
|
|
1826
|
+
return m.breakdown.length ? k(
|
|
1826
1827
|
pe.FmPopover,
|
|
1827
1828
|
{
|
|
1828
|
-
showPopover: le.value ===
|
|
1829
|
+
showPopover: le.value === m.id,
|
|
1829
1830
|
placement: "bottom-end",
|
|
1830
1831
|
zIndex: 9999,
|
|
1831
|
-
"onPopover-changed": (G) => P(
|
|
1832
|
+
"onPopover-changed": (G) => P(m.id, G)
|
|
1832
1833
|
},
|
|
1833
1834
|
{
|
|
1834
1835
|
"popover-button": () => k(
|
|
@@ -1842,7 +1843,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
1842
1843
|
k(pe.FmIcon, { name: "info", size: "sm", outline: !0 })
|
|
1843
1844
|
]
|
|
1844
1845
|
),
|
|
1845
|
-
default: () => I(
|
|
1846
|
+
default: () => I(m)
|
|
1846
1847
|
}
|
|
1847
1848
|
) : J;
|
|
1848
1849
|
},
|
|
@@ -1857,8 +1858,8 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
1857
1858
|
header: () => ye("Variance", "The difference between Stock Take balance and System Balance."),
|
|
1858
1859
|
size: 200,
|
|
1859
1860
|
cell(e) {
|
|
1860
|
-
const
|
|
1861
|
-
return k("div", { class: "text-right fm-typo-en-body-lg-400" }, ne(
|
|
1861
|
+
const m = e.row.original.adjustedAmount;
|
|
1862
|
+
return k("div", { class: "text-right fm-typo-en-body-lg-400" }, ne(m));
|
|
1862
1863
|
},
|
|
1863
1864
|
meta: {
|
|
1864
1865
|
textAlign: "right"
|
|
@@ -1870,8 +1871,8 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
1870
1871
|
header: () => ye(`Variance (${s.value})`),
|
|
1871
1872
|
size: 150,
|
|
1872
1873
|
cell(e) {
|
|
1873
|
-
const
|
|
1874
|
-
return k("div", { class: "text-right fm-typo-en-body-lg-400" }, ne(
|
|
1874
|
+
const m = e.row.original.varianceInCost;
|
|
1875
|
+
return k("div", { class: "text-right fm-typo-en-body-lg-400" }, ne(m));
|
|
1875
1876
|
},
|
|
1876
1877
|
meta: {
|
|
1877
1878
|
textAlign: "right"
|
|
@@ -1886,19 +1887,19 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
1886
1887
|
),
|
|
1887
1888
|
size: 200,
|
|
1888
1889
|
cell(e) {
|
|
1889
|
-
const
|
|
1890
|
-
if (
|
|
1890
|
+
const m = e.row.original.adjustedDiffPercentage;
|
|
1891
|
+
if (m == null)
|
|
1891
1892
|
return k(
|
|
1892
1893
|
"div",
|
|
1893
1894
|
{ class: "flex items-center gap-4 justify-end fm-typo-en-body-lg-400" },
|
|
1894
1895
|
Ot
|
|
1895
1896
|
);
|
|
1896
|
-
const j = ne(
|
|
1897
|
-
if (
|
|
1897
|
+
const j = ne(m);
|
|
1898
|
+
if (m === 0)
|
|
1898
1899
|
return k("div", { class: "flex items-center gap-4 justify-end fm-typo-en-body-lg-400" }, [
|
|
1899
1900
|
ne(0)
|
|
1900
1901
|
]);
|
|
1901
|
-
const D =
|
|
1902
|
+
const D = m > 0;
|
|
1902
1903
|
return k("div", { class: "flex items-center gap-4 justify-end fm-typo-en-body-lg-400" }, [
|
|
1903
1904
|
k(pe.FmIcon, {
|
|
1904
1905
|
name: D ? "arrow_drop_up" : "arrow_drop_down",
|
|
@@ -1919,9 +1920,9 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
1919
1920
|
size: 180,
|
|
1920
1921
|
cell(e) {
|
|
1921
1922
|
var O;
|
|
1922
|
-
const
|
|
1923
|
+
const m = e.row.original, j = m.stockTakeValue, D = se.value.find((G) => G._id === m.id), V = (O = D == null ? void 0 : D.defaultCost) == null ? void 0 : O.measurement, C = m.physicalBalance, J = m.costPerUnit;
|
|
1923
1924
|
if (V) {
|
|
1924
|
-
const G = te.toFormatString({ value: V.conversion }), me = `${ne(C, { minPrecision: 2, maxPrecision: 4 })} ${
|
|
1925
|
+
const G = te.toFormatString({ value: V.conversion }), me = `${ne(C, { minPrecision: 2, maxPrecision: 4 })} ${m.baseUnit} ÷ ${G} × ${J} ${s.value}`;
|
|
1925
1926
|
return k(
|
|
1926
1927
|
pe.FmTooltip,
|
|
1927
1928
|
{ zIndex: 51 },
|
|
@@ -1939,7 +1940,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
1939
1940
|
}
|
|
1940
1941
|
);
|
|
1941
1942
|
} else {
|
|
1942
|
-
const G = `${ne(C, { minPrecision: 2, maxPrecision: 4 })} ${
|
|
1943
|
+
const G = `${ne(C, { minPrecision: 2, maxPrecision: 4 })} ${m.baseUnit} × ${J} ${s.value}`;
|
|
1943
1944
|
return k(
|
|
1944
1945
|
pe.FmTooltip,
|
|
1945
1946
|
{ zIndex: 51 },
|
|
@@ -1969,9 +1970,9 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
1969
1970
|
size: 180,
|
|
1970
1971
|
cell(e) {
|
|
1971
1972
|
var O;
|
|
1972
|
-
const
|
|
1973
|
+
const m = e.row.original, j = m.systemValue, D = se.value.find((G) => G._id === m.id), V = (O = D == null ? void 0 : D.defaultCost) == null ? void 0 : O.measurement, C = m.systemBalance, J = m.costPerUnit;
|
|
1973
1974
|
if (V) {
|
|
1974
|
-
const G = te.toFormatString({ value: V.conversion }), me = `${ne(C, { minPrecision: 2, maxPrecision: 4 })} ${
|
|
1975
|
+
const G = te.toFormatString({ value: V.conversion }), me = `${ne(C, { minPrecision: 2, maxPrecision: 4 })} ${m.baseUnit} ÷ ${G} × ${J} ${s.value}`;
|
|
1975
1976
|
return k(
|
|
1976
1977
|
pe.FmTooltip,
|
|
1977
1978
|
{ zIndex: 51 },
|
|
@@ -1989,7 +1990,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
1989
1990
|
}
|
|
1990
1991
|
);
|
|
1991
1992
|
} else {
|
|
1992
|
-
const G = `${ne(C, { minPrecision: 2, maxPrecision: 4 })} ${
|
|
1993
|
+
const G = `${ne(C, { minPrecision: 2, maxPrecision: 4 })} ${m.baseUnit} × ${J} ${s.value}`;
|
|
1993
1994
|
return k(
|
|
1994
1995
|
pe.FmTooltip,
|
|
1995
1996
|
{ zIndex: 51 },
|
|
@@ -2017,7 +2018,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
2017
2018
|
header: () => "Amounts",
|
|
2018
2019
|
enableSorting: !1,
|
|
2019
2020
|
cell(e) {
|
|
2020
|
-
const
|
|
2021
|
+
const m = e.row.original, j = (C, J, O = "normal") => k(
|
|
2021
2022
|
pe.FmTooltip,
|
|
2022
2023
|
{ zIndex: 50 },
|
|
2023
2024
|
{
|
|
@@ -2047,7 +2048,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
2047
2048
|
return O === "orphan" ? `${C} ${J} (invalid UOM — not on SKU)` : O === "inactive" ? `${C} ${J} (NetSuite-inactive UOM)` : `${C} ${J}`;
|
|
2048
2049
|
}
|
|
2049
2050
|
}
|
|
2050
|
-
), D =
|
|
2051
|
+
), D = m.measurements.filter((C) => !!C.amount).map((C) => j(C.amount, C.abbrev, C.variant)), V = m.baseUnitAmount || !D.length ? [j(m.baseUnitAmount, m.baseUnit), ...D] : D;
|
|
2051
2052
|
return k(
|
|
2052
2053
|
"div",
|
|
2053
2054
|
{
|
|
@@ -2059,8 +2060,8 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
2059
2060
|
}
|
|
2060
2061
|
}
|
|
2061
2062
|
]), ln = M(() => xt.value.map((a) => a.size ?? 0).reduce((a, e) => a + e)), dt = W(""), cn = M(() => {
|
|
2062
|
-
var
|
|
2063
|
-
const a = ((j = (
|
|
2063
|
+
var m, j;
|
|
2064
|
+
const a = ((j = (m = t.draft) == null ? void 0 : m.negativeStockItems) == null ? void 0 : j.reduce(
|
|
2064
2065
|
(D, V) => (D[V.sku._id] = V, D),
|
|
2065
2066
|
{}
|
|
2066
2067
|
)) ?? {}, e = new Map(
|
|
@@ -2185,13 +2186,13 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
2185
2186
|
const a = /* @__PURE__ */ new Set();
|
|
2186
2187
|
for (const e of se.value)
|
|
2187
2188
|
if (e.customAttributes)
|
|
2188
|
-
for (const
|
|
2189
|
-
|
|
2189
|
+
for (const m of Object.keys(e.customAttributes))
|
|
2190
|
+
m !== "tag" && a.add(m);
|
|
2190
2191
|
return Array.from(a).sort();
|
|
2191
2192
|
}), Ze = Et({}), Ct = M(
|
|
2192
2193
|
() => mt.value.filter((a) => Ze[a])
|
|
2193
2194
|
), dn = M(() => {
|
|
2194
|
-
var e,
|
|
2195
|
+
var e, m, j, D, V;
|
|
2195
2196
|
if (!t.draft) return [];
|
|
2196
2197
|
const a = t.draft.approvedAt ? {
|
|
2197
2198
|
action: `Approve at ${Ce(t.draft.approvedAt)}`,
|
|
@@ -2211,7 +2212,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
2211
2212
|
} : null,
|
|
2212
2213
|
{
|
|
2213
2214
|
label: "Location",
|
|
2214
|
-
value: ((
|
|
2215
|
+
value: ((m = R._currentLocation) == null ? void 0 : m.name) ?? Ot
|
|
2215
2216
|
},
|
|
2216
2217
|
{
|
|
2217
2218
|
label: "Created at",
|
|
@@ -2309,7 +2310,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
2309
2310
|
t.draft && (Xe.value = !0, r.approveDraft(
|
|
2310
2311
|
t.draft,
|
|
2311
2312
|
() => {
|
|
2312
|
-
Xe.value = !1, Je.value = !1,
|
|
2313
|
+
Xe.value = !1, Je.value = !1, d("submitted");
|
|
2313
2314
|
},
|
|
2314
2315
|
() => {
|
|
2315
2316
|
Xe.value = !1;
|
|
@@ -2317,7 +2318,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
2317
2318
|
));
|
|
2318
2319
|
}
|
|
2319
2320
|
return (a, e) => {
|
|
2320
|
-
const
|
|
2321
|
+
const m = Z("FmButtonGroup"), j = Z("FmMenuDivider"), D = Z("FmCard"), V = Z("FmIcon"), C = Z("FmButton"), J = Z("FmCircularProgress"), O = Z("FmChip"), G = Z("FmTextField"), me = Z("FmTable"), Ae = Z("FmSpacer"), ge = Z("FmTooltip"), Ie = Z("FmSideSheet");
|
|
2321
2322
|
return h(), T(ce, null, [
|
|
2322
2323
|
$(Ie, {
|
|
2323
2324
|
"dismiss-away": "",
|
|
@@ -2358,7 +2359,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
2358
2359
|
key: 1,
|
|
2359
2360
|
label: "Reject",
|
|
2360
2361
|
variant: "destructive",
|
|
2361
|
-
onClick: e[6] || (e[6] = () => t.draft && u(r).rejectDraft(t.draft, () =>
|
|
2362
|
+
onClick: e[6] || (e[6] = () => t.draft && u(r).rejectDraft(t.draft, () => d("submitted")))
|
|
2362
2363
|
})) : K("", !0),
|
|
2363
2364
|
$(C, {
|
|
2364
2365
|
label: "Close",
|
|
@@ -2372,7 +2373,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
2372
2373
|
loading: A.value,
|
|
2373
2374
|
onClick: e[8] || (e[8] = () => {
|
|
2374
2375
|
t.draft && (A.value = !0, u(r).syncDraft(t.draft, () => {
|
|
2375
|
-
A.value = !1,
|
|
2376
|
+
A.value = !1, d("submitted");
|
|
2376
2377
|
}));
|
|
2377
2378
|
})
|
|
2378
2379
|
}, null, 8, ["loading"])
|
|
@@ -2390,7 +2391,7 @@ const Ba = { class: "w-full flex flex-col gap-32" }, Ta = { class: "flex flex-co
|
|
|
2390
2391
|
default: X(() => [
|
|
2391
2392
|
o("div", Ba, [
|
|
2392
2393
|
o("div", null, [
|
|
2393
|
-
$(
|
|
2394
|
+
$(m, {
|
|
2394
2395
|
items: ft,
|
|
2395
2396
|
modelValue: Oe.value,
|
|
2396
2397
|
"onUpdate:modelValue": e[0] || (e[0] = (U) => Oe.value = U)
|
|
@@ -2704,7 +2705,7 @@ async function Do(n) {
|
|
|
2704
2705
|
header: 1,
|
|
2705
2706
|
defval: ""
|
|
2706
2707
|
}), B = (v) => String(v).trim().toLowerCase().replace(/^\uFEFF/, ""), N = f.findIndex(
|
|
2707
|
-
(v) => v.some((
|
|
2708
|
+
(v) => v.some((d) => B(d) === "code")
|
|
2708
2709
|
);
|
|
2709
2710
|
if (N === -1) {
|
|
2710
2711
|
l([]);
|
|
@@ -2783,13 +2784,13 @@ function $o() {
|
|
|
2783
2784
|
);
|
|
2784
2785
|
const v = new Map(
|
|
2785
2786
|
p.map((b) => [b.id, b.balance])
|
|
2786
|
-
),
|
|
2787
|
+
), d = new Set(F.map((b) => b.sku._id));
|
|
2787
2788
|
n.value = F.map((b) => {
|
|
2788
2789
|
const y = v.get(b.sku._id) ?? { amount: 0, precision: 0 }, w = y.amount / Math.pow(10, y.precision);
|
|
2789
2790
|
return { ...b, systemBalance: y, variance: b.physicalCount - w };
|
|
2790
2791
|
});
|
|
2791
2792
|
for (const b of Object.values(s.skuByCode)) {
|
|
2792
|
-
if (
|
|
2793
|
+
if (d.has(b._id)) continue;
|
|
2793
2794
|
const y = v.get(b._id);
|
|
2794
2795
|
if (!y) continue;
|
|
2795
2796
|
const w = y.amount / Math.pow(10, y.precision);
|
|
@@ -3019,7 +3020,7 @@ const Io = { class: "flex flex-col gap-16" }, Fo = {
|
|
|
3019
3020
|
}
|
|
3020
3021
|
];
|
|
3021
3022
|
});
|
|
3022
|
-
async function
|
|
3023
|
+
async function d(w) {
|
|
3023
3024
|
x.value = w, await F(w);
|
|
3024
3025
|
}
|
|
3025
3026
|
async function b() {
|
|
@@ -3065,7 +3066,7 @@ const Io = { class: "flex flex-col gap-16" }, Fo = {
|
|
|
3065
3066
|
class: Se({ "h-[200px]": !x.value }),
|
|
3066
3067
|
accept: ".csv",
|
|
3067
3068
|
disabled: u(E),
|
|
3068
|
-
onFileUpload:
|
|
3069
|
+
onFileUpload: d
|
|
3069
3070
|
}, kn({ _: 2 }, [
|
|
3070
3071
|
x.value ? {
|
|
3071
3072
|
name: "default",
|
|
@@ -3228,14 +3229,14 @@ const Io = { class: "flex flex-col gap-16" }, Fo = {
|
|
|
3228
3229
|
value: "add",
|
|
3229
3230
|
isPrimary: !0,
|
|
3230
3231
|
prependIcon: "add"
|
|
3231
|
-
},
|
|
3232
|
+
}, d = {
|
|
3232
3233
|
label: l("inventory.common.refresh"),
|
|
3233
3234
|
value: "refresh",
|
|
3234
3235
|
isPrimary: !1
|
|
3235
3236
|
};
|
|
3236
|
-
return [...F.value ? [v] : [],
|
|
3237
|
+
return [...F.value ? [v] : [], d];
|
|
3237
3238
|
});
|
|
3238
|
-
return (v,
|
|
3239
|
+
return (v, d) => {
|
|
3239
3240
|
const b = Z("FmTable");
|
|
3240
3241
|
return h(), T(ce, null, [
|
|
3241
3242
|
$(Dn, {
|
|
@@ -3257,7 +3258,7 @@ const Io = { class: "flex flex-col gap-16" }, Fo = {
|
|
|
3257
3258
|
"change-location": "",
|
|
3258
3259
|
searchable: "",
|
|
3259
3260
|
search: f.value,
|
|
3260
|
-
"onUpdate:search":
|
|
3261
|
+
"onUpdate:search": d[0] || (d[0] = (y) => f.value = y)
|
|
3261
3262
|
}, null, 8, ["search"]),
|
|
3262
3263
|
(h(), ae(b, {
|
|
3263
3264
|
key: u(r).tableKey,
|
|
@@ -3266,7 +3267,7 @@ const Io = { class: "flex flex-col gap-16" }, Fo = {
|
|
|
3266
3267
|
"row-data": u(r).drafts,
|
|
3267
3268
|
"search-value": f.value,
|
|
3268
3269
|
loading: A.value,
|
|
3269
|
-
onRowClick:
|
|
3270
|
+
onRowClick: d[1] || (d[1] = (y) => u(t)(y.original)),
|
|
3270
3271
|
"page-size": E.value
|
|
3271
3272
|
}, {
|
|
3272
3273
|
"list-row": X((y) => [
|
|
@@ -3322,15 +3323,15 @@ const Io = { class: "flex flex-col gap-16" }, Fo = {
|
|
|
3322
3323
|
}, 8, ["title", "actions"]),
|
|
3323
3324
|
$(Jo, {
|
|
3324
3325
|
show: B.value,
|
|
3325
|
-
"onUpdate:show":
|
|
3326
|
+
"onUpdate:show": d[2] || (d[2] = (y) => B.value = y),
|
|
3326
3327
|
onSubmitted: u(r).fetchDrafts
|
|
3327
3328
|
}, null, 8, ["show", "onSubmitted"]),
|
|
3328
3329
|
(h(), ae(_n, { to: "body" }, [
|
|
3329
3330
|
$(xo, wn(u(s), {
|
|
3330
3331
|
show: u(g),
|
|
3331
|
-
"onUpdate:show":
|
|
3332
|
-
onSubmitted:
|
|
3333
|
-
onRefresh:
|
|
3332
|
+
"onUpdate:show": d[3] || (d[3] = (y) => _t(g) ? g.value = y : null),
|
|
3333
|
+
onSubmitted: d[4] || (d[4] = () => (g.value = !1, u(r).fetchDrafts())),
|
|
3334
|
+
onRefresh: d[5] || (d[5] = (y) => u(r).updateDraftRef(y))
|
|
3334
3335
|
}), null, 16, ["show"])
|
|
3335
3336
|
]))
|
|
3336
3337
|
], 64);
|