@feedmepos/mf-inventory-portal 1.8.0-dev.1 → 1.8.0-dev.2
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-DVHgBTHP.js +1499 -0
- package/dist/{ApprovalView-C8_ax05b.js → ApprovalView-RaXuWWSu.js} +9 -9
- package/dist/{BindingsDialog-t0ZY9eh5.js → BindingsDialog-DomvXijP.js} +2 -2
- package/dist/{BindingsPicker-C0Qblmml.js → BindingsPicker-DGnzxEs7.js} +2 -2
- package/dist/{BindingsTable-CsqUBbRA.js → BindingsTable-DfG9kWrv.js} +4 -4
- package/dist/{BulkReceiveRequestView-DAG-TMox.js → BulkReceiveRequestView-DxHWrfbi.js} +21 -22
- package/dist/ChangeLocationComponent.vue_vue_type_script_setup_true_lang-CVekIoiN.js +151 -0
- package/dist/{ClosingDraftView-CdKp4Ny6.js → ClosingDraftView-C3n66bbh.js} +20 -20
- package/dist/{ClosingHistoryView-Blyq9-BS.js → ClosingHistoryView-kdpYGy1Y.js} +5 -5
- package/dist/{ClosingTemplateView-C326DL4q.js → ClosingTemplateView-DwGloYxn.js} +302 -291
- package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-CXjubRbj.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-9eY_r8LF.js} +1 -1
- package/dist/{DefaultView-CsIMmQAY.js → DefaultView-JC_e4xgC.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-eTrMvJzA.js → DeliveryOrderPrintPreview-BBCvI67S.js} +2 -2
- package/dist/DeprecateSoonWarningDialog.vue_vue_type_script_setup_true_lang-5Cc08Svt.js +58 -0
- package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-B7nBbxMo.js → EmailDialog.vue_vue_type_script_setup_true_lang-H4FWc9ga.js} +1663 -1668
- package/dist/FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-C1C8aDA6.js +61 -0
- package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-CI2KTzDs.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-Q8Mptiv3.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Db_FiSRe.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CE1_yyHe.js} +2 -2
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CGJi3f86.js +120 -0
- package/dist/{FmMultiselectDialog-CYUxtxnS.js → FmMultiselectDialog-DCaRlBIy.js} +2 -2
- package/dist/{FmMultiselectDialog-BAw-gp5K.js → FmMultiselectDialog-yVPY5aBV.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DOkV11NN.js → FmUnitInput.vue_vue_type_script_setup_true_lang-ClaLVtpK.js} +6 -6
- package/dist/{ImportView-BmotFC-3.js → ImportView-DQrVMzxN.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DVCCpvS4.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-7lT5UZc8.js} +1 -1
- package/dist/IngredientGroupView-BMUnEaY7.js +1000 -0
- package/dist/{IngredientsView-CZ6E7cXf.js → IngredientsView-DPj9lBTK.js} +303 -296
- package/dist/{IntegrationExplorerView-B15ND4Fg.js → IntegrationExplorerView-CO2wpUR_.js} +4 -4
- package/dist/{IntegrationView-hkNhsqx2.js → IntegrationView-DIeZoey0.js} +2403 -2408
- package/dist/{InventoryBindingForm-SfuUF0_O.js → InventoryBindingForm-Cj4_Chue.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Zq81p_MF.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CaBOK7NC.js} +5 -5
- package/dist/{InventoryBindingSummary-DUcukkyJ.js → InventoryBindingSummary-yzGzd7jJ.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BmfROiLM.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DzzTPdyF.js} +1 -1
- package/dist/{ProductionRunDetailView-BwgRX-14.js → ProductionRunDetailView-Cw-ecaey.js} +4 -4
- package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-BbNXNhpr.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-BYyiiAWb.js} +7 -7
- package/dist/{ProductionRunView-CZU7LY9-.js → ProductionRunView-C11eseXQ.js} +3 -3
- package/dist/{PublishView-DS2FZ66p.js → PublishView-CPK9NeVF.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-CZa0MVAs.js → PurchaseOrderPrintPreview-DosqWQeN.js} +2 -2
- package/dist/{ReceiveRequestView-Bk5b3nVB.js → ReceiveRequestView-BxSkpK2t.js} +15 -16
- package/dist/{RecipeView-DvI6X-uN.js → RecipeView-oHDWsT0P.js} +19 -20
- package/dist/SettingsView-QlUNwFhM.js +983 -0
- package/dist/{StockView-Z9wGihT7.js → StockView-a8LbVZ_7.js} +324 -322
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DdZg9T4n.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-GdGJCuc0.js} +1 -1
- package/dist/{SupplierView-D8q6siZW.js → SupplierView-BKxKoi_0.js} +451 -447
- package/dist/{SurchargeView-Db_5YFoR.js → SurchargeView-Db4cwhZv.js} +7 -7
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-WOVs4Fr1.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-CpkF77Ow.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BtoP4XgE.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CCCj4WVF.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-Bljc4Vuy.js → TransferDetails.vue_vue_type_script_setup_true_lang-CFNPXqt5.js} +39 -40
- package/dist/{TransferTemplateView-DtsJzmUr.js → TransferTemplateView-CzwxOBMQ.js} +22 -23
- package/dist/{UnitCostHistoryView-BqDiQ4IE.js → UnitCostHistoryView-CqcyjCCd.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-BjSmg5LX.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-DO80_8SZ.js} +4 -4
- package/dist/{UnitView-CM695-VI.js → UnitView-BqdK1AM_.js} +8 -8
- package/dist/{WarehouseView-BdidU4p6.js → WarehouseView-COJM9IXM.js} +193 -189
- package/dist/{WastageTemplateView-DdhwdXT6.js → WastageTemplateView-DW3viTHN.js} +15 -15
- package/dist/api/feature-flags.d.ts +10 -0
- package/dist/api/license.d.ts +9 -0
- package/dist/{app-Cb5s4jMu.js → app-yvK__CBL.js} +143 -106
- package/dist/app.d.ts +36 -0
- package/dist/app.js +1 -1
- package/dist/{closing-template-DnqnpXxn.js → closing-template-DezidSM0.js} +1 -1
- package/dist/components/ChangeLocationComponent.vue.d.ts +21 -14
- package/dist/components/DeprecateSoonWarningDialog.vue.d.ts +22 -0
- package/dist/components/FeatureCapabilityBadge.vue.d.ts +25 -0
- package/dist/components/{PreviewBadge.vue.d.ts → FeatureCapabilityGate.vue.d.ts} +10 -7
- package/dist/components/{PremiumBadge.vue.d.ts → PlanTierBadge.vue.d.ts} +5 -13
- package/dist/components/PlanUpgradeDialog.vue.d.ts +30 -0
- package/dist/composable/useNavigationMenu.d.ts +2 -1
- package/dist/{date2-BPhD_1Of.js → date2-2XjepIqc.js} +1 -1
- package/dist/{dayjs.min-Zbd6-uVD.js → dayjs.min-CNp5DLBB.js} +1 -1
- package/dist/{decimal-Df6a50Ld.js → decimal-Z7oJdGk8.js} +2 -2
- package/dist/{defineDeepModel-Brbsikbi.js → defineDeepModel-CMxJn_H2.js} +1 -1
- package/dist/{duplicate-template-B9kuShaF.js → duplicate-template-BetV5oy_.js} +1 -1
- package/dist/{inventory-core-dart.default-DDRxXXnt.js → feature-CkWaZ-5K.js} +3046 -1837
- package/dist/feature-flags/core.d.ts +27 -0
- package/dist/feature-flags/core.spec.d.ts +1 -0
- package/dist/feature-flags/navigation-capabilities.d.ts +23 -0
- package/dist/feature-flags/navigation-capabilities.spec.d.ts +1 -0
- package/dist/feature-flags/plan-tier.d.ts +6 -0
- package/dist/feature-flags/plan-tier.spec.d.ts +1 -0
- package/dist/feature-flags/portal-feature-catalog.d.ts +24 -0
- package/dist/feature-flags/vue.d.ts +14 -0
- package/dist/{format-time-from-id-DmUjUcVj.js → format-time-from-id-DatSI9uD.js} +1 -1
- package/dist/{format-unit-display-CsQA0SQd.js → format-unit-display-DM5We5cx.js} +13 -13
- package/dist/id-to-date-Dxw2jKhy.js +67 -0
- package/dist/{import-export.helper-DCQ6oX9s.js → import-export.helper-BOmADwUw.js} +6 -6
- package/dist/{index-C-mazZwS.js → index-7fz5sGDO.js} +3 -3
- package/dist/{index-UmM6gHJ1.js → index-CIH9NCvs.js} +1 -1
- package/dist/{index-BXaIMGnI.js → index-ClYgfwW7.js} +1 -1
- package/dist/{lz-string-Bibw5D_6.js → lz-string-CCsc2X7t.js} +1 -1
- package/dist/{netsuite-Bev0OtQT.js → netsuite-COumFXC2.js} +2 -2
- package/dist/{number-y_W4pn_d.js → number-gSLvxNqA.js} +3 -3
- package/dist/portal-feature-catalog-yGIESKTc.js +246 -0
- package/dist/{predefined-templates-BHvUnTk_.js → predefined-templates-Bw9A9LNA.js} +1 -1
- package/dist/{purchase-order-template-DgOKEzhS.js → purchase-order-template-BaZjdGq8.js} +1 -1
- package/dist/{recalculationUtils-Dv__DzZh.js → recalculationUtils-t32wAurN.js} +1 -1
- package/dist/{row-action.enum-ncgDYAjP.js → row-action.enum-BDeudY4d.js} +2 -2
- package/dist/{rules-CZTBvenw.js → rules-C1btu0Md.js} +2 -2
- package/dist/{stock-CxCRZo_D.js → stock-B59sfN28.js} +1 -1
- package/dist/{stock-XINW8JOM.js → stock-BF86TMW0.js} +3 -3
- package/dist/stores/feature.d.ts +12 -0
- package/dist/{supplier-CkZdeMcl.js → supplier-DnbLJ_cS.js} +2 -2
- package/dist/{surcharge-FRSFqjGl.js → surcharge-C1uE3uQa.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-Cm1styDr.js → uom-rules-DjfyrFHJ.js} +1 -1
- package/dist/{use-ingredient-select-dialog-ntAqHX04.js → use-ingredient-select-dialog-7A7fWyEH.js} +2 -2
- package/dist/{use-inventory-binding-dialog-DVIJO8Cl.js → use-inventory-binding-dialog-Cc1tjTfV.js} +2 -2
- package/dist/{use-template-enabled-locations-CIZqw-Z8.js → use-template-enabled-locations-C-Hqqgzt.js} +2 -2
- package/dist/{use-transfer-locations-CM5vNttA.js → use-transfer-locations-CqsXvOI2.js} +2 -2
- package/dist/{useHrmPermission-CslLuBoP.js → useHrmPermission-BzwD3Ctc.js} +1 -1
- package/dist/useNavigationMenu-PrZg9HS7.js +352 -0
- package/dist/{useSseClient-CCV4mPzD.js → useSseClient-FCyLWq8k.js} +1 -1
- package/dist/views/integration/components/IntegrationCard.vue.d.ts +38 -0
- package/dist/views/settings/FeatureFlagView.vue.d.ts +2 -0
- package/dist/{vue-i18n-C5j4EQhi.js → vue-i18n-C34f-Tph.js} +434 -434
- package/dist/{xlsx.util-B50OvX4z.js → xlsx.util-X4amwe_k.js} +2 -2
- package/package.json +6 -6
- package/dist/App-BXgpGzGR.js +0 -1476
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-zcEv1Swg.js +0 -243
- package/dist/IngredientGroupView-qrR9ksEn.js +0 -985
- package/dist/PremiumBadge.vue_vue_type_script_setup_true_lang-3e3kDsbN.js +0 -93
- package/dist/PreviewBadge.vue_vue_type_script_setup_true_lang-DX2MJqL4.js +0 -29
- package/dist/SettingsView-sThYErMz.js +0 -698
- package/dist/feature-Ckn5ra3z.js +0 -1136
- package/dist/useNavigationMenu-CSinmNCY.js +0 -172
- /package/dist/components/{FmFeatureFlagDialog.vue.d.ts → DeprecateSoonPill.vue.d.ts} +0 -0
|
@@ -1,44 +1,43 @@
|
|
|
1
|
-
import { defineComponent as pe,
|
|
1
|
+
import { defineComponent as pe, createElementBlock as q, openBlock as j, createElementVNode as e, createVNode as y, toDisplayString as f, unref as s, ref as Y, h as be, computed as T, watch as Fe, resolveComponent as D, createBlock as ne, isRef as Pe, withCtx as M, Fragment as ue, renderList as ve, createCommentVNode as se, normalizeClass as He, reactive as _t, mergeModels as st, useModel as jt, onMounted as Xe, createTextVNode as me, normalizeStyle as kt, watchEffect as Vt, renderSlot as at, onUnmounted as Ct, Teleport as Bt, normalizeProps as rt, mergeProps as ze } from "vue";
|
|
2
2
|
import { u as Dt, _ as Mt } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
|
|
3
|
-
import { u as Se, c as Re, a as Ne, F as
|
|
4
|
-
import { u as Oe } from "./stock-
|
|
3
|
+
import { u as Se, c as Re, a as Ne, F as lt, t as It, E as ie, s as Ht, d as Tt, B as Et, w as oe, h as Ce, i as it, e as ut, L as ge, M as Be } from "./app-yvK__CBL.js";
|
|
4
|
+
import { u as Oe } from "./stock-BF86TMW0.js";
|
|
5
5
|
import { c as Ut } from "./component-BmLAdDiY.js";
|
|
6
|
-
import { _ as ht, o as Pt } from "./UnitDisplayControl.vue_vue_type_script_setup_true_lang-
|
|
7
|
-
import { _ as Ke, S as Ge, g as bt, a as Rt } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-
|
|
8
|
-
import {
|
|
9
|
-
import { useI18n as ye, useCoreStore as
|
|
10
|
-
import { u as gt, i as Te
|
|
11
|
-
import { useSnackbar as we, useDialog as Le, useProxiedModel as Ye, useBreakpoints as
|
|
12
|
-
import { defineStore as
|
|
13
|
-
import { F as
|
|
14
|
-
import { g as $e, a as he, e as
|
|
15
|
-
import { u as Ae } from "./stock-
|
|
16
|
-
import { c as Ue, A as
|
|
17
|
-
import { u as
|
|
18
|
-
import { a as St } from "./FmMultiselectDialog-
|
|
19
|
-
import { d as ke } from "./dayjs.min-
|
|
20
|
-
import { _ as
|
|
21
|
-
import { g as
|
|
22
|
-
import { b as
|
|
23
|
-
import { i as
|
|
24
|
-
import { _ as
|
|
25
|
-
import { F as _e } from "./
|
|
26
|
-
import { u as
|
|
27
|
-
import {
|
|
28
|
-
import { _ as lo
|
|
29
|
-
import {
|
|
30
|
-
import { u as uo } from "./
|
|
31
|
-
import {
|
|
32
|
-
import { P as mo, J as fo } from "./app-C39bYJmq.js";
|
|
6
|
+
import { _ as ht, o as Pt } from "./UnitDisplayControl.vue_vue_type_script_setup_true_lang-DO80_8SZ.js";
|
|
7
|
+
import { _ as Ke, S as Ge, g as bt, a as Rt } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-GdGJCuc0.js";
|
|
8
|
+
import { a as qe } from "./FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-C1C8aDA6.js";
|
|
9
|
+
import { useI18n as ye, useCoreStore as Je } from "@feedmepos/mf-common";
|
|
10
|
+
import { u as gt, i as Te } from "./id-to-date-Dxw2jKhy.js";
|
|
11
|
+
import { useSnackbar as we, useDialog as Le, useProxiedModel as Ye, useBreakpoints as Nt } from "@feedmepos/ui-library";
|
|
12
|
+
import { defineStore as Ot } from "pinia";
|
|
13
|
+
import { F as Qe } from "./FmAdminBadge-DlplQOHb.js";
|
|
14
|
+
import { g as $e, a as he, e as Lt, t as Ee, c as xe, f as Yt, h as ct, i as xt, j as Ze, d as Me, k as zt } from "./number-gSLvxNqA.js";
|
|
15
|
+
import { u as Ae } from "./stock-B59sfN28.js";
|
|
16
|
+
import { c as Ue, A as Gt, M as Wt, R as Kt } from "./rules-C1btu0Md.js";
|
|
17
|
+
import { u as qt } from "./use-inventory-binding-dialog-Cc1tjTfV.js";
|
|
18
|
+
import { a as St } from "./FmMultiselectDialog-DCaRlBIy.js";
|
|
19
|
+
import { d as ke } from "./dayjs.min-CNp5DLBB.js";
|
|
20
|
+
import { _ as Xt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DzzTPdyF.js";
|
|
21
|
+
import { g as Jt } from "./decimal-Z7oJdGk8.js";
|
|
22
|
+
import { b as Qt, d as Zt, f as wt, t as dt, a as mt, p as eo, n as to, c as oo } from "./date2-2XjepIqc.js";
|
|
23
|
+
import { i as no } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-Q8Mptiv3.js";
|
|
24
|
+
import { _ as so } from "./empty-placeholder-B0QU467o.js";
|
|
25
|
+
import { F as _e, u as ao } from "./feature-CkWaZ-5K.js";
|
|
26
|
+
import { u as At } from "./useHrmPermission-BzwD3Ctc.js";
|
|
27
|
+
import { _ as ro, F as ft } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js";
|
|
28
|
+
import { _ as lo } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CGJi3f86.js";
|
|
29
|
+
import { u as io } from "./useSseClient-FCyLWq8k.js";
|
|
30
|
+
import { u as uo } from "./netsuite-COumFXC2.js";
|
|
31
|
+
import { P as co, J as mo } from "./app-C39bYJmq.js";
|
|
33
32
|
var Ie = /* @__PURE__ */ ((A) => (A.History = "History", A.Convert = "Convert", A.Adjust = "Adjust", A))(Ie || {});
|
|
34
|
-
const
|
|
33
|
+
const fo = [
|
|
35
34
|
{
|
|
36
35
|
translationKey: "inventory.stock.action.history",
|
|
37
36
|
color: "text-neutral-700",
|
|
38
37
|
value: "History"
|
|
39
38
|
/* History */
|
|
40
39
|
}
|
|
41
|
-
],
|
|
40
|
+
], vo = [
|
|
42
41
|
{
|
|
43
42
|
translationKey: "inventory.stock.action.history",
|
|
44
43
|
color: "text-neutral-700",
|
|
@@ -57,24 +56,25 @@ const vo = [
|
|
|
57
56
|
value: "Adjust"
|
|
58
57
|
/* Adjust */
|
|
59
58
|
}
|
|
60
|
-
], yo = { class: "whitespace-nowrap" }, _o = /* @__PURE__ */ pe({
|
|
59
|
+
], po = { class: "flex items-center gap-8" }, yo = { class: "whitespace-nowrap" }, _o = /* @__PURE__ */ pe({
|
|
61
60
|
__name: "StockHeaderPreview",
|
|
62
61
|
setup(A) {
|
|
63
62
|
const { t: c } = ye();
|
|
64
|
-
return (k,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
return (k, _) => (j(), q("div", po, [
|
|
64
|
+
e("div", yo, f(s(c)("inventory.stock.prediction.daysRemaining")), 1),
|
|
65
|
+
y(qe, {
|
|
66
|
+
tier: "standard",
|
|
67
|
+
category: "beta"
|
|
68
|
+
})
|
|
69
|
+
]));
|
|
70
70
|
}
|
|
71
|
-
}), Ft =
|
|
72
|
-
const A = Y(!1), c = Se(), k = Oe(),
|
|
71
|
+
}), Ft = Ot("stockActions", () => {
|
|
72
|
+
const A = Y(!1), c = Se(), k = Oe(), _ = gt(), w = we(), V = Le(), { t: d } = ye();
|
|
73
73
|
async function r() {
|
|
74
74
|
if (c._currentLocation) {
|
|
75
75
|
A.value = !0;
|
|
76
76
|
try {
|
|
77
|
-
await k.readStockBalance(), await k.readProductBalance(), await
|
|
77
|
+
await k.readStockBalance(), await k.readProductBalance(), await _.readStockEstimateBalance();
|
|
78
78
|
} catch {
|
|
79
79
|
w.open({
|
|
80
80
|
title: d("inventory.stock.error.title"),
|
|
@@ -159,24 +159,24 @@ const vo = [
|
|
|
159
159
|
});
|
|
160
160
|
function ko() {
|
|
161
161
|
var V;
|
|
162
|
-
const A = Se(), c = Ft(), k =
|
|
162
|
+
const A = Se(), c = Ft(), k = Je(), { t: _ } = ye();
|
|
163
163
|
return {
|
|
164
164
|
columnDefs: [
|
|
165
165
|
{
|
|
166
166
|
accessorKey: "code",
|
|
167
|
-
header: () =>
|
|
167
|
+
header: () => _("inventory.stock.code"),
|
|
168
168
|
enableSorting: !0,
|
|
169
169
|
size: 300
|
|
170
170
|
},
|
|
171
171
|
{
|
|
172
172
|
accessorKey: "name",
|
|
173
|
-
header: () =>
|
|
173
|
+
header: () => _("inventory.stock.product"),
|
|
174
174
|
enableSorting: !0,
|
|
175
175
|
size: "auto"
|
|
176
176
|
},
|
|
177
177
|
{
|
|
178
178
|
id: "UOM",
|
|
179
|
-
header: () =>
|
|
179
|
+
header: () => _("inventory.stock.balance"),
|
|
180
180
|
cell(d) {
|
|
181
181
|
const r = d.row.original, b = {
|
|
182
182
|
unit: r.unit,
|
|
@@ -191,7 +191,7 @@ function ko() {
|
|
|
191
191
|
...(V = k.sessionUser.value) != null && V.role.isAdmin ? [
|
|
192
192
|
{
|
|
193
193
|
accessorKey: "isInactive",
|
|
194
|
-
header: () => be(
|
|
194
|
+
header: () => be(Qe, {}, () => `${_("inventory.ingredient.status.title")}`),
|
|
195
195
|
cell(d) {
|
|
196
196
|
const r = d.row.original.isInactive;
|
|
197
197
|
return be(
|
|
@@ -202,7 +202,7 @@ function ko() {
|
|
|
202
202
|
r ? "bg-red-100 text-red-700" : "bg-green-100 text-green-700"
|
|
203
203
|
].join(" ")
|
|
204
204
|
},
|
|
205
|
-
|
|
205
|
+
_(r ? "inventory.ingredient.status.inactive" : "inventory.ingredient.status.active")
|
|
206
206
|
);
|
|
207
207
|
},
|
|
208
208
|
enableSorting: !0
|
|
@@ -235,7 +235,7 @@ function ko() {
|
|
|
235
235
|
cell(d) {
|
|
236
236
|
var r;
|
|
237
237
|
return Ut(
|
|
238
|
-
((r = A._currentLocation) == null ? void 0 : r.type) === "restaurant" ?
|
|
238
|
+
((r = A._currentLocation) == null ? void 0 : r.type) === "restaurant" ? fo : vo,
|
|
239
239
|
(b) => c.onActionMenu(b, d.row.original)
|
|
240
240
|
);
|
|
241
241
|
},
|
|
@@ -295,11 +295,11 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
|
|
|
295
295
|
},
|
|
296
296
|
emits: ["update:show", "submitted"],
|
|
297
297
|
setup(A, { expose: c, emit: k }) {
|
|
298
|
-
const
|
|
298
|
+
const _ = A, w = k, V = qt(), d = Ne(), r = Ae(), b = we(), { t: R } = ye(), C = Y(0), l = Y(null), a = T(() => d.skus), B = T(
|
|
299
299
|
() => {
|
|
300
300
|
var x, F;
|
|
301
|
-
return (((F = (x =
|
|
302
|
-
(G) => G.type ===
|
|
301
|
+
return (((F = (x = _.sku) == null ? void 0 : x.convert) == null ? void 0 : F.inventoryBindings) ?? []).filter(
|
|
302
|
+
(G) => G.type === lt.enum.SKU
|
|
303
303
|
);
|
|
304
304
|
}
|
|
305
305
|
), v = T({
|
|
@@ -307,57 +307,57 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
|
|
|
307
307
|
return !!l.value;
|
|
308
308
|
},
|
|
309
309
|
set(x) {
|
|
310
|
-
x ? l.value = Re(B.value) : (l.value = null, C.value = Math.min(C.value,
|
|
310
|
+
x ? l.value = Re(B.value) : (l.value = null, C.value = Math.min(C.value, _.maxCount ?? 0));
|
|
311
311
|
}
|
|
312
312
|
}), g = Y(!1);
|
|
313
|
-
Fe([() =>
|
|
313
|
+
Fe([() => _.show], ([x]) => {
|
|
314
314
|
x && (C.value = 0);
|
|
315
315
|
});
|
|
316
316
|
function o() {
|
|
317
|
-
L(
|
|
317
|
+
L(_.sku, Ee(C.value), l.value);
|
|
318
318
|
}
|
|
319
319
|
function t(x) {
|
|
320
320
|
if (l.value)
|
|
321
321
|
return !0;
|
|
322
|
-
const F = vt(x).isInteger().max(
|
|
322
|
+
const F = vt(x).isInteger().max(_.maxCount ?? 0).error ?? "";
|
|
323
323
|
return F || !0;
|
|
324
324
|
}
|
|
325
325
|
function n(x) {
|
|
326
326
|
var I;
|
|
327
|
-
const F = (I =
|
|
327
|
+
const F = (I = _.sku.convert) != null && I.measurement ? _.sku.unit.measurements.find((u) => {
|
|
328
328
|
var h;
|
|
329
|
-
return u.id === ((h =
|
|
330
|
-
}) ?? null : null, G = $e(
|
|
329
|
+
return u.id === ((h = _.sku.convert) == null ? void 0 : h.measurement);
|
|
330
|
+
}) ?? null : null, G = $e(_.sku.unit, F), H = Yt(+x);
|
|
331
331
|
return vt(H).isInteger().max(G).error ? "Precision cannot be more than " + G : !0;
|
|
332
332
|
}
|
|
333
333
|
const $ = T(
|
|
334
334
|
() => {
|
|
335
335
|
var x, F;
|
|
336
|
-
return (x =
|
|
336
|
+
return (x = _.sku.convert) != null && x.measurement ? (F = _.sku.unit.measurements.find((G) => {
|
|
337
337
|
var H;
|
|
338
|
-
return G.id === ((H =
|
|
339
|
-
})) == null ? void 0 : F.abbrev :
|
|
338
|
+
return G.id === ((H = _.sku.convert) == null ? void 0 : H.measurement);
|
|
339
|
+
})) == null ? void 0 : F.abbrev : _.sku.unit.abbrev;
|
|
340
340
|
}
|
|
341
341
|
), E = T(() => {
|
|
342
342
|
var H, J;
|
|
343
343
|
const F = It({
|
|
344
|
-
bindings: ((H =
|
|
344
|
+
bindings: ((H = _.sku.convert) == null ? void 0 : H.inventoryBindings) ?? [],
|
|
345
345
|
skus: d.skus,
|
|
346
346
|
skuGroups: d.skuGroups,
|
|
347
347
|
recipes: d.recipes
|
|
348
348
|
}).inventoryBindings.filter((I) => "success" in I && I.success).map((I) => I).map((I) => I.binding);
|
|
349
349
|
return (J = l.value ?? F) == null ? void 0 : J.map((I) => {
|
|
350
|
-
var ee, ae, Q, W,
|
|
351
|
-
const u = d.skus.find((le) => le._id === I.id), h = ((ee = I.measurement) == null ? void 0 : ee.abbrev) ?? ((ae = u == null ? void 0 : u.unit) == null ? void 0 : ae.abbrev), p = (Q =
|
|
350
|
+
var ee, ae, Q, W, te;
|
|
351
|
+
const u = d.skus.find((le) => le._id === I.id), h = ((ee = I.measurement) == null ? void 0 : ee.abbrev) ?? ((ae = u == null ? void 0 : u.unit) == null ? void 0 : ae.abbrev), p = (Q = _.sku.convert) != null && Q.measurement ? _.sku.unit.measurements.find((le) => {
|
|
352
352
|
var ce;
|
|
353
|
-
return le.id === ((ce =
|
|
354
|
-
}) ?? null : null, m = $e(
|
|
355
|
-
|
|
353
|
+
return le.id === ((ce = _.sku.convert) == null ? void 0 : ce.measurement);
|
|
354
|
+
}) ?? null : null, m = $e(_.sku.unit, p), i = n(`${C.value}`) === !0 ? he(
|
|
355
|
+
Lt(
|
|
356
356
|
I.amount,
|
|
357
357
|
Ee(+C.value, m)
|
|
358
358
|
),
|
|
359
359
|
!1
|
|
360
|
-
) : "0", S = (
|
|
360
|
+
) : "0", S = (te = (W = l.value) == null ? void 0 : W.find((le) => le.id === (u == null ? void 0 : u._id))) == null ? void 0 : te.amount, P = S ? he(S, !1) : null;
|
|
361
361
|
return {
|
|
362
362
|
sku: u,
|
|
363
363
|
convertAmount: P ?? i,
|
|
@@ -379,7 +379,7 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
|
|
|
379
379
|
(F = (x = N.value) == null ? void 0 : x.resetInputs) == null || F.call(x);
|
|
380
380
|
}
|
|
381
381
|
});
|
|
382
|
-
const O = Ye(
|
|
382
|
+
const O = Ye(_, "show");
|
|
383
383
|
async function L(x, F, G) {
|
|
384
384
|
g.value = !0;
|
|
385
385
|
try {
|
|
@@ -445,22 +445,22 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
|
|
|
445
445
|
function re() {
|
|
446
446
|
const x = (l.value ?? []).map((F) => ({
|
|
447
447
|
...F,
|
|
448
|
-
type:
|
|
448
|
+
type: lt.enum.SKU
|
|
449
449
|
}));
|
|
450
450
|
V.promptIngredientsBinding(
|
|
451
451
|
x,
|
|
452
452
|
(F) => l.value = F,
|
|
453
|
-
|
|
453
|
+
_.sku._id
|
|
454
454
|
);
|
|
455
455
|
}
|
|
456
456
|
return Fe(
|
|
457
|
-
() =>
|
|
457
|
+
() => _.show,
|
|
458
458
|
(x) => {
|
|
459
459
|
x || (l.value = null, C.value = 0);
|
|
460
460
|
}
|
|
461
461
|
), (x, F) => {
|
|
462
462
|
const G = D("FmTextField"), H = D("FmForm"), J = D("FmCard"), I = D("FmSwitch"), u = D("FmFormGroup"), h = D("FmSelect"), p = D("FmButton"), m = D("FmSideSheet");
|
|
463
|
-
return j(),
|
|
463
|
+
return j(), ne(m, {
|
|
464
464
|
"dismiss-away": "",
|
|
465
465
|
modelValue: s(O),
|
|
466
466
|
"onUpdate:modelValue": F[3] || (F[3] = (i) => Pe(O) ? O.value = i : null),
|
|
@@ -473,13 +473,13 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
|
|
|
473
473
|
]),
|
|
474
474
|
default: M(() => [
|
|
475
475
|
e("div", xo, [
|
|
476
|
-
|
|
476
|
+
y(H, {
|
|
477
477
|
ref_key: "formRef",
|
|
478
478
|
ref: N,
|
|
479
479
|
onValidationSuccess: o
|
|
480
480
|
}, {
|
|
481
481
|
default: M(() => [
|
|
482
|
-
|
|
482
|
+
y(G, {
|
|
483
483
|
disabled: g.value,
|
|
484
484
|
"model-value": C.value,
|
|
485
485
|
"onUpdate:modelValue": F[0] || (F[0] = (i) => C.value = i),
|
|
@@ -491,7 +491,7 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
|
|
|
491
491
|
]),
|
|
492
492
|
_: 1
|
|
493
493
|
}, 512),
|
|
494
|
-
|
|
494
|
+
y(J, {
|
|
495
495
|
variant: "outlined",
|
|
496
496
|
class: "p-16"
|
|
497
497
|
}, {
|
|
@@ -512,10 +512,10 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
|
|
|
512
512
|
]),
|
|
513
513
|
_: 1
|
|
514
514
|
}),
|
|
515
|
-
|
|
515
|
+
y(J, { variant: "outlined" }, {
|
|
516
516
|
default: M(() => [
|
|
517
517
|
e("div", $o, [
|
|
518
|
-
|
|
518
|
+
y(I, {
|
|
519
519
|
value: "",
|
|
520
520
|
modelValue: v.value,
|
|
521
521
|
"onUpdate:modelValue": F[1] || (F[1] = (i) => v.value = i),
|
|
@@ -523,18 +523,18 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
|
|
|
523
523
|
"label-placement": "right"
|
|
524
524
|
}, null, 8, ["modelValue", "label"]),
|
|
525
525
|
v.value ? (j(), q(ue, { key: 0 }, [
|
|
526
|
-
|
|
526
|
+
y(u, {
|
|
527
527
|
modelValue: l.value,
|
|
528
|
-
rules: [s(
|
|
528
|
+
rules: [s(Gt)(1, "Must have at least one ingredient binding")]
|
|
529
529
|
}, null, 8, ["modelValue", "rules"]),
|
|
530
530
|
e("div", jo, [
|
|
531
531
|
e("div", Vo, f(s(R)("inventory.stock.convert.ingredients")), 1),
|
|
532
|
-
(j(!0), q(ue, null, ve(l.value, (i) => (j(),
|
|
532
|
+
(j(!0), q(ue, null, ve(l.value, (i) => (j(), ne(u, {
|
|
533
533
|
key: i.id,
|
|
534
534
|
disabled: g.value,
|
|
535
535
|
modelValue: +s(he)(i.amount ?? { amount: 1, precision: 0 }),
|
|
536
536
|
rules: [
|
|
537
|
-
s(
|
|
537
|
+
s(Wt)(
|
|
538
538
|
a.value.find((S) => S._id === i.id).unit,
|
|
539
539
|
i.measurement
|
|
540
540
|
),
|
|
@@ -546,7 +546,7 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
|
|
|
546
546
|
return [
|
|
547
547
|
e("div", Co, [
|
|
548
548
|
e("div", Bo, f((P = a.value.find((Q) => Q._id === i.id)) == null ? void 0 : P.name), 1),
|
|
549
|
-
|
|
549
|
+
y(G, {
|
|
550
550
|
class: "xs:col-span-2",
|
|
551
551
|
disabled: g.value,
|
|
552
552
|
modelValue: +s(he)(
|
|
@@ -555,7 +555,7 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
|
|
|
555
555
|
"onUpdate:modelValue": (Q) => X(i.id, Q, l.value ?? []),
|
|
556
556
|
invalid: S
|
|
557
557
|
}, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "invalid"]),
|
|
558
|
-
|
|
558
|
+
y(h, {
|
|
559
559
|
disabled: g.value,
|
|
560
560
|
class: "translate-y-[2px]",
|
|
561
561
|
items: z(i.id),
|
|
@@ -566,7 +566,7 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
|
|
|
566
566
|
"helper-text": M(() => F[4] || (F[4] = [])),
|
|
567
567
|
_: 2
|
|
568
568
|
}, 1032, ["disabled", "items", "model-value", "onUpdate:modelValue", "invalid"]),
|
|
569
|
-
|
|
569
|
+
y(p, {
|
|
570
570
|
disabled: g.value,
|
|
571
571
|
type: "button",
|
|
572
572
|
variant: "tertiary",
|
|
@@ -580,7 +580,7 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
|
|
|
580
580
|
}, 1032, ["disabled", "modelValue", "rules"]))), 128))
|
|
581
581
|
]),
|
|
582
582
|
e("div", null, [
|
|
583
|
-
|
|
583
|
+
y(p, {
|
|
584
584
|
icon: "link",
|
|
585
585
|
label: s(R)("inventory.stock.convert.linkIngredient"),
|
|
586
586
|
variant: "plain",
|
|
@@ -596,7 +596,7 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
|
|
|
596
596
|
]),
|
|
597
597
|
"side-sheet-footer": M(() => [
|
|
598
598
|
e("div", Do, [
|
|
599
|
-
|
|
599
|
+
y(p, {
|
|
600
600
|
loading: g.value,
|
|
601
601
|
label: s(R)("inventory.stock.convert.convertButton"),
|
|
602
602
|
onClick: F[2] || (F[2] = (i) => {
|
|
@@ -655,7 +655,7 @@ const We = {
|
|
|
655
655
|
},
|
|
656
656
|
emits: ["update:modelValue", "click:delete"],
|
|
657
657
|
setup(A, { emit: c }) {
|
|
658
|
-
const k = A,
|
|
658
|
+
const k = A, _ = c, { t: w } = ye(), V = Oe(), d = T(
|
|
659
659
|
() => Object.keys(We).map((t) => ({
|
|
660
660
|
label: Ht(t),
|
|
661
661
|
value: t
|
|
@@ -673,7 +673,7 @@ const We = {
|
|
|
673
673
|
n.amount = We[n.type].toAdjustmentAmount(
|
|
674
674
|
+he($),
|
|
675
675
|
$.precision
|
|
676
|
-
),
|
|
676
|
+
), _("update:modelValue", n);
|
|
677
677
|
}
|
|
678
678
|
}), R = T({
|
|
679
679
|
get() {
|
|
@@ -687,7 +687,7 @@ const We = {
|
|
|
687
687
|
n.amount = We[b.value].toAdjustmentAmount(
|
|
688
688
|
t,
|
|
689
689
|
$.precision
|
|
690
|
-
),
|
|
690
|
+
), _("update:modelValue", n);
|
|
691
691
|
}
|
|
692
692
|
}), C = T({
|
|
693
693
|
get() {
|
|
@@ -699,7 +699,7 @@ const We = {
|
|
|
699
699
|
const n = {
|
|
700
700
|
...k.modelValue
|
|
701
701
|
};
|
|
702
|
-
n.measurement = ((E = ($ = k.modelValue.doc.unit) == null ? void 0 : $.measurements) == null ? void 0 : E.find((N) => N.id === t)) ?? null,
|
|
702
|
+
n.measurement = ((E = ($ = k.modelValue.doc.unit) == null ? void 0 : $.measurements) == null ? void 0 : E.find((N) => N.id === t)) ?? null, _("update:modelValue", n);
|
|
703
703
|
}
|
|
704
704
|
}), l = T({
|
|
705
705
|
get() {
|
|
@@ -709,7 +709,7 @@ const We = {
|
|
|
709
709
|
const n = {
|
|
710
710
|
...k.modelValue
|
|
711
711
|
};
|
|
712
|
-
n.remark = t,
|
|
712
|
+
n.remark = t, _("update:modelValue", n);
|
|
713
713
|
}
|
|
714
714
|
}), a = T(() => {
|
|
715
715
|
var n;
|
|
@@ -719,15 +719,15 @@ const We = {
|
|
|
719
719
|
const t = k.modelValue.amount, n = k.modelValue.measurement;
|
|
720
720
|
return n ? xt(t, n.conversion) : t;
|
|
721
721
|
}), v = T(
|
|
722
|
-
() => k.isBackdate ? a.value :
|
|
722
|
+
() => k.isBackdate ? a.value : Ze(a.value, B.value)
|
|
723
723
|
), g = T(
|
|
724
|
-
() =>
|
|
724
|
+
() => Jt(v.value, k.modelValue.doc.unit)
|
|
725
725
|
), o = T(
|
|
726
726
|
() => !k.isBackdate && B.value.amount < 0
|
|
727
727
|
);
|
|
728
728
|
return (t, n) => {
|
|
729
729
|
const $ = D("FmButton"), E = D("FmSelect"), N = D("FmTextarea"), O = D("FmCard");
|
|
730
|
-
return j(),
|
|
730
|
+
return j(), ne(O, {
|
|
731
731
|
variant: "outlined",
|
|
732
732
|
class: "grid grid-cols-2 gap-8 p-16"
|
|
733
733
|
}, {
|
|
@@ -737,23 +737,23 @@ const We = {
|
|
|
737
737
|
e("div", To, f(t.modelValue.doc.name), 1),
|
|
738
738
|
e("div", Eo, f(t.modelValue.doc.code), 1)
|
|
739
739
|
]),
|
|
740
|
-
|
|
740
|
+
y($, {
|
|
741
741
|
variant: "tertiary",
|
|
742
742
|
"prepend-icon": "delete",
|
|
743
|
-
onClick: n[0] || (n[0] = (L) =>
|
|
743
|
+
onClick: n[0] || (n[0] = (L) => _("click:delete"))
|
|
744
744
|
})
|
|
745
745
|
]),
|
|
746
|
-
|
|
746
|
+
y(E, {
|
|
747
747
|
disabled: t.disabled,
|
|
748
748
|
class: "col-span-2",
|
|
749
749
|
label: "Type",
|
|
750
750
|
items: d.value,
|
|
751
751
|
modelValue: b.value,
|
|
752
752
|
"onUpdate:modelValue": n[1] || (n[1] = (L) => b.value = L),
|
|
753
|
-
rules: [s(
|
|
753
|
+
rules: [s(Kt)()],
|
|
754
754
|
"label-mark": "required"
|
|
755
755
|
}, null, 8, ["disabled", "items", "modelValue", "rules"]),
|
|
756
|
-
|
|
756
|
+
y(Xt, {
|
|
757
757
|
disabled: t.disabled,
|
|
758
758
|
label: "Amount",
|
|
759
759
|
step: +s(he)({
|
|
@@ -764,14 +764,14 @@ const We = {
|
|
|
764
764
|
"onUpdate:modelValue": n[2] || (n[2] = (L) => R.value = L),
|
|
765
765
|
rules: [s(Ue)(0)]
|
|
766
766
|
}, null, 8, ["disabled", "step", "modelValue", "rules"]),
|
|
767
|
-
|
|
767
|
+
y(E, {
|
|
768
768
|
disabled: t.disabled,
|
|
769
769
|
label: "Unit",
|
|
770
770
|
items: r.value,
|
|
771
771
|
modelValue: C.value,
|
|
772
772
|
"onUpdate:modelValue": n[3] || (n[3] = (L) => C.value = L)
|
|
773
773
|
}, null, 8, ["disabled", "items", "modelValue"]),
|
|
774
|
-
|
|
774
|
+
y(N, {
|
|
775
775
|
class: "col-span-2",
|
|
776
776
|
disabled: t.disabled,
|
|
777
777
|
label: "Remark",
|
|
@@ -799,7 +799,7 @@ const We = {
|
|
|
799
799
|
},
|
|
800
800
|
emits: ["update:show", "submitted"],
|
|
801
801
|
setup(A, { expose: c, emit: k }) {
|
|
802
|
-
const
|
|
802
|
+
const _ = A, w = k, V = Ne(), d = Le(), r = Ae(), b = we(), R = Y(!1), { t: C } = ye();
|
|
803
803
|
function l() {
|
|
804
804
|
g(Re(v));
|
|
805
805
|
}
|
|
@@ -818,25 +818,25 @@ const We = {
|
|
|
818
818
|
($ = (n = a.value) == null ? void 0 : n.resetInputs) == null || $.call(n);
|
|
819
819
|
}
|
|
820
820
|
});
|
|
821
|
-
const B = Ye(
|
|
821
|
+
const B = Ye(_, "show"), v = _t({
|
|
822
822
|
remark: "",
|
|
823
823
|
adjustments: [
|
|
824
824
|
{
|
|
825
825
|
id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
|
|
826
826
|
type: ie.enum.PURCHASE,
|
|
827
|
-
doc:
|
|
827
|
+
doc: _.stock,
|
|
828
828
|
measurement: null,
|
|
829
829
|
remark: "",
|
|
830
830
|
amount: xe(1)
|
|
831
831
|
}
|
|
832
832
|
]
|
|
833
833
|
});
|
|
834
|
-
Fe([() =>
|
|
834
|
+
Fe([() => _.show], ([n]) => {
|
|
835
835
|
n && (v.remark = "", v.adjustments = [
|
|
836
836
|
{
|
|
837
837
|
id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
|
|
838
838
|
type: ie.enum.PURCHASE,
|
|
839
|
-
doc:
|
|
839
|
+
doc: _.stock,
|
|
840
840
|
measurement: null,
|
|
841
841
|
remark: "",
|
|
842
842
|
amount: xe(1)
|
|
@@ -910,7 +910,7 @@ const We = {
|
|
|
910
910
|
}
|
|
911
911
|
return (n, $) => {
|
|
912
912
|
const E = D("FmTextarea"), N = D("FmButton"), O = D("FmForm"), L = D("FmSideSheet");
|
|
913
|
-
return j(),
|
|
913
|
+
return j(), ne(L, {
|
|
914
914
|
modelValue: s(B),
|
|
915
915
|
"onUpdate:modelValue": $[2] || ($[2] = (X) => Pe(B) ? B.value = X : null),
|
|
916
916
|
"dismiss-away": "",
|
|
@@ -922,28 +922,28 @@ const We = {
|
|
|
922
922
|
])
|
|
923
923
|
]),
|
|
924
924
|
default: M(() => [
|
|
925
|
-
|
|
925
|
+
y(O, {
|
|
926
926
|
class: "w-full flex flex-col gap-12",
|
|
927
927
|
ref_key: "formRef",
|
|
928
928
|
ref: a,
|
|
929
929
|
onValidationSuccess: l
|
|
930
930
|
}, {
|
|
931
931
|
default: M(() => [
|
|
932
|
-
|
|
932
|
+
y(E, {
|
|
933
933
|
label: s(C)("inventory.stock.adjust.remark"),
|
|
934
934
|
modelValue: v.remark,
|
|
935
935
|
"onUpdate:modelValue": $[0] || ($[0] = (X) => v.remark = X)
|
|
936
936
|
}, null, 8, ["label", "modelValue"]),
|
|
937
937
|
e("div", Lo, [
|
|
938
938
|
e("div", Yo, f(s(C)("inventory.stock.adjust.adjustedItems")), 1),
|
|
939
|
-
|
|
939
|
+
y(N, {
|
|
940
940
|
"prepend-icon": "add",
|
|
941
941
|
variant: "tertiary",
|
|
942
942
|
size: "md",
|
|
943
943
|
onClick: o
|
|
944
944
|
})
|
|
945
945
|
]),
|
|
946
|
-
(j(!0), q(ue, null, ve(v.adjustments, (X, z) => (j(),
|
|
946
|
+
(j(!0), q(ue, null, ve(v.adjustments, (X, z) => (j(), ne($t, {
|
|
947
947
|
key: X.id,
|
|
948
948
|
modelValue: v.adjustments[z],
|
|
949
949
|
"onUpdate:modelValue": (K) => v.adjustments[z] = K,
|
|
@@ -955,7 +955,7 @@ const We = {
|
|
|
955
955
|
]),
|
|
956
956
|
"side-sheet-footer": M(() => [
|
|
957
957
|
e("div", zo, [
|
|
958
|
-
|
|
958
|
+
y(N, {
|
|
959
959
|
label: s(C)("inventory.stock.adjust.adjustButton"),
|
|
960
960
|
loading: R.value,
|
|
961
961
|
onClick: $[1] || ($[1] = (X) => {
|
|
@@ -979,7 +979,7 @@ const We = {
|
|
|
979
979
|
},
|
|
980
980
|
emits: ["update:show", "submitted"],
|
|
981
981
|
setup(A, { emit: c }) {
|
|
982
|
-
const k = A,
|
|
982
|
+
const k = A, _ = c, { t: w } = ye(), V = Ne(), d = Ae(), r = Le(), b = we(), R = Ye(k, "show"), C = Y(!1), l = _t({
|
|
983
983
|
remark: "",
|
|
984
984
|
effectiveAt: /* @__PURE__ */ new Date(),
|
|
985
985
|
adjustments: []
|
|
@@ -1081,7 +1081,7 @@ const We = {
|
|
|
1081
1081
|
adjustments: K,
|
|
1082
1082
|
...a.value ? { effectiveAt: l.effectiveAt.toISOString() } : {}
|
|
1083
1083
|
};
|
|
1084
|
-
await d.adjustSku(Re(U)),
|
|
1084
|
+
await d.adjustSku(Re(U)), _("submitted"), _("update:show", !1);
|
|
1085
1085
|
} catch (K) {
|
|
1086
1086
|
b.open({
|
|
1087
1087
|
title: w("inventory.stock.adjust.error.title"),
|
|
@@ -1094,7 +1094,7 @@ const We = {
|
|
|
1094
1094
|
}
|
|
1095
1095
|
return (K, U) => {
|
|
1096
1096
|
const Z = D("FmTextarea"), re = D("FmSwitch"), x = D("FmDatePicker"), F = D("FmTimePicker"), G = D("FmFormGroup"), H = D("FmButton"), J = D("FmForm"), I = D("FmSideSheet");
|
|
1097
|
-
return j(),
|
|
1097
|
+
return j(), ne(I, {
|
|
1098
1098
|
modelValue: s(R),
|
|
1099
1099
|
"onUpdate:modelValue": U[6] || (U[6] = (u) => Pe(R) ? R.value = u : null),
|
|
1100
1100
|
"dismiss-away": "",
|
|
@@ -1107,20 +1107,20 @@ const We = {
|
|
|
1107
1107
|
])
|
|
1108
1108
|
]),
|
|
1109
1109
|
default: M(() => [
|
|
1110
|
-
|
|
1110
|
+
y(J, {
|
|
1111
1111
|
class: "flex flex-col gap-16",
|
|
1112
1112
|
ref_key: "formRef",
|
|
1113
1113
|
ref: g,
|
|
1114
1114
|
onValidationSuccess: z
|
|
1115
1115
|
}, {
|
|
1116
1116
|
default: M(() => [
|
|
1117
|
-
|
|
1117
|
+
y(Z, {
|
|
1118
1118
|
label: s(w)("inventory.stock.adjust.remark"),
|
|
1119
1119
|
modelValue: l.remark,
|
|
1120
1120
|
"onUpdate:modelValue": U[0] || (U[0] = (u) => l.remark = u),
|
|
1121
1121
|
"label-mark": "optional"
|
|
1122
1122
|
}, null, 8, ["label", "modelValue"]),
|
|
1123
|
-
|
|
1123
|
+
y(re, {
|
|
1124
1124
|
value: "",
|
|
1125
1125
|
"model-value": a.value,
|
|
1126
1126
|
"onUpdate:modelValue": U[1] || (U[1] = (u) => a.value = u),
|
|
@@ -1132,7 +1132,7 @@ const We = {
|
|
|
1132
1132
|
e("label", Xo, f(s(w)("inventory.stock.stock_adjustment.effectiveAt")), 1),
|
|
1133
1133
|
e("div", Jo, [
|
|
1134
1134
|
e("div", Qo, [
|
|
1135
|
-
|
|
1135
|
+
y(x, {
|
|
1136
1136
|
class: "w-full",
|
|
1137
1137
|
modelValue: B.value,
|
|
1138
1138
|
"onUpdate:modelValue": U[2] || (U[2] = (u) => B.value = u),
|
|
@@ -1140,7 +1140,7 @@ const We = {
|
|
|
1140
1140
|
}, null, 8, ["modelValue"])
|
|
1141
1141
|
]),
|
|
1142
1142
|
e("div", Zo, [
|
|
1143
|
-
|
|
1143
|
+
y(F, {
|
|
1144
1144
|
class: "w-full",
|
|
1145
1145
|
modelValue: v.value,
|
|
1146
1146
|
"onUpdate:modelValue": U[3] || (U[3] = (u) => v.value = u),
|
|
@@ -1148,7 +1148,7 @@ const We = {
|
|
|
1148
1148
|
}, null, 8, ["modelValue"])
|
|
1149
1149
|
])
|
|
1150
1150
|
]),
|
|
1151
|
-
|
|
1151
|
+
y(G, {
|
|
1152
1152
|
"model-value": o.value,
|
|
1153
1153
|
rules: n.value
|
|
1154
1154
|
}, null, 8, ["model-value", "rules"]),
|
|
@@ -1156,14 +1156,14 @@ const We = {
|
|
|
1156
1156
|
])) : se("", !0),
|
|
1157
1157
|
e("div", tn, [
|
|
1158
1158
|
e("div", on, f(s(w)("inventory.stock.adjust.adjustedItems")), 1),
|
|
1159
|
-
|
|
1159
|
+
y(H, {
|
|
1160
1160
|
"prepend-icon": "add",
|
|
1161
1161
|
variant: "tertiary",
|
|
1162
1162
|
size: "md",
|
|
1163
1163
|
onClick: L
|
|
1164
1164
|
})
|
|
1165
1165
|
]),
|
|
1166
|
-
(j(!0), q(ue, null, ve(l.adjustments, (u, h) => (j(),
|
|
1166
|
+
(j(!0), q(ue, null, ve(l.adjustments, (u, h) => (j(), ne($t, {
|
|
1167
1167
|
key: u.doc._id,
|
|
1168
1168
|
modelValue: l.adjustments[h],
|
|
1169
1169
|
"onUpdate:modelValue": (p) => l.adjustments[h] = p,
|
|
@@ -1176,7 +1176,7 @@ const We = {
|
|
|
1176
1176
|
]),
|
|
1177
1177
|
"side-sheet-footer": M(() => [
|
|
1178
1178
|
e("div", nn, [
|
|
1179
|
-
|
|
1179
|
+
y(H, {
|
|
1180
1180
|
label: s(w)("common.confirm"),
|
|
1181
1181
|
loading: C.value,
|
|
1182
1182
|
disabled: $.value,
|
|
@@ -1185,10 +1185,10 @@ const We = {
|
|
|
1185
1185
|
return (p = (h = g.value) == null ? void 0 : h.validateInputs) == null ? void 0 : p.call(h);
|
|
1186
1186
|
})
|
|
1187
1187
|
}, null, 8, ["label", "loading", "disabled"]),
|
|
1188
|
-
|
|
1188
|
+
y(H, {
|
|
1189
1189
|
label: s(w)("common.close"),
|
|
1190
1190
|
variant: "tertiary",
|
|
1191
|
-
onClick: U[5] || (U[5] = (u) =>
|
|
1191
|
+
onClick: U[5] || (U[5] = (u) => _("update:show", !1))
|
|
1192
1192
|
}, null, 8, ["label"])
|
|
1193
1193
|
])
|
|
1194
1194
|
]),
|
|
@@ -1198,11 +1198,11 @@ const We = {
|
|
|
1198
1198
|
}
|
|
1199
1199
|
}), an = Tt((A, c) => ({
|
|
1200
1200
|
// TODO: remove once latest inventory backend has been push
|
|
1201
|
-
async findBillsByBusinessId(k,
|
|
1201
|
+
async findBillsByBusinessId(k, _, w) {
|
|
1202
1202
|
const V = `${A.businessesBackendUrl}/${k}/reports/find-many`, d = {
|
|
1203
1203
|
// type: TYPE.bill,
|
|
1204
1204
|
type: "bill",
|
|
1205
|
-
restaurantIds:
|
|
1205
|
+
restaurantIds: _,
|
|
1206
1206
|
ids: w
|
|
1207
1207
|
};
|
|
1208
1208
|
return await c.post(V, d);
|
|
@@ -1218,19 +1218,19 @@ const We = {
|
|
|
1218
1218
|
class: "flex justify-center items-center h-32"
|
|
1219
1219
|
}, ln = { class: "mb-3" }, un = { class: "flex flex-col gap-8" }, cn = { class: "flex flex-col text-fm-color-typo-primary mb-3 text-center" }, dn = { class: "text-fm-color-neutral-gray-400 fm-typo-en-body-sm-600" }, mn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, fn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, vn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, pn = { class: "flex flex-col w-full px-2" }, yn = { class: "flex gap-2" }, _n = /* @__PURE__ */ pe({
|
|
1220
1220
|
__name: "AmendAdjustmentForm",
|
|
1221
|
-
props: /* @__PURE__ */
|
|
1221
|
+
props: /* @__PURE__ */ st({
|
|
1222
1222
|
adjustmentId: {}
|
|
1223
1223
|
}, {
|
|
1224
1224
|
modelValue: {},
|
|
1225
1225
|
modelModifiers: {}
|
|
1226
1226
|
}),
|
|
1227
|
-
emits: /* @__PURE__ */
|
|
1227
|
+
emits: /* @__PURE__ */ st(["refreshHistory"], ["update:modelValue"]),
|
|
1228
1228
|
setup(A, { emit: c }) {
|
|
1229
|
-
const k = A,
|
|
1229
|
+
const k = A, _ = c, w = Ae(), V = jt(A, "modelValue"), d = Y(!1), r = Y(!1), b = Y(!1), R = Y({
|
|
1230
1230
|
_id: `inventoryAdjustment_${(/* @__PURE__ */ new Date()).toISOString()}_XXXXX`,
|
|
1231
1231
|
skus: []
|
|
1232
1232
|
}), C = Y();
|
|
1233
|
-
|
|
1233
|
+
Xe(async () => {
|
|
1234
1234
|
d.value = !0;
|
|
1235
1235
|
const o = await w.readSingleAdjustment(k.adjustmentId);
|
|
1236
1236
|
if (!o) throw new Error("Adjustment not found");
|
|
@@ -1250,7 +1250,7 @@ const We = {
|
|
|
1250
1250
|
}), await w.revertWastageAdjustment({
|
|
1251
1251
|
targetWastageAdjustmentId: k.adjustmentId,
|
|
1252
1252
|
amountsGoingToAdjust: o
|
|
1253
|
-
}),
|
|
1253
|
+
}), _("refreshHistory"), b.value = !1, V.value = {};
|
|
1254
1254
|
}
|
|
1255
1255
|
function a(o) {
|
|
1256
1256
|
const { skuId: t, idx: n, unit: $, measurement: E } = o;
|
|
@@ -1288,19 +1288,19 @@ const We = {
|
|
|
1288
1288
|
}
|
|
1289
1289
|
return (o, t) => {
|
|
1290
1290
|
const n = D("FmIcon"), $ = D("FmStepperField"), E = D("FmCard"), N = D("FmForm"), O = D("FmSpacer"), L = D("FmButton"), X = D("FmDialog");
|
|
1291
|
-
return j(),
|
|
1291
|
+
return j(), ne(X, {
|
|
1292
1292
|
modelValue: b.value,
|
|
1293
1293
|
"onUpdate:modelValue": t[4] || (t[4] = (z) => b.value = z),
|
|
1294
1294
|
overlay: !0
|
|
1295
1295
|
}, {
|
|
1296
1296
|
"dialog-button": M(() => [
|
|
1297
|
-
|
|
1297
|
+
y(Qe, null, {
|
|
1298
1298
|
default: M(() => [
|
|
1299
1299
|
e("button", {
|
|
1300
1300
|
onClick: t[0] || (t[0] = (z) => b.value = !0),
|
|
1301
1301
|
class: "rounded-md hover:bg-gray-100 transition-colors"
|
|
1302
1302
|
}, [
|
|
1303
|
-
|
|
1303
|
+
y(n, {
|
|
1304
1304
|
name: "edit",
|
|
1305
1305
|
size: "sm"
|
|
1306
1306
|
})
|
|
@@ -1316,15 +1316,15 @@ const We = {
|
|
|
1316
1316
|
e("div", pn, [
|
|
1317
1317
|
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)),
|
|
1318
1318
|
e("div", yn, [
|
|
1319
|
-
|
|
1320
|
-
|
|
1319
|
+
y(O),
|
|
1320
|
+
y(L, {
|
|
1321
1321
|
class: "sm:w-full xs:w-full",
|
|
1322
1322
|
label: "Close",
|
|
1323
1323
|
size: "md",
|
|
1324
1324
|
variant: "tertiary",
|
|
1325
1325
|
onClick: t[3] || (t[3] = (z) => b.value = !1)
|
|
1326
1326
|
}),
|
|
1327
|
-
|
|
1327
|
+
y(L, {
|
|
1328
1328
|
class: "sm:w-full xs:w-full",
|
|
1329
1329
|
label: "Submit",
|
|
1330
1330
|
size: "md",
|
|
@@ -1335,7 +1335,7 @@ const We = {
|
|
|
1335
1335
|
])
|
|
1336
1336
|
]),
|
|
1337
1337
|
default: M(() => [
|
|
1338
|
-
d.value ? (j(), q("div", rn)) : (j(),
|
|
1338
|
+
d.value ? (j(), q("div", rn)) : (j(), ne(N, {
|
|
1339
1339
|
key: 1,
|
|
1340
1340
|
ref_key: "formRef",
|
|
1341
1341
|
ref: C,
|
|
@@ -1351,11 +1351,11 @@ const We = {
|
|
|
1351
1351
|
e("p", ln, [
|
|
1352
1352
|
t[6] || (t[6] = e("b", null, "Date:", -1)),
|
|
1353
1353
|
t[7] || (t[7] = e("br", null, null, -1)),
|
|
1354
|
-
me(" " + f(s(
|
|
1354
|
+
me(" " + f(s(Qt)(s(Et)(R.value._id))), 1)
|
|
1355
1355
|
]),
|
|
1356
1356
|
e("div", un, [
|
|
1357
1357
|
(j(!0), q(ue, null, ve(R.value.skus, (z, K) => (j(), q(ue, { key: K }, [
|
|
1358
|
-
(j(!0), q(ue, null, ve(z.amounts, (U, Z) => (j(),
|
|
1358
|
+
(j(!0), q(ue, null, ve(z.amounts, (U, Z) => (j(), ne(E, {
|
|
1359
1359
|
key: Z,
|
|
1360
1360
|
variant: "outlined",
|
|
1361
1361
|
class: "p-2"
|
|
@@ -1374,7 +1374,7 @@ const We = {
|
|
|
1374
1374
|
t[9] || (t[9] = e("span", { class: "fm-typo-en-body-lg-600" }, "Current amount:", -1)),
|
|
1375
1375
|
e("span", null, f(s(_e).toFormatString({ value: U.amount })) + " " + f(v(z, U)), 1)
|
|
1376
1376
|
]),
|
|
1377
|
-
|
|
1377
|
+
y($, {
|
|
1378
1378
|
"max-fraction-digits": s($e)(z.sku.unit),
|
|
1379
1379
|
"model-value": a({
|
|
1380
1380
|
skuId: z.sku._id,
|
|
@@ -1463,8 +1463,8 @@ const We = {
|
|
|
1463
1463
|
const v = [...a].filter((g) => new Date(g.snapshotAt) <= new Date(l)).sort((g, o) => new Date(o.snapshotAt).getTime() - new Date(g.snapshotAt).getTime());
|
|
1464
1464
|
return v.length > 0 ? v[0].cost : null;
|
|
1465
1465
|
}
|
|
1466
|
-
const
|
|
1467
|
-
|
|
1466
|
+
const _ = Y(!1), w = Y(), V = Y(null), d = T(() => V.value === null ? "unset" : _.value ? `${V.value}px` : "0px");
|
|
1467
|
+
Xe(() => {
|
|
1468
1468
|
var C;
|
|
1469
1469
|
V.value = ((C = w.value) == null ? void 0 : C.scrollHeight) || 0;
|
|
1470
1470
|
});
|
|
@@ -1476,18 +1476,18 @@ const We = {
|
|
|
1476
1476
|
}).flatMap((o) => o.amounts);
|
|
1477
1477
|
for (const o of v) {
|
|
1478
1478
|
const t = o.measurement ? xt(o.measurement.conversion, o.amount) : o.amount;
|
|
1479
|
-
a[g = o.type] ?? (a[g] = { amount: 0, precision: 0 }), a[o.type] =
|
|
1479
|
+
a[g = o.type] ?? (a[g] = { amount: 0, precision: 0 }), a[o.type] = Ze(t, a[o.type]);
|
|
1480
1480
|
}
|
|
1481
1481
|
return Object.entries(a).reduce(
|
|
1482
1482
|
(o, [t, n]) => (o[t] = /// comment, because without it formatter makes code uglier
|
|
1483
|
-
`${
|
|
1483
|
+
`${oe.toFormatString({
|
|
1484
1484
|
value: n,
|
|
1485
1485
|
precision: 4
|
|
1486
1486
|
})} ${l.unit.abbrev}`, o),
|
|
1487
1487
|
{}
|
|
1488
1488
|
);
|
|
1489
1489
|
}), { t: b } = ye(), R = T(() => c.record.adjustmentsByTime.map(({ date: C, adjustments: l }) => ({
|
|
1490
|
-
time:
|
|
1490
|
+
time: Zt(new Date(C)),
|
|
1491
1491
|
adjustments: l.flatMap(
|
|
1492
1492
|
(a) => {
|
|
1493
1493
|
var B, v;
|
|
@@ -1513,9 +1513,9 @@ const We = {
|
|
|
1513
1513
|
var N;
|
|
1514
1514
|
let $ = n.cost;
|
|
1515
1515
|
if (o) {
|
|
1516
|
-
const O =
|
|
1516
|
+
const O = oe.fromDinero(o), L = n.amount, X = n.measurement ? oe.multiply([L, n.measurement.conversion]) : L;
|
|
1517
1517
|
$ = {
|
|
1518
|
-
...
|
|
1518
|
+
...oe.multiply([
|
|
1519
1519
|
O,
|
|
1520
1520
|
X
|
|
1521
1521
|
]),
|
|
@@ -1524,15 +1524,15 @@ const We = {
|
|
|
1524
1524
|
}
|
|
1525
1525
|
let E = "";
|
|
1526
1526
|
return v ? E = n.remark || "" : E = [a.adjustmentRemark, n.remark].filter((L) => L).join("/"), {
|
|
1527
|
-
amount: `${
|
|
1527
|
+
amount: `${oe.toFormatString({ value: n.amount, precision: 4 })} ${((N = n.measurement) == null ? void 0 : N.abbrev) ?? a.sku.unit.abbrev}`,
|
|
1528
1528
|
backdateFrom: a.backdateFrom,
|
|
1529
1529
|
name: n.type,
|
|
1530
1530
|
billRemark: v,
|
|
1531
1531
|
remark: E,
|
|
1532
1532
|
reason: a.reason || "",
|
|
1533
1533
|
cost: $,
|
|
1534
|
-
toBalance:
|
|
1535
|
-
value: a.toBalance ??
|
|
1534
|
+
toBalance: oe.toFormatString({
|
|
1535
|
+
value: a.toBalance ?? oe.fromNumber(0),
|
|
1536
1536
|
precision: 4
|
|
1537
1537
|
}),
|
|
1538
1538
|
baseUnit: a.sku.unit.abbrev,
|
|
@@ -1544,16 +1544,16 @@ const We = {
|
|
|
1544
1544
|
})));
|
|
1545
1545
|
return (C, l) => {
|
|
1546
1546
|
const a = D("FmIcon"), B = D("FmTooltip"), v = D("FmCard");
|
|
1547
|
-
return j(),
|
|
1547
|
+
return j(), ne(v, { variant: "outlined" }, {
|
|
1548
1548
|
default: M(() => [
|
|
1549
1549
|
e("div", kn, [
|
|
1550
1550
|
e("div", {
|
|
1551
1551
|
class: "flex items-center cursor-pointer mb-1",
|
|
1552
|
-
onClick: l[0] || (l[0] = (g) =>
|
|
1552
|
+
onClick: l[0] || (l[0] = (g) => _.value = !_.value)
|
|
1553
1553
|
}, [
|
|
1554
1554
|
e("div", hn, f(C.record.date), 1),
|
|
1555
|
-
|
|
1556
|
-
name:
|
|
1555
|
+
y(a, {
|
|
1556
|
+
name: _.value ? "expand_more" : "expand_less",
|
|
1557
1557
|
color: "#777777",
|
|
1558
1558
|
size: "md"
|
|
1559
1559
|
}, null, 8, ["name"])
|
|
@@ -1597,7 +1597,7 @@ const We = {
|
|
|
1597
1597
|
}, [
|
|
1598
1598
|
e("div", wn, [
|
|
1599
1599
|
me(f(s(b)(`inventory.inventoryAdjustment.type.${o.name}`)) + " ", 1),
|
|
1600
|
-
o.backdateFrom ? (j(),
|
|
1600
|
+
o.backdateFrom ? (j(), ne(B, {
|
|
1601
1601
|
key: 0,
|
|
1602
1602
|
variant: "plain",
|
|
1603
1603
|
placement: "top",
|
|
@@ -1609,7 +1609,7 @@ const We = {
|
|
|
1609
1609
|
])), 1)
|
|
1610
1610
|
]),
|
|
1611
1611
|
default: M(() => [
|
|
1612
|
-
|
|
1612
|
+
y(a, {
|
|
1613
1613
|
name: "info",
|
|
1614
1614
|
size: "sm",
|
|
1615
1615
|
color: "primary"
|
|
@@ -1621,7 +1621,7 @@ const We = {
|
|
|
1621
1621
|
o.billRemark && o.remark ? (j(), q("span", $n, " (" + f(o.remark) + ") ", 1)) : se("", !0),
|
|
1622
1622
|
!o.billRemark && o.reason ? (j(), q("span", jn, " (" + f(o.reason) + ") ", 1)) : se("", !0),
|
|
1623
1623
|
!o.billRemark && o.remark ? (j(), q("span", Vn, " # " + f(o.remark), 1)) : se("", !0),
|
|
1624
|
-
(t = o.createdBy) != null && t.name ? (j(),
|
|
1624
|
+
(t = o.createdBy) != null && t.name ? (j(), ne(B, {
|
|
1625
1625
|
key: 5,
|
|
1626
1626
|
variant: "plain",
|
|
1627
1627
|
placement: "top",
|
|
@@ -1632,7 +1632,7 @@ const We = {
|
|
|
1632
1632
|
]),
|
|
1633
1633
|
default: M(() => [
|
|
1634
1634
|
e("span", Cn, [
|
|
1635
|
-
|
|
1635
|
+
y(a, {
|
|
1636
1636
|
name: "person",
|
|
1637
1637
|
size: "sm",
|
|
1638
1638
|
color: "primary"
|
|
@@ -1651,7 +1651,7 @@ const We = {
|
|
|
1651
1651
|
"ml-auto": !0
|
|
1652
1652
|
})
|
|
1653
1653
|
}, f(o.amount), 3),
|
|
1654
|
-
o.name === s(ie).Enum.WASTAGE ? (j(),
|
|
1654
|
+
o.name === s(ie).Enum.WASTAGE ? (j(), ne(_n, {
|
|
1655
1655
|
key: 0,
|
|
1656
1656
|
adjustmentId: o.adjustmentId,
|
|
1657
1657
|
onRefreshHistory: l[1] || (l[1] = (n) => C.$emit("refreshHistory"))
|
|
@@ -1677,7 +1677,7 @@ function In(A, c) {
|
|
|
1677
1677
|
);
|
|
1678
1678
|
if (!c)
|
|
1679
1679
|
return Object.entries(k).reduce(
|
|
1680
|
-
(d, [r]) => (d[r] =
|
|
1680
|
+
(d, [r]) => (d[r] = oe.fromNumber(0), d),
|
|
1681
1681
|
{}
|
|
1682
1682
|
);
|
|
1683
1683
|
const w = A.flatMap((d) => {
|
|
@@ -1685,8 +1685,8 @@ function In(A, c) {
|
|
|
1685
1685
|
return ((r = d.skus) == null ? void 0 : r.filter((b) => b.sku._id === c._id)) ?? [];
|
|
1686
1686
|
}).flatMap((d) => d.amounts);
|
|
1687
1687
|
for (const d of w) {
|
|
1688
|
-
const r = d.measurement ?
|
|
1689
|
-
k[V = d.type] ?? (k[V] = { amount: 0, precision: 0 }), k[d.type] =
|
|
1688
|
+
const r = d.measurement ? oe.multiply([d.measurement.conversion, d.amount]) : d.amount;
|
|
1689
|
+
k[V = d.type] ?? (k[V] = { amount: 0, precision: 0 }), k[d.type] = oe.add([r, k[d.type]]);
|
|
1690
1690
|
}
|
|
1691
1691
|
return Object.entries(k).reduce(
|
|
1692
1692
|
(d, [r, b]) => {
|
|
@@ -1695,7 +1695,7 @@ function In(A, c) {
|
|
|
1695
1695
|
amount: Math.abs(b.amount)
|
|
1696
1696
|
};
|
|
1697
1697
|
return d[r] = /// comment, because without it formatter makes code uglier
|
|
1698
|
-
`${
|
|
1698
|
+
`${oe.toFormatString({
|
|
1699
1699
|
value: R,
|
|
1700
1700
|
precision: 4
|
|
1701
1701
|
})} ${c.unit.abbrev}`, d;
|
|
@@ -1719,11 +1719,11 @@ function Hn(A, c) {
|
|
|
1719
1719
|
for (const r of d) {
|
|
1720
1720
|
if (r.type !== ie.Enum.SALES)
|
|
1721
1721
|
continue;
|
|
1722
|
-
const b = r.measurement ?
|
|
1723
|
-
k ?? (k =
|
|
1722
|
+
const b = r.measurement ? oe.multiply([r.measurement.conversion, r.amount]) : r.amount;
|
|
1723
|
+
k ?? (k = oe.fromNumber(0)), k = oe.add([k, b]);
|
|
1724
1724
|
}
|
|
1725
1725
|
}
|
|
1726
|
-
return k != null ? (k.amount = Math.abs(k.amount), `${
|
|
1726
|
+
return k != null ? (k.amount = Math.abs(k.amount), `${oe.toFormatString({
|
|
1727
1727
|
value: k,
|
|
1728
1728
|
precision: 4
|
|
1729
1729
|
})} ${c.unit.abbrev}`) : null;
|
|
@@ -1740,10 +1740,10 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
1740
1740
|
}, Wn = { class: "flex flex-col gap-1" }, Kn = { class: "text-fm-color-typo-secondary" }, qn = { class: "font-bold" }, Xn = { class: "flex flex-col gap-1" }, Jn = { class: "text-fm-color-typo-secondary flex" }, Qn = { class: "font-bold" }, Zn = { class: "flex flex-col gap-1" }, es = { class: "text-fm-color-typo-secondary" }, ts = { class: "font-bold" }, os = { class: "flex flex-col gap-1" }, ns = { class: "text-fm-color-typo-secondary" }, ss = { class: "font-bold" }, as = { class: "flex flex-col gap-1" }, rs = { class: "text-fm-color-typo-secondary" }, ls = { class: "font-bold" }, is = { class: "flex flex-col gap-1" }, us = { class: "text-fm-color-typo-secondary" }, cs = { class: "font-bold" }, ds = { class: "flex flex-col gap-1" }, ms = { class: "text-fm-color-typo-secondary" }, fs = { class: "font-bold" }, vs = { class: "flex flex-col gap-1" }, ps = { class: "text-fm-color-typo-secondary" }, ys = { class: "font-bold" }, _s = { class: "flex flex-col gap-1" }, ks = { class: "text-fm-color-typo-secondary" }, hs = { class: "font-bold" }, bs = {
|
|
1741
1741
|
key: 0,
|
|
1742
1742
|
class: "flex flex-col gap-8"
|
|
1743
|
-
}, gs = { class: "flex" }, xs = { class: "flex-1 flex flex-col gap-1" }, Ss = { class: "flex gap-1 items-center text-fm-color-typo-secondary" },
|
|
1743
|
+
}, gs = { class: "flex" }, xs = { class: "flex-1 flex flex-col gap-1" }, Ss = { class: "flex items-center gap-8" }, ws = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, As = { class: "font-bold" }, Fs = { class: "flex-1 flex flex-col gap-1" }, $s = { class: "flex items-center gap-8" }, js = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, Vs = { class: "flex flex-col gap-1" }, Cs = { class: "font-bold" }, Bs = {
|
|
1744
1744
|
key: 2,
|
|
1745
1745
|
class: "flex-1 flex flex-col items-center gap-8"
|
|
1746
|
-
},
|
|
1746
|
+
}, Ds = ["src"], Ms = { class: "font-bold text-lg" }, Is = { class: "text-xs text-neutral-400 text-center" }, Hs = /* @__PURE__ */ pe({
|
|
1747
1747
|
__name: "StockHistory",
|
|
1748
1748
|
props: {
|
|
1749
1749
|
sku: {},
|
|
@@ -1751,9 +1751,9 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
1751
1751
|
},
|
|
1752
1752
|
emits: ["update:show"],
|
|
1753
1753
|
setup(A) {
|
|
1754
|
-
const c =
|
|
1754
|
+
const c = Je(), k = Oe(), _ = Ae(), w = an(), V = Se(), d = ao(), { t: r } = ye(), b = A, R = Y(!1), C = we(), l = Y("adjustment"), a = Y([
|
|
1755
1755
|
{ label: "Adjustment (Default)", value: "adjustment" }
|
|
1756
|
-
]), B = Y([]), v = Y(
|
|
1756
|
+
]), B = Y([]), v = Y(no(0));
|
|
1757
1757
|
async function g() {
|
|
1758
1758
|
R.value = !0;
|
|
1759
1759
|
try {
|
|
@@ -1768,14 +1768,14 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
1768
1768
|
R.value = !1;
|
|
1769
1769
|
}
|
|
1770
1770
|
}
|
|
1771
|
-
|
|
1771
|
+
Xe(() => {
|
|
1772
1772
|
g();
|
|
1773
1773
|
}), Fe([() => v.value, () => b.sku], () => {
|
|
1774
1774
|
g();
|
|
1775
1775
|
});
|
|
1776
1776
|
const o = Y([]), t = Y([]), n = Y(new Array());
|
|
1777
1777
|
function $(u, h) {
|
|
1778
|
-
return h === "day" ?
|
|
1778
|
+
return h === "day" ? oo(u) : wt(u);
|
|
1779
1779
|
}
|
|
1780
1780
|
function E(u, h) {
|
|
1781
1781
|
const p = u.reduce(
|
|
@@ -1794,7 +1794,7 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
1794
1794
|
}));
|
|
1795
1795
|
}
|
|
1796
1796
|
async function N() {
|
|
1797
|
-
let u = await
|
|
1797
|
+
let u = await _.readStockAdjustment(
|
|
1798
1798
|
b.sku._id,
|
|
1799
1799
|
dt(new Date(v.value.startDate)).toISOString(),
|
|
1800
1800
|
mt(new Date(v.value.endDate)).toISOString()
|
|
@@ -1807,7 +1807,7 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
1807
1807
|
adjustmentsByTime: E(m, "minute")
|
|
1808
1808
|
}));
|
|
1809
1809
|
try {
|
|
1810
|
-
const p = await
|
|
1810
|
+
const p = await _.readUnitCostHistory(
|
|
1811
1811
|
b.sku._id,
|
|
1812
1812
|
dt(new Date(v.value.startDate)).toISOString(),
|
|
1813
1813
|
mt(new Date(v.value.endDate)).toISOString()
|
|
@@ -1852,7 +1852,7 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
1852
1852
|
amount: 0,
|
|
1853
1853
|
precision: 0
|
|
1854
1854
|
}, h = b.sku;
|
|
1855
|
-
return h ? `${
|
|
1855
|
+
return h ? `${oe.toFormatString({
|
|
1856
1856
|
value: u,
|
|
1857
1857
|
precision: 4
|
|
1858
1858
|
})} ${h.unit.abbrev}` : "";
|
|
@@ -1865,7 +1865,7 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
1865
1865
|
amount: 0,
|
|
1866
1866
|
precision: 0
|
|
1867
1867
|
}, h = b.sku;
|
|
1868
|
-
return h ? `${
|
|
1868
|
+
return h ? `${oe.toFormatString({ value: u, precision: 4 })} ${h.unit.abbrev}` : "";
|
|
1869
1869
|
}), U = T(() => {
|
|
1870
1870
|
var p;
|
|
1871
1871
|
const h = o.value.flatMap((m) => {
|
|
@@ -1876,11 +1876,11 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
1876
1876
|
const S = i.cost;
|
|
1877
1877
|
if (!S) return m;
|
|
1878
1878
|
const P = {
|
|
1879
|
-
...
|
|
1879
|
+
...zt(m, Math.max(m.precision, S.precision)),
|
|
1880
1880
|
currency: S.currency
|
|
1881
1881
|
};
|
|
1882
1882
|
return {
|
|
1883
|
-
...
|
|
1883
|
+
...Ze(P, S),
|
|
1884
1884
|
currency: m.currency
|
|
1885
1885
|
};
|
|
1886
1886
|
},
|
|
@@ -1893,7 +1893,7 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
1893
1893
|
return Me(h, !1, h.precision);
|
|
1894
1894
|
});
|
|
1895
1895
|
function Z() {
|
|
1896
|
-
const { startDate: u, endDate: h } =
|
|
1896
|
+
const { startDate: u, endDate: h } = eo(v.value);
|
|
1897
1897
|
u !== null && h !== null && (v.value = {
|
|
1898
1898
|
startDate: u,
|
|
1899
1899
|
endDate: h
|
|
@@ -1918,8 +1918,8 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
1918
1918
|
const F = T(() => {
|
|
1919
1919
|
var m, i, S, P, ee, ae;
|
|
1920
1920
|
const u = [...o.value].reverse().find((Q) => {
|
|
1921
|
-
var W,
|
|
1922
|
-
return (
|
|
1921
|
+
var W, te;
|
|
1922
|
+
return (te = (W = Q.skus) == null ? void 0 : W.find) == null ? void 0 : te.call(W, (le) => le.sku._id === b.sku._id);
|
|
1923
1923
|
});
|
|
1924
1924
|
if (!u) return "No data";
|
|
1925
1925
|
const h = (m = u.skus) == null ? void 0 : m.find((Q) => Q.sku._id === b.sku._id);
|
|
@@ -1929,10 +1929,10 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
1929
1929
|
const Q = [...h.amounts].reverse()[0], W = {
|
|
1930
1930
|
amount: ((i = Q.cost) == null ? void 0 : i.amount) ?? 0,
|
|
1931
1931
|
precision: ((S = Q.cost) == null ? void 0 : S.precision) ?? 0
|
|
1932
|
-
},
|
|
1932
|
+
}, te = Q.amount, le = te.amount == 0 ? oe.fromNumber(0) : oe.divide([W, te]);
|
|
1933
1933
|
return {
|
|
1934
|
-
...
|
|
1935
|
-
currency: ((P = Q.cost) == null ? void 0 : P.currency) || Ce(((ee = c.currentCountry) == null ? void 0 : ee.value) ??
|
|
1934
|
+
...oe.multiply([le, p]),
|
|
1935
|
+
currency: ((P = Q.cost) == null ? void 0 : P.currency) || Ce(((ee = c.currentCountry) == null ? void 0 : ee.value) ?? it)
|
|
1936
1936
|
};
|
|
1937
1937
|
} else {
|
|
1938
1938
|
const Q = u.effectiveAt ?? Te(u._id), W = x(
|
|
@@ -1940,10 +1940,10 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
1940
1940
|
Q ?? (/* @__PURE__ */ new Date()).toISOString()
|
|
1941
1941
|
);
|
|
1942
1942
|
if (!W) return "No data";
|
|
1943
|
-
const
|
|
1943
|
+
const te = oe.fromDinero(W);
|
|
1944
1944
|
return {
|
|
1945
|
-
...
|
|
1946
|
-
currency: W.currency || Ce(((ae = c.currentCountry) == null ? void 0 : ae.value) ??
|
|
1945
|
+
...oe.multiply([te, p]),
|
|
1946
|
+
currency: W.currency || Ce(((ae = c.currentCountry) == null ? void 0 : ae.value) ?? it)
|
|
1947
1947
|
};
|
|
1948
1948
|
}
|
|
1949
1949
|
}), G = T(() => {
|
|
@@ -1954,15 +1954,15 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
1954
1954
|
return i == null ? void 0 : i.toCostBalances;
|
|
1955
1955
|
});
|
|
1956
1956
|
return !u || u.some((m) => m.cost == null) ? "No data" : {
|
|
1957
|
-
...u.reduce((m, i) =>
|
|
1957
|
+
...u.reduce((m, i) => oe.add([m, oe.fromDinero(i.cost)]), {
|
|
1958
1958
|
amount: 0,
|
|
1959
1959
|
precision: 0
|
|
1960
1960
|
}),
|
|
1961
1961
|
currency: Ce((p = c.currentCountry) == null ? void 0 : p.value)
|
|
1962
1962
|
};
|
|
1963
|
-
}), H = T(() => b.sku.valuation ===
|
|
1963
|
+
}), H = T(() => b.sku.valuation === ut.Enum.FIFO ? G.value : F.value);
|
|
1964
1964
|
function J() {
|
|
1965
|
-
const { startDate: u, endDate: h } =
|
|
1965
|
+
const { startDate: u, endDate: h } = to(v.value);
|
|
1966
1966
|
u !== null && h !== null && (v.value = {
|
|
1967
1967
|
startDate: u,
|
|
1968
1968
|
endDate: h
|
|
@@ -1970,8 +1970,8 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
1970
1970
|
}
|
|
1971
1971
|
const I = Ye(b, "show");
|
|
1972
1972
|
return (u, h) => {
|
|
1973
|
-
const p = D("FmButton"), m = D("FmField"), i = D("FmDateRangePicker"), S = D("FmSpacer"), P = D("FmCircularProgress"), ee = D("FmIcon"), ae = D("FmTooltip"), Q = D("FmMenuDivider"), W = D("FmChip"),
|
|
1974
|
-
return j(),
|
|
1973
|
+
const p = D("FmButton"), m = D("FmField"), i = D("FmDateRangePicker"), S = D("FmSpacer"), P = D("FmCircularProgress"), ee = D("FmIcon"), ae = D("FmTooltip"), Q = D("FmMenuDivider"), W = D("FmChip"), te = D("FmSelect"), le = D("FmCardSection"), ce = D("FmCard"), je = D("FmSideSheet");
|
|
1974
|
+
return j(), ne(je, {
|
|
1975
1975
|
"dismiss-away": "",
|
|
1976
1976
|
modelValue: s(I),
|
|
1977
1977
|
"onUpdate:modelValue": h[5] || (h[5] = (fe) => Pe(I) ? I.value = fe : null),
|
|
@@ -1981,7 +1981,7 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
1981
1981
|
"side-sheet-header": M(() => [
|
|
1982
1982
|
e("div", Tn, [
|
|
1983
1983
|
e("div", En, f(s(r)("inventory.stock.history.title", [u.sku.name])), 1),
|
|
1984
|
-
|
|
1984
|
+
y(p, {
|
|
1985
1985
|
variant: "tertiary",
|
|
1986
1986
|
"prepend-icon": "close",
|
|
1987
1987
|
onClick: h[0] || (h[0] = (fe) => I.value = !1)
|
|
@@ -1994,7 +1994,7 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
1994
1994
|
e("div", Un, [
|
|
1995
1995
|
e("div", Pn, [
|
|
1996
1996
|
e("div", Rn, [
|
|
1997
|
-
|
|
1997
|
+
y(i, {
|
|
1998
1998
|
modelValue: v.value,
|
|
1999
1999
|
"onUpdate:modelValue": h[1] || (h[1] = (de) => v.value = de),
|
|
2000
2000
|
"show-predefined-range": "",
|
|
@@ -2003,7 +2003,7 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
2003
2003
|
"z-index": 50
|
|
2004
2004
|
}, {
|
|
2005
2005
|
"trigger-button": M(({ opened: de }) => [
|
|
2006
|
-
|
|
2006
|
+
y(m, {
|
|
2007
2007
|
"prepend-icon": "calendar_month",
|
|
2008
2008
|
focused: de
|
|
2009
2009
|
}, {
|
|
@@ -2016,27 +2016,27 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
2016
2016
|
_: 1
|
|
2017
2017
|
}, 8, ["modelValue"])
|
|
2018
2018
|
]),
|
|
2019
|
-
|
|
2019
|
+
y(p, {
|
|
2020
2020
|
variant: "tertiary",
|
|
2021
2021
|
onClick: h[2] || (h[2] = (de) => Z()),
|
|
2022
2022
|
"prepend-icon": "navigate_before"
|
|
2023
2023
|
}),
|
|
2024
|
-
|
|
2024
|
+
y(p, {
|
|
2025
2025
|
variant: "tertiary",
|
|
2026
2026
|
onClick: h[3] || (h[3] = (de) => J()),
|
|
2027
2027
|
"prepend-icon": "navigate_next"
|
|
2028
2028
|
})
|
|
2029
2029
|
]),
|
|
2030
2030
|
R.value ? (j(), q("div", Nn, [
|
|
2031
|
-
|
|
2032
|
-
|
|
2031
|
+
y(S),
|
|
2032
|
+
y(P, { size: "xl" }),
|
|
2033
2033
|
e("div", On, f(s(r)("inventory.stock.history.loading")), 1),
|
|
2034
|
-
|
|
2035
|
-
|
|
2034
|
+
y(S),
|
|
2035
|
+
y(S)
|
|
2036
2036
|
])) : t.value && ((fe = t.value) == null ? void 0 : fe.length) > 0 ? (j(), q("div", Ln, [
|
|
2037
|
-
|
|
2037
|
+
y(ce, { variant: "outlined" }, {
|
|
2038
2038
|
default: M(() => [
|
|
2039
|
-
|
|
2039
|
+
y(le, { class: "flex flex-col gap-4" }, {
|
|
2040
2040
|
default: M(() => [
|
|
2041
2041
|
e("div", Yn, [
|
|
2042
2042
|
e("div", zn, f(s(r)("inventory.stock.history.summary.title")), 1)
|
|
@@ -2049,7 +2049,7 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
2049
2049
|
e("div", Xn, [
|
|
2050
2050
|
e("div", Jn, [
|
|
2051
2051
|
me(f(s(r)("inventory.stock.history.summary.totalSales")) + " ", 1),
|
|
2052
|
-
X.value != null ? (j(),
|
|
2052
|
+
X.value != null ? (j(), ne(ae, {
|
|
2053
2053
|
key: 0,
|
|
2054
2054
|
variant: "plain",
|
|
2055
2055
|
placement: "top",
|
|
@@ -2057,7 +2057,7 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
2057
2057
|
"z-index": 50
|
|
2058
2058
|
}, {
|
|
2059
2059
|
default: M(() => [
|
|
2060
|
-
|
|
2060
|
+
y(ee, {
|
|
2061
2061
|
name: "warning",
|
|
2062
2062
|
size: "sm"
|
|
2063
2063
|
})
|
|
@@ -2097,34 +2097,35 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
2097
2097
|
])
|
|
2098
2098
|
]),
|
|
2099
2099
|
s(d).enableTotalCost ? (j(), q("div", bs, [
|
|
2100
|
-
|
|
2100
|
+
y(Q, { class: "w-full" }),
|
|
2101
2101
|
e("div", gs, [
|
|
2102
2102
|
e("div", xs, [
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
}, 8, ["content"])
|
|
2121
|
-
])
|
|
2103
|
+
e("div", Ss, [
|
|
2104
|
+
e("div", ws, [
|
|
2105
|
+
me(f(s(r)("inventory.stock.history.estimatedValue")) + " ", 1),
|
|
2106
|
+
y(ae, {
|
|
2107
|
+
variant: "plain",
|
|
2108
|
+
placement: "top",
|
|
2109
|
+
content: `[${re.value}] ${s(r)("inventory.stock.history.estimatedValueTooltip")}`,
|
|
2110
|
+
"z-index": 50
|
|
2111
|
+
}, {
|
|
2112
|
+
default: M(() => [
|
|
2113
|
+
y(ee, {
|
|
2114
|
+
name: "help",
|
|
2115
|
+
size: "sm"
|
|
2116
|
+
})
|
|
2117
|
+
]),
|
|
2118
|
+
_: 1
|
|
2119
|
+
}, 8, ["content"])
|
|
2122
2120
|
]),
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2121
|
+
y(qe, {
|
|
2122
|
+
tier: "premium",
|
|
2123
|
+
category: "premium"
|
|
2124
|
+
})
|
|
2125
|
+
]),
|
|
2126
|
+
e("div", As, [
|
|
2127
|
+
u.sku.valuation === s(ut).Enum.FIFO ? (j(), q(ue, { key: 0 }, [
|
|
2128
|
+
y(W, {
|
|
2128
2129
|
label: "FIFO",
|
|
2129
2130
|
compact: ""
|
|
2130
2131
|
}),
|
|
@@ -2141,7 +2142,7 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
2141
2142
|
) : H.value), 1)
|
|
2142
2143
|
], 64))
|
|
2143
2144
|
]),
|
|
2144
|
-
|
|
2145
|
+
y(te, {
|
|
2145
2146
|
modelValue: l.value,
|
|
2146
2147
|
"onUpdate:modelValue": h[4] || (h[4] = (de) => l.value = de),
|
|
2147
2148
|
items: a.value,
|
|
@@ -2150,32 +2151,33 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
2150
2151
|
style: { width: "200px" }
|
|
2151
2152
|
}, null, 8, ["modelValue", "items"])
|
|
2152
2153
|
]),
|
|
2153
|
-
e("div",
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
})
|
|
2174
|
-
])
|
|
2154
|
+
e("div", Fs, [
|
|
2155
|
+
e("div", $s, [
|
|
2156
|
+
e("div", js, [
|
|
2157
|
+
me(f(s(r)("inventory.stock.history.costSold")) + " ", 1),
|
|
2158
|
+
y(ae, {
|
|
2159
|
+
variant: "plain",
|
|
2160
|
+
placement: "top",
|
|
2161
|
+
"z-index": 50
|
|
2162
|
+
}, {
|
|
2163
|
+
content: M(() => [
|
|
2164
|
+
e("div", Vs, f(s(r)("inventory.stock.history.costSoldTooltip")), 1)
|
|
2165
|
+
]),
|
|
2166
|
+
default: M(() => [
|
|
2167
|
+
y(ee, {
|
|
2168
|
+
name: "help",
|
|
2169
|
+
size: "sm"
|
|
2170
|
+
})
|
|
2171
|
+
]),
|
|
2172
|
+
_: 1
|
|
2173
|
+
})
|
|
2175
2174
|
]),
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2175
|
+
y(qe, {
|
|
2176
|
+
tier: "premium",
|
|
2177
|
+
category: "premium"
|
|
2178
|
+
})
|
|
2179
|
+
]),
|
|
2180
|
+
e("div", Cs, f(U.value), 1)
|
|
2179
2181
|
])
|
|
2180
2182
|
])
|
|
2181
2183
|
])) : se("", !0)
|
|
@@ -2189,7 +2191,7 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
2189
2191
|
(j(!0), q(ue, null, ve(t.value, (de) => (j(), q(ue, {
|
|
2190
2192
|
key: de.date
|
|
2191
2193
|
}, [
|
|
2192
|
-
u.sku ? (j(),
|
|
2194
|
+
u.sku ? (j(), ne(Mn, {
|
|
2193
2195
|
key: 0,
|
|
2194
2196
|
record: de,
|
|
2195
2197
|
sku: u.sku,
|
|
@@ -2199,18 +2201,18 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
2199
2201
|
onRefreshHistory: g
|
|
2200
2202
|
}, null, 8, ["record", "sku", "bills", "unit-cost-history", "cost-mechanism"])) : se("", !0)
|
|
2201
2203
|
], 64))), 128))
|
|
2202
|
-
])) : (j(), q("div",
|
|
2203
|
-
|
|
2204
|
+
])) : (j(), q("div", Bs, [
|
|
2205
|
+
y(S),
|
|
2204
2206
|
e("div", null, [
|
|
2205
2207
|
e("img", {
|
|
2206
|
-
src: s(
|
|
2208
|
+
src: s(so),
|
|
2207
2209
|
alt: "List is empty"
|
|
2208
|
-
}, null, 8,
|
|
2210
|
+
}, null, 8, Ds)
|
|
2209
2211
|
]),
|
|
2210
|
-
e("div",
|
|
2211
|
-
e("div",
|
|
2212
|
-
|
|
2213
|
-
|
|
2212
|
+
e("div", Ms, f(s(r)("inventory.stock.history.noRecords")), 1),
|
|
2213
|
+
e("div", Is, f(s(r)("inventory.stock.history.changeDateRange")), 1),
|
|
2214
|
+
y(S),
|
|
2215
|
+
y(S)
|
|
2214
2216
|
]))
|
|
2215
2217
|
])
|
|
2216
2218
|
];
|
|
@@ -2219,7 +2221,7 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
2219
2221
|
}, 8, ["modelValue"]);
|
|
2220
2222
|
};
|
|
2221
2223
|
}
|
|
2222
|
-
}),
|
|
2224
|
+
}), Ts = /* @__PURE__ */ pe({
|
|
2223
2225
|
__name: "HrmPermissionGuard",
|
|
2224
2226
|
props: {
|
|
2225
2227
|
permission: { default: void 0 },
|
|
@@ -2233,12 +2235,12 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
2233
2235
|
});
|
|
2234
2236
|
Vt(() => {
|
|
2235
2237
|
});
|
|
2236
|
-
const { hasPermission:
|
|
2237
|
-
return (w, V) => s(
|
|
2238
|
+
const { hasPermission: _ } = At(k, () => c.mode);
|
|
2239
|
+
return (w, V) => s(_) ? at(w.$slots, "default", { key: 0 }) : at(w.$slots, "fallback", { key: 1 });
|
|
2238
2240
|
}
|
|
2239
2241
|
});
|
|
2240
|
-
function
|
|
2241
|
-
const c =
|
|
2242
|
+
function Es(A) {
|
|
2243
|
+
const c = io(), k = Se(), _ = Y(!1), w = Y(null), V = Y(null);
|
|
2242
2244
|
let d = null, r = !1, b = !1;
|
|
2243
2245
|
function R() {
|
|
2244
2246
|
if (b) return;
|
|
@@ -2262,7 +2264,7 @@ function Hs(A) {
|
|
|
2262
2264
|
var B, v, g;
|
|
2263
2265
|
if (!(!b || !a)) {
|
|
2264
2266
|
if (w.value = a, a.completedAt && (V.value = a.completedAt), a.message === "processing" || !a.completedAt && !a.message) {
|
|
2265
|
-
r = !0,
|
|
2267
|
+
r = !0, _.value = !0;
|
|
2266
2268
|
return;
|
|
2267
2269
|
}
|
|
2268
2270
|
if (a.message === "completed" || a.completedAt) {
|
|
@@ -2283,25 +2285,25 @@ function Hs(A) {
|
|
|
2283
2285
|
}
|
|
2284
2286
|
}
|
|
2285
2287
|
function l() {
|
|
2286
|
-
d && (d(), d = null), b = !1, r = !1,
|
|
2288
|
+
d && (d(), d = null), b = !1, r = !1, _.value = !1, w.value = null;
|
|
2287
2289
|
}
|
|
2288
2290
|
return Ct(() => {
|
|
2289
2291
|
l();
|
|
2290
2292
|
}), {
|
|
2291
|
-
refreshing:
|
|
2293
|
+
refreshing: _,
|
|
2292
2294
|
refreshStatus: w,
|
|
2293
2295
|
lastCompletedAt: V,
|
|
2294
2296
|
startListening: R,
|
|
2295
2297
|
stopListening: l
|
|
2296
2298
|
};
|
|
2297
2299
|
}
|
|
2298
|
-
const
|
|
2300
|
+
const Us = {
|
|
2299
2301
|
key: 0,
|
|
2300
2302
|
class: "flex items-center gap-1"
|
|
2301
|
-
},
|
|
2303
|
+
}, Ps = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Rs = { class: "flex flex-col gap-8" }, Ns = { class: "flex flex-col" }, Os = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ls = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, ga = /* @__PURE__ */ pe({
|
|
2302
2304
|
__name: "StockView",
|
|
2303
2305
|
setup(A) {
|
|
2304
|
-
const { t: c } = ye(), k = Ne(),
|
|
2306
|
+
const { t: c } = ye(), k = Ne(), _ = Se(), w = Oe(), V = Ft(), d = Ae(), r = gt(), b = uo(), { columnDefs: R } = ko(), C = Je(), { hasPermission: l } = At(
|
|
2305
2307
|
T(() => [
|
|
2306
2308
|
{
|
|
2307
2309
|
action: Be.Action.manage,
|
|
@@ -2314,10 +2316,10 @@ const Ts = {
|
|
|
2314
2316
|
return l.value || ((p = C.sessionUser.value) == null ? void 0 : p.role.isAdmin);
|
|
2315
2317
|
}
|
|
2316
2318
|
), B = Le(), v = we();
|
|
2317
|
-
|
|
2319
|
+
_.watchLocation(X);
|
|
2318
2320
|
const g = T(
|
|
2319
2321
|
() => new Set(b.getAvailableItems(b.businessSubsidiaryId))
|
|
2320
|
-
), o = Y(!1), t = Y(!1), { refreshing: n, lastCompletedAt: $, startListening: E, stopListening: N } =
|
|
2322
|
+
), o = Y(!1), t = Y(!1), { refreshing: n, lastCompletedAt: $, startListening: E, stopListening: N } = Es({
|
|
2321
2323
|
onCompleted: async () => {
|
|
2322
2324
|
await X(), t.value = !1, v.open({
|
|
2323
2325
|
title: "Balance refreshed",
|
|
@@ -2374,7 +2376,7 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
|
|
|
2374
2376
|
});
|
|
2375
2377
|
}
|
|
2376
2378
|
async function X() {
|
|
2377
|
-
if (
|
|
2379
|
+
if (_._currentLocation) {
|
|
2378
2380
|
o.value = !0;
|
|
2379
2381
|
try {
|
|
2380
2382
|
await w.readStockBalance(), await w.readProductBalance(), await r.readStockEstimateBalance();
|
|
@@ -2408,10 +2410,10 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
|
|
|
2408
2410
|
]
|
|
2409
2411
|
}), U = T(() => {
|
|
2410
2412
|
var i, S, P;
|
|
2411
|
-
const p = K.value ?
|
|
2413
|
+
const p = K.value ? co.build(K.value) : null, m = [];
|
|
2412
2414
|
for (const ee of k.skus) {
|
|
2413
2415
|
let ae = !0;
|
|
2414
|
-
if (b.isEnabled && re.value && g.value && ae && (ae = g.value.has(ee._id)), p && ae && (ae =
|
|
2416
|
+
if (b.isEnabled && re.value && g.value && ae && (ae = g.value.has(ee._id)), p && ae && (ae = mo(
|
|
2415
2417
|
{
|
|
2416
2418
|
status: ee.isInactive ? "Inactive" : "Active"
|
|
2417
2419
|
},
|
|
@@ -2420,7 +2422,7 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
|
|
|
2420
2422
|
const Q = ee.trackingMeasurement;
|
|
2421
2423
|
let W = (S = (i = w.stockBalance.skus) == null ? void 0 : i.find(
|
|
2422
2424
|
(ce) => ce.id === ee._id
|
|
2423
|
-
)) == null ? void 0 : S.balance,
|
|
2425
|
+
)) == null ? void 0 : S.balance, te = r.inventoryForecast.skus.find(
|
|
2424
2426
|
(ce) => ce.id === ee._id
|
|
2425
2427
|
);
|
|
2426
2428
|
const le = {
|
|
@@ -2429,15 +2431,15 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
|
|
|
2429
2431
|
amount: 0,
|
|
2430
2432
|
precision: 0
|
|
2431
2433
|
},
|
|
2432
|
-
operator:
|
|
2433
|
-
day: (
|
|
2434
|
+
operator: te == null ? void 0 : te.operator,
|
|
2435
|
+
day: (te == null ? void 0 : te.depletionDays) ?? void 0,
|
|
2434
2436
|
trackingUnitAbbrev: Q ? ((P = ee.unit.measurements.find((ce) => ce.id === Q)) == null ? void 0 : P.abbrev) ?? "" : ee.unit.abbrev
|
|
2435
2437
|
};
|
|
2436
2438
|
m.push(le);
|
|
2437
2439
|
}
|
|
2438
2440
|
}
|
|
2439
2441
|
return m;
|
|
2440
|
-
}), Z = Y(""), re = Y(!0), { breakpoints: x } =
|
|
2442
|
+
}), Z = Y(""), re = Y(!0), { breakpoints: x } = Nt(), F = T(() => x.value.xs || x.value.sm), G = T(() => F.value ? 10 : 20), H = Dt(), J = T(() => {
|
|
2441
2443
|
const p = [
|
|
2442
2444
|
{
|
|
2443
2445
|
label: c("inventory.stock.stock_balance.refreshBalance"),
|
|
@@ -2476,7 +2478,7 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
|
|
|
2476
2478
|
}
|
|
2477
2479
|
return (p, m) => {
|
|
2478
2480
|
const i = D("FmSwitch"), S = D("FmTable");
|
|
2479
|
-
return j(),
|
|
2481
|
+
return j(), ne(Mt, {
|
|
2480
2482
|
title: s(c)("inventory.stock.title"),
|
|
2481
2483
|
actions: J.value,
|
|
2482
2484
|
"onClick:action": h
|
|
@@ -2493,7 +2495,7 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
|
|
|
2493
2495
|
}
|
|
2494
2496
|
])
|
|
2495
2497
|
}, [
|
|
2496
|
-
|
|
2498
|
+
y(lo, {
|
|
2497
2499
|
searchable: "",
|
|
2498
2500
|
"change-location": "",
|
|
2499
2501
|
search: Z.value,
|
|
@@ -2505,12 +2507,12 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
|
|
|
2505
2507
|
"onUpdate:filter": m[2] || (m[2] = (W) => K.value = W)
|
|
2506
2508
|
}, {
|
|
2507
2509
|
default: M(() => [
|
|
2508
|
-
s(b).isEnabled ? (j(), q("div",
|
|
2509
|
-
e("span",
|
|
2510
|
-
|
|
2511
|
-
|
|
2510
|
+
s(b).isEnabled ? (j(), q("div", Us, [
|
|
2511
|
+
e("span", Ps, f(s(c)("inventory.integration.netsuite.subsidiaryHierarchy.filtering")), 1),
|
|
2512
|
+
y(Rt),
|
|
2513
|
+
y(Qe, null, {
|
|
2512
2514
|
default: M(() => [
|
|
2513
|
-
|
|
2515
|
+
y(i, {
|
|
2514
2516
|
modelValue: re.value,
|
|
2515
2517
|
"onUpdate:modelValue": m[0] || (m[0] = (W) => re.value = W)
|
|
2516
2518
|
}, null, 8, ["modelValue"])
|
|
@@ -2521,46 +2523,46 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
|
|
|
2521
2523
|
]),
|
|
2522
2524
|
_: 1
|
|
2523
2525
|
}, 8, ["search", "filter-attributes", "filter"]),
|
|
2524
|
-
(j(),
|
|
2526
|
+
(j(), ne(S, {
|
|
2525
2527
|
style: kt(s(H).tableHeight),
|
|
2526
2528
|
"column-defs": s(R),
|
|
2527
2529
|
"row-data": U.value,
|
|
2528
2530
|
"search-value": Z.value,
|
|
2529
|
-
loading: o.value || s(n) || !s(
|
|
2530
|
-
key: (P = s(
|
|
2531
|
+
loading: o.value || s(n) || !s(_)._currentLocation,
|
|
2532
|
+
key: (P = s(_)._currentLocation) == null ? void 0 : P.dbName,
|
|
2531
2533
|
onRowClick: m[3] || (m[3] = (W) => s(V).showSkuHistory(W.original)),
|
|
2532
2534
|
"page-size": G.value
|
|
2533
2535
|
}, {
|
|
2534
2536
|
"list-row": M((W) => [
|
|
2535
|
-
|
|
2537
|
+
y(ro, {
|
|
2536
2538
|
row: W,
|
|
2537
2539
|
onRowClick: s(V).showSkuHistory
|
|
2538
2540
|
}, {
|
|
2539
|
-
default: M((
|
|
2540
|
-
var le, ce, je, fe, de,
|
|
2541
|
+
default: M((te) => {
|
|
2542
|
+
var le, ce, je, fe, de, et, tt, ot, Ve, nt;
|
|
2541
2543
|
return [
|
|
2542
|
-
e("div",
|
|
2543
|
-
e("div",
|
|
2544
|
-
e("div",
|
|
2545
|
-
|
|
2546
|
-
render: (je = (ce = (le =
|
|
2547
|
-
props: (de = (fe =
|
|
2544
|
+
e("div", Rs, [
|
|
2545
|
+
e("div", Ns, [
|
|
2546
|
+
e("div", Os, [
|
|
2547
|
+
y(s(ft), {
|
|
2548
|
+
render: (je = (ce = (le = te.code) == null ? void 0 : le.column) == null ? void 0 : ce.columnDef) == null ? void 0 : je.cell,
|
|
2549
|
+
props: (de = (fe = te.code) == null ? void 0 : fe.getContext) == null ? void 0 : de.call(fe)
|
|
2548
2550
|
}, null, 8, ["render", "props"])
|
|
2549
2551
|
]),
|
|
2550
|
-
e("div",
|
|
2551
|
-
|
|
2552
|
-
render: (
|
|
2553
|
-
props: (
|
|
2552
|
+
e("div", Ls, [
|
|
2553
|
+
y(s(ft), {
|
|
2554
|
+
render: (ot = (tt = (et = te.name) == null ? void 0 : et.column) == null ? void 0 : tt.columnDef) == null ? void 0 : ot.cell,
|
|
2555
|
+
props: (nt = (Ve = te.name) == null ? void 0 : Ve.getContext) == null ? void 0 : nt.call(Ve)
|
|
2554
2556
|
}, null, 8, ["render", "props"])
|
|
2555
2557
|
])
|
|
2556
2558
|
]),
|
|
2557
2559
|
e("div", null, [
|
|
2558
|
-
|
|
2560
|
+
y(Ke, {
|
|
2559
2561
|
days: W.original.day
|
|
2560
2562
|
}, null, 8, ["days"])
|
|
2561
2563
|
]),
|
|
2562
2564
|
e("div", null, [
|
|
2563
|
-
|
|
2565
|
+
y(ht, {
|
|
2564
2566
|
class: "xs:w-[160px]",
|
|
2565
2567
|
unit: W.original.unit,
|
|
2566
2568
|
sku: W.original,
|
|
@@ -2577,20 +2579,20 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
|
|
|
2577
2579
|
_: 1
|
|
2578
2580
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
2579
2581
|
], 2),
|
|
2580
|
-
(j(),
|
|
2581
|
-
(ee = s(V).stockHistoryProps) != null && ee.sku ? (j(),
|
|
2582
|
-
(ae = s(V).convertSkuDialogProps) != null && ae.sku ? (j(),
|
|
2583
|
-
(Q = s(V).adjustSkuDialogProps) != null && Q.stock ? (j(),
|
|
2582
|
+
(j(), ne(Bt, { to: "body" }, [
|
|
2583
|
+
(ee = s(V).stockHistoryProps) != null && ee.sku ? (j(), ne(Hs, rt(ze({ key: 0 }, s(V).stockHistoryProps)), null, 16)) : se("", !0),
|
|
2584
|
+
(ae = s(V).convertSkuDialogProps) != null && ae.sku ? (j(), ne(Mo, rt(ze({ key: 1 }, s(V).convertSkuDialogProps)), null, 16)) : se("", !0),
|
|
2585
|
+
(Q = s(V).adjustSkuDialogProps) != null && Q.stock ? (j(), ne(Go, ze({ key: 2 }, s(V).adjustSkuDialogProps, {
|
|
2584
2586
|
onSubmitted: m[4] || (m[4] = (W) => X())
|
|
2585
2587
|
}), null, 16)) : se("", !0),
|
|
2586
|
-
|
|
2588
|
+
y(Ts, {
|
|
2587
2589
|
permission: {
|
|
2588
2590
|
action: s(Be).Action.manage,
|
|
2589
2591
|
subject: s(Be).Subject.Business.inventory_stockAdjustment
|
|
2590
2592
|
}
|
|
2591
2593
|
}, {
|
|
2592
2594
|
default: M(() => [
|
|
2593
|
-
I.value ? (j(),
|
|
2595
|
+
I.value ? (j(), ne(sn, {
|
|
2594
2596
|
key: 0,
|
|
2595
2597
|
show: I.value,
|
|
2596
2598
|
"onUpdate:show": m[5] || (m[5] = (W) => I.value = W),
|
|
@@ -2608,5 +2610,5 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
|
|
|
2608
2610
|
}
|
|
2609
2611
|
});
|
|
2610
2612
|
export {
|
|
2611
|
-
|
|
2613
|
+
ga as default
|
|
2612
2614
|
};
|