@feedmepos/mf-inventory-portal 1.9.0-dev.5 → 1.9.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-DDALXIcF.js → App-CjEtCJ3u.js} +10 -10
- package/dist/{ApprovalView-BJVCW2q7.js → ApprovalView-CWeB-z4R.js} +9 -9
- package/dist/{BindingsDialog-DDMJjWjv.js → BindingsDialog-B2WXjWQ0.js} +2 -2
- package/dist/{BindingsPicker-twbdYEAL.js → BindingsPicker-DTc0Q5Em.js} +2 -2
- package/dist/{BindingsTable-Cpx3vSvk.js → BindingsTable-x1FRAcgJ.js} +4 -4
- package/dist/{BulkReceiveRequestPage-DD33ulSC.js → BulkReceiveRequestPage-Dk4K_vUX.js} +1022 -1047
- package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-CtHsMnkV.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-CPGujVFu.js} +1 -1
- package/dist/{ClosingDraftView-BUc5bGIU.js → ClosingDraftView-BqpTn8dY.js} +19 -19
- package/dist/{ClosingHistoryView-DPz6D5S2.js → ClosingHistoryView-BJQWFz5X.js} +7 -7
- package/dist/{ClosingTemplateView-DabFVZCc.js → ClosingTemplateView-Pj1Kj49d.js} +18 -18
- package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-izGh8Myj.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-Dxt4x9Ia.js} +1 -1
- package/dist/{DefaultView-DURO6g6_.js → DefaultView-BIyIubVt.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-BJBheF-Y.js → DeliveryOrderPrintPreview-2nIVkxIe.js} +2 -2
- package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-BDZaoowM.js → EmailDialog.vue_vue_type_script_setup_true_lang-BnJdt92Q.js} +4795 -4757
- package/dist/{FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-lABO5UTH.js → FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-FraKTknm.js} +1 -1
- package/dist/{FeatureCapabilityGate-4YBofjM5.js → FeatureCapabilityGate-6_6psomb.js} +2 -2
- package/dist/{FeaturePageGate.vue_vue_type_script_setup_true_lang-VwGbsXYy.js → FeaturePageGate.vue_vue_type_script_setup_true_lang-CbrcFNoj.js} +1 -1
- package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-CrYonFQ4.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-B-wMlDXd.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-D0cZr3AO.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CxOLg-J3.js} +2 -2
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CvIVLMp-.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BeIfx9jE.js} +2 -2
- package/dist/{FmMultiselectDialog-lXXaY5lK.js → FmMultiselectDialog-CcH__ggk.js} +2 -2
- package/dist/{FmMultiselectDialog-Cwd47xa5.js → FmMultiselectDialog-snxpWhRm.js} +2 -2
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CqqOESle.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DHlqvBTh.js} +5 -5
- package/dist/{ImportView-hEJUxq3v.js → ImportView-C7KyQ6wA.js} +7 -7
- package/dist/{IngredientsView-DEhTu1Jk.js → IngredientsView-z4pObocZ.js} +15 -15
- package/dist/{IntegrationExplorerView-KpAJ2V3E.js → IntegrationExplorerView-thWjNTPa.js} +6 -6
- package/dist/{IntegrationPlatformView-qrPYWqT5.js → IntegrationPlatformView-BDe83nB1.js} +2 -2
- package/dist/{IntegrationView-BcZjB2Df.js → IntegrationView-CyR9BK3D.js} +15 -15
- package/dist/{InventoryBindingForm-BVW5nyBI.js → InventoryBindingForm-CjTZYqzB.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-ClC9JScP.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DzXGyj0H.js} +4 -4
- package/dist/{InventoryBindingSummary-karaxDWz.js → InventoryBindingSummary-CnLEvpRL.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DC-dWx9K.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DpysXAz4.js} +2 -2
- package/dist/{ProductionRunDetailPage-CRoWs8GL.js → ProductionRunDetailPage-DqlFNDov.js} +4 -4
- package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-lzagKc6P.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-D-GoCIbB.js} +8 -8
- package/dist/{ProductionRunPage-DeEzvebS.js → ProductionRunPage-xr34sye0.js} +4 -4
- package/dist/{PublishView-BG0YVyQ_.js → PublishView-CfuP-tjm.js} +15 -15
- package/dist/{PurchaseOrderPrintPreview-DZs6nzcB.js → PurchaseOrderPrintPreview-DjAxJ2cK.js} +2 -2
- package/dist/ReceiveRequestView-CVw76dPw.js +692 -0
- package/dist/{RecipeView-D-u82Imb.js → RecipeView-UlHc-Voo.js} +16 -16
- package/dist/{SettingsView-CavH72Zf.js → SettingsView-C1OGXlIE.js} +7 -7
- package/dist/{StockView-Mbbag4gi.js → StockView-CrKLqz-6.js} +543 -543
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-I8S3lE8n.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Cm5vtlP6.js} +1 -1
- package/dist/{SupplierView-BKjQQMUB.js → SupplierView-DhH5eT5y.js} +13 -13
- package/dist/{SurchargeView-tG9jxSHT.js → SurchargeView-ByKH6JnI.js} +7 -7
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-f3MH8VXz.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-ZSuKa-oz.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CVPc0HNQ.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CHvqcU44.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BzJkA7ub.js → TransferDetails.vue_vue_type_script_setup_true_lang-CHyAdS3A.js} +24 -24
- package/dist/{TransferTemplateView-DUvgcoFR.js → TransferTemplateView-DJ1XO2Vg.js} +19 -19
- package/dist/{UnitCostHistoryView-DXFlnpzI.js → UnitCostHistoryView-CrBs_s0L.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-T4rShFa9.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-DRJptXCQ.js} +4 -4
- package/dist/{UnitView-ChPy6-nH.js → UnitView--PWg-4ON.js} +7 -7
- package/dist/{WarehouseView-B4rRtSI3.js → WarehouseView-DoOwa0Zq.js} +8 -8
- package/dist/{WastageTemplateView-BWvFXjS6.js → WastageTemplateView-CiLs8nAz.js} +15 -15
- package/dist/{app-DMflhu6b.js → app-CFO3QhF-.js} +37 -29
- package/dist/app.d.ts +8 -0
- package/dist/app.js +1 -1
- package/dist/{bulk-edit-simulation.helper-DezcOq8o.js → bulk-edit-simulation.helper-BjYd_yK4.js} +2 -2
- package/dist/{closing-template-BGERrbIQ.js → closing-template-DXfmztnK.js} +1 -1
- package/dist/{date2-DIxf2HSS.js → date2-BMfqPhRQ.js} +1 -1
- package/dist/{dayjs.min-W80OrMgJ.js → dayjs.min-BVjxIhrP.js} +1 -1
- package/dist/{decimal-BTK7NAET.js → decimal-Drh1-c85.js} +2 -2
- package/dist/{defineDeepModel-DJ9LqqzR.js → defineDeepModel-BuNVB2KT.js} +1 -1
- package/dist/{duplicate-template-BC7pMF-s.js → duplicate-template-Dua82hTr.js} +1 -1
- package/dist/{feature-h3MFKUcz.js → feature-C1JuDWvs.js} +2 -2
- package/dist/{format-time-from-id-DSAFHO8d.js → format-time-from-id-Cq6U2Bxo.js} +1 -1
- package/dist/{format-unit-display-wiLcRFDI.js → format-unit-display-DQLT3yWg.js} +12 -12
- package/dist/{id-to-date-Di8Eschw.js → id-to-date-F63bzmo9.js} +1 -1
- package/dist/{import-export.helper-avwvLBKD.js → import-export.helper-C-wM1uvH.js} +5 -5
- package/dist/{index-CXhgWYdX.js → index-BI_mOT-T.js} +1 -1
- package/dist/{index-C-uWBaU4.js → index-CUK2ixs-.js} +3 -3
- package/dist/{index-CcmysfjG.js → index-CvbK4SMT.js} +1 -1
- package/dist/{lz-string-MCnthIwP.js → lz-string-DaX9t6Vd.js} +1 -1
- package/dist/{netsuite-CsMFS8uH.js → netsuite-Zrpzr6d8.js} +2 -2
- package/dist/{netsuite-explorer-CLsdKVZp.js → netsuite-explorer-C3fHF-PT.js} +1 -1
- package/dist/{predefined-templates-B4URhizE.js → predefined-templates-DG6CeFks.js} +1 -1
- package/dist/{publish-versions-BGoX_gD4.js → publish-versions-Cr7-V-Br.js} +1 -1
- package/dist/{purchase-order-template-Cn2JQYD0.js → purchase-order-template-wj3XUGRR.js} +1 -1
- package/dist/{recalculationUtils-sCuVobBd.js → recalculationUtils-B2fP6IRt.js} +1 -1
- package/dist/{row-action.enum-BM2HgD4R.js → row-action.enum-fy5kNv1e.js} +1 -1
- package/dist/{rules-BaYKzbRv.js → rules-BbnkP4bE.js} +3 -3
- package/dist/{stock-BZMbxbyg.js → stock-2HrEwnse.js} +1 -1
- package/dist/{stock-B4uI5_D4.js → stock-qgCoZCip.js} +2 -2
- package/dist/{supplier-B0dtsWm4.js → supplier-jSpdakxP.js} +2 -2
- package/dist/{surcharge-Djbv5SzM.js → surcharge-BUcmyVUD.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-jR6owpw7.js → uom-rules-CRVV9zbT.js} +1 -1
- package/dist/{use-ingredient-select-dialog-VfIKtgzP.js → use-ingredient-select-dialog-BEpP8U3E.js} +2 -2
- package/dist/{use-inventory-binding-dialog-BdgHGwC_.js → use-inventory-binding-dialog-C71O7N8L.js} +2 -2
- package/dist/{use-template-enabled-locations-B1xMD71z.js → use-template-enabled-locations-DIN3OgYg.js} +2 -2
- package/dist/{use-transfer-locations-NrMDt6DD.js → use-transfer-locations-Bp60KXqJ.js} +2 -2
- package/dist/{useHrmPermission-DT0o2-yP.js → useHrmPermission-isSBKi_1.js} +1 -1
- package/dist/{useNavigationMenu-CMjxTTiM.js → useNavigationMenu-B7i0bnUj.js} +5 -5
- package/dist/{useSseClient-D4n-A1ST.js → useSseClient-DOVhr07c.js} +1 -1
- package/dist/views/receive-request/helper/purchase-export.d.ts +26 -0
- package/dist/views/receive-request/helper/purchase-export.spec.d.ts +1 -0
- package/dist/{vue-BOcyAWzp.js → vue-XyWi0ihT.js} +2 -2
- package/dist/{vue-i18n-69kj_U4j.js → vue-i18n-B1LiOy9S.js} +288 -288
- package/dist/{xlsx.util-CJm8uh4D.js → xlsx.util-CLxGkNhJ.js} +2 -2
- package/package.json +3 -3
- package/dist/ReceiveRequestView-B5jmw3_m.js +0 -729
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { defineComponent as ye, createElementBlock as E, openBlock as p, createElementVNode as e, createVNode as b, toDisplayString as r, unref as o, ref as z, h as Fe, computed as N, watch as ge, resolveComponent as
|
|
1
|
+
import { defineComponent as ye, createElementBlock as E, openBlock as p, createElementVNode as e, createVNode as b, toDisplayString as r, unref as o, ref as z, h as Fe, computed as N, watch as ge, resolveComponent as R, createBlock as ee, isRef as Ne, withCtx as U, Fragment as ae, renderList as fe, createCommentVNode as Q, normalizeClass as he, reactive as _t, normalizeStyle as Qe, createTextVNode as ve, mergeModels as st, useModel as Ct, onMounted as Ze, nextTick as Bt, watchEffect as Vt, renderSlot as at, onUnmounted as Dt, Teleport as It, normalizeProps as lt, mergeProps as We } from "vue";
|
|
2
2
|
import { u as Mt, _ as Tt } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
|
|
3
|
-
import { u as Ce, c as Oe, a as Le, F as rt, v as Ht, s as K, E as ue,
|
|
4
|
-
import { u as ze } from "./stock-
|
|
5
|
-
import { c as
|
|
6
|
-
import { _ as kt, o as
|
|
7
|
-
import { _ as Je, S as Ke, g as bt, a as
|
|
8
|
-
import { _ as
|
|
3
|
+
import { u as Ce, c as Oe, a as Le, F as rt, v as Ht, s as K, E as ue, G as Et, d as Ut, B as Pt, h as Rt, e as it, M as je, O as Ee } from "./app-CFO3QhF-.js";
|
|
4
|
+
import { u as ze } from "./stock-qgCoZCip.js";
|
|
5
|
+
import { c as Nt } from "./component-BmLAdDiY.js";
|
|
6
|
+
import { _ as kt, o as Ot } from "./UnitDisplayControl.vue_vue_type_script_setup_true_lang-DRJptXCQ.js";
|
|
7
|
+
import { _ as Je, S as Ke, g as bt, a as Lt } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Cm5vtlP6.js";
|
|
8
|
+
import { _ as zt } from "./FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-FraKTknm.js";
|
|
9
9
|
import { useI18n as _e, useCoreStore as et } from "@feedmepos/mf-common";
|
|
10
|
-
import { u as ht, i as De } from "./id-to-date-
|
|
11
|
-
import { useSnackbar as xe, useDialog as Ye, useProxiedModel as qe, components as
|
|
12
|
-
import { defineStore as
|
|
10
|
+
import { u as ht, i as De } from "./id-to-date-F63bzmo9.js";
|
|
11
|
+
import { useSnackbar as xe, useDialog as Ye, useProxiedModel as qe, components as Yt, useBreakpoints as qt } from "@feedmepos/ui-library";
|
|
12
|
+
import { defineStore as Gt } from "pinia";
|
|
13
13
|
import { F as Ge } from "./FmAdminBadge-DlplQOHb.js";
|
|
14
|
-
import { g as Ie, a as $e, h as
|
|
15
|
-
import { u as Be } from "./stock-
|
|
16
|
-
import { u as
|
|
17
|
-
import { a as xt } from "./FmMultiselectDialog-
|
|
18
|
-
import { d as we } from "./dayjs.min-
|
|
19
|
-
import { _ as
|
|
20
|
-
import { g as
|
|
21
|
-
import { c as St, f as nt, b as
|
|
22
|
-
import { i as
|
|
23
|
-
import { _ as
|
|
24
|
-
import { F as wt } from "./FeatureCapabilityGate-
|
|
25
|
-
import "./feature-
|
|
26
|
-
import { u as $t } from "./useHrmPermission-
|
|
14
|
+
import { g as Ie, a as $e, h as Wt, t as Me, I as ut, f as tt, A as Kt, M as Xt, i as Jt, j as ct, k as gt, l as ot, R as Qt, d as Pe, m as Zt } from "./rules-BbnkP4bE.js";
|
|
15
|
+
import { u as Be } from "./stock-2HrEwnse.js";
|
|
16
|
+
import { u as eo } from "./use-inventory-binding-dialog-C71O7N8L.js";
|
|
17
|
+
import { a as xt } from "./FmMultiselectDialog-snxpWhRm.js";
|
|
18
|
+
import { d as we } from "./dayjs.min-BVjxIhrP.js";
|
|
19
|
+
import { _ as to } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DpysXAz4.js";
|
|
20
|
+
import { g as oo } from "./decimal-Drh1-c85.js";
|
|
21
|
+
import { c as St, f as nt, b as no, d as so, t as dt, a as mt, p as ao, n as lo } from "./date2-BMfqPhRQ.js";
|
|
22
|
+
import { i as ro } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-B-wMlDXd.js";
|
|
23
|
+
import { _ as io } from "./empty-placeholder-B0QU467o.js";
|
|
24
|
+
import { F as wt } from "./FeatureCapabilityGate-6_6psomb.js";
|
|
25
|
+
import "./feature-C1JuDWvs.js";
|
|
26
|
+
import { u as $t } from "./useHrmPermission-isSBKi_1.js";
|
|
27
27
|
import { F as ft } from "./index-eGvSlWMU.js";
|
|
28
|
-
import { _ as
|
|
29
|
-
import { _ as
|
|
30
|
-
import { u as
|
|
31
|
-
import { u as
|
|
32
|
-
import { P as
|
|
33
|
-
var
|
|
34
|
-
const
|
|
28
|
+
import { _ as uo } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-gJQQKKAC.js";
|
|
29
|
+
import { _ as co } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BeIfx9jE.js";
|
|
30
|
+
import { u as mo } from "./useSseClient-DOVhr07c.js";
|
|
31
|
+
import { u as fo } from "./netsuite-Zrpzr6d8.js";
|
|
32
|
+
import { P as vo, J as po } from "./app-C39bYJmq.js";
|
|
33
|
+
var Re = /* @__PURE__ */ ((j) => (j.History = "History", j.Convert = "Convert", j.Adjust = "Adjust", j))(Re || {});
|
|
34
|
+
const yo = [
|
|
35
35
|
{
|
|
36
36
|
translationKey: "inventory.stock.action.history",
|
|
37
37
|
color: "text-neutral-700",
|
|
38
38
|
value: "History"
|
|
39
39
|
/* History */
|
|
40
40
|
}
|
|
41
|
-
],
|
|
41
|
+
], _o = [
|
|
42
42
|
{
|
|
43
43
|
translationKey: "inventory.stock.action.history",
|
|
44
44
|
color: "text-neutral-700",
|
|
@@ -57,27 +57,27 @@ const _o = [
|
|
|
57
57
|
value: "Adjust"
|
|
58
58
|
/* Adjust */
|
|
59
59
|
}
|
|
60
|
-
],
|
|
60
|
+
], ko = { class: "flex items-center gap-8" }, bo = { class: "whitespace-nowrap" }, ho = /* @__PURE__ */ ye({
|
|
61
61
|
__name: "StockHeaderPreview",
|
|
62
62
|
setup(j) {
|
|
63
63
|
const { t: f } = _e();
|
|
64
|
-
return (h, v) => (p(), E("div",
|
|
65
|
-
e("div",
|
|
66
|
-
b(
|
|
64
|
+
return (h, v) => (p(), E("div", ko, [
|
|
65
|
+
e("div", bo, r(o(f)("inventory.stock.prediction.daysRemaining")), 1),
|
|
66
|
+
b(zt, {
|
|
67
67
|
tier: "standard",
|
|
68
68
|
category: "beta"
|
|
69
69
|
})
|
|
70
70
|
]));
|
|
71
71
|
}
|
|
72
|
-
}), At =
|
|
73
|
-
const j = z(!1), f = Ce(), h = ze(), v = ht(),
|
|
72
|
+
}), At = Gt("stockActions", () => {
|
|
73
|
+
const j = z(!1), f = Ce(), h = ze(), v = ht(), S = xe(), A = Ye(), { t: u } = _e();
|
|
74
74
|
async function i() {
|
|
75
75
|
if (f._currentLocation) {
|
|
76
76
|
j.value = !0;
|
|
77
77
|
try {
|
|
78
78
|
await h.readStockBalance(), await v.readStockEstimateBalance();
|
|
79
79
|
} catch {
|
|
80
|
-
|
|
80
|
+
S.open({
|
|
81
81
|
title: u("inventory.stock.error.title"),
|
|
82
82
|
message: u("inventory.stock.error.message"),
|
|
83
83
|
type: "error"
|
|
@@ -91,7 +91,7 @@ const _o = [
|
|
|
91
91
|
async function L(x) {
|
|
92
92
|
var c, s, T;
|
|
93
93
|
if (!!!((s = (c = x.convert) == null ? void 0 : c.inventoryBindings) != null && s.length)) {
|
|
94
|
-
|
|
94
|
+
A.open({
|
|
95
95
|
title: u("inventory.stock.error.convert.title"),
|
|
96
96
|
message: u("inventory.stock.error.convert.message")
|
|
97
97
|
});
|
|
@@ -100,7 +100,7 @@ const _o = [
|
|
|
100
100
|
try {
|
|
101
101
|
await h.readProductBalance();
|
|
102
102
|
} catch (H) {
|
|
103
|
-
|
|
103
|
+
S.open({
|
|
104
104
|
title: u("inventory.stock.error.title"),
|
|
105
105
|
message: u("inventory.stock.error.message"),
|
|
106
106
|
type: "error"
|
|
@@ -148,13 +148,13 @@ const _o = [
|
|
|
148
148
|
function a(x, l) {
|
|
149
149
|
const t = Oe(l);
|
|
150
150
|
switch (x) {
|
|
151
|
-
case
|
|
151
|
+
case Re.History:
|
|
152
152
|
C(t);
|
|
153
153
|
return;
|
|
154
|
-
case
|
|
154
|
+
case Re.Convert:
|
|
155
155
|
L(t);
|
|
156
156
|
return;
|
|
157
|
-
case
|
|
157
|
+
case Re.Adjust:
|
|
158
158
|
k(t);
|
|
159
159
|
return;
|
|
160
160
|
}
|
|
@@ -168,8 +168,8 @@ const _o = [
|
|
|
168
168
|
adjustSkuDialogProps: D
|
|
169
169
|
};
|
|
170
170
|
});
|
|
171
|
-
function
|
|
172
|
-
var
|
|
171
|
+
function go() {
|
|
172
|
+
var A;
|
|
173
173
|
const j = Ce(), f = At(), h = et(), { t: v } = _e();
|
|
174
174
|
return {
|
|
175
175
|
columnDefs: [
|
|
@@ -199,7 +199,7 @@ function xo() {
|
|
|
199
199
|
},
|
|
200
200
|
size: 180
|
|
201
201
|
},
|
|
202
|
-
...(
|
|
202
|
+
...(A = h.sessionUser.value) != null && A.role.isAdmin ? [
|
|
203
203
|
{
|
|
204
204
|
accessorKey: "isInactive",
|
|
205
205
|
header: () => Fe(Ge, {}, () => `${v("inventory.ingredient.status.title")}`),
|
|
@@ -222,7 +222,7 @@ function xo() {
|
|
|
222
222
|
{
|
|
223
223
|
accessorKey: "day",
|
|
224
224
|
id: "expireDate",
|
|
225
|
-
header: () => Fe(
|
|
225
|
+
header: () => Fe(ho),
|
|
226
226
|
enableSorting: !0,
|
|
227
227
|
sortUndefined: "last",
|
|
228
228
|
cell(u) {
|
|
@@ -245,8 +245,8 @@ function xo() {
|
|
|
245
245
|
id: "action",
|
|
246
246
|
cell(u) {
|
|
247
247
|
var i;
|
|
248
|
-
return
|
|
249
|
-
((i = j._currentLocation) == null ? void 0 : i.type) === "restaurant" ?
|
|
248
|
+
return Nt(
|
|
249
|
+
((i = j._currentLocation) == null ? void 0 : i.type) === "restaurant" ? yo : _o,
|
|
250
250
|
(_) => f.onActionMenu(_, u.row.original)
|
|
251
251
|
);
|
|
252
252
|
},
|
|
@@ -260,7 +260,7 @@ function xo() {
|
|
|
260
260
|
]
|
|
261
261
|
};
|
|
262
262
|
}
|
|
263
|
-
const
|
|
263
|
+
const xo = {
|
|
264
264
|
context: null,
|
|
265
265
|
error: null,
|
|
266
266
|
isRequired(j = "This field is required") {
|
|
@@ -295,9 +295,9 @@ const So = {
|
|
|
295
295
|
}
|
|
296
296
|
};
|
|
297
297
|
function vt(j) {
|
|
298
|
-
return { ...
|
|
298
|
+
return { ...xo, context: j };
|
|
299
299
|
}
|
|
300
|
-
const
|
|
300
|
+
const So = { class: "flex items-center" }, wo = { class: "fm-typo-en-title-md-800" }, $o = { class: "flex flex-col gap-24 w-full" }, Ao = { class: "flex flex-col gap-8" }, Fo = { class: "fm-typo-en-body-lg-600" }, jo = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary flex-grow" }, Co = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-error" }, Bo = { class: "flex flex-col p-16 gap-8" }, Vo = { class: "flex flex-col gap-4" }, Do = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100 border-b py-12 px-16" }, Io = { class: "grid grid-cols-[auto_100px_100px_48px] xs:grid-cols-[auto_80px_120px_48px] gap-8 px-8 items-center" }, Mo = { class: "xs:col-span-3" }, To = { class: "flex gap-8" }, Ho = /* @__PURE__ */ ye({
|
|
301
301
|
__name: "ConvertSkuDialog",
|
|
302
302
|
props: {
|
|
303
303
|
sku: {},
|
|
@@ -306,10 +306,10 @@ const wo = { class: "flex items-center" }, $o = { class: "fm-typo-en-title-md-80
|
|
|
306
306
|
},
|
|
307
307
|
emits: ["update:show", "submitted"],
|
|
308
308
|
setup(j, { expose: f, emit: h }) {
|
|
309
|
-
const v = j,
|
|
309
|
+
const v = j, S = h, A = eo(), u = Le(), i = Be(), _ = xe(), { t: L } = _e(), D = z(0), k = z(null), d = N(() => u.skus), C = N(
|
|
310
310
|
() => {
|
|
311
|
-
var
|
|
312
|
-
return (((g = (
|
|
311
|
+
var $, g;
|
|
312
|
+
return (((g = ($ = v.sku) == null ? void 0 : $.convert) == null ? void 0 : g.inventoryBindings) ?? []).filter(
|
|
313
313
|
(G) => G.type === rt.enum.SKU
|
|
314
314
|
);
|
|
315
315
|
}
|
|
@@ -317,28 +317,28 @@ const wo = { class: "flex items-center" }, $o = { class: "fm-typo-en-title-md-80
|
|
|
317
317
|
get() {
|
|
318
318
|
return !!k.value;
|
|
319
319
|
},
|
|
320
|
-
set(
|
|
321
|
-
|
|
320
|
+
set($) {
|
|
321
|
+
$ ? k.value = Oe(C.value) : (k.value = null, l.value = {}, D.value = Math.min(D.value, v.maxCount ?? 0));
|
|
322
322
|
}
|
|
323
323
|
}), x = z(!1);
|
|
324
|
-
ge([() => v.show], ([
|
|
325
|
-
|
|
324
|
+
ge([() => v.show], ([$]) => {
|
|
325
|
+
$ && (D.value = 0);
|
|
326
326
|
});
|
|
327
327
|
const l = z({});
|
|
328
|
-
function t(
|
|
329
|
-
return String(
|
|
328
|
+
function t($) {
|
|
329
|
+
return String($ ?? "").trim().length === 0;
|
|
330
330
|
}
|
|
331
|
-
function n(
|
|
332
|
-
if (t(
|
|
333
|
-
const g = ut()(String(
|
|
334
|
-
return g !== !0 ? g : Number(
|
|
331
|
+
function n($) {
|
|
332
|
+
if (t($)) return "Required";
|
|
333
|
+
const g = ut()(String($));
|
|
334
|
+
return g !== !0 ? g : Number($) >= 0 || "Must be zero or greater";
|
|
335
335
|
}
|
|
336
|
-
function c(
|
|
336
|
+
function c($) {
|
|
337
337
|
const g = { ...l.value };
|
|
338
|
-
delete g[
|
|
338
|
+
delete g[$], l.value = g;
|
|
339
339
|
}
|
|
340
340
|
function s() {
|
|
341
|
-
if (k.value && (Object.keys(l.value).length > 0 || k.value.some((
|
|
341
|
+
if (k.value && (Object.keys(l.value).length > 0 || k.value.some(($) => $.amount.amount < 0))) {
|
|
342
342
|
_.open({
|
|
343
343
|
title: "Invalid amount",
|
|
344
344
|
message: "Please correct the highlighted ingredient amounts.",
|
|
@@ -348,24 +348,24 @@ const wo = { class: "flex items-center" }, $o = { class: "fm-typo-en-title-md-80
|
|
|
348
348
|
}
|
|
349
349
|
Y(v.sku, Me(D.value), k.value);
|
|
350
350
|
}
|
|
351
|
-
function T(
|
|
351
|
+
function T($) {
|
|
352
352
|
if (k.value)
|
|
353
353
|
return !0;
|
|
354
|
-
const g = vt(
|
|
354
|
+
const g = vt($).isInteger().max(v.maxCount ?? 0).error ?? "";
|
|
355
355
|
return g || !0;
|
|
356
356
|
}
|
|
357
|
-
function H(
|
|
358
|
-
var
|
|
359
|
-
const g = (
|
|
357
|
+
function H($) {
|
|
358
|
+
var P;
|
|
359
|
+
const g = (P = v.sku.convert) != null && P.measurement ? v.sku.unit.measurements.find((te) => {
|
|
360
360
|
var le;
|
|
361
361
|
return te.id === ((le = v.sku.convert) == null ? void 0 : le.measurement);
|
|
362
|
-
}) ?? null : null, G = Ie(v.sku.unit, g), q =
|
|
362
|
+
}) ?? null : null, G = Ie(v.sku.unit, g), q = Jt(+$);
|
|
363
363
|
return vt(q).isInteger().max(G).error ? "Precision cannot be more than " + G : !0;
|
|
364
364
|
}
|
|
365
365
|
const V = N(
|
|
366
366
|
() => {
|
|
367
|
-
var
|
|
368
|
-
return (
|
|
367
|
+
var $, g;
|
|
368
|
+
return ($ = v.sku.convert) != null && $.measurement ? (g = v.sku.unit.measurements.find((G) => {
|
|
369
369
|
var q;
|
|
370
370
|
return G.id === ((q = v.sku.convert) == null ? void 0 : q.measurement);
|
|
371
371
|
})) == null ? void 0 : g.abbrev : v.sku.unit.abbrev;
|
|
@@ -377,19 +377,19 @@ const wo = { class: "flex items-center" }, $o = { class: "fm-typo-en-title-md-80
|
|
|
377
377
|
skus: u.skus,
|
|
378
378
|
skuGroups: [],
|
|
379
379
|
recipes: u.recipes
|
|
380
|
-
}).inventoryBindings.filter((
|
|
381
|
-
return (M = k.value ?? g) == null ? void 0 : M.map((
|
|
380
|
+
}).inventoryBindings.filter((P) => "success" in P && P.success).map((P) => P).map((P) => P.binding);
|
|
381
|
+
return (M = k.value ?? g) == null ? void 0 : M.map((P) => {
|
|
382
382
|
var B, O, X, se, ne;
|
|
383
|
-
const te = u.skus.find((ie) => ie._id ===
|
|
383
|
+
const te = u.skus.find((ie) => ie._id === P.id), le = ((B = P.measurement) == null ? void 0 : B.abbrev) ?? ((O = te == null ? void 0 : te.unit) == null ? void 0 : O.abbrev), re = (X = v.sku.convert) != null && X.measurement ? v.sku.unit.measurements.find((ie) => {
|
|
384
384
|
var de;
|
|
385
385
|
return ie.id === ((de = v.sku.convert) == null ? void 0 : de.measurement);
|
|
386
|
-
}) ?? null : null,
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
Me(+D.value,
|
|
386
|
+
}) ?? null : null, F = Ie(v.sku.unit, re), m = H(`${D.value}`) === !0 ? $e(
|
|
387
|
+
Wt(
|
|
388
|
+
P.amount,
|
|
389
|
+
Me(+D.value, F)
|
|
390
390
|
),
|
|
391
391
|
!1
|
|
392
|
-
) : "0",
|
|
392
|
+
) : "0", w = (ne = (se = k.value) == null ? void 0 : se.find((ie) => ie.id === (te == null ? void 0 : te._id))) == null ? void 0 : ne.amount, y = w ? $e(w, !1) : null;
|
|
393
393
|
return {
|
|
394
394
|
sku: te,
|
|
395
395
|
convertAmount: y ?? m,
|
|
@@ -399,26 +399,26 @@ const wo = { class: "flex items-center" }, $o = { class: "fm-typo-en-title-md-80
|
|
|
399
399
|
}), I = z();
|
|
400
400
|
f({
|
|
401
401
|
validateInputs: () => {
|
|
402
|
-
var
|
|
403
|
-
(g = (
|
|
402
|
+
var $, g;
|
|
403
|
+
(g = ($ = I.value) == null ? void 0 : $.validateInputs) == null || g.call($);
|
|
404
404
|
},
|
|
405
405
|
resetInputsValidation: () => {
|
|
406
|
-
var
|
|
407
|
-
(g = (
|
|
406
|
+
var $, g;
|
|
407
|
+
(g = ($ = I.value) == null ? void 0 : $.resetInputsValidation) == null || g.call($);
|
|
408
408
|
},
|
|
409
409
|
resetInputs: () => {
|
|
410
|
-
var
|
|
411
|
-
(g = (
|
|
410
|
+
var $, g;
|
|
411
|
+
(g = ($ = I.value) == null ? void 0 : $.resetInputs) == null || g.call($);
|
|
412
412
|
}
|
|
413
413
|
});
|
|
414
414
|
const W = qe(v, "show");
|
|
415
|
-
async function Y(
|
|
415
|
+
async function Y($, g, G) {
|
|
416
416
|
x.value = !0;
|
|
417
417
|
try {
|
|
418
418
|
await i.convertSku({
|
|
419
419
|
conversions: [
|
|
420
420
|
{
|
|
421
|
-
doc:
|
|
421
|
+
doc: $,
|
|
422
422
|
amount: g,
|
|
423
423
|
overrides: G == null ? void 0 : G.map((q) => ({
|
|
424
424
|
...q,
|
|
@@ -430,85 +430,85 @@ const wo = { class: "flex items-center" }, $o = { class: "fm-typo-en-title-md-80
|
|
|
430
430
|
}))
|
|
431
431
|
}
|
|
432
432
|
]
|
|
433
|
-
}),
|
|
433
|
+
}), S("update:show", !1), S("submitted");
|
|
434
434
|
} catch (q) {
|
|
435
435
|
_.open({
|
|
436
436
|
title: "Something went wrong",
|
|
437
|
-
message: `Cannot convert ${
|
|
437
|
+
message: `Cannot convert ${$.name}. Please try again.`,
|
|
438
438
|
type: "error"
|
|
439
|
-
}), console.error("error at converting stock amount",
|
|
439
|
+
}), console.error("error at converting stock amount", $, g, q);
|
|
440
440
|
} finally {
|
|
441
441
|
x.value = !1;
|
|
442
442
|
}
|
|
443
443
|
}
|
|
444
|
-
function Z(
|
|
444
|
+
function Z($, g, G) {
|
|
445
445
|
if (n(g) !== !0) {
|
|
446
|
-
l.value = { ...l.value, [
|
|
446
|
+
l.value = { ...l.value, [$]: g };
|
|
447
447
|
return;
|
|
448
448
|
}
|
|
449
|
-
c(
|
|
449
|
+
c($);
|
|
450
450
|
const q = +g;
|
|
451
|
-
k.value = G.map((M) => (M.id !==
|
|
451
|
+
k.value = G.map((M) => (M.id !== $ || (M.amount = K.fromNumber(q)), M));
|
|
452
452
|
}
|
|
453
|
-
function oe(
|
|
454
|
-
const g = d.value.find((G) => G._id ===
|
|
453
|
+
function oe($) {
|
|
454
|
+
const g = d.value.find((G) => G._id === $);
|
|
455
455
|
return g ? bt(g.unit, !0) : [];
|
|
456
456
|
}
|
|
457
|
-
function ce(
|
|
458
|
-
const G = oe(
|
|
457
|
+
function ce($, g) {
|
|
458
|
+
const G = oe($), q = G.find((M) => M.value === g) ?? G.find((M) => M.value === null);
|
|
459
459
|
return q ? {
|
|
460
460
|
...q,
|
|
461
461
|
label: q.abbrev
|
|
462
462
|
} : null;
|
|
463
463
|
}
|
|
464
|
-
function pe(
|
|
464
|
+
function pe($, g, G) {
|
|
465
465
|
let q;
|
|
466
466
|
if (g === null)
|
|
467
|
-
q = G.map((M) => (M.id !==
|
|
467
|
+
q = G.map((M) => (M.id !== $ || (M.measurement = null), M)) ?? [];
|
|
468
468
|
else {
|
|
469
|
-
const M = d.value.find((
|
|
470
|
-
q = G.map((
|
|
469
|
+
const M = d.value.find((P) => P._id === $);
|
|
470
|
+
q = G.map((P) => {
|
|
471
471
|
var te, le;
|
|
472
|
-
return
|
|
472
|
+
return P.id !== $ || (P.measurement = (le = (te = M == null ? void 0 : M.unit) == null ? void 0 : te.measurements) == null ? void 0 : le.find((re) => re.id === g)), P;
|
|
473
473
|
}) ?? [];
|
|
474
474
|
}
|
|
475
475
|
k.value = q;
|
|
476
476
|
}
|
|
477
|
-
function ke(
|
|
478
|
-
const G = g.filter((q) => q.id !==
|
|
479
|
-
c(
|
|
477
|
+
function ke($, g) {
|
|
478
|
+
const G = g.filter((q) => q.id !== $);
|
|
479
|
+
c($), k.value = G;
|
|
480
480
|
}
|
|
481
481
|
function be() {
|
|
482
|
-
const
|
|
482
|
+
const $ = (k.value ?? []).map((g) => ({
|
|
483
483
|
...g,
|
|
484
484
|
type: rt.enum.SKU
|
|
485
485
|
}));
|
|
486
|
-
|
|
487
|
-
|
|
486
|
+
A.promptIngredientsBinding(
|
|
487
|
+
$,
|
|
488
488
|
(g) => k.value = g,
|
|
489
489
|
v.sku._id
|
|
490
490
|
);
|
|
491
491
|
}
|
|
492
492
|
return ge(
|
|
493
493
|
() => v.show,
|
|
494
|
-
(
|
|
495
|
-
|
|
494
|
+
($) => {
|
|
495
|
+
$ || (k.value = null, l.value = {}, D.value = 0);
|
|
496
496
|
}
|
|
497
|
-
), (
|
|
498
|
-
const G =
|
|
499
|
-
return p(), ee(
|
|
497
|
+
), ($, g) => {
|
|
498
|
+
const G = R("FmTextField"), q = R("FmForm"), M = R("FmCard"), P = R("FmSwitch"), te = R("FmFormGroup"), le = R("FmSelect"), re = R("FmButton"), F = R("FmSideSheet");
|
|
499
|
+
return p(), ee(F, {
|
|
500
500
|
"dismiss-away": "",
|
|
501
501
|
modelValue: o(W),
|
|
502
502
|
"onUpdate:modelValue": g[3] || (g[3] = (m) => Ne(W) ? W.value = m : null),
|
|
503
503
|
"max-width": 500
|
|
504
504
|
}, {
|
|
505
505
|
"side-sheet-header": U(() => [
|
|
506
|
-
e("div",
|
|
507
|
-
e("div",
|
|
506
|
+
e("div", So, [
|
|
507
|
+
e("div", wo, r(o(L)("inventory.stock.convert.title", { name: $.sku.name })), 1)
|
|
508
508
|
])
|
|
509
509
|
]),
|
|
510
510
|
default: U(() => [
|
|
511
|
-
e("div",
|
|
511
|
+
e("div", $o, [
|
|
512
512
|
b(q, {
|
|
513
513
|
ref_key: "formRef",
|
|
514
514
|
ref: I,
|
|
@@ -522,7 +522,7 @@ const wo = { class: "flex items-center" }, $o = { class: "fm-typo-en-title-md-80
|
|
|
522
522
|
label: o(L)("inventory.stock.convert.amount"),
|
|
523
523
|
rules: [o(ut)(), T, H, o(tt)(0)],
|
|
524
524
|
"append-text": V.value,
|
|
525
|
-
"helper-text": k.value ? void 0 : `Max ${
|
|
525
|
+
"helper-text": k.value ? void 0 : `Max ${$.maxCount} ${V.value}`
|
|
526
526
|
}, null, 8, ["disabled", "model-value", "label", "rules", "append-text", "helper-text"])
|
|
527
527
|
]),
|
|
528
528
|
_: 1
|
|
@@ -532,16 +532,16 @@ const wo = { class: "flex items-center" }, $o = { class: "fm-typo-en-title-md-80
|
|
|
532
532
|
class: "p-16"
|
|
533
533
|
}, {
|
|
534
534
|
default: U(() => [
|
|
535
|
-
e("div",
|
|
536
|
-
e("div",
|
|
535
|
+
e("div", Ao, [
|
|
536
|
+
e("div", Fo, r(o(L)("inventory.stock.convert.deductionSummary")), 1),
|
|
537
537
|
(p(!0), E(ae, null, fe(J.value, (m) => {
|
|
538
|
-
var
|
|
538
|
+
var w, y;
|
|
539
539
|
return p(), E("div", {
|
|
540
|
-
key: (
|
|
540
|
+
key: (w = m.sku) == null ? void 0 : w._id,
|
|
541
541
|
class: "flex items-center"
|
|
542
542
|
}, [
|
|
543
|
-
e("div",
|
|
544
|
-
e("div",
|
|
543
|
+
e("div", jo, r((y = m.sku) == null ? void 0 : y.name), 1),
|
|
544
|
+
e("div", Co, " -" + r(m.convertAmount) + " " + r(m.abbrev), 1)
|
|
545
545
|
]);
|
|
546
546
|
}), 128))
|
|
547
547
|
])
|
|
@@ -550,8 +550,8 @@ const wo = { class: "flex items-center" }, $o = { class: "fm-typo-en-title-md-80
|
|
|
550
550
|
}),
|
|
551
551
|
b(M, { variant: "outlined" }, {
|
|
552
552
|
default: U(() => [
|
|
553
|
-
e("div",
|
|
554
|
-
b(
|
|
553
|
+
e("div", Bo, [
|
|
554
|
+
b(P, {
|
|
555
555
|
value: "",
|
|
556
556
|
modelValue: a.value,
|
|
557
557
|
"onUpdate:modelValue": g[1] || (g[1] = (m) => a.value = m),
|
|
@@ -561,27 +561,27 @@ const wo = { class: "flex items-center" }, $o = { class: "fm-typo-en-title-md-80
|
|
|
561
561
|
a.value ? (p(), E(ae, { key: 0 }, [
|
|
562
562
|
b(te, {
|
|
563
563
|
modelValue: k.value,
|
|
564
|
-
rules: [o(
|
|
564
|
+
rules: [o(Kt)(1, "Must have at least one ingredient binding")]
|
|
565
565
|
}, null, 8, ["modelValue", "rules"]),
|
|
566
|
-
e("div",
|
|
567
|
-
e("div",
|
|
566
|
+
e("div", Vo, [
|
|
567
|
+
e("div", Do, r(o(L)("inventory.stock.convert.ingredients")), 1),
|
|
568
568
|
(p(!0), E(ae, null, fe(k.value, (m) => (p(), ee(te, {
|
|
569
569
|
key: m.id,
|
|
570
570
|
disabled: x.value,
|
|
571
571
|
modelValue: l.value[m.id] ?? +o($e)(m.amount ?? { amount: 1, precision: 0 }),
|
|
572
572
|
rules: [
|
|
573
573
|
n,
|
|
574
|
-
o(
|
|
575
|
-
d.value.find((
|
|
574
|
+
o(Xt)(
|
|
575
|
+
d.value.find((w) => w._id === m.id).unit,
|
|
576
576
|
m.measurement
|
|
577
577
|
)
|
|
578
578
|
]
|
|
579
579
|
}, {
|
|
580
|
-
default: U(({ invalid:
|
|
580
|
+
default: U(({ invalid: w }) => {
|
|
581
581
|
var y, B, O;
|
|
582
582
|
return [
|
|
583
|
-
e("div",
|
|
584
|
-
e("div",
|
|
583
|
+
e("div", Io, [
|
|
584
|
+
e("div", Mo, r((y = d.value.find((X) => X._id === m.id)) == null ? void 0 : y.name), 1),
|
|
585
585
|
b(G, {
|
|
586
586
|
class: "xs:col-span-2",
|
|
587
587
|
disabled: x.value,
|
|
@@ -589,7 +589,7 @@ const wo = { class: "flex items-center" }, $o = { class: "fm-typo-en-title-md-80
|
|
|
589
589
|
m.amount ?? { amount: 1, precision: 0 }
|
|
590
590
|
),
|
|
591
591
|
"onUpdate:modelValue": (X) => Z(m.id, X, k.value ?? []),
|
|
592
|
-
invalid:
|
|
592
|
+
invalid: w
|
|
593
593
|
}, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "invalid"]),
|
|
594
594
|
b(le, {
|
|
595
595
|
disabled: x.value,
|
|
@@ -597,7 +597,7 @@ const wo = { class: "flex items-center" }, $o = { class: "fm-typo-en-title-md-80
|
|
|
597
597
|
items: oe(m.id),
|
|
598
598
|
"model-value": (O = ce(m.id, (B = m.measurement) == null ? void 0 : B.id)) == null ? void 0 : O.value,
|
|
599
599
|
"onUpdate:modelValue": (X) => pe(m.id, X, k.value ?? []),
|
|
600
|
-
invalid:
|
|
600
|
+
invalid: w
|
|
601
601
|
}, {
|
|
602
602
|
"helper-text": U(() => g[4] || (g[4] = [])),
|
|
603
603
|
_: 2
|
|
@@ -631,13 +631,13 @@ const wo = { class: "flex items-center" }, $o = { class: "fm-typo-en-title-md-80
|
|
|
631
631
|
])
|
|
632
632
|
]),
|
|
633
633
|
"side-sheet-footer": U(() => [
|
|
634
|
-
e("div",
|
|
634
|
+
e("div", To, [
|
|
635
635
|
b(re, {
|
|
636
636
|
loading: x.value,
|
|
637
637
|
label: o(L)("inventory.stock.convert.convertButton"),
|
|
638
638
|
onClick: g[2] || (g[2] = (m) => {
|
|
639
|
-
var
|
|
640
|
-
return (y = (
|
|
639
|
+
var w, y;
|
|
640
|
+
return (y = (w = I.value) == null ? void 0 : w.validateInputs) == null ? void 0 : y.call(w);
|
|
641
641
|
})
|
|
642
642
|
}, null, 8, ["loading", "label"])
|
|
643
643
|
])
|
|
@@ -679,7 +679,7 @@ const Xe = {
|
|
|
679
679
|
label: "Purchase",
|
|
680
680
|
toAdjustmentAmount: pt
|
|
681
681
|
}
|
|
682
|
-
},
|
|
682
|
+
}, Eo = { class: "col-span-2 flex" }, Uo = { class: "flex-1" }, Po = { class: "fm-typo-en-body-lg-600" }, Ro = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, No = { class: "col-span-2 flex flex-col gap-4" }, Oo = { class: "flex gap-4 text-fm-color-typo-primary fm-typo-en-body-lg-600" }, Lo = {
|
|
683
683
|
key: 0,
|
|
684
684
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-warning"
|
|
685
685
|
}, Ft = /* @__PURE__ */ ye({
|
|
@@ -691,9 +691,9 @@ const Xe = {
|
|
|
691
691
|
},
|
|
692
692
|
emits: ["update:modelValue", "click:delete"],
|
|
693
693
|
setup(j, { emit: f }) {
|
|
694
|
-
const h = j, v = f, { t:
|
|
694
|
+
const h = j, v = f, { t: S } = _e(), A = ze(), u = N(
|
|
695
695
|
() => Object.keys(Xe).map((t) => ({
|
|
696
|
-
label:
|
|
696
|
+
label: S(`inventory.inventoryAdjustment.type.${t}`),
|
|
697
697
|
value: t
|
|
698
698
|
}))
|
|
699
699
|
), i = N(() => bt(h.modelValue.doc.unit, !0)), _ = N({
|
|
@@ -749,7 +749,7 @@ const Xe = {
|
|
|
749
749
|
}
|
|
750
750
|
}), d = N(() => {
|
|
751
751
|
var n;
|
|
752
|
-
const t = (n =
|
|
752
|
+
const t = (n = A.stockBalance.skus) == null ? void 0 : n.find((c) => c.id === h.modelValue.doc._id);
|
|
753
753
|
return (t == null ? void 0 : t.balance) ?? { amount: 0, precision: 0 };
|
|
754
754
|
}), C = N(() => {
|
|
755
755
|
const t = h.modelValue.amount, n = h.modelValue.measurement;
|
|
@@ -757,21 +757,21 @@ const Xe = {
|
|
|
757
757
|
}), a = N(
|
|
758
758
|
() => h.isBackdate ? d.value : ot(d.value, C.value)
|
|
759
759
|
), x = N(
|
|
760
|
-
() =>
|
|
760
|
+
() => oo(a.value, h.modelValue.doc.unit)
|
|
761
761
|
), l = N(
|
|
762
762
|
() => !h.isBackdate && C.value.amount < 0
|
|
763
763
|
);
|
|
764
764
|
return (t, n) => {
|
|
765
|
-
const c =
|
|
765
|
+
const c = R("FmButton"), s = R("FmSelect"), T = R("FmTextarea"), H = R("FmCard");
|
|
766
766
|
return p(), ee(H, {
|
|
767
767
|
variant: "outlined",
|
|
768
768
|
class: "grid grid-cols-2 gap-8 p-16"
|
|
769
769
|
}, {
|
|
770
770
|
default: U(() => [
|
|
771
|
-
e("div",
|
|
772
|
-
e("div",
|
|
771
|
+
e("div", Eo, [
|
|
772
|
+
e("div", Uo, [
|
|
773
773
|
e("div", Po, r(t.modelValue.doc.name), 1),
|
|
774
|
-
e("div",
|
|
774
|
+
e("div", Ro, r(t.modelValue.doc.code), 1)
|
|
775
775
|
]),
|
|
776
776
|
b(c, {
|
|
777
777
|
variant: "tertiary",
|
|
@@ -782,16 +782,16 @@ const Xe = {
|
|
|
782
782
|
b(s, {
|
|
783
783
|
disabled: t.disabled,
|
|
784
784
|
class: "col-span-2",
|
|
785
|
-
label: "
|
|
785
|
+
label: o(S)("inventory.common.type"),
|
|
786
786
|
items: u.value,
|
|
787
787
|
modelValue: _.value,
|
|
788
788
|
"onUpdate:modelValue": n[1] || (n[1] = (V) => _.value = V),
|
|
789
|
-
rules: [o(
|
|
789
|
+
rules: [o(Qt)()],
|
|
790
790
|
"label-mark": "required"
|
|
791
|
-
}, null, 8, ["disabled", "items", "modelValue", "rules"]),
|
|
792
|
-
b(
|
|
791
|
+
}, null, 8, ["disabled", "label", "items", "modelValue", "rules"]),
|
|
792
|
+
b(to, {
|
|
793
793
|
disabled: t.disabled,
|
|
794
|
-
label: "
|
|
794
|
+
label: o(S)("inventory.stock.adjust.amount"),
|
|
795
795
|
step: +o($e)({
|
|
796
796
|
amount: 1,
|
|
797
797
|
precision: o(Ie)(t.modelValue.doc.unit, t.modelValue.measurement)
|
|
@@ -799,35 +799,35 @@ const Xe = {
|
|
|
799
799
|
modelValue: L.value,
|
|
800
800
|
"onUpdate:modelValue": n[2] || (n[2] = (V) => L.value = V),
|
|
801
801
|
rules: [o(tt)(0)]
|
|
802
|
-
}, null, 8, ["disabled", "step", "modelValue", "rules"]),
|
|
802
|
+
}, null, 8, ["disabled", "label", "step", "modelValue", "rules"]),
|
|
803
803
|
b(s, {
|
|
804
804
|
disabled: t.disabled,
|
|
805
|
-
label: "
|
|
805
|
+
label: o(S)("inventory.common.unit"),
|
|
806
806
|
items: i.value,
|
|
807
807
|
modelValue: D.value,
|
|
808
808
|
"onUpdate:modelValue": n[3] || (n[3] = (V) => D.value = V)
|
|
809
|
-
}, null, 8, ["disabled", "items", "modelValue"]),
|
|
809
|
+
}, null, 8, ["disabled", "label", "items", "modelValue"]),
|
|
810
810
|
b(T, {
|
|
811
811
|
class: "col-span-2",
|
|
812
812
|
disabled: t.disabled,
|
|
813
|
-
label: "
|
|
813
|
+
label: o(S)("inventory.stock.adjust.remark"),
|
|
814
814
|
modelValue: k.value,
|
|
815
815
|
"onUpdate:modelValue": n[4] || (n[4] = (V) => k.value = V),
|
|
816
816
|
"label-mark": "optional"
|
|
817
|
-
}, null, 8, ["disabled", "modelValue"]),
|
|
818
|
-
e("div",
|
|
819
|
-
e("div",
|
|
817
|
+
}, null, 8, ["disabled", "label", "modelValue"]),
|
|
818
|
+
e("div", No, [
|
|
819
|
+
e("div", Oo, r(o(S)("inventory.stock.stock_adjustment.stockAfter")), 1),
|
|
820
820
|
e("div", {
|
|
821
821
|
class: he(["fm-typo-en-body-lg-600", l.value ? "text-red-700" : "text-green-700"])
|
|
822
822
|
}, r(x.value), 3),
|
|
823
|
-
t.isBackdate ? (p(), E("div",
|
|
823
|
+
t.isBackdate ? (p(), E("div", Lo, r(o(S)("inventory.stock.stock_adjustment.backdatePreviewWarning")), 1)) : Q("", !0)
|
|
824
824
|
])
|
|
825
825
|
]),
|
|
826
826
|
_: 1
|
|
827
827
|
});
|
|
828
828
|
};
|
|
829
829
|
}
|
|
830
|
-
}),
|
|
830
|
+
}), zo = { class: "flex items-center" }, Yo = { class: "fm-typo-en-title-md-800" }, qo = { class: "flex items-center" }, Go = { class: "fm-typo-en-title-sm-800 flex-1" }, Wo = { class: "flex gap-8" }, Ko = /* @__PURE__ */ ye({
|
|
831
831
|
__name: "AdjustSkuDialog",
|
|
832
832
|
props: {
|
|
833
833
|
stock: {},
|
|
@@ -835,7 +835,7 @@ const Xe = {
|
|
|
835
835
|
},
|
|
836
836
|
emits: ["update:show", "submitted"],
|
|
837
837
|
setup(j, { expose: f, emit: h }) {
|
|
838
|
-
const v = j,
|
|
838
|
+
const v = j, S = h, A = Le(), u = Ye(), i = Be(), _ = xe(), L = z(!1), { t: D } = _e();
|
|
839
839
|
function k() {
|
|
840
840
|
x(Oe(a));
|
|
841
841
|
}
|
|
@@ -892,7 +892,7 @@ const Xe = {
|
|
|
892
892
|
doc: c,
|
|
893
893
|
type: T
|
|
894
894
|
}))
|
|
895
|
-
}),
|
|
895
|
+
}), S("update:show", !1), S("submitted");
|
|
896
896
|
} catch (c) {
|
|
897
897
|
_.open({
|
|
898
898
|
title: D("inventory.stock.adjust.error.title"),
|
|
@@ -904,7 +904,7 @@ const Xe = {
|
|
|
904
904
|
}
|
|
905
905
|
}
|
|
906
906
|
function l() {
|
|
907
|
-
const n =
|
|
907
|
+
const n = A.skus.map((s) => ({
|
|
908
908
|
label: s.name,
|
|
909
909
|
sublabel: s.code,
|
|
910
910
|
value: s._id
|
|
@@ -933,7 +933,7 @@ const Xe = {
|
|
|
933
933
|
(T) => a.adjustments.find((H) => H.doc._id === T) ?? {
|
|
934
934
|
id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
|
|
935
935
|
type: ue.enum.PURCHASE,
|
|
936
|
-
doc:
|
|
936
|
+
doc: A.skus.find((H) => H._id === T),
|
|
937
937
|
measurement: null,
|
|
938
938
|
remark: "",
|
|
939
939
|
amount: K.fromNumber(1)
|
|
@@ -945,7 +945,7 @@ const Xe = {
|
|
|
945
945
|
a.adjustments.splice(n, 1);
|
|
946
946
|
}
|
|
947
947
|
return (n, c) => {
|
|
948
|
-
const s =
|
|
948
|
+
const s = R("FmTextarea"), T = R("FmButton"), H = R("FmForm"), V = R("FmSideSheet");
|
|
949
949
|
return p(), ee(V, {
|
|
950
950
|
modelValue: o(C),
|
|
951
951
|
"onUpdate:modelValue": c[2] || (c[2] = (J) => Ne(C) ? C.value = J : null),
|
|
@@ -953,8 +953,8 @@ const Xe = {
|
|
|
953
953
|
"max-width": 500
|
|
954
954
|
}, {
|
|
955
955
|
"side-sheet-header": U(() => [
|
|
956
|
-
e("div",
|
|
957
|
-
e("div",
|
|
956
|
+
e("div", zo, [
|
|
957
|
+
e("div", Yo, r(o(D)("inventory.stock.adjust.title")), 1)
|
|
958
958
|
])
|
|
959
959
|
]),
|
|
960
960
|
default: U(() => [
|
|
@@ -970,8 +970,8 @@ const Xe = {
|
|
|
970
970
|
modelValue: a.remark,
|
|
971
971
|
"onUpdate:modelValue": c[0] || (c[0] = (J) => a.remark = J)
|
|
972
972
|
}, null, 8, ["label", "modelValue"]),
|
|
973
|
-
e("div",
|
|
974
|
-
e("div",
|
|
973
|
+
e("div", qo, [
|
|
974
|
+
e("div", Go, r(o(D)("inventory.stock.adjust.adjustedItems")), 1),
|
|
975
975
|
b(T, {
|
|
976
976
|
"prepend-icon": "add",
|
|
977
977
|
variant: "tertiary",
|
|
@@ -990,7 +990,7 @@ const Xe = {
|
|
|
990
990
|
}, 512)
|
|
991
991
|
]),
|
|
992
992
|
"side-sheet-footer": U(() => [
|
|
993
|
-
e("div",
|
|
993
|
+
e("div", Wo, [
|
|
994
994
|
b(T, {
|
|
995
995
|
label: o(D)("inventory.stock.adjust.adjustButton"),
|
|
996
996
|
loading: L.value,
|
|
@@ -1005,17 +1005,17 @@ const Xe = {
|
|
|
1005
1005
|
}, 8, ["modelValue"]);
|
|
1006
1006
|
};
|
|
1007
1007
|
}
|
|
1008
|
-
}),
|
|
1008
|
+
}), Xo = { class: "flex items-center w-full gap-8" }, Jo = { class: "fm-typo-en-title-md-800 flex-1" }, Qo = {
|
|
1009
1009
|
key: 0,
|
|
1010
1010
|
class: "flex flex-col gap-4"
|
|
1011
|
-
},
|
|
1011
|
+
}, Zo = { class: "fm-typo-en-body-md-600" }, en = { class: "flex gap-8 items-start" }, tn = { class: "flex-1 min-w-0" }, on = { class: "flex-1 min-w-0" }, nn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, sn = { class: "flex items-center" }, an = { class: "fm-typo-en-title-sm-800 flex-1" }, ln = { class: "flex gap-8" }, yt = 14, rn = /* @__PURE__ */ ye({
|
|
1012
1012
|
__name: "StockAdjustmentSideSheet",
|
|
1013
1013
|
props: {
|
|
1014
1014
|
show: { type: Boolean }
|
|
1015
1015
|
},
|
|
1016
1016
|
emits: ["update:show", "submitted"],
|
|
1017
1017
|
setup(j, { emit: f }) {
|
|
1018
|
-
const h = j, v = f, { t:
|
|
1018
|
+
const h = j, v = f, { t: S } = _e(), A = Le(), u = Be(), i = Ye(), _ = xe(), L = qe(h, "show"), D = z(!1), k = _t({
|
|
1019
1019
|
remark: "",
|
|
1020
1020
|
effectiveAt: /* @__PURE__ */ new Date(),
|
|
1021
1021
|
adjustments: []
|
|
@@ -1030,12 +1030,12 @@ const Xe = {
|
|
|
1030
1030
|
function t() {
|
|
1031
1031
|
if (!d.value) return !0;
|
|
1032
1032
|
const W = we(`${C.value} ${a.value}`, "YYYY-MM-DD HH:mm");
|
|
1033
|
-
if (!W.isValid()) return
|
|
1033
|
+
if (!W.isValid()) return S("inventory.stock.stock_adjustment.invalidDateTime");
|
|
1034
1034
|
const Y = we();
|
|
1035
1035
|
if (W.isAfter(Y))
|
|
1036
|
-
return
|
|
1036
|
+
return S("inventory.stock.stock_adjustment.futureDateNotAllowed");
|
|
1037
1037
|
const Z = Y.subtract(yt, "day");
|
|
1038
|
-
return W.isBefore(Z) ?
|
|
1038
|
+
return W.isBefore(Z) ? S("inventory.stock.stock_adjustment.backdateLimitError", { days: yt }) : !0;
|
|
1039
1039
|
}
|
|
1040
1040
|
const n = N(() => [() => t()]), c = N(() => k.adjustments.length === 0 || t() !== !0);
|
|
1041
1041
|
function s() {
|
|
@@ -1046,18 +1046,18 @@ const Xe = {
|
|
|
1046
1046
|
}
|
|
1047
1047
|
const H = N(() => {
|
|
1048
1048
|
const W = {};
|
|
1049
|
-
return
|
|
1049
|
+
return A.skus.forEach((Y) => {
|
|
1050
1050
|
W[Y._id] = Y;
|
|
1051
1051
|
}), W;
|
|
1052
1052
|
});
|
|
1053
1053
|
function V() {
|
|
1054
|
-
const W =
|
|
1054
|
+
const W = A.skus.map((Z) => ({
|
|
1055
1055
|
label: Z.name,
|
|
1056
1056
|
sublabel: Z.code,
|
|
1057
1057
|
value: Z._id
|
|
1058
1058
|
})), Y = k.adjustments.map((Z) => Z.doc._id);
|
|
1059
1059
|
i.open({
|
|
1060
|
-
title:
|
|
1060
|
+
title: S("inventory.stock.adjust.selectIngredients"),
|
|
1061
1061
|
contentComponent: xt,
|
|
1062
1062
|
contentComponentProps: {
|
|
1063
1063
|
items: W,
|
|
@@ -1068,11 +1068,11 @@ const Xe = {
|
|
|
1068
1068
|
closeButton: !0,
|
|
1069
1069
|
dismissAway: !0,
|
|
1070
1070
|
primaryActions: {
|
|
1071
|
-
text:
|
|
1071
|
+
text: S("common.confirm"),
|
|
1072
1072
|
close: !0
|
|
1073
1073
|
},
|
|
1074
1074
|
secondaryActions: {
|
|
1075
|
-
text:
|
|
1075
|
+
text: S("common.close"),
|
|
1076
1076
|
close: !0,
|
|
1077
1077
|
variant: "tertiary"
|
|
1078
1078
|
}
|
|
@@ -1095,8 +1095,8 @@ const Xe = {
|
|
|
1095
1095
|
async function I() {
|
|
1096
1096
|
if (k.adjustments.length === 0) {
|
|
1097
1097
|
_.open({
|
|
1098
|
-
title:
|
|
1099
|
-
message:
|
|
1098
|
+
title: S("inventory.stock.error.title"),
|
|
1099
|
+
message: S("inventory.stock.stock_adjustment.noAdjustments"),
|
|
1100
1100
|
type: "warning"
|
|
1101
1101
|
});
|
|
1102
1102
|
return;
|
|
@@ -1120,8 +1120,8 @@ const Xe = {
|
|
|
1120
1120
|
await u.adjustSku(Oe(Y)), v("submitted"), v("update:show", !1);
|
|
1121
1121
|
} catch (W) {
|
|
1122
1122
|
_.open({
|
|
1123
|
-
title:
|
|
1124
|
-
message:
|
|
1123
|
+
title: S("inventory.stock.adjust.error.title"),
|
|
1124
|
+
message: S("inventory.stock.adjust.error.message"),
|
|
1125
1125
|
type: "error"
|
|
1126
1126
|
}), console.error("error on stock adjustment", W);
|
|
1127
1127
|
} finally {
|
|
@@ -1129,7 +1129,7 @@ const Xe = {
|
|
|
1129
1129
|
}
|
|
1130
1130
|
}
|
|
1131
1131
|
return (W, Y) => {
|
|
1132
|
-
const Z =
|
|
1132
|
+
const Z = R("FmTextarea"), oe = R("FmSwitch"), ce = R("FmDatePicker"), pe = R("FmTimePicker"), ke = R("FmFormGroup"), be = R("FmButton"), $ = R("FmForm"), g = R("FmSideSheet");
|
|
1133
1133
|
return p(), ee(g, {
|
|
1134
1134
|
modelValue: o(L),
|
|
1135
1135
|
"onUpdate:modelValue": Y[6] || (Y[6] = (G) => Ne(L) ? L.value = G : null),
|
|
@@ -1138,12 +1138,12 @@ const Xe = {
|
|
|
1138
1138
|
onAfterEnter: T
|
|
1139
1139
|
}, {
|
|
1140
1140
|
"side-sheet-header": U(() => [
|
|
1141
|
-
e("div",
|
|
1142
|
-
e("div",
|
|
1141
|
+
e("div", Xo, [
|
|
1142
|
+
e("div", Jo, r(o(S)("inventory.stock.stock_adjustment.title")), 1)
|
|
1143
1143
|
])
|
|
1144
1144
|
]),
|
|
1145
1145
|
default: U(() => [
|
|
1146
|
-
b(
|
|
1146
|
+
b($, {
|
|
1147
1147
|
class: "flex flex-col gap-16",
|
|
1148
1148
|
ref_key: "formRef",
|
|
1149
1149
|
ref: x,
|
|
@@ -1151,7 +1151,7 @@ const Xe = {
|
|
|
1151
1151
|
}, {
|
|
1152
1152
|
default: U(() => [
|
|
1153
1153
|
b(Z, {
|
|
1154
|
-
label: o(
|
|
1154
|
+
label: o(S)("inventory.stock.adjust.remark"),
|
|
1155
1155
|
modelValue: k.remark,
|
|
1156
1156
|
"onUpdate:modelValue": Y[0] || (Y[0] = (G) => k.remark = G),
|
|
1157
1157
|
"label-mark": "optional"
|
|
@@ -1160,14 +1160,14 @@ const Xe = {
|
|
|
1160
1160
|
value: "",
|
|
1161
1161
|
"model-value": d.value,
|
|
1162
1162
|
"onUpdate:modelValue": Y[1] || (Y[1] = (G) => d.value = G),
|
|
1163
|
-
label: o(
|
|
1164
|
-
sublabel: o(
|
|
1163
|
+
label: o(S)("inventory.stock.stock_adjustment.backdateLabel"),
|
|
1164
|
+
sublabel: o(S)("inventory.stock.stock_adjustment.backdateSublabel"),
|
|
1165
1165
|
labelPlacement: "right"
|
|
1166
1166
|
}, null, 8, ["model-value", "label", "sublabel"]),
|
|
1167
|
-
d.value ? (p(), E("div",
|
|
1168
|
-
e("label",
|
|
1169
|
-
e("div",
|
|
1170
|
-
e("div",
|
|
1167
|
+
d.value ? (p(), E("div", Qo, [
|
|
1168
|
+
e("label", Zo, r(o(S)("inventory.stock.stock_adjustment.effectiveAt")), 1),
|
|
1169
|
+
e("div", en, [
|
|
1170
|
+
e("div", tn, [
|
|
1171
1171
|
b(ce, {
|
|
1172
1172
|
class: "w-full",
|
|
1173
1173
|
modelValue: C.value,
|
|
@@ -1175,7 +1175,7 @@ const Xe = {
|
|
|
1175
1175
|
clearable: !1
|
|
1176
1176
|
}, null, 8, ["modelValue"])
|
|
1177
1177
|
]),
|
|
1178
|
-
e("div",
|
|
1178
|
+
e("div", on, [
|
|
1179
1179
|
b(pe, {
|
|
1180
1180
|
class: "w-full",
|
|
1181
1181
|
modelValue: a.value,
|
|
@@ -1188,10 +1188,10 @@ const Xe = {
|
|
|
1188
1188
|
"model-value": l.value,
|
|
1189
1189
|
rules: n.value
|
|
1190
1190
|
}, null, 8, ["model-value", "rules"]),
|
|
1191
|
-
e("div",
|
|
1191
|
+
e("div", nn, r(o(S)("inventory.stock.stock_adjustment.immediateHint")), 1)
|
|
1192
1192
|
])) : Q("", !0),
|
|
1193
|
-
e("div",
|
|
1194
|
-
e("div",
|
|
1193
|
+
e("div", sn, [
|
|
1194
|
+
e("div", an, r(o(S)("inventory.stock.adjust.adjustedItems")), 1),
|
|
1195
1195
|
b(be, {
|
|
1196
1196
|
"prepend-icon": "add",
|
|
1197
1197
|
variant: "tertiary",
|
|
@@ -1211,9 +1211,9 @@ const Xe = {
|
|
|
1211
1211
|
}, 512)
|
|
1212
1212
|
]),
|
|
1213
1213
|
"side-sheet-footer": U(() => [
|
|
1214
|
-
e("div",
|
|
1214
|
+
e("div", ln, [
|
|
1215
1215
|
b(be, {
|
|
1216
|
-
label: o(
|
|
1216
|
+
label: o(S)("common.confirm"),
|
|
1217
1217
|
loading: D.value,
|
|
1218
1218
|
disabled: c.value,
|
|
1219
1219
|
onClick: Y[4] || (Y[4] = (G) => {
|
|
@@ -1222,7 +1222,7 @@ const Xe = {
|
|
|
1222
1222
|
})
|
|
1223
1223
|
}, null, 8, ["label", "loading", "disabled"]),
|
|
1224
1224
|
b(be, {
|
|
1225
|
-
label: o(
|
|
1225
|
+
label: o(S)("common.close"),
|
|
1226
1226
|
variant: "tertiary",
|
|
1227
1227
|
onClick: Y[5] || (Y[5] = (G) => v("update:show", !1))
|
|
1228
1228
|
}, null, 8, ["label"])
|
|
@@ -1233,20 +1233,20 @@ const Xe = {
|
|
|
1233
1233
|
};
|
|
1234
1234
|
}
|
|
1235
1235
|
});
|
|
1236
|
-
function
|
|
1237
|
-
const h =
|
|
1236
|
+
function un(j, f) {
|
|
1237
|
+
const h = Et(), v = xe(), S = z(null), A = z(null);
|
|
1238
1238
|
ge(
|
|
1239
1239
|
[j, () => f()._id],
|
|
1240
1240
|
async ([_], L, D) => {
|
|
1241
1241
|
let k = !0;
|
|
1242
1242
|
D(() => {
|
|
1243
1243
|
k = !1;
|
|
1244
|
-
}),
|
|
1244
|
+
}), S.value = null, A.value = null;
|
|
1245
1245
|
try {
|
|
1246
1246
|
const d = await h.readLastClosing(_, !1);
|
|
1247
|
-
if (!k || (
|
|
1247
|
+
if (!k || (S.value = d, !(d != null && d._id))) return;
|
|
1248
1248
|
const C = await h.readClosingAdjustment(_, d._id);
|
|
1249
|
-
k && (
|
|
1249
|
+
k && (A.value = C);
|
|
1250
1250
|
} catch (d) {
|
|
1251
1251
|
console.error("Failed to fetch last closing balance:", d), k && v.open({
|
|
1252
1252
|
title: "Something went wrong",
|
|
@@ -1258,58 +1258,58 @@ function cn(j, f) {
|
|
|
1258
1258
|
{ immediate: !0 }
|
|
1259
1259
|
);
|
|
1260
1260
|
const u = N(() => {
|
|
1261
|
-
const _ =
|
|
1261
|
+
const _ = S.value;
|
|
1262
1262
|
if (!_) return "";
|
|
1263
1263
|
const L = _.effectiveAt ?? (_._id ? De(_._id) : null);
|
|
1264
1264
|
return L ? St(new Date(L)) : "";
|
|
1265
1265
|
});
|
|
1266
1266
|
return { lastClosingBalance: N(() => {
|
|
1267
1267
|
var D, k, d;
|
|
1268
|
-
const _ = f(), L = (d = (k = (D =
|
|
1268
|
+
const _ = f(), L = (d = (k = (D = A.value) == null ? void 0 : D.skus) == null ? void 0 : k.find(
|
|
1269
1269
|
(C) => C.sku._id === _._id
|
|
1270
1270
|
)) == null ? void 0 : d.toBalance;
|
|
1271
1271
|
return L ? `${K.toFormatString({ value: L, precision: 4 })} ${_.unit.abbrev}` : "—";
|
|
1272
1272
|
}), lastClosingDate: u };
|
|
1273
1273
|
}
|
|
1274
|
-
const
|
|
1274
|
+
const cn = Ut((j, f) => ({
|
|
1275
1275
|
// TODO: remove once latest inventory backend has been push
|
|
1276
|
-
async findBillsByBusinessId(h, v,
|
|
1277
|
-
const
|
|
1276
|
+
async findBillsByBusinessId(h, v, S) {
|
|
1277
|
+
const A = `${j.businessesBackendUrl}/${h}/reports/find-many`, u = {
|
|
1278
1278
|
// type: TYPE.bill,
|
|
1279
1279
|
type: "bill",
|
|
1280
1280
|
restaurantIds: v,
|
|
1281
|
-
ids:
|
|
1281
|
+
ids: S
|
|
1282
1282
|
};
|
|
1283
|
-
return await f.post(
|
|
1283
|
+
return await f.post(A, u);
|
|
1284
1284
|
},
|
|
1285
1285
|
async findBillsById(h, v) {
|
|
1286
|
-
const
|
|
1286
|
+
const A = Ce().currentLocationDBName, u = v ? `?${new URLSearchParams({ fields: v.join(",") })}` : "", i = `${j.inventoryBackendUrl}/${A}/bill/search${u}`, _ = {
|
|
1287
1287
|
ids: h
|
|
1288
1288
|
};
|
|
1289
1289
|
return await f.post(i, _);
|
|
1290
1290
|
}
|
|
1291
|
-
})),
|
|
1291
|
+
})), dn = { class: "fm-typo-en-heading-lg-600" }, mn = {
|
|
1292
1292
|
key: 0,
|
|
1293
1293
|
class: "py-16"
|
|
1294
|
-
},
|
|
1294
|
+
}, fn = {
|
|
1295
1295
|
key: 1,
|
|
1296
1296
|
class: "flex flex-col gap-8 py-8 max-h-[60vh] overflow-auto"
|
|
1297
|
-
},
|
|
1297
|
+
}, vn = {
|
|
1298
1298
|
key: 0,
|
|
1299
1299
|
class: "rounded-md border border-blue-100 bg-blue-50 px-12 py-8",
|
|
1300
1300
|
"data-selected-adjustment": ""
|
|
1301
|
-
},
|
|
1301
|
+
}, pn = { class: "text-xs text-fm-color-typo-secondary" }, yn = { class: "text-sm" }, _n = { class: "text-xs text-fm-color-typo-secondary mt-4 flex flex-wrap gap-8" }, kn = { key: 0 }, bn = { key: 1 }, hn = { class: "border border-fm-color-neutral-gray-100 rounded-md" }, gn = { class: "px-12 py-8 text-xs font-mono text-fm-color-neutral-gray-300 break-all" }, xn = { class: "px-12 pb-12" }, Sn = { class: "font-bold text-sm mb-4" }, wn = {
|
|
1302
1302
|
key: 0,
|
|
1303
1303
|
role: "note",
|
|
1304
1304
|
"data-adjustment-scope-warning": "",
|
|
1305
1305
|
class: "flex items-start gap-8 rounded-md border border-amber-200 bg-amber-50 px-12 py-8 mb-8 text-xs text-amber-800"
|
|
1306
|
-
},
|
|
1306
|
+
}, $n = {
|
|
1307
1307
|
class: "text-xs flex flex-col gap-4",
|
|
1308
1308
|
"data-bill-receipt": ""
|
|
1309
|
-
},
|
|
1309
|
+
}, An = { class: "flex justify-between gap-8 text-fm-color-neutral-gray-300 mb-4" }, Fn = ["data-item-key"], jn = { class: "w-[24px] shrink-0 text-right" }, Cn = { class: "grow min-w-0 break-words" }, Bn = { key: 0 }, Vn = {
|
|
1310
1310
|
key: 1,
|
|
1311
1311
|
class: "text-fm-color-neutral-gray-300"
|
|
1312
|
-
},
|
|
1312
|
+
}, Dn = { key: 2 }, In = { class: "shrink-0 text-right" }, Mn = { class: "flex items-start gap-8 min-w-0" }, Tn = { class: "break-words font-medium" }, Hn = { class: "shrink-0 text-right" }, En = /* @__PURE__ */ ye({
|
|
1313
1313
|
__name: "BillInventoryInfoDialog",
|
|
1314
1314
|
props: {
|
|
1315
1315
|
show: { type: Boolean },
|
|
@@ -1322,7 +1322,7 @@ const dn = Rt((j, f) => ({
|
|
|
1322
1322
|
},
|
|
1323
1323
|
emits: ["update:show"],
|
|
1324
1324
|
setup(j, { emit: f }) {
|
|
1325
|
-
const { FmDialog: h, FmButton: v, FmSpacer:
|
|
1325
|
+
const { FmDialog: h, FmButton: v, FmSpacer: S, FmIcon: A } = Yt, { t: u } = _e(), i = j, _ = f, L = N(() => {
|
|
1326
1326
|
var a;
|
|
1327
1327
|
if (!i.bill) return [];
|
|
1328
1328
|
const d = [];
|
|
@@ -1358,11 +1358,11 @@ const dn = Rt((j, f) => ({
|
|
|
1358
1358
|
"dialog-header": U(() => {
|
|
1359
1359
|
var a;
|
|
1360
1360
|
return [
|
|
1361
|
-
e("div",
|
|
1361
|
+
e("div", dn, r(o(u)("inventory.stock.record.bill", [((a = d.bill) == null ? void 0 : a.seqNumber) ?? d.billId])), 1)
|
|
1362
1362
|
];
|
|
1363
1363
|
}),
|
|
1364
1364
|
"dialog-footer": U(() => [
|
|
1365
|
-
b(o(
|
|
1365
|
+
b(o(S), { class: "sm:hidden xs:hidden" }),
|
|
1366
1366
|
b(o(v), {
|
|
1367
1367
|
label: o(u)("inventory.stock.record.closeBill"),
|
|
1368
1368
|
size: "md",
|
|
@@ -1370,14 +1370,14 @@ const dn = Rt((j, f) => ({
|
|
|
1370
1370
|
}, null, 8, ["label"])
|
|
1371
1371
|
]),
|
|
1372
1372
|
default: U(() => [
|
|
1373
|
-
d.bill ? (p(), E("div",
|
|
1374
|
-
d.adjustmentContext ? (p(), E("div",
|
|
1375
|
-
e("div",
|
|
1373
|
+
d.bill ? (p(), E("div", fn, [
|
|
1374
|
+
d.adjustmentContext ? (p(), E("div", vn, [
|
|
1375
|
+
e("div", pn, r(o(u)("inventory.stock.record.selectedAdjustment")), 1),
|
|
1376
1376
|
(p(!0), E(ae, null, fe(d.amounts, (a, x) => (p(), E("div", {
|
|
1377
1377
|
key: x,
|
|
1378
1378
|
class: "flex items-center justify-between gap-8 mt-4"
|
|
1379
1379
|
}, [
|
|
1380
|
-
e("span",
|
|
1380
|
+
e("span", yn, r(o(u)(`inventory.inventoryAdjustment.type.${a.type}`)), 1),
|
|
1381
1381
|
e("span", {
|
|
1382
1382
|
class: he([
|
|
1383
1383
|
"font-bold text-sm",
|
|
@@ -1385,25 +1385,25 @@ const dn = Rt((j, f) => ({
|
|
|
1385
1385
|
])
|
|
1386
1386
|
}, r(k(a)), 3)
|
|
1387
1387
|
]))), 128)),
|
|
1388
|
-
e("div",
|
|
1389
|
-
d.adjustmentContext.timestamp ? (p(), E("span",
|
|
1390
|
-
d.adjustmentContext.actor ? (p(), E("span",
|
|
1388
|
+
e("div", _n, [
|
|
1389
|
+
d.adjustmentContext.timestamp ? (p(), E("span", kn, r(o(nt)(new Date(d.adjustmentContext.timestamp))), 1)) : Q("", !0),
|
|
1390
|
+
d.adjustmentContext.actor ? (p(), E("span", bn, r(d.adjustmentContext.actor), 1)) : Q("", !0)
|
|
1391
1391
|
])
|
|
1392
1392
|
])) : Q("", !0),
|
|
1393
|
-
e("div",
|
|
1394
|
-
e("div",
|
|
1395
|
-
e("div",
|
|
1396
|
-
e("div",
|
|
1397
|
-
d.adjustmentContext ? (p(), E("div",
|
|
1398
|
-
b(o(
|
|
1393
|
+
e("div", hn, [
|
|
1394
|
+
e("div", gn, r(d.bill._id), 1),
|
|
1395
|
+
e("div", xn, [
|
|
1396
|
+
e("div", Sn, r(d.sku.name) + " (" + r(d.sku.unit.abbrev) + ")", 1),
|
|
1397
|
+
d.adjustmentContext ? (p(), E("div", wn, [
|
|
1398
|
+
b(o(A), {
|
|
1399
1399
|
name: "warning",
|
|
1400
1400
|
size: "sm",
|
|
1401
1401
|
class: "shrink-0"
|
|
1402
1402
|
}),
|
|
1403
1403
|
e("span", null, r(o(u)("inventory.stock.record.selectedAdjustmentHint")), 1)
|
|
1404
1404
|
])) : Q("", !0),
|
|
1405
|
-
e("div",
|
|
1406
|
-
e("div",
|
|
1405
|
+
e("div", $n, [
|
|
1406
|
+
e("div", An, [
|
|
1407
1407
|
e("span", null, r(o(u)("inventory.stock.record.billItem")), 1),
|
|
1408
1408
|
e("span", null, r(o(u)("inventory.stock.record.billStockChange")), 1)
|
|
1409
1409
|
]),
|
|
@@ -1413,44 +1413,44 @@ const dn = Rt((j, f) => ({
|
|
|
1413
1413
|
class: he(["flex items-start gap-8", { "bg-blue-50 font-bold rounded": a.key === d.itemRef }]),
|
|
1414
1414
|
style: Qe({ paddingLeft: `${a.depth * 16}px` })
|
|
1415
1415
|
}, [
|
|
1416
|
-
e("div",
|
|
1417
|
-
e("div",
|
|
1418
|
-
a.depth > 1 ? (p(), E("span",
|
|
1419
|
-
a.code ? (p(), E("span",
|
|
1416
|
+
e("div", jn, r(a.depth === 0 ? a.quantity : ""), 1),
|
|
1417
|
+
e("div", Cn, [
|
|
1418
|
+
a.depth > 1 ? (p(), E("span", Bn, "- ")) : Q("", !0),
|
|
1419
|
+
a.code ? (p(), E("span", Vn, r(a.code), 1)) : Q("", !0),
|
|
1420
1420
|
ve(" " + r(a.name) + " ", 1),
|
|
1421
|
-
a.depth > 0 && a.quantity !== 1 ? (p(), E("span",
|
|
1421
|
+
a.depth > 0 && a.quantity !== 1 ? (p(), E("span", Dn, " ×" + r(a.quantity), 1)) : Q("", !0)
|
|
1422
1422
|
]),
|
|
1423
|
-
e("div",
|
|
1423
|
+
e("div", In, [
|
|
1424
1424
|
(p(!0), E(ae, null, fe(a.amounts, (x, l) => (p(), E("div", { key: l }, r(k(x)), 1))), 128))
|
|
1425
1425
|
])
|
|
1426
|
-
], 14,
|
|
1426
|
+
], 14, Fn))), 128)),
|
|
1427
1427
|
(p(!0), E(ae, null, fe(D.value, (a, x) => (p(), E("div", {
|
|
1428
1428
|
key: x,
|
|
1429
1429
|
role: "alert",
|
|
1430
1430
|
class: "flex items-start justify-between gap-8 rounded-md border border-red-200 bg-red-50 px-12 py-8 mt-4 text-red-700"
|
|
1431
1431
|
}, [
|
|
1432
|
-
e("div",
|
|
1433
|
-
b(o(
|
|
1432
|
+
e("div", Mn, [
|
|
1433
|
+
b(o(A), {
|
|
1434
1434
|
name: "error",
|
|
1435
1435
|
size: "sm",
|
|
1436
1436
|
class: "shrink-0"
|
|
1437
1437
|
}),
|
|
1438
|
-
e("span",
|
|
1438
|
+
e("span", Tn, r(o(u)("inventory.stock.record.billItemNoLongerExists")), 1)
|
|
1439
1439
|
]),
|
|
1440
|
-
e("div",
|
|
1440
|
+
e("div", Hn, r(k(a)), 1)
|
|
1441
1441
|
]))), 128))
|
|
1442
1442
|
])
|
|
1443
1443
|
])
|
|
1444
1444
|
])
|
|
1445
|
-
])) : (p(), E("div",
|
|
1445
|
+
])) : (p(), E("div", mn, r(o(u)("inventory.stock.record.billNotFound")), 1))
|
|
1446
1446
|
]),
|
|
1447
1447
|
_: 1
|
|
1448
1448
|
}, 8, ["model-value"]));
|
|
1449
1449
|
}
|
|
1450
|
-
}),
|
|
1450
|
+
}), Un = {
|
|
1451
1451
|
key: 0,
|
|
1452
1452
|
class: "flex justify-center items-center h-32"
|
|
1453
|
-
}, Pn = { class: "mb-3" },
|
|
1453
|
+
}, Pn = { class: "mb-3" }, Rn = { class: "flex flex-col gap-8" }, Nn = { class: "flex flex-col text-fm-color-typo-primary mb-3 text-center" }, On = { class: "text-fm-color-neutral-gray-400 fm-typo-en-body-sm-600" }, Ln = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, zn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, Yn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, qn = { class: "flex flex-col w-full px-2" }, Gn = { class: "flex gap-2" }, Wn = /* @__PURE__ */ ye({
|
|
1454
1454
|
__name: "AmendAdjustmentForm",
|
|
1455
1455
|
props: /* @__PURE__ */ st({
|
|
1456
1456
|
adjustmentId: {}
|
|
@@ -1460,13 +1460,13 @@ const dn = Rt((j, f) => ({
|
|
|
1460
1460
|
}),
|
|
1461
1461
|
emits: /* @__PURE__ */ st(["refreshHistory"], ["update:modelValue"]),
|
|
1462
1462
|
setup(j, { emit: f }) {
|
|
1463
|
-
const h = j, v = f,
|
|
1463
|
+
const h = j, v = f, S = Be(), A = Ct(j, "modelValue"), u = z(!1), i = z(!1), _ = z(!1), L = z({
|
|
1464
1464
|
_id: `inventoryAdjustment_${(/* @__PURE__ */ new Date()).toISOString()}_XXXXX`,
|
|
1465
1465
|
skus: []
|
|
1466
1466
|
}), D = z();
|
|
1467
1467
|
Ze(async () => {
|
|
1468
1468
|
u.value = !0;
|
|
1469
|
-
const l = await
|
|
1469
|
+
const l = await S.readSingleAdjustment(h.adjustmentId);
|
|
1470
1470
|
if (!l) throw new Error("Adjustment not found");
|
|
1471
1471
|
L.value = l, u.value = !1;
|
|
1472
1472
|
});
|
|
@@ -1474,30 +1474,30 @@ const dn = Rt((j, f) => ({
|
|
|
1474
1474
|
var t, n;
|
|
1475
1475
|
if ((n = (t = D == null ? void 0 : D.value) == null ? void 0 : t.validateInputs) == null || n.call(t), !i.value) return;
|
|
1476
1476
|
const l = {};
|
|
1477
|
-
Object.keys(
|
|
1477
|
+
Object.keys(A.value || {}).forEach((c) => {
|
|
1478
1478
|
var s;
|
|
1479
|
-
Object.keys(((s =
|
|
1479
|
+
Object.keys(((s = A.value) == null ? void 0 : s[c]) || {}).forEach((T) => {
|
|
1480
1480
|
var V, J;
|
|
1481
|
-
const H = (J = (V =
|
|
1481
|
+
const H = (J = (V = A.value) == null ? void 0 : V[c]) == null ? void 0 : J[Number(T)];
|
|
1482
1482
|
H && C(H.amount) > 0 && (l[c] || (l[c] = []), l[c].push(H));
|
|
1483
1483
|
});
|
|
1484
|
-
}), await
|
|
1484
|
+
}), await S.revertWastageAdjustment({
|
|
1485
1485
|
targetWastageAdjustmentId: h.adjustmentId,
|
|
1486
1486
|
amountsGoingToAdjust: l
|
|
1487
|
-
}), v("refreshHistory"), _.value = !1,
|
|
1487
|
+
}), v("refreshHistory"), _.value = !1, A.value = {};
|
|
1488
1488
|
}
|
|
1489
1489
|
function d(l) {
|
|
1490
1490
|
const { skuId: t, idx: n, unit: c, measurement: s } = l;
|
|
1491
1491
|
return N({
|
|
1492
1492
|
get: () => {
|
|
1493
1493
|
var V, J, I;
|
|
1494
|
-
const T = (I = (J = (V =
|
|
1494
|
+
const T = (I = (J = (V = A.value) == null ? void 0 : V[t]) == null ? void 0 : J[n]) == null ? void 0 : I.amount;
|
|
1495
1495
|
return T ? Number(K.toFormatString({ value: T })) : 0;
|
|
1496
1496
|
},
|
|
1497
1497
|
set: (T) => {
|
|
1498
1498
|
const H = T ?? 0;
|
|
1499
|
-
|
|
1500
|
-
const V = {
|
|
1499
|
+
A.value || (A.value = {});
|
|
1500
|
+
const V = { ...A.value };
|
|
1501
1501
|
V[t] || (V[t] = {});
|
|
1502
1502
|
const J = Ie(c);
|
|
1503
1503
|
let I;
|
|
@@ -1515,7 +1515,7 @@ const dn = Rt((j, f) => ({
|
|
|
1515
1515
|
}),
|
|
1516
1516
|
type: ue.Enum.WASTAGE,
|
|
1517
1517
|
measurement: s
|
|
1518
|
-
},
|
|
1518
|
+
}, A.value = V;
|
|
1519
1519
|
}
|
|
1520
1520
|
});
|
|
1521
1521
|
}
|
|
@@ -1532,7 +1532,7 @@ const dn = Rt((j, f) => ({
|
|
|
1532
1532
|
return n ? K.toFormatString({ value: n }) : "N/A";
|
|
1533
1533
|
}
|
|
1534
1534
|
return (l, t) => {
|
|
1535
|
-
const n =
|
|
1535
|
+
const n = R("FmIcon"), c = R("FmStepperField"), s = R("FmCard"), T = R("FmForm"), H = R("FmSpacer"), V = R("FmButton"), J = R("FmDialog");
|
|
1536
1536
|
return p(), ee(J, {
|
|
1537
1537
|
modelValue: _.value,
|
|
1538
1538
|
"onUpdate:modelValue": t[4] || (t[4] = (I) => _.value = I),
|
|
@@ -1558,9 +1558,9 @@ const dn = Rt((j, f) => ({
|
|
|
1558
1558
|
e("div", null, "Amend Adjustment", -1)
|
|
1559
1559
|
])),
|
|
1560
1560
|
"dialog-footer": U(() => [
|
|
1561
|
-
e("div",
|
|
1561
|
+
e("div", qn, [
|
|
1562
1562
|
t[13] || (t[13] = e("span", { class: "text-fm-color-system-warning-400 fm-typo-en-body-sm-400" }, "1. New adjustment EXTRA will be created for each reversal", -1)),
|
|
1563
|
-
e("div",
|
|
1563
|
+
e("div", Gn, [
|
|
1564
1564
|
b(H),
|
|
1565
1565
|
b(V, {
|
|
1566
1566
|
class: "sm:w-full xs:w-full",
|
|
@@ -1580,7 +1580,7 @@ const dn = Rt((j, f) => ({
|
|
|
1580
1580
|
])
|
|
1581
1581
|
]),
|
|
1582
1582
|
default: U(() => [
|
|
1583
|
-
u.value ? (p(), E("div",
|
|
1583
|
+
u.value ? (p(), E("div", Un)) : (p(), ee(T, {
|
|
1584
1584
|
key: 1,
|
|
1585
1585
|
ref_key: "formRef",
|
|
1586
1586
|
ref: D,
|
|
@@ -1596,9 +1596,9 @@ const dn = Rt((j, f) => ({
|
|
|
1596
1596
|
e("p", Pn, [
|
|
1597
1597
|
t[6] || (t[6] = e("b", null, "Date:", -1)),
|
|
1598
1598
|
t[7] || (t[7] = e("br", null, null, -1)),
|
|
1599
|
-
ve(" " + r(o(
|
|
1599
|
+
ve(" " + r(o(no)(o(Pt)(L.value._id))), 1)
|
|
1600
1600
|
]),
|
|
1601
|
-
e("div",
|
|
1601
|
+
e("div", Rn, [
|
|
1602
1602
|
(p(!0), E(ae, null, fe(L.value.skus, (I, W) => (p(), E(ae, { key: W }, [
|
|
1603
1603
|
(p(!0), E(ae, null, fe(I.amounts, (Y, Z) => (p(), ee(s, {
|
|
1604
1604
|
key: Z,
|
|
@@ -1606,16 +1606,16 @@ const dn = Rt((j, f) => ({
|
|
|
1606
1606
|
class: "p-2"
|
|
1607
1607
|
}, {
|
|
1608
1608
|
default: U(() => [
|
|
1609
|
-
e("div",
|
|
1610
|
-
e("span",
|
|
1609
|
+
e("div", Nn, [
|
|
1610
|
+
e("span", On, r(I.sku.code), 1),
|
|
1611
1611
|
e("span", null, r(I.sku.name), 1)
|
|
1612
1612
|
]),
|
|
1613
1613
|
t[12] || (t[12] = e("hr", { class: "m-2" }, null, -1)),
|
|
1614
|
-
e("div",
|
|
1614
|
+
e("div", Ln, [
|
|
1615
1615
|
t[8] || (t[8] = e("span", { class: "fm-typo-en-body-lg-600" }, "Adjustment type:", -1)),
|
|
1616
1616
|
e("span", null, r(Y.type), 1)
|
|
1617
1617
|
]),
|
|
1618
|
-
e("div",
|
|
1618
|
+
e("div", zn, [
|
|
1619
1619
|
t[9] || (t[9] = e("span", { class: "fm-typo-en-body-lg-600" }, "Current amount:", -1)),
|
|
1620
1620
|
e("span", null, r(o(K).toFormatString({ value: Y.amount })) + " " + r(a(I, Y)), 1)
|
|
1621
1621
|
]),
|
|
@@ -1640,7 +1640,7 @@ const dn = Rt((j, f) => ({
|
|
|
1640
1640
|
(oe) => o(tt)(-1)(oe ?? 0)
|
|
1641
1641
|
]
|
|
1642
1642
|
}, null, 8, ["max-fraction-digits", "model-value", "onUpdate:modelValue", "helper-text", "append-text", "rules"]),
|
|
1643
|
-
e("div",
|
|
1643
|
+
e("div", Yn, [
|
|
1644
1644
|
t[10] || (t[10] = e("span", { class: "fm-typo-en-body-lg-600" }, "Amount after amend:", -1)),
|
|
1645
1645
|
t[11] || (t[11] = e("span", { class: "text-fm-color-system-warning-400 fm-typo-en-body-sm-400" }, "* It's an estimate for your reference, as it didn't include all the reversals related to this adjustment", -1)),
|
|
1646
1646
|
ve(" " + r(x(
|
|
@@ -1667,16 +1667,16 @@ const dn = Rt((j, f) => ({
|
|
|
1667
1667
|
}, 8, ["modelValue"]);
|
|
1668
1668
|
};
|
|
1669
1669
|
}
|
|
1670
|
-
}),
|
|
1670
|
+
}), Kn = { class: "p-16" }, Xn = { class: "fm-typo-en-body-md-600 flex-grow" }, Jn = ["onClick"], Qn = { class: "flex-grow text-fm-color-typo-secondary" }, Zn = {
|
|
1671
1671
|
key: 0,
|
|
1672
1672
|
class: "my-5"
|
|
1673
|
-
},
|
|
1673
|
+
}, es = { class: "shrink-0 whitespace-nowrap text-neutral-400" }, ts = { class: "flex-grow min-w-0" }, os = { class: "flex gap-1" }, ns = { class: "flex flex-wrap items-center gap-x-1 min-w-0 break-words" }, ss = { class: "flex flex-col gap-1" }, as = ["onClick"], ls = {
|
|
1674
1674
|
key: 2,
|
|
1675
1675
|
class: "text-xs text-gray-400"
|
|
1676
|
-
},
|
|
1676
|
+
}, rs = { key: 3 }, is = { key: 4 }, us = { class: "inline-flex items-center gap-0.5 text-fm-color-typo-secondary" }, cs = {
|
|
1677
1677
|
key: 6,
|
|
1678
1678
|
class: "inline-flex items-center rounded-md bg-yellow-400/10 px-2 text-xs font-medium text-yellow-500 inset-ring inset-ring-yellow-400/20"
|
|
1679
|
-
},
|
|
1679
|
+
}, ds = { class: "shrink-0 whitespace-nowrap text-fm-color-typo-secondary" }, ms = ["onClick"], fs = /* @__PURE__ */ ye({
|
|
1680
1680
|
__name: "StockRecordCard",
|
|
1681
1681
|
props: {
|
|
1682
1682
|
record: {},
|
|
@@ -1705,12 +1705,12 @@ const dn = Rt((j, f) => ({
|
|
|
1705
1705
|
const n = [...l].filter((c) => new Date(c.snapshotAt) <= new Date(x)).sort((c, s) => new Date(s.snapshotAt).getTime() - new Date(c.snapshotAt).getTime());
|
|
1706
1706
|
return n.length > 0 ? n[0].cost : null;
|
|
1707
1707
|
}
|
|
1708
|
-
const v = z(null),
|
|
1708
|
+
const v = z(null), S = N(
|
|
1709
1709
|
() => f.bills.find((a) => {
|
|
1710
1710
|
var x;
|
|
1711
1711
|
return a._id === ((x = v.value) == null ? void 0 : x.billId);
|
|
1712
1712
|
}) ?? null
|
|
1713
|
-
),
|
|
1713
|
+
), A = z(!1), u = z(), i = z(null), _ = N(() => i.value === null ? "unset" : A.value ? `${i.value}px` : "0px");
|
|
1714
1714
|
Ze(() => {
|
|
1715
1715
|
var a;
|
|
1716
1716
|
i.value = ((a = u.value) == null ? void 0 : a.scrollHeight) || 0;
|
|
@@ -1738,7 +1738,7 @@ const dn = Rt((j, f) => ({
|
|
|
1738
1738
|
await navigator.clipboard.writeText(a), k.open({ message: `Copied ${a}`, type: "success" });
|
|
1739
1739
|
}
|
|
1740
1740
|
const C = N(() => f.record.adjustmentsByTime.map(({ date: x, adjustments: l }) => ({
|
|
1741
|
-
time:
|
|
1741
|
+
time: so(new Date(x)),
|
|
1742
1742
|
adjustments: l.flatMap(
|
|
1743
1743
|
(t) => {
|
|
1744
1744
|
var n, c;
|
|
@@ -1801,27 +1801,27 @@ const dn = Rt((j, f) => ({
|
|
|
1801
1801
|
return ge(
|
|
1802
1802
|
() => f.typeFilter,
|
|
1803
1803
|
(a) => {
|
|
1804
|
-
a && (
|
|
1804
|
+
a && (A.value = !0);
|
|
1805
1805
|
},
|
|
1806
1806
|
{ immediate: !0 }
|
|
1807
1807
|
), ge([C, () => f.debug], async () => {
|
|
1808
1808
|
var a;
|
|
1809
1809
|
await Bt(), i.value = ((a = u.value) == null ? void 0 : a.scrollHeight) || 0;
|
|
1810
1810
|
}), (a, x) => {
|
|
1811
|
-
const l =
|
|
1811
|
+
const l = R("FmIcon"), t = R("FmTooltip"), n = R("FmCard");
|
|
1812
1812
|
return p(), ee(n, {
|
|
1813
1813
|
variant: "outlined",
|
|
1814
1814
|
style: { overflow: "clip" }
|
|
1815
1815
|
}, {
|
|
1816
1816
|
default: U(() => [
|
|
1817
|
-
e("div",
|
|
1817
|
+
e("div", Kn, [
|
|
1818
1818
|
e("div", {
|
|
1819
1819
|
class: "sticky top-0 z-10 bg-white flex items-center cursor-pointer py-4 mb-1",
|
|
1820
|
-
onClick: x[0] || (x[0] = (c) =>
|
|
1820
|
+
onClick: x[0] || (x[0] = (c) => A.value = !A.value)
|
|
1821
1821
|
}, [
|
|
1822
|
-
e("div",
|
|
1822
|
+
e("div", Xn, r(a.record.date), 1),
|
|
1823
1823
|
b(l, {
|
|
1824
|
-
name:
|
|
1824
|
+
name: A.value ? "expand_more" : "expand_less",
|
|
1825
1825
|
color: "#777777",
|
|
1826
1826
|
size: "md"
|
|
1827
1827
|
}, null, 8, ["name"])
|
|
@@ -1835,7 +1835,7 @@ const dn = Rt((j, f) => ({
|
|
|
1835
1835
|
style: { "font-size": "0.8rem" },
|
|
1836
1836
|
onClick: (T) => a.$emit("toggleType", s)
|
|
1837
1837
|
}, [
|
|
1838
|
-
e("div",
|
|
1838
|
+
e("div", Qn, r(o(D)(`inventory.inventoryAdjustment.type.${s}`)), 1),
|
|
1839
1839
|
e("div", {
|
|
1840
1840
|
class: he({
|
|
1841
1841
|
"text-fm-color-typo-error": c.startsWith("-"),
|
|
@@ -1843,7 +1843,7 @@ const dn = Rt((j, f) => ({
|
|
|
1843
1843
|
"ml-auto": !0
|
|
1844
1844
|
})
|
|
1845
1845
|
}, r(c), 3)
|
|
1846
|
-
], 10,
|
|
1846
|
+
], 10, Jn))), 128)),
|
|
1847
1847
|
e("div", {
|
|
1848
1848
|
ref_key: "detailRef",
|
|
1849
1849
|
ref: u,
|
|
@@ -1854,20 +1854,20 @@ const dn = Rt((j, f) => ({
|
|
|
1854
1854
|
transition: "max-height 0.2s ease-out"
|
|
1855
1855
|
})
|
|
1856
1856
|
}, [
|
|
1857
|
-
C.value.length ? (p(), E("hr",
|
|
1857
|
+
C.value.length ? (p(), E("hr", Zn)) : Q("", !0),
|
|
1858
1858
|
(p(!0), E(ae, null, fe(C.value, (c) => (p(), E("div", {
|
|
1859
1859
|
key: c.time,
|
|
1860
1860
|
class: "flex gap-1 w-full"
|
|
1861
1861
|
}, [
|
|
1862
|
-
e("div",
|
|
1863
|
-
e("div",
|
|
1862
|
+
e("div", es, r(c.time), 1),
|
|
1863
|
+
e("div", ts, [
|
|
1864
1864
|
(p(!0), E(ae, null, fe(c.adjustments, (s) => {
|
|
1865
1865
|
var T;
|
|
1866
1866
|
return p(), E("div", {
|
|
1867
1867
|
key: s.name
|
|
1868
1868
|
}, [
|
|
1869
|
-
e("div",
|
|
1870
|
-
e("div",
|
|
1869
|
+
e("div", os, [
|
|
1870
|
+
e("div", ns, [
|
|
1871
1871
|
e("span", null, r(o(D)(`inventory.inventoryAdjustment.type.${s.name}`)), 1),
|
|
1872
1872
|
s.backdateFrom ? (p(), ee(t, {
|
|
1873
1873
|
key: 0,
|
|
@@ -1876,7 +1876,7 @@ const dn = Rt((j, f) => ({
|
|
|
1876
1876
|
"z-index": 50
|
|
1877
1877
|
}, {
|
|
1878
1878
|
content: U(() => [
|
|
1879
|
-
e("div",
|
|
1879
|
+
e("div", ss, r(o(D)("inventory.stock.record.backdate", [
|
|
1880
1880
|
o(nt)(new Date(s.backdateFrom))
|
|
1881
1881
|
])), 1)
|
|
1882
1882
|
]),
|
|
@@ -1905,10 +1905,10 @@ const dn = Rt((j, f) => ({
|
|
|
1905
1905
|
}
|
|
1906
1906
|
};
|
|
1907
1907
|
}
|
|
1908
|
-
}, " # " + r(s.billRemark || o(D)("inventory.stock.record.bill", [s.billId])), 9,
|
|
1909
|
-
s.billRemark && s.remark ? (p(), E("span",
|
|
1910
|
-
!s.billRemark && s.reason ? (p(), E("span",
|
|
1911
|
-
!s.billRemark && s.remark ? (p(), E("span",
|
|
1908
|
+
}, " # " + r(s.billRemark || o(D)("inventory.stock.record.bill", [s.billId])), 9, as)) : Q("", !0),
|
|
1909
|
+
s.billRemark && s.remark ? (p(), E("span", ls, " (" + r(s.remark) + ") ", 1)) : Q("", !0),
|
|
1910
|
+
!s.billRemark && s.reason ? (p(), E("span", rs, " (" + r(s.reason) + ") ", 1)) : Q("", !0),
|
|
1911
|
+
!s.billRemark && s.remark ? (p(), E("span", is, " # " + r(s.remark), 1)) : Q("", !0),
|
|
1912
1912
|
(T = s.createdBy) != null && T.name ? (p(), ee(t, {
|
|
1913
1913
|
key: 5,
|
|
1914
1914
|
variant: "plain",
|
|
@@ -1919,7 +1919,7 @@ const dn = Rt((j, f) => ({
|
|
|
1919
1919
|
ve(r(o(D)("inventory.stock.record.createdBy", [s.createdBy.name])), 1)
|
|
1920
1920
|
]),
|
|
1921
1921
|
default: U(() => [
|
|
1922
|
-
e("span",
|
|
1922
|
+
e("span", us, [
|
|
1923
1923
|
b(l, {
|
|
1924
1924
|
name: "person",
|
|
1925
1925
|
size: "sm",
|
|
@@ -1930,7 +1930,7 @@ const dn = Rt((j, f) => ({
|
|
|
1930
1930
|
]),
|
|
1931
1931
|
_: 2
|
|
1932
1932
|
}, 1024)) : Q("", !0),
|
|
1933
|
-
s.name === o(ue).Enum.CLOSING ? (p(), E("span",
|
|
1933
|
+
s.name === o(ue).Enum.CLOSING ? (p(), E("span", cs, " Actual Balance: " + r(s.toBalance) + " " + r(s.baseUnit), 1)) : Q("", !0)
|
|
1934
1934
|
]),
|
|
1935
1935
|
e("div", {
|
|
1936
1936
|
class: he({
|
|
@@ -1939,7 +1939,7 @@ const dn = Rt((j, f) => ({
|
|
|
1939
1939
|
"ml-auto shrink-0 whitespace-nowrap": !0
|
|
1940
1940
|
})
|
|
1941
1941
|
}, r(s.amount), 3),
|
|
1942
|
-
s.name === o(ue).Enum.WASTAGE ? (p(), ee(
|
|
1942
|
+
s.name === o(ue).Enum.WASTAGE ? (p(), ee(Wn, {
|
|
1943
1943
|
key: 0,
|
|
1944
1944
|
adjustmentId: s.adjustmentId,
|
|
1945
1945
|
onRefreshHistory: x[1] || (x[1] = (H) => a.$emit("refreshHistory"))
|
|
@@ -1950,7 +1950,7 @@ const dn = Rt((j, f) => ({
|
|
|
1950
1950
|
compact: ""
|
|
1951
1951
|
}, {
|
|
1952
1952
|
default: U(() => [
|
|
1953
|
-
e("div",
|
|
1953
|
+
e("div", ds, " (" + r(o(Pe)(s.cost, !1, s.cost.precision)) + ") ", 1)
|
|
1954
1954
|
]),
|
|
1955
1955
|
_: 2
|
|
1956
1956
|
}, 1024)) : Q("", !0)
|
|
@@ -1965,17 +1965,17 @@ const dn = Rt((j, f) => ({
|
|
|
1965
1965
|
name: "content_copy",
|
|
1966
1966
|
size: "sm"
|
|
1967
1967
|
})
|
|
1968
|
-
], 8,
|
|
1968
|
+
], 8, ms)) : Q("", !0)
|
|
1969
1969
|
]);
|
|
1970
1970
|
}), 128))
|
|
1971
1971
|
])
|
|
1972
1972
|
]))), 128))
|
|
1973
1973
|
], 4)
|
|
1974
1974
|
]),
|
|
1975
|
-
v.value ? (p(), ee(
|
|
1975
|
+
v.value ? (p(), ee(En, {
|
|
1976
1976
|
key: 0,
|
|
1977
1977
|
show: !0,
|
|
1978
|
-
bill:
|
|
1978
|
+
bill: S.value,
|
|
1979
1979
|
"bill-id": v.value.billId,
|
|
1980
1980
|
sku: v.value.sku,
|
|
1981
1981
|
amounts: v.value.amounts,
|
|
@@ -1991,8 +1991,8 @@ const dn = Rt((j, f) => ({
|
|
|
1991
1991
|
};
|
|
1992
1992
|
}
|
|
1993
1993
|
});
|
|
1994
|
-
function
|
|
1995
|
-
var
|
|
1994
|
+
function vs(j, f) {
|
|
1995
|
+
var A;
|
|
1996
1996
|
const h = Object.keys(ue.enum).reduce(
|
|
1997
1997
|
(u, i) => (u[i] = { amount: 0, precision: 0 }, u),
|
|
1998
1998
|
{}
|
|
@@ -2002,13 +2002,13 @@ function ps(j, f) {
|
|
|
2002
2002
|
(u, [i]) => (u[i] = K.fromNumber(0), u),
|
|
2003
2003
|
{}
|
|
2004
2004
|
);
|
|
2005
|
-
const
|
|
2005
|
+
const S = j.flatMap((u) => {
|
|
2006
2006
|
var i;
|
|
2007
2007
|
return ((i = u.skus) == null ? void 0 : i.filter((_) => _.sku._id === f._id)) ?? [];
|
|
2008
2008
|
}).flatMap((u) => u.amounts);
|
|
2009
|
-
for (const u of
|
|
2009
|
+
for (const u of S) {
|
|
2010
2010
|
const i = u.measurement ? K.multiply([u.measurement.conversion, u.amount]) : u.amount;
|
|
2011
|
-
h[
|
|
2011
|
+
h[A = u.type] ?? (h[A] = { amount: 0, precision: 0 }), h[u.type] = K.add([i, h[u.type]]);
|
|
2012
2012
|
}
|
|
2013
2013
|
return Object.entries(h).reduce(
|
|
2014
2014
|
(u, [i, _]) => {
|
|
@@ -2025,19 +2025,19 @@ function ps(j, f) {
|
|
|
2025
2025
|
{}
|
|
2026
2026
|
);
|
|
2027
2027
|
}
|
|
2028
|
-
function
|
|
2028
|
+
function ps(j, f) {
|
|
2029
2029
|
if (!f)
|
|
2030
2030
|
return null;
|
|
2031
2031
|
let h = null;
|
|
2032
|
-
const
|
|
2032
|
+
const S = j.flatMap((A) => {
|
|
2033
2033
|
var u;
|
|
2034
|
-
return ((u =
|
|
2035
|
-
}).flatMap((
|
|
2034
|
+
return ((u = A.skus) == null ? void 0 : u.filter((i) => i.sku._id === f._id)) ?? [];
|
|
2035
|
+
}).flatMap((A) => {
|
|
2036
2036
|
var u;
|
|
2037
|
-
return
|
|
2037
|
+
return !A.history || ((u = A.history) == null ? void 0 : u.length) === 0 ? [] : A.history[0];
|
|
2038
2038
|
});
|
|
2039
|
-
for (const
|
|
2040
|
-
const u =
|
|
2039
|
+
for (const A of S) {
|
|
2040
|
+
const u = A.amounts;
|
|
2041
2041
|
for (const i of u) {
|
|
2042
2042
|
if (i.type !== ue.Enum.SALES)
|
|
2043
2043
|
continue;
|
|
@@ -2050,20 +2050,20 @@ function ys(j, f) {
|
|
|
2050
2050
|
precision: 4
|
|
2051
2051
|
})} ${f.unit.abbrev}`) : null;
|
|
2052
2052
|
}
|
|
2053
|
-
const
|
|
2053
|
+
const ys = { class: "flex items-center w-full fm-typo-en-title-md-800" }, _s = { class: "flex-1 line-clamp-2" }, ks = { class: "flex flex-col gap-32 w-full h-full" }, bs = { class: "flex flex-col gap-16" }, hs = { class: "flex items-center relative gap-4" }, gs = { class: "flex-1" }, xs = { class: "flex items-center gap-8" }, Ss = { class: "flex items-center gap-8" }, ws = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, $s = { class: "fm-typo-cn-body-lg-600 flex-grow" }, As = {
|
|
2054
2054
|
key: 0,
|
|
2055
2055
|
class: "grid gap-12 fm-typo-en-body-md-400",
|
|
2056
2056
|
style: { "grid-template-columns": "auto auto auto", "grid-auto-rows": "1fr" }
|
|
2057
|
-
},
|
|
2057
|
+
}, Fs = { class: "flex flex-col gap-1" }, js = { class: "text-fm-color-typo-secondary" }, Cs = { class: "font-bold" }, Bs = { class: "flex flex-col gap-1" }, Vs = { class: "text-fm-color-typo-secondary flex" }, Ds = { class: "font-bold" }, Is = { class: "flex flex-col gap-1" }, Ms = { class: "text-fm-color-typo-secondary" }, Ts = { class: "font-bold" }, Hs = { class: "flex flex-col gap-1" }, Es = { class: "text-fm-color-typo-secondary" }, Us = { class: "font-bold" }, Ps = { class: "flex flex-col gap-1" }, Rs = { class: "text-fm-color-typo-secondary" }, Ns = { class: "font-bold" }, Os = { class: "flex flex-col gap-1" }, Ls = { class: "text-fm-color-typo-secondary" }, zs = { class: "font-bold" }, Ys = { class: "flex flex-col gap-1" }, qs = { class: "text-fm-color-typo-secondary" }, Gs = { class: "font-bold" }, Ws = { class: "flex flex-col gap-1" }, Ks = { class: "text-fm-color-typo-secondary" }, Xs = { class: "font-bold" }, Js = { class: "flex flex-col gap-1" }, Qs = { class: "text-fm-color-typo-secondary" }, Zs = { class: "font-bold" }, ea = { class: "flex flex-col gap-1" }, ta = { class: "text-fm-color-typo-secondary" }, oa = { key: 0 }, na = { class: "font-bold" }, sa = { class: "flex flex-col gap-8" }, aa = { class: "flex" }, la = { class: "flex-1 flex flex-col gap-1" }, ra = { class: "flex items-center gap-8" }, ia = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, ua = { class: "font-bold" }, ca = { class: "flex-1 flex flex-col gap-1" }, da = { class: "flex items-center gap-8" }, ma = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, fa = { class: "flex flex-col gap-1" }, va = { class: "font-bold" }, pa = {
|
|
2058
2058
|
key: 0,
|
|
2059
2059
|
class: "flex-1 flex flex-col items-center gap-16"
|
|
2060
|
-
},
|
|
2060
|
+
}, ya = { class: "fm-typo-en-body-lg-400 translate-x-4" }, _a = {
|
|
2061
2061
|
key: 1,
|
|
2062
2062
|
class: "flex flex-col gap-12"
|
|
2063
|
-
},
|
|
2063
|
+
}, ka = {
|
|
2064
2064
|
key: 2,
|
|
2065
2065
|
class: "flex-1 flex flex-col items-center gap-8"
|
|
2066
|
-
},
|
|
2066
|
+
}, ba = ["src"], ha = { class: "font-bold text-lg" }, ga = { class: "text-xs text-neutral-400 text-center" }, xa = /* @__PURE__ */ ye({
|
|
2067
2067
|
__name: "StockHistory",
|
|
2068
2068
|
props: {
|
|
2069
2069
|
sku: {},
|
|
@@ -2071,22 +2071,22 @@ const _s = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ks = {
|
|
|
2071
2071
|
},
|
|
2072
2072
|
emits: ["update:show"],
|
|
2073
2073
|
setup(j) {
|
|
2074
|
-
const f = et(), h = ze(), v = Be(),
|
|
2075
|
-
() =>
|
|
2074
|
+
const f = et(), h = ze(), v = Be(), S = cn(), A = Ce(), u = N(() => Rt(f.currentCountry.value)), { t: i } = _e(), _ = j, { lastClosingBalance: L, lastClosingDate: D } = un(
|
|
2075
|
+
() => A.currentLocationDBName,
|
|
2076
2076
|
() => _.sku
|
|
2077
2077
|
), k = z(!1), d = xe(), C = z("adjustment"), a = z([
|
|
2078
2078
|
{ label: "Adjustment (Default)", value: "adjustment" }
|
|
2079
|
-
]), x = z([]), l = z(
|
|
2079
|
+
]), x = z([]), l = z(ro(0));
|
|
2080
2080
|
async function t() {
|
|
2081
2081
|
k.value = !0;
|
|
2082
2082
|
try {
|
|
2083
2083
|
await V(), await h.readStockBalance();
|
|
2084
|
-
} catch (
|
|
2084
|
+
} catch (F) {
|
|
2085
2085
|
d.open({
|
|
2086
2086
|
title: "Something went wrong",
|
|
2087
2087
|
message: "Cannot fetch stock history. Please try again.",
|
|
2088
2088
|
type: "error"
|
|
2089
|
-
}), console.log("failed at fetching item adjustment history", _.sku, l,
|
|
2089
|
+
}), console.log("failed at fetching item adjustment history", _.sku, l, F);
|
|
2090
2090
|
} finally {
|
|
2091
2091
|
k.value = !1;
|
|
2092
2092
|
}
|
|
@@ -2097,11 +2097,11 @@ const _s = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ks = {
|
|
|
2097
2097
|
t();
|
|
2098
2098
|
});
|
|
2099
2099
|
const n = z([]), c = z([]), s = z(new Array());
|
|
2100
|
-
function T(
|
|
2101
|
-
return m === "day" ? St(
|
|
2100
|
+
function T(F, m) {
|
|
2101
|
+
return m === "day" ? St(F) : nt(F);
|
|
2102
2102
|
}
|
|
2103
|
-
function H(
|
|
2104
|
-
const
|
|
2103
|
+
function H(F, m) {
|
|
2104
|
+
const w = F.reduce(
|
|
2105
2105
|
(y, B) => {
|
|
2106
2106
|
const O = B.effectiveAt ?? De(B._id);
|
|
2107
2107
|
if (!O)
|
|
@@ -2111,37 +2111,37 @@ const _s = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ks = {
|
|
|
2111
2111
|
},
|
|
2112
2112
|
{}
|
|
2113
2113
|
);
|
|
2114
|
-
return Object.keys(
|
|
2114
|
+
return Object.keys(w).map((y) => ({
|
|
2115
2115
|
date: y,
|
|
2116
|
-
adjustments:
|
|
2116
|
+
adjustments: w[y]
|
|
2117
2117
|
}));
|
|
2118
2118
|
}
|
|
2119
2119
|
async function V() {
|
|
2120
|
-
let
|
|
2120
|
+
let F = await v.readStockAdjustment(
|
|
2121
2121
|
_.sku._id,
|
|
2122
2122
|
dt(new Date(l.value.startDate)).toISOString(),
|
|
2123
2123
|
mt(new Date(l.value.endDate)).toISOString()
|
|
2124
2124
|
);
|
|
2125
|
-
n.value =
|
|
2125
|
+
n.value = F;
|
|
2126
2126
|
const m = [
|
|
2127
2127
|
...new Set(
|
|
2128
|
-
|
|
2128
|
+
F.filter(({ ref: w }) => w == null ? void 0 : w.startsWith("bill_")).map(({ ref: w }) => w)
|
|
2129
2129
|
)
|
|
2130
2130
|
];
|
|
2131
|
-
await J(m), c.value = H(
|
|
2132
|
-
date:
|
|
2131
|
+
await J(m), c.value = H(F, "day").map(({ date: w, adjustments: y }) => ({
|
|
2132
|
+
date: w,
|
|
2133
2133
|
adjustments: y,
|
|
2134
2134
|
adjustmentsByTime: H(y, "minute")
|
|
2135
2135
|
}));
|
|
2136
2136
|
try {
|
|
2137
|
-
const
|
|
2137
|
+
const w = await v.readUnitCostHistory(
|
|
2138
2138
|
_.sku._id,
|
|
2139
2139
|
dt(new Date(l.value.startDate)).toISOString(),
|
|
2140
2140
|
mt(new Date(l.value.endDate)).toISOString()
|
|
2141
2141
|
);
|
|
2142
|
-
x.value =
|
|
2142
|
+
x.value = w;
|
|
2143
2143
|
const y = /* @__PURE__ */ new Set();
|
|
2144
|
-
|
|
2144
|
+
w.forEach((O) => {
|
|
2145
2145
|
y.add(O.mechanism);
|
|
2146
2146
|
});
|
|
2147
2147
|
const B = [{ label: "Default", value: "adjustment" }];
|
|
@@ -2152,66 +2152,66 @@ const _s = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ks = {
|
|
|
2152
2152
|
label: "NetSuite Average (Beta)",
|
|
2153
2153
|
value: je.Enum["netsuite-average"]
|
|
2154
2154
|
}), a.value = B, !y.has(C.value) && C.value !== "adjustment" && (C.value = "adjustment");
|
|
2155
|
-
} catch (
|
|
2156
|
-
console.error("Failed to fetch unit cost history:",
|
|
2155
|
+
} catch (w) {
|
|
2156
|
+
console.error("Failed to fetch unit cost history:", w);
|
|
2157
2157
|
}
|
|
2158
2158
|
}
|
|
2159
|
-
async function J(
|
|
2160
|
-
if (!
|
|
2159
|
+
async function J(F) {
|
|
2160
|
+
if (!F.length) {
|
|
2161
2161
|
s.value = [];
|
|
2162
2162
|
return;
|
|
2163
2163
|
}
|
|
2164
|
-
s.value = await
|
|
2164
|
+
s.value = await S.findBillsById(F, ["_id", "seqNumber", "items"]).catch((m) => {
|
|
2165
2165
|
var B;
|
|
2166
2166
|
console.error("Error on using latest bill API, retrying using legacy api", m);
|
|
2167
|
-
const
|
|
2168
|
-
return
|
|
2167
|
+
const w = ((B = f.currentBusiness.value) == null ? void 0 : B._id) ?? "", y = A.currentLocation.doc._id;
|
|
2168
|
+
return S.findBillsByBusinessId(w, [y], F);
|
|
2169
2169
|
});
|
|
2170
2170
|
}
|
|
2171
2171
|
const I = N(() => {
|
|
2172
|
-
const
|
|
2173
|
-
return
|
|
2172
|
+
const F = n.value, m = _.sku;
|
|
2173
|
+
return vs(F, m);
|
|
2174
2174
|
}), W = N(() => {
|
|
2175
|
-
const
|
|
2176
|
-
return
|
|
2175
|
+
const F = n.value, m = _.sku;
|
|
2176
|
+
return ps(F, m);
|
|
2177
2177
|
}), Y = N(() => {
|
|
2178
|
-
const
|
|
2178
|
+
const F = [...n.value].computeFirst((w) => {
|
|
2179
2179
|
var B, O;
|
|
2180
|
-
const y = (O = (B =
|
|
2180
|
+
const y = (O = (B = w.skus) == null ? void 0 : B.find) == null ? void 0 : O.call(B, (X) => X.sku._id === _.sku._id);
|
|
2181
2181
|
return y == null ? void 0 : y.fromBalance;
|
|
2182
2182
|
}) ?? {
|
|
2183
2183
|
amount: 0,
|
|
2184
2184
|
precision: 0
|
|
2185
2185
|
}, m = _.sku;
|
|
2186
2186
|
return m ? `${K.toFormatString({
|
|
2187
|
-
value:
|
|
2187
|
+
value: F,
|
|
2188
2188
|
precision: 4
|
|
2189
2189
|
})} ${m.unit.abbrev}` : "";
|
|
2190
2190
|
}), Z = N(() => {
|
|
2191
|
-
const
|
|
2191
|
+
const F = [...n.value].reverse().computeFirst((w) => {
|
|
2192
2192
|
var B, O;
|
|
2193
|
-
const y = (O = (B =
|
|
2193
|
+
const y = (O = (B = w.skus) == null ? void 0 : B.find) == null ? void 0 : O.call(B, (X) => X.sku._id === _.sku._id);
|
|
2194
2194
|
return y == null ? void 0 : y.toBalance;
|
|
2195
2195
|
}) ?? {
|
|
2196
2196
|
amount: 0,
|
|
2197
2197
|
precision: 0
|
|
2198
2198
|
}, m = _.sku;
|
|
2199
|
-
return m ? `${K.toFormatString({ value:
|
|
2199
|
+
return m ? `${K.toFormatString({ value: F, precision: 4 })} ${m.unit.abbrev}` : "";
|
|
2200
2200
|
}), oe = N(() => {
|
|
2201
|
-
const m = n.value.flatMap((
|
|
2201
|
+
const m = n.value.flatMap((w) => {
|
|
2202
2202
|
var y;
|
|
2203
|
-
return ((y =
|
|
2204
|
-
}).filter((
|
|
2205
|
-
(
|
|
2203
|
+
return ((y = w.skus) == null ? void 0 : y.flatMap((B) => B.amounts)) ?? [];
|
|
2204
|
+
}).filter((w) => w.amount.amount < 0).reduce(
|
|
2205
|
+
(w, y) => {
|
|
2206
2206
|
const B = y.cost;
|
|
2207
|
-
if (!B) return
|
|
2207
|
+
if (!B) return w;
|
|
2208
2208
|
const O = {
|
|
2209
|
-
...
|
|
2209
|
+
...Zt(w, Math.max(w.precision, B.precision)),
|
|
2210
2210
|
currency: B.currency
|
|
2211
2211
|
};
|
|
2212
2212
|
return {
|
|
2213
2213
|
...ot(O, B),
|
|
2214
|
-
currency:
|
|
2214
|
+
currency: w.currency
|
|
2215
2215
|
};
|
|
2216
2216
|
},
|
|
2217
2217
|
{
|
|
@@ -2220,102 +2220,102 @@ const _s = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ks = {
|
|
|
2220
2220
|
currency: u.value
|
|
2221
2221
|
}
|
|
2222
2222
|
);
|
|
2223
|
-
return
|
|
2223
|
+
return Pe(m, !1, m.precision);
|
|
2224
2224
|
});
|
|
2225
2225
|
function ce() {
|
|
2226
|
-
const { startDate:
|
|
2227
|
-
|
|
2228
|
-
startDate:
|
|
2226
|
+
const { startDate: F, endDate: m } = ao(l.value);
|
|
2227
|
+
F !== null && m !== null && (l.value = {
|
|
2228
|
+
startDate: F,
|
|
2229
2229
|
endDate: m
|
|
2230
2230
|
});
|
|
2231
2231
|
}
|
|
2232
2232
|
const pe = N(() => i("inventory.ingredient.valuationMethod.WAVG"));
|
|
2233
|
-
function ke(
|
|
2233
|
+
function ke(F, m) {
|
|
2234
2234
|
if (C.value === "adjustment")
|
|
2235
2235
|
return null;
|
|
2236
|
-
const
|
|
2236
|
+
const w = x.value.filter(
|
|
2237
2237
|
(O) => O.mechanism === C.value && O.skuId === _.sku._id
|
|
2238
2238
|
);
|
|
2239
|
-
if (
|
|
2240
|
-
const y =
|
|
2239
|
+
if (w.length === 0) return null;
|
|
2240
|
+
const y = w.find((O) => {
|
|
2241
2241
|
const X = O.meta;
|
|
2242
|
-
return (X == null ? void 0 : X.adjustmentId) ===
|
|
2242
|
+
return (X == null ? void 0 : X.adjustmentId) === F;
|
|
2243
2243
|
});
|
|
2244
2244
|
if (y) return y.cost;
|
|
2245
|
-
const B = [...
|
|
2245
|
+
const B = [...w].filter((O) => new Date(O.snapshotAt) <= new Date(m)).sort((O, X) => new Date(X.snapshotAt).getTime() - new Date(O.snapshotAt).getTime());
|
|
2246
2246
|
return B.length > 0 ? B[0].cost : null;
|
|
2247
2247
|
}
|
|
2248
2248
|
const be = N(() => {
|
|
2249
2249
|
var y, B, O, X;
|
|
2250
|
-
const
|
|
2250
|
+
const F = [...n.value].reverse().find((se) => {
|
|
2251
2251
|
var ne, ie;
|
|
2252
2252
|
return (ie = (ne = se.skus) == null ? void 0 : ne.find) == null ? void 0 : ie.call(ne, (de) => de.sku._id === _.sku._id);
|
|
2253
2253
|
});
|
|
2254
|
-
if (!
|
|
2255
|
-
const m = (y =
|
|
2254
|
+
if (!F) return "No data";
|
|
2255
|
+
const m = (y = F.skus) == null ? void 0 : y.find((se) => se.sku._id === _.sku._id);
|
|
2256
2256
|
if (!m) return "No data";
|
|
2257
|
-
const
|
|
2257
|
+
const w = m.toBalance;
|
|
2258
2258
|
if (C.value === "adjustment") {
|
|
2259
2259
|
const se = [...m.amounts].reverse()[0], ne = {
|
|
2260
2260
|
amount: ((B = se.cost) == null ? void 0 : B.amount) ?? 0,
|
|
2261
2261
|
precision: ((O = se.cost) == null ? void 0 : O.precision) ?? 0
|
|
2262
|
-
}, ie = se.amount, de = ie.amount == 0 ? K.fromNumber(0) : K.divide([ne, ie]), Se = K.multiply([de,
|
|
2262
|
+
}, ie = se.amount, de = ie.amount == 0 ? K.fromNumber(0) : K.divide([ne, ie]), Se = K.multiply([de, w]);
|
|
2263
2263
|
return {
|
|
2264
2264
|
...Se,
|
|
2265
2265
|
currency: Se.amount === 0 ? u.value : ((X = se.cost) == null ? void 0 : X.currency) ?? u.value
|
|
2266
2266
|
};
|
|
2267
2267
|
} else {
|
|
2268
|
-
const se =
|
|
2269
|
-
|
|
2268
|
+
const se = F.effectiveAt ?? De(F._id), ne = ke(
|
|
2269
|
+
F._id,
|
|
2270
2270
|
se ?? (/* @__PURE__ */ new Date()).toISOString()
|
|
2271
2271
|
);
|
|
2272
2272
|
if (!ne) return "No data";
|
|
2273
|
-
const ie = K.fromDinero(ne), de = K.multiply([ie,
|
|
2273
|
+
const ie = K.fromDinero(ne), de = K.multiply([ie, w]);
|
|
2274
2274
|
return {
|
|
2275
2275
|
...de,
|
|
2276
2276
|
currency: de.amount === 0 ? u.value : ne.currency
|
|
2277
2277
|
};
|
|
2278
2278
|
}
|
|
2279
|
-
}),
|
|
2280
|
-
const
|
|
2279
|
+
}), $ = N(() => {
|
|
2280
|
+
const F = [...n.value].reverse().computeFirst((w) => {
|
|
2281
2281
|
var B, O;
|
|
2282
|
-
const y = (O = (B =
|
|
2282
|
+
const y = (O = (B = w.skus) == null ? void 0 : B.find) == null ? void 0 : O.call(B, (X) => X.sku._id === _.sku._id);
|
|
2283
2283
|
return y == null ? void 0 : y.toCostBalances;
|
|
2284
2284
|
});
|
|
2285
|
-
return !
|
|
2286
|
-
...
|
|
2285
|
+
return !F || F.some((w) => w.cost == null) ? "No data" : {
|
|
2286
|
+
...F.reduce((w, y) => K.add([w, K.fromDinero(y.cost)]), {
|
|
2287
2287
|
amount: 0,
|
|
2288
2288
|
precision: 0
|
|
2289
2289
|
}),
|
|
2290
2290
|
currency: u.value
|
|
2291
2291
|
};
|
|
2292
|
-
}), g = N(() => _.sku.valuation === it.Enum.FIFO ?
|
|
2292
|
+
}), g = N(() => _.sku.valuation === it.Enum.FIFO ? $.value : be.value);
|
|
2293
2293
|
function G() {
|
|
2294
|
-
const { startDate:
|
|
2295
|
-
|
|
2296
|
-
startDate:
|
|
2294
|
+
const { startDate: F, endDate: m } = lo(l.value);
|
|
2295
|
+
F !== null && m !== null && (l.value = {
|
|
2296
|
+
startDate: F,
|
|
2297
2297
|
endDate: m
|
|
2298
2298
|
});
|
|
2299
2299
|
}
|
|
2300
|
-
const q = z(!0), M = z(!1),
|
|
2301
|
-
function te(
|
|
2302
|
-
|
|
2300
|
+
const q = z(!0), M = z(!1), P = z(null);
|
|
2301
|
+
function te(F) {
|
|
2302
|
+
P.value = P.value === F ? null : F;
|
|
2303
2303
|
}
|
|
2304
2304
|
const le = N(() => {
|
|
2305
|
-
const
|
|
2306
|
-
return
|
|
2305
|
+
const F = P.value;
|
|
2306
|
+
return F ? c.value.filter(
|
|
2307
2307
|
(m) => m.adjustments.some(
|
|
2308
|
-
(
|
|
2308
|
+
(w) => {
|
|
2309
2309
|
var y;
|
|
2310
|
-
return (y =
|
|
2311
|
-
(B) => B.sku._id === _.sku._id && B.amounts.some((O) => O.type ===
|
|
2310
|
+
return (y = w.skus) == null ? void 0 : y.some(
|
|
2311
|
+
(B) => B.sku._id === _.sku._id && B.amounts.some((O) => O.type === F)
|
|
2312
2312
|
);
|
|
2313
2313
|
}
|
|
2314
2314
|
)
|
|
2315
2315
|
) : c.value;
|
|
2316
2316
|
}), re = qe(_, "show");
|
|
2317
|
-
return (
|
|
2318
|
-
const
|
|
2317
|
+
return (F, m) => {
|
|
2318
|
+
const w = R("FmButton"), y = R("FmField"), B = R("FmDateRangePicker"), O = R("FmSpacer"), X = R("FmSwitch"), se = R("FmIcon"), ne = R("FmTooltip"), ie = R("FmMenuDivider"), de = R("FmChip"), Se = R("FmSelect"), Te = R("FmCardSection"), Ae = R("FmCard"), He = R("FmCircularProgress"), jt = R("FmSideSheet");
|
|
2319
2319
|
return p(), ee(jt, {
|
|
2320
2320
|
"dismiss-away": "",
|
|
2321
2321
|
modelValue: o(re),
|
|
@@ -2324,9 +2324,9 @@ const _s = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ks = {
|
|
|
2324
2324
|
"max-width": 800
|
|
2325
2325
|
}, {
|
|
2326
2326
|
"side-sheet-header": U(() => [
|
|
2327
|
-
e("div",
|
|
2328
|
-
e("div",
|
|
2329
|
-
b(
|
|
2327
|
+
e("div", ys, [
|
|
2328
|
+
e("div", _s, r(o(i)("inventory.stock.history.title", [F.sku.name])), 1),
|
|
2329
|
+
b(w, {
|
|
2330
2330
|
variant: "tertiary",
|
|
2331
2331
|
"prepend-icon": "close",
|
|
2332
2332
|
onClick: m[0] || (m[0] = (Ve) => re.value = !1)
|
|
@@ -2336,10 +2336,10 @@ const _s = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ks = {
|
|
|
2336
2336
|
default: U(() => {
|
|
2337
2337
|
var Ve;
|
|
2338
2338
|
return [
|
|
2339
|
-
e("div",
|
|
2340
|
-
e("div",
|
|
2341
|
-
e("div",
|
|
2342
|
-
e("div",
|
|
2339
|
+
e("div", ks, [
|
|
2340
|
+
e("div", bs, [
|
|
2341
|
+
e("div", hs, [
|
|
2342
|
+
e("div", gs, [
|
|
2343
2343
|
b(B, {
|
|
2344
2344
|
modelValue: l.value,
|
|
2345
2345
|
"onUpdate:modelValue": m[1] || (m[1] = (me) => l.value = me),
|
|
@@ -2362,30 +2362,30 @@ const _s = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ks = {
|
|
|
2362
2362
|
_: 1
|
|
2363
2363
|
}, 8, ["modelValue"])
|
|
2364
2364
|
]),
|
|
2365
|
-
b(
|
|
2365
|
+
b(w, {
|
|
2366
2366
|
variant: "tertiary",
|
|
2367
2367
|
onClick: m[2] || (m[2] = (me) => ce()),
|
|
2368
2368
|
"prepend-icon": "navigate_before"
|
|
2369
2369
|
}),
|
|
2370
|
-
b(
|
|
2370
|
+
b(w, {
|
|
2371
2371
|
variant: "tertiary",
|
|
2372
2372
|
onClick: m[3] || (m[3] = (me) => G()),
|
|
2373
2373
|
"prepend-icon": "navigate_next"
|
|
2374
2374
|
})
|
|
2375
2375
|
]),
|
|
2376
|
-
e("div",
|
|
2377
|
-
|
|
2376
|
+
e("div", xs, [
|
|
2377
|
+
P.value ? (p(), ee(w, {
|
|
2378
2378
|
key: 0,
|
|
2379
2379
|
variant: "secondary",
|
|
2380
|
-
label: o(i)(`inventory.inventoryAdjustment.type.${
|
|
2380
|
+
label: o(i)(`inventory.inventoryAdjustment.type.${P.value}`),
|
|
2381
2381
|
"append-icon": "close",
|
|
2382
|
-
onClick: m[4] || (m[4] = (me) =>
|
|
2382
|
+
onClick: m[4] || (m[4] = (me) => P.value = null)
|
|
2383
2383
|
}, null, 8, ["label"])) : Q("", !0),
|
|
2384
2384
|
b(O),
|
|
2385
2385
|
b(Ge, null, {
|
|
2386
2386
|
default: U(() => [
|
|
2387
|
-
e("div",
|
|
2388
|
-
e("div",
|
|
2387
|
+
e("div", Ss, [
|
|
2388
|
+
e("div", ws, r(o(i)("inventory.stock.history.debug")), 1),
|
|
2389
2389
|
b(X, {
|
|
2390
2390
|
modelValue: M.value,
|
|
2391
2391
|
"onUpdate:modelValue": m[5] || (m[5] = (me) => M.value = me)
|
|
@@ -2406,20 +2406,20 @@ const _s = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ks = {
|
|
|
2406
2406
|
class: he(["flex items-center cursor-pointer", { "pb-16": q.value }]),
|
|
2407
2407
|
onClick: m[6] || (m[6] = (me) => q.value = !q.value)
|
|
2408
2408
|
}, [
|
|
2409
|
-
e("div",
|
|
2409
|
+
e("div", $s, r(o(i)("inventory.stock.history.summary.title")), 1),
|
|
2410
2410
|
b(se, {
|
|
2411
2411
|
name: q.value ? "expand_more" : "expand_less",
|
|
2412
2412
|
color: "#777777",
|
|
2413
2413
|
size: "md"
|
|
2414
2414
|
}, null, 8, ["name"])
|
|
2415
2415
|
], 2),
|
|
2416
|
-
q.value ? (p(), E("div",
|
|
2417
|
-
e("div",
|
|
2418
|
-
e("div",
|
|
2419
|
-
e("div",
|
|
2416
|
+
q.value ? (p(), E("div", As, [
|
|
2417
|
+
e("div", Fs, [
|
|
2418
|
+
e("div", js, r(o(i)("inventory.stock.history.summary.totalPurchase")), 1),
|
|
2419
|
+
e("div", Cs, r(I.value.PURCHASE), 1)
|
|
2420
2420
|
]),
|
|
2421
|
-
e("div",
|
|
2422
|
-
e("div",
|
|
2421
|
+
e("div", Bs, [
|
|
2422
|
+
e("div", Vs, [
|
|
2423
2423
|
ve(r(o(i)("inventory.stock.history.summary.totalSales")) + " ", 1),
|
|
2424
2424
|
W.value != null ? (p(), ee(ne, {
|
|
2425
2425
|
key: 0,
|
|
@@ -2437,42 +2437,42 @@ const _s = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ks = {
|
|
|
2437
2437
|
_: 1
|
|
2438
2438
|
}, 8, ["content"])) : Q("", !0)
|
|
2439
2439
|
]),
|
|
2440
|
-
e("div",
|
|
2440
|
+
e("div", Ds, r(I.value.SALES), 1)
|
|
2441
2441
|
]),
|
|
2442
|
-
e("div",
|
|
2443
|
-
e("div",
|
|
2444
|
-
e("div",
|
|
2442
|
+
e("div", Is, [
|
|
2443
|
+
e("div", Ms, r(o(i)("inventory.stock.history.summary.totalLose")), 1),
|
|
2444
|
+
e("div", Ts, r(I.value.LOSE), 1)
|
|
2445
2445
|
]),
|
|
2446
|
-
e("div",
|
|
2447
|
-
e("div",
|
|
2448
|
-
e("div",
|
|
2446
|
+
e("div", Hs, [
|
|
2447
|
+
e("div", Es, r(o(i)("inventory.stock.history.summary.totalRequest")), 1),
|
|
2448
|
+
e("div", Us, r(I.value.REQUEST), 1)
|
|
2449
2449
|
]),
|
|
2450
2450
|
e("div", Ps, [
|
|
2451
|
-
e("div",
|
|
2452
|
-
e("div",
|
|
2451
|
+
e("div", Rs, r(o(i)("inventory.stock.history.summary.totalReceive")), 1),
|
|
2452
|
+
e("div", Ns, r(I.value.RECEIVE), 1)
|
|
2453
2453
|
]),
|
|
2454
|
-
e("div",
|
|
2455
|
-
e("div",
|
|
2456
|
-
e("div",
|
|
2454
|
+
e("div", Os, [
|
|
2455
|
+
e("div", Ls, r(o(i)("inventory.stock.history.summary.totalConvert")), 1),
|
|
2456
|
+
e("div", zs, r(I.value.CONVERT), 1)
|
|
2457
2457
|
]),
|
|
2458
|
-
e("div",
|
|
2459
|
-
e("div",
|
|
2460
|
-
e("div",
|
|
2458
|
+
e("div", Ys, [
|
|
2459
|
+
e("div", qs, r(o(i)("inventory.stock.history.summary.totalDamage")), 1),
|
|
2460
|
+
e("div", Gs, r(I.value.DAMAGE), 1)
|
|
2461
2461
|
]),
|
|
2462
|
-
e("div",
|
|
2463
|
-
e("div",
|
|
2464
|
-
e("div",
|
|
2462
|
+
e("div", Ws, [
|
|
2463
|
+
e("div", Ks, r(o(i)("inventory.stock.history.summary.firstAdjustmentBalance")), 1),
|
|
2464
|
+
e("div", Xs, r(Y.value), 1)
|
|
2465
2465
|
]),
|
|
2466
|
-
e("div",
|
|
2467
|
-
e("div",
|
|
2468
|
-
e("div",
|
|
2466
|
+
e("div", Js, [
|
|
2467
|
+
e("div", Qs, r(o(i)("inventory.stock.history.summary.lastAdjustmentBalance")), 1),
|
|
2468
|
+
e("div", Zs, r(Z.value), 1)
|
|
2469
2469
|
]),
|
|
2470
|
-
e("div",
|
|
2471
|
-
e("div",
|
|
2470
|
+
e("div", ea, [
|
|
2471
|
+
e("div", ta, [
|
|
2472
2472
|
ve(r(o(i)("inventory.stock.history.summary.lastClosingBalance")) + " ", 1),
|
|
2473
|
-
o(D) ? (p(), E("span",
|
|
2473
|
+
o(D) ? (p(), E("span", oa, "(" + r(o(D)) + ")", 1)) : Q("", !0)
|
|
2474
2474
|
]),
|
|
2475
|
-
e("div",
|
|
2475
|
+
e("div", na, r(o(L)), 1)
|
|
2476
2476
|
])
|
|
2477
2477
|
])) : Q("", !0),
|
|
2478
2478
|
q.value ? (p(), ee(wt, {
|
|
@@ -2480,12 +2480,12 @@ const _s = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ks = {
|
|
|
2480
2480
|
"feature-key": "total-cost"
|
|
2481
2481
|
}, {
|
|
2482
2482
|
default: U(() => [
|
|
2483
|
-
e("div",
|
|
2483
|
+
e("div", sa, [
|
|
2484
2484
|
b(ie, { class: "w-full" }),
|
|
2485
|
-
e("div",
|
|
2486
|
-
e("div",
|
|
2487
|
-
e("div",
|
|
2488
|
-
e("div",
|
|
2485
|
+
e("div", aa, [
|
|
2486
|
+
e("div", la, [
|
|
2487
|
+
e("div", ra, [
|
|
2488
|
+
e("div", ia, [
|
|
2489
2489
|
ve(r(o(i)("inventory.stock.history.estimatedValue")) + " ", 1),
|
|
2490
2490
|
b(ne, {
|
|
2491
2491
|
variant: "plain",
|
|
@@ -2503,19 +2503,19 @@ const _s = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ks = {
|
|
|
2503
2503
|
}, 8, ["content"])
|
|
2504
2504
|
])
|
|
2505
2505
|
]),
|
|
2506
|
-
e("div",
|
|
2507
|
-
|
|
2506
|
+
e("div", ua, [
|
|
2507
|
+
F.sku.valuation === o(it).Enum.FIFO ? (p(), E(ae, { key: 0 }, [
|
|
2508
2508
|
b(de, {
|
|
2509
2509
|
label: "FIFO",
|
|
2510
2510
|
compact: ""
|
|
2511
2511
|
}),
|
|
2512
|
-
ve(" " + r(typeof g.value != "string" ? o(
|
|
2512
|
+
ve(" " + r(typeof g.value != "string" ? o(Pe)(
|
|
2513
2513
|
g.value,
|
|
2514
2514
|
!1,
|
|
2515
2515
|
g.value.precision
|
|
2516
2516
|
) : g.value), 1)
|
|
2517
2517
|
], 64)) : (p(), E(ae, { key: 1 }, [
|
|
2518
|
-
ve(r(typeof g.value != "string" ? o(
|
|
2518
|
+
ve(r(typeof g.value != "string" ? o(Pe)(
|
|
2519
2519
|
g.value,
|
|
2520
2520
|
!1,
|
|
2521
2521
|
g.value.precision
|
|
@@ -2531,9 +2531,9 @@ const _s = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ks = {
|
|
|
2531
2531
|
style: { width: "200px" }
|
|
2532
2532
|
}, null, 8, ["modelValue", "items"])
|
|
2533
2533
|
]),
|
|
2534
|
-
e("div",
|
|
2535
|
-
e("div",
|
|
2536
|
-
e("div",
|
|
2534
|
+
e("div", ca, [
|
|
2535
|
+
e("div", da, [
|
|
2536
|
+
e("div", ma, [
|
|
2537
2537
|
ve(r(o(i)("inventory.stock.history.costSold")) + " ", 1),
|
|
2538
2538
|
b(ne, {
|
|
2539
2539
|
variant: "plain",
|
|
@@ -2541,7 +2541,7 @@ const _s = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ks = {
|
|
|
2541
2541
|
"z-index": 50
|
|
2542
2542
|
}, {
|
|
2543
2543
|
content: U(() => [
|
|
2544
|
-
e("div",
|
|
2544
|
+
e("div", fa, r(o(i)("inventory.stock.history.costSoldTooltip")), 1)
|
|
2545
2545
|
]),
|
|
2546
2546
|
default: U(() => [
|
|
2547
2547
|
b(se, {
|
|
@@ -2553,7 +2553,7 @@ const _s = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ks = {
|
|
|
2553
2553
|
})
|
|
2554
2554
|
])
|
|
2555
2555
|
]),
|
|
2556
|
-
e("div",
|
|
2556
|
+
e("div", va, r(oe.value), 1)
|
|
2557
2557
|
])
|
|
2558
2558
|
])
|
|
2559
2559
|
])
|
|
@@ -2567,39 +2567,39 @@ const _s = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ks = {
|
|
|
2567
2567
|
_: 1
|
|
2568
2568
|
}))
|
|
2569
2569
|
]),
|
|
2570
|
-
k.value ? (p(), E("div",
|
|
2570
|
+
k.value ? (p(), E("div", pa, [
|
|
2571
2571
|
b(O),
|
|
2572
2572
|
b(He, { size: "xl" }),
|
|
2573
|
-
e("div",
|
|
2573
|
+
e("div", ya, r(o(i)("inventory.stock.history.loading")), 1),
|
|
2574
2574
|
b(O),
|
|
2575
2575
|
b(O)
|
|
2576
|
-
])) : c.value && ((Ve = c.value) == null ? void 0 : Ve.length) > 0 ? (p(), E("div",
|
|
2576
|
+
])) : c.value && ((Ve = c.value) == null ? void 0 : Ve.length) > 0 ? (p(), E("div", _a, [
|
|
2577
2577
|
(p(!0), E(ae, null, fe(le.value, (me) => (p(), E(ae, {
|
|
2578
2578
|
key: me.date
|
|
2579
2579
|
}, [
|
|
2580
|
-
|
|
2580
|
+
F.sku ? (p(), ee(fs, {
|
|
2581
2581
|
key: 0,
|
|
2582
2582
|
record: me,
|
|
2583
|
-
sku:
|
|
2583
|
+
sku: F.sku,
|
|
2584
2584
|
bills: s.value,
|
|
2585
2585
|
"unit-cost-history": x.value,
|
|
2586
2586
|
"cost-mechanism": C.value,
|
|
2587
|
-
"type-filter":
|
|
2587
|
+
"type-filter": P.value,
|
|
2588
2588
|
debug: M.value,
|
|
2589
2589
|
onRefreshHistory: t,
|
|
2590
2590
|
onToggleType: te
|
|
2591
2591
|
}, null, 8, ["record", "sku", "bills", "unit-cost-history", "cost-mechanism", "type-filter", "debug"])) : Q("", !0)
|
|
2592
2592
|
], 64))), 128))
|
|
2593
|
-
])) : (p(), E("div",
|
|
2593
|
+
])) : (p(), E("div", ka, [
|
|
2594
2594
|
b(O),
|
|
2595
2595
|
e("div", null, [
|
|
2596
2596
|
e("img", {
|
|
2597
|
-
src: o(
|
|
2597
|
+
src: o(io),
|
|
2598
2598
|
alt: "List is empty"
|
|
2599
|
-
}, null, 8,
|
|
2599
|
+
}, null, 8, ba)
|
|
2600
2600
|
]),
|
|
2601
|
-
e("div",
|
|
2602
|
-
e("div",
|
|
2601
|
+
e("div", ha, r(o(i)("inventory.stock.history.noRecords")), 1),
|
|
2602
|
+
e("div", ga, r(o(i)("inventory.stock.history.changeDateRange")), 1),
|
|
2603
2603
|
b(O),
|
|
2604
2604
|
b(O)
|
|
2605
2605
|
]))
|
|
@@ -2610,7 +2610,7 @@ const _s = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ks = {
|
|
|
2610
2610
|
}, 8, ["modelValue"]);
|
|
2611
2611
|
};
|
|
2612
2612
|
}
|
|
2613
|
-
}),
|
|
2613
|
+
}), Sa = /* @__PURE__ */ ye({
|
|
2614
2614
|
__name: "HrmPermissionGuard",
|
|
2615
2615
|
props: {
|
|
2616
2616
|
permission: { default: void 0 },
|
|
@@ -2619,17 +2619,17 @@ const _s = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ks = {
|
|
|
2619
2619
|
},
|
|
2620
2620
|
setup(j) {
|
|
2621
2621
|
const f = j, h = N(() => {
|
|
2622
|
-
const
|
|
2623
|
-
return f.permission &&
|
|
2622
|
+
const S = [];
|
|
2623
|
+
return f.permission && S.push(f.permission), f.permissions && S.push(...f.permissions), S;
|
|
2624
2624
|
});
|
|
2625
2625
|
Vt(() => {
|
|
2626
2626
|
});
|
|
2627
2627
|
const { hasPermission: v } = $t(h, () => f.mode);
|
|
2628
|
-
return (
|
|
2628
|
+
return (S, A) => o(v) ? at(S.$slots, "default", { key: 0 }) : at(S.$slots, "fallback", { key: 1 });
|
|
2629
2629
|
}
|
|
2630
2630
|
});
|
|
2631
|
-
function
|
|
2632
|
-
const f =
|
|
2631
|
+
function wa(j) {
|
|
2632
|
+
const f = mo(), h = Ce(), v = z(!1), S = z(null), A = z(null);
|
|
2633
2633
|
let u = null, i = !1, _ = !1;
|
|
2634
2634
|
function L() {
|
|
2635
2635
|
if (_) return;
|
|
@@ -2652,7 +2652,7 @@ function $a(j) {
|
|
|
2652
2652
|
async function D(d) {
|
|
2653
2653
|
var C, a, x;
|
|
2654
2654
|
if (!(!_ || !d)) {
|
|
2655
|
-
if (
|
|
2655
|
+
if (S.value = d, d.completedAt && (A.value = d.completedAt), d.message === "processing" || !d.completedAt && !d.message) {
|
|
2656
2656
|
i = !0, v.value = !0;
|
|
2657
2657
|
return;
|
|
2658
2658
|
}
|
|
@@ -2674,25 +2674,25 @@ function $a(j) {
|
|
|
2674
2674
|
}
|
|
2675
2675
|
}
|
|
2676
2676
|
function k() {
|
|
2677
|
-
u && (u(), u = null), _ = !1, i = !1, v.value = !1,
|
|
2677
|
+
u && (u(), u = null), _ = !1, i = !1, v.value = !1, S.value = null;
|
|
2678
2678
|
}
|
|
2679
2679
|
return Dt(() => {
|
|
2680
2680
|
k();
|
|
2681
2681
|
}), {
|
|
2682
2682
|
refreshing: v,
|
|
2683
|
-
refreshStatus:
|
|
2684
|
-
lastCompletedAt:
|
|
2683
|
+
refreshStatus: S,
|
|
2684
|
+
lastCompletedAt: A,
|
|
2685
2685
|
startListening: L,
|
|
2686
2686
|
stopListening: k
|
|
2687
2687
|
};
|
|
2688
2688
|
}
|
|
2689
|
-
const
|
|
2689
|
+
const $a = {
|
|
2690
2690
|
key: 0,
|
|
2691
2691
|
class: "flex items-center gap-1"
|
|
2692
|
-
},
|
|
2692
|
+
}, Aa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Fa = { class: "flex flex-col gap-8" }, ja = { class: "flex flex-col" }, Ca = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ba = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, ul = /* @__PURE__ */ ye({
|
|
2693
2693
|
__name: "StockView",
|
|
2694
2694
|
setup(j) {
|
|
2695
|
-
const { t: f } = _e(), h = Le(), v = Ce(),
|
|
2695
|
+
const { t: f } = _e(), h = Le(), v = Ce(), S = ze(), A = At(), u = Be(), i = ht(), _ = fo(), { columnDefs: L } = go(), D = et(), { hasPermission: k } = $t(
|
|
2696
2696
|
N(() => [
|
|
2697
2697
|
{
|
|
2698
2698
|
action: Ee.Action.manage,
|
|
@@ -2708,7 +2708,7 @@ const Aa = {
|
|
|
2708
2708
|
v.watchLocation(J);
|
|
2709
2709
|
const x = N(
|
|
2710
2710
|
() => new Set(_.getAvailableItems(_.businessSubsidiaryId))
|
|
2711
|
-
), l = z(!1), t = z(!1), { refreshing: n, lastCompletedAt: c, startListening: s, stopListening: T } =
|
|
2711
|
+
), l = z(!1), t = z(!1), { refreshing: n, lastCompletedAt: c, startListening: s, stopListening: T } = wa({
|
|
2712
2712
|
onCompleted: async () => {
|
|
2713
2713
|
await J(), t.value = !1, a.open({
|
|
2714
2714
|
title: "Balance refreshed",
|
|
@@ -2726,12 +2726,12 @@ const Aa = {
|
|
|
2726
2726
|
}), H = N(() => n.value || t.value);
|
|
2727
2727
|
async function V() {
|
|
2728
2728
|
s();
|
|
2729
|
-
const M = f("inventory.stock.stock_balance.refreshBalanceDescription"),
|
|
2729
|
+
const M = f("inventory.stock.stock_balance.refreshBalanceDescription"), P = c.value ? `${M}
|
|
2730
2730
|
|
|
2731
2731
|
Last refreshed: ${new Date(c.value).toLocaleString()}` : M;
|
|
2732
2732
|
C.open({
|
|
2733
2733
|
title: f("inventory.stock.stock_balance.refreshBalance"),
|
|
2734
|
-
message:
|
|
2734
|
+
message: P,
|
|
2735
2735
|
closeButton: !0,
|
|
2736
2736
|
primaryActions: {
|
|
2737
2737
|
text: f("common.confirm"),
|
|
@@ -2768,7 +2768,7 @@ Last refreshed: ${new Date(c.value).toLocaleString()}` : M;
|
|
|
2768
2768
|
if (v._currentLocation) {
|
|
2769
2769
|
l.value = !0;
|
|
2770
2770
|
try {
|
|
2771
|
-
await
|
|
2771
|
+
await S.readStockBalance(), await i.readStockEstimateBalance();
|
|
2772
2772
|
} catch (M) {
|
|
2773
2773
|
a.open({
|
|
2774
2774
|
title: f("inventory.stock.error.title"),
|
|
@@ -2799,36 +2799,36 @@ Last refreshed: ${new Date(c.value).toLocaleString()}` : M;
|
|
|
2799
2799
|
]
|
|
2800
2800
|
}), Y = N(() => {
|
|
2801
2801
|
var te, le, re;
|
|
2802
|
-
const M = W.value ?
|
|
2803
|
-
for (const
|
|
2802
|
+
const M = W.value ? vo.build(W.value) : null, P = [];
|
|
2803
|
+
for (const F of h.skus) {
|
|
2804
2804
|
let m = !0;
|
|
2805
|
-
if (_.isEnabled && oe.value && x.value && m && (m = x.value.has(
|
|
2805
|
+
if (_.isEnabled && oe.value && x.value && m && (m = x.value.has(F._id)), M && m && (m = po(
|
|
2806
2806
|
{
|
|
2807
|
-
status:
|
|
2807
|
+
status: F.isInactive ? "Inactive" : "Active"
|
|
2808
2808
|
},
|
|
2809
2809
|
M
|
|
2810
2810
|
)), m) {
|
|
2811
|
-
const
|
|
2812
|
-
let y = (le = (te =
|
|
2813
|
-
(X) => X.id ===
|
|
2811
|
+
const w = F.trackingMeasurement;
|
|
2812
|
+
let y = (le = (te = S.stockBalance.skus) == null ? void 0 : te.find(
|
|
2813
|
+
(X) => X.id === F._id
|
|
2814
2814
|
)) == null ? void 0 : le.balance, B = i.inventoryForecast.skus.find(
|
|
2815
|
-
(X) => X.id ===
|
|
2815
|
+
(X) => X.id === F._id
|
|
2816
2816
|
);
|
|
2817
2817
|
const O = {
|
|
2818
|
-
...
|
|
2818
|
+
...F,
|
|
2819
2819
|
balance: y ?? {
|
|
2820
2820
|
amount: 0,
|
|
2821
2821
|
precision: 0
|
|
2822
2822
|
},
|
|
2823
2823
|
operator: B == null ? void 0 : B.operator,
|
|
2824
2824
|
day: (B == null ? void 0 : B.depletionDays) ?? void 0,
|
|
2825
|
-
trackingUnitAbbrev:
|
|
2825
|
+
trackingUnitAbbrev: w ? ((re = F.unit.measurements.find((X) => X.id === w)) == null ? void 0 : re.abbrev) ?? "" : F.unit.abbrev
|
|
2826
2826
|
};
|
|
2827
|
-
|
|
2827
|
+
P.push(O);
|
|
2828
2828
|
}
|
|
2829
2829
|
}
|
|
2830
|
-
return
|
|
2831
|
-
}), Z = z(""), oe = z(!0), { breakpoints: ce } =
|
|
2830
|
+
return P;
|
|
2831
|
+
}), Z = z(""), oe = z(!0), { breakpoints: ce } = qt(), pe = N(() => ce.value.xs || ce.value.sm), ke = N(() => pe.value ? 10 : 20), be = Mt(), $ = N(() => {
|
|
2832
2832
|
const M = [
|
|
2833
2833
|
{
|
|
2834
2834
|
label: f("inventory.stock.stock_balance.refreshBalance"),
|
|
@@ -2860,20 +2860,20 @@ Last refreshed: ${new Date(c.value).toLocaleString()}` : M;
|
|
|
2860
2860
|
case "refresh":
|
|
2861
2861
|
return J();
|
|
2862
2862
|
case "export":
|
|
2863
|
-
return
|
|
2863
|
+
return Ot(Y.value);
|
|
2864
2864
|
case "stockAdjustment":
|
|
2865
2865
|
return G();
|
|
2866
2866
|
}
|
|
2867
2867
|
}
|
|
2868
|
-
return (M,
|
|
2869
|
-
const te =
|
|
2868
|
+
return (M, P) => {
|
|
2869
|
+
const te = R("FmSwitch"), le = R("FmTable");
|
|
2870
2870
|
return p(), ee(Tt, {
|
|
2871
2871
|
title: o(f)("inventory.stock.title"),
|
|
2872
|
-
actions:
|
|
2872
|
+
actions: $.value,
|
|
2873
2873
|
"onClick:action": q
|
|
2874
2874
|
}, {
|
|
2875
2875
|
default: U(() => {
|
|
2876
|
-
var re,
|
|
2876
|
+
var re, F, m, w;
|
|
2877
2877
|
return [
|
|
2878
2878
|
e("div", {
|
|
2879
2879
|
class: he([
|
|
@@ -2884,26 +2884,26 @@ Last refreshed: ${new Date(c.value).toLocaleString()}` : M;
|
|
|
2884
2884
|
}
|
|
2885
2885
|
])
|
|
2886
2886
|
}, [
|
|
2887
|
-
b(
|
|
2887
|
+
b(co, {
|
|
2888
2888
|
searchable: "",
|
|
2889
2889
|
"change-location": "",
|
|
2890
2890
|
search: Z.value,
|
|
2891
|
-
"onUpdate:search":
|
|
2891
|
+
"onUpdate:search": P[1] || (P[1] = (y) => Z.value = y),
|
|
2892
2892
|
"hide-filter-options": !0,
|
|
2893
2893
|
filterable: "",
|
|
2894
2894
|
"filter-attributes": I.value,
|
|
2895
2895
|
filter: W.value,
|
|
2896
|
-
"onUpdate:filter":
|
|
2896
|
+
"onUpdate:filter": P[2] || (P[2] = (y) => W.value = y)
|
|
2897
2897
|
}, {
|
|
2898
2898
|
default: U(() => [
|
|
2899
|
-
o(_).isEnabled ? (p(), E("div",
|
|
2900
|
-
e("span",
|
|
2901
|
-
b(
|
|
2899
|
+
o(_).isEnabled ? (p(), E("div", $a, [
|
|
2900
|
+
e("span", Aa, r(o(f)("inventory.integration.netsuite.subsidiaryHierarchy.filtering")), 1),
|
|
2901
|
+
b(Lt),
|
|
2902
2902
|
b(Ge, null, {
|
|
2903
2903
|
default: U(() => [
|
|
2904
2904
|
b(te, {
|
|
2905
2905
|
modelValue: oe.value,
|
|
2906
|
-
"onUpdate:modelValue":
|
|
2906
|
+
"onUpdate:modelValue": P[0] || (P[0] = (y) => oe.value = y)
|
|
2907
2907
|
}, null, 8, ["modelValue"])
|
|
2908
2908
|
]),
|
|
2909
2909
|
_: 1
|
|
@@ -2919,26 +2919,26 @@ Last refreshed: ${new Date(c.value).toLocaleString()}` : M;
|
|
|
2919
2919
|
"search-value": Z.value,
|
|
2920
2920
|
loading: l.value || o(n) || !o(v)._currentLocation,
|
|
2921
2921
|
key: (re = o(v)._currentLocation) == null ? void 0 : re.dbName,
|
|
2922
|
-
onRowClick:
|
|
2922
|
+
onRowClick: P[3] || (P[3] = (y) => o(A).showSkuHistory(y.original)),
|
|
2923
2923
|
"page-size": ke.value
|
|
2924
2924
|
}, {
|
|
2925
2925
|
"list-row": U((y) => [
|
|
2926
|
-
b(
|
|
2926
|
+
b(uo, {
|
|
2927
2927
|
row: y,
|
|
2928
|
-
onRowClick: o(
|
|
2928
|
+
onRowClick: o(A).showSkuHistory
|
|
2929
2929
|
}, {
|
|
2930
2930
|
default: U((B) => {
|
|
2931
2931
|
var O, X, se, ne, ie, de, Se, Te, Ae, He;
|
|
2932
2932
|
return [
|
|
2933
|
-
e("div",
|
|
2934
|
-
e("div",
|
|
2935
|
-
e("div",
|
|
2933
|
+
e("div", Fa, [
|
|
2934
|
+
e("div", ja, [
|
|
2935
|
+
e("div", Ca, [
|
|
2936
2936
|
b(o(ft), {
|
|
2937
2937
|
render: (se = (X = (O = B.code) == null ? void 0 : O.column) == null ? void 0 : X.columnDef) == null ? void 0 : se.cell,
|
|
2938
2938
|
props: (ie = (ne = B.code) == null ? void 0 : ne.getContext) == null ? void 0 : ie.call(ne)
|
|
2939
2939
|
}, null, 8, ["render", "props"])
|
|
2940
2940
|
]),
|
|
2941
|
-
e("div",
|
|
2941
|
+
e("div", Ba, [
|
|
2942
2942
|
b(o(ft), {
|
|
2943
2943
|
render: (Te = (Se = (de = B.name) == null ? void 0 : de.column) == null ? void 0 : Se.columnDef) == null ? void 0 : Te.cell,
|
|
2944
2944
|
props: (He = (Ae = B.name) == null ? void 0 : Ae.getContext) == null ? void 0 : He.call(Ae)
|
|
@@ -2969,23 +2969,23 @@ Last refreshed: ${new Date(c.value).toLocaleString()}` : M;
|
|
|
2969
2969
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
2970
2970
|
], 2),
|
|
2971
2971
|
(p(), ee(It, { to: "body" }, [
|
|
2972
|
-
(
|
|
2973
|
-
(m = o(
|
|
2974
|
-
(
|
|
2975
|
-
onSubmitted:
|
|
2972
|
+
(F = o(A).stockHistoryProps) != null && F.sku ? (p(), ee(xa, lt(We({ key: 0 }, o(A).stockHistoryProps)), null, 16)) : Q("", !0),
|
|
2973
|
+
(m = o(A).convertSkuDialogProps) != null && m.sku ? (p(), ee(Ho, lt(We({ key: 1 }, o(A).convertSkuDialogProps)), null, 16)) : Q("", !0),
|
|
2974
|
+
(w = o(A).adjustSkuDialogProps) != null && w.stock ? (p(), ee(Ko, We({ key: 2 }, o(A).adjustSkuDialogProps, {
|
|
2975
|
+
onSubmitted: P[4] || (P[4] = (y) => J())
|
|
2976
2976
|
}), null, 16)) : Q("", !0),
|
|
2977
|
-
b(
|
|
2977
|
+
b(Sa, {
|
|
2978
2978
|
permission: {
|
|
2979
2979
|
action: o(Ee).Action.manage,
|
|
2980
2980
|
subject: o(Ee).Subject.Business.inventory_stockAdjustment
|
|
2981
2981
|
}
|
|
2982
2982
|
}, {
|
|
2983
2983
|
default: U(() => [
|
|
2984
|
-
g.value ? (p(), ee(
|
|
2984
|
+
g.value ? (p(), ee(rn, {
|
|
2985
2985
|
key: 0,
|
|
2986
2986
|
show: g.value,
|
|
2987
|
-
"onUpdate:show":
|
|
2988
|
-
onSubmitted:
|
|
2987
|
+
"onUpdate:show": P[5] || (P[5] = (y) => g.value = y),
|
|
2988
|
+
onSubmitted: P[6] || (P[6] = (y) => J())
|
|
2989
2989
|
}, null, 8, ["show"])) : Q("", !0)
|
|
2990
2990
|
]),
|
|
2991
2991
|
_: 1
|
|
@@ -2999,5 +2999,5 @@ Last refreshed: ${new Date(c.value).toLocaleString()}` : M;
|
|
|
2999
2999
|
}
|
|
3000
3000
|
});
|
|
3001
3001
|
export {
|
|
3002
|
-
|
|
3002
|
+
ul as default
|
|
3003
3003
|
};
|