@feedmepos/mf-inventory-portal 1.8.0-dev.4 → 1.8.0-dev.5
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-FeJnwZme.js → App-DEbWEOwe.js} +609 -558
- package/dist/{ApprovalView-Eo-cGWyA.js → ApprovalView-BEnYHIlU.js} +9 -9
- package/dist/{BindingsDialog-DkjuXydb.js → BindingsDialog-CJVkMoBS.js} +2 -2
- package/dist/{BindingsPicker-DUOQcOlj.js → BindingsPicker-CX9o-xdQ.js} +2 -2
- package/dist/{BindingsTable-CoDdU5xh.js → BindingsTable-Cil4LJ7l.js} +4 -4
- package/dist/{BulkReceiveRequestView-BGh8fbEX.js → BulkReceiveRequestView-DYEc2jPw.js} +19 -19
- package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-CStISRqy.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-DoAv2mHA.js} +1 -1
- package/dist/{ClosingDraftView-Cwnhrv5P.js → ClosingDraftView-Bz94Iejf.js} +20 -20
- package/dist/{ClosingHistoryView-oHf77Lal.js → ClosingHistoryView-B479Y-mH.js} +5 -5
- package/dist/{ClosingTemplateView-1P8J1vAn.js → ClosingTemplateView-F_nx43n6.js} +18 -18
- package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-BuEPaqQK.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DddYGHxQ.js} +1 -1
- package/dist/{DefaultView-3Z8aVFSU.js → DefaultView-CkZOl0ov.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-uT_e3Suw.js → DeliveryOrderPrintPreview-BJEpwAX6.js} +2 -2
- package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-BCgnXxEi.js → EmailDialog.vue_vue_type_script_setup_true_lang-BW988AoC.js} +23 -23
- package/dist/FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-Izn-hTjK.js +297 -0
- package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-BlKpGdCx.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-CoUWxHlj.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DKkxn1J-.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Ci81xTbl.js} +2 -2
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-dOXDST-E.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CnaHTAUZ.js} +2 -2
- package/dist/{FmMultiselectDialog-DRxZAkcu.js → FmMultiselectDialog-BE8BlO6_.js} +2 -2
- package/dist/FmMultiselectDialog-COKgBmPZ.js +123 -0
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DRSzQqVJ.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BQHd3NjM.js} +6 -6
- package/dist/ImportView-Crb_yrNb.js +1291 -0
- package/dist/{IngredientsView-N9U7tdI_.js → IngredientsView-lDypeR4c.js} +34 -35
- package/dist/{IntegrationExplorerView-CjmeGQ14.js → IntegrationExplorerView-DgOFGj7H.js} +4 -4
- package/dist/{IntegrationView-DAdpmuxx.js → IntegrationView-0sbjINo5.js} +973 -974
- package/dist/{InventoryBindingForm-CAj3MurI.js → InventoryBindingForm-BhyrjIXJ.js} +1 -1
- package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-KCz_BQ6T.js +472 -0
- package/dist/{InventoryBindingSummary-B-1OBUdw.js → InventoryBindingSummary-CsfNKd1r.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CUYYEuW3.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-C32OoIBz.js} +1 -1
- package/dist/{ProductionRunDetailView-eFvl8-By.js → ProductionRunDetailView-BxbDtGMo.js} +4 -4
- package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-DaC7e4qS.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-BdJVvwSP.js} +9 -9
- package/dist/{ProductionRunView-C_NJJKLr.js → ProductionRunView-CJhNEIzT.js} +3 -3
- package/dist/{PublishView-BglAEkzU.js → PublishView-vkt6-D6P.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-BTF9ikpQ.js → PurchaseOrderPrintPreview-25dHfVKp.js} +2 -2
- package/dist/{ReceiveRequestView-BUvehG10.js → ReceiveRequestView-BO4Z2dZu.js} +13 -13
- package/dist/RecipeView-B_AE7QQv.js +3428 -0
- package/dist/{SettingsView-DRR86cHo.js → SettingsView-qTUvQCuu.js} +164 -168
- package/dist/{StockView-D1oEnbZp.js → StockView-yh6qkYUS.js} +267 -267
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CxU92-io.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Cn_fx9qG.js} +1 -1
- package/dist/{SupplierView-D68wz0-g.js → SupplierView-Dqzu1Bvh.js} +14 -14
- package/dist/{SurchargeView-Cw9rTw2h.js → SurchargeView-CDosn36c.js} +7 -7
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-Az-a1Dsp.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-DZ3Gdlp9.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-C-sxbacO.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CWoh2FqQ.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CsHfLaCv.js → TransferDetails.vue_vue_type_script_setup_true_lang-BtjKnIwf.js} +690 -666
- package/dist/{TransferTemplateView-CHPJMjYC.js → TransferTemplateView-fDZcC9i4.js} +20 -20
- package/dist/{UnitCostHistoryView-DM8OzWhe.js → UnitCostHistoryView-CmTTIXAp.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-DpwK5mFH.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-DZihCM0T.js} +4 -4
- package/dist/{UnitView-90uR-ZzQ.js → UnitView-BTx59sFK.js} +8 -8
- package/dist/{WarehouseView-Bulg6Vac.js → WarehouseView-BIFe08FJ.js} +8 -8
- package/dist/{WastageTemplateView-BmAHnnwm.js → WastageTemplateView-B_oJqm0_.js} +15 -15
- package/dist/api/feature-flags.d.ts +2 -0
- package/dist/api/license.d.ts +0 -2
- package/dist/{app-Ccdgbe4f.js → app-DyEvx3Em.js} +1628 -1817
- package/dist/app.d.ts +0 -150
- package/dist/app.js +1 -1
- package/dist/{closing-template-DuBZxoXx.js → closing-template-FgcLy4RT.js} +1 -1
- package/dist/{date2-IBrLdtni.js → date2-Rv4IwT9a.js} +1 -1
- package/dist/{dayjs.min-DEkq-Hpp.js → dayjs.min-DOq1QM_M.js} +1 -1
- package/dist/{decimal-g6jRdlSk.js → decimal-7vA05AaD.js} +2 -2
- package/dist/{defineDeepModel-P5a5Ffpn.js → defineDeepModel-22Md2SKY.js} +1 -1
- package/dist/{duplicate-template-Do8s80ei.js → duplicate-template-D2tjCY7C.js} +1 -1
- package/dist/{feature-ChVm5JED.js → feature-BMTKl6PK.js} +1999 -3092
- package/dist/feature-flags/portal-feature-catalog.d.ts +0 -2
- package/dist/{format-time-from-id-BgbBOII7.js → format-time-from-id-DXhm_Ji1.js} +1 -1
- package/dist/{format-unit-display-hSXy2iu6.js → format-unit-display-DxWLjFPz.js} +13 -13
- package/dist/helper/menu-usage-module.d.ts +1 -1
- package/dist/{id-to-date-DlGYysU8.js → id-to-date-VKlOL3mN.js} +1 -1
- package/dist/{import-export.helper-LrZhiz2W.js → import-export.helper-BiF5aKUp.js} +6 -6
- package/dist/{index-BTNJ1fk2.js → index-DEl_gZn0.js} +3 -3
- package/dist/{index-DsOmtywr.js → index-DdtsVAcv.js} +1 -1
- package/dist/{index-DCiNwlw2.js → index-DoBWE4Ci.js} +1 -1
- package/dist/{lz-string-DRuyjE9G.js → lz-string-BwQj8QRN.js} +1 -1
- package/dist/{netsuite-B6y8GZCP.js → netsuite-s1S33-lP.js} +2 -2
- package/dist/{number-Besn-1-5.js → number-BmKjsNrc.js} +3 -3
- package/dist/{predefined-templates-D92mN_2S.js → predefined-templates-BZ2KqNix.js} +1 -1
- package/dist/{purchase-order-template-hvq2pfWx.js → purchase-order-template-CINU4my1.js} +1 -1
- package/dist/{recalculationUtils-BlZR5O2G.js → recalculationUtils-R5tFu_ts.js} +1 -1
- package/dist/router/name.d.ts +0 -1
- package/dist/{row-action.enum-R2bi3eAv.js → row-action.enum-ePO-Py0V.js} +1 -1
- package/dist/{rules-DzwoRKUS.js → rules-BZrZVzw7.js} +2 -2
- package/dist/{stock-Cq37EARQ.js → stock-C2HOKq0k.js} +8 -8
- package/dist/{stock-oJqnUrtt.js → stock-Ce1UvAZ3.js} +1 -1
- package/dist/stores/feature.d.ts +9 -9
- package/dist/stores/inventory.d.ts +0 -47
- package/dist/stores/supplier.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/{supplier-DtdwvcPr.js → supplier-DgT66emI.js} +2 -2
- package/dist/{surcharge-CjdJGIsM.js → surcharge-CsVMuzPM.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-BqPn_GoZ.js → uom-rules-CR1XukyM.js} +1 -1
- package/dist/{use-ingredient-select-dialog-0hRCj6Fu.js → use-ingredient-select-dialog-CJkG4hEX.js} +2 -2
- package/dist/use-inventory-binding-dialog-B36kPj4V.js +113 -0
- package/dist/{use-template-enabled-locations-8ZfTj4YB.js → use-template-enabled-locations-Boa9QLPV.js} +2 -2
- package/dist/{use-transfer-locations-BGS1EBEt.js → use-transfer-locations-BxOygSUg.js} +2 -2
- package/dist/{useHrmPermission-BcQ2KPD-.js → useHrmPermission-DLHAqbLV.js} +1 -1
- package/dist/{useNavigationMenu-DImtns81.js → useNavigationMenu-D6abZMGz.js} +65 -74
- package/dist/{useSseClient-DPSFFVci.js → useSseClient-C7pff-EW.js} +1 -1
- package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +0 -1
- package/dist/views/ingredients/components/inventory-binding/composables/use-inventory-binding-dialog.d.ts +0 -1
- package/dist/views/ingredients/components/inventory-binding/v2/InventoryBindingFormV2.vue.d.ts +0 -1
- package/dist/views/ingredients/components/inventory-binding/v2/composables/use-inventory-binding-dialog.d.ts +0 -1
- package/dist/views/ingredients/helper/is-linked-ingredient-error.d.ts +1 -1
- package/dist/views/integration/components/IntegrationCard.vue.d.ts +3 -3
- package/dist/views/recipe/helper/bulk-edit-simulation.helper.d.ts +0 -1
- package/dist/views/recipe/helper/import-recipe.d.ts +2 -2
- package/dist/{vue-i18n-DTyGIjTI.js → vue-i18n-CpOOFhVU.js} +219 -219
- package/dist/{xlsx.util-CK9Lnq3Q.js → xlsx.util-xwI5tVz6.js} +2 -2
- package/package.json +4 -4
- package/dist/DeprecateSoonWarningDialog.vue_vue_type_script_setup_true_lang-D_vmtZDZ.js +0 -58
- package/dist/FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-D-RzUmqA.js +0 -81
- package/dist/FmMultiselectDialog-C8uYx8rr.js +0 -77
- package/dist/ImportView-Qigtf3ik.js +0 -1302
- package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-B8PJeYrP.js +0 -51
- package/dist/IngredientGroupView-RNYZLkQu.js +0 -1000
- package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-3pYuu62C.js +0 -563
- package/dist/RecipeView-DO5-jgwh.js +0 -3624
- package/dist/feature-flags/premium-flags.spec.d.ts +0 -1
- package/dist/random-CSbEbElR.js +0 -10
- package/dist/use-inventory-binding-dialog-BLRcIC1u.js +0 -152
- package/dist/usePromise-CbVUCxhj.js +0 -29
- package/dist/views/ingredient-group/IngredientGroupView.vue.d.ts +0 -3
- package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialog.vue.d.ts +0 -31
- package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialogProps.d.ts +0 -10
- package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupForm.vue.d.ts +0 -21
- package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupFormProps.d.ts +0 -12
- package/dist/views/ingredient-group/components/ingredient-group-rule-field/IngredientGroupRuleField.vue.d.ts +0 -37
- package/dist/views/ingredient-group/composables/use-ingredient-group-actions.d.ts +0 -24
- package/dist/views/ingredient-group/composables/use-ingredient-group-rule-item.d.ts +0 -31
- package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +0 -77
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { defineComponent as pe, createElementBlock as q, openBlock as j, createElementVNode as e, createVNode as y, toDisplayString as
|
|
1
|
+
import { defineComponent as pe, createElementBlock as q, openBlock as j, createElementVNode as e, createVNode as y, toDisplayString as m, 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 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-
|
|
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-DyEvx3Em.js";
|
|
4
|
+
import { u as Oe } from "./stock-C2HOKq0k.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
|
|
8
|
-
import { a as qe } from "./FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-
|
|
6
|
+
import { _ as ht, o as Pt } from "./UnitDisplayControl.vue_vue_type_script_setup_true_lang-DZihCM0T.js";
|
|
7
|
+
import { _ as Ke, S as We, g as bt, a as Rt } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Cn_fx9qG.js";
|
|
8
|
+
import { a as qe } from "./FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-Izn-hTjK.js";
|
|
9
9
|
import { useI18n as ye, useCoreStore as Je } from "@feedmepos/mf-common";
|
|
10
|
-
import { u as gt, i as Te } from "./id-to-date-
|
|
10
|
+
import { u as gt, i as Te } from "./id-to-date-VKlOL3mN.js";
|
|
11
11
|
import { useSnackbar as we, useDialog as Le, useProxiedModel as Ye, useBreakpoints as Nt } from "@feedmepos/ui-library";
|
|
12
12
|
import { defineStore as Ot } from "pinia";
|
|
13
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-
|
|
15
|
-
import { u as Ae } from "./stock-
|
|
16
|
-
import { c as Ue, A as
|
|
17
|
-
import { u as qt } from "./use-inventory-binding-dialog-
|
|
18
|
-
import { a as St } from "./FmMultiselectDialog-
|
|
19
|
-
import { d as ke } from "./dayjs.min-
|
|
20
|
-
import { _ as Xt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-
|
|
21
|
-
import { g as Jt } from "./decimal-
|
|
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-
|
|
23
|
-
import { i as no } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-
|
|
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-BmKjsNrc.js";
|
|
15
|
+
import { u as Ae } from "./stock-Ce1UvAZ3.js";
|
|
16
|
+
import { c as Ue, A as Wt, M as Gt, R as Kt } from "./rules-BZrZVzw7.js";
|
|
17
|
+
import { u as qt } from "./use-inventory-binding-dialog-B36kPj4V.js";
|
|
18
|
+
import { a as St } from "./FmMultiselectDialog-BE8BlO6_.js";
|
|
19
|
+
import { d as ke } from "./dayjs.min-DOq1QM_M.js";
|
|
20
|
+
import { _ as Xt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-C32OoIBz.js";
|
|
21
|
+
import { g as Jt } from "./decimal-7vA05AaD.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-Rv4IwT9a.js";
|
|
23
|
+
import { i as no } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-CoUWxHlj.js";
|
|
24
24
|
import { _ as so } from "./empty-placeholder-B0QU467o.js";
|
|
25
|
-
import { F as _e, u as ao } from "./feature-
|
|
26
|
-
import { u as At } from "./useHrmPermission-
|
|
25
|
+
import { F as _e, u as ao } from "./feature-BMTKl6PK.js";
|
|
26
|
+
import { u as At } from "./useHrmPermission-DLHAqbLV.js";
|
|
27
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-
|
|
29
|
-
import { u as io } from "./useSseClient-
|
|
30
|
-
import { u as uo } from "./netsuite-
|
|
28
|
+
import { _ as lo } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CnaHTAUZ.js";
|
|
29
|
+
import { u as io } from "./useSseClient-C7pff-EW.js";
|
|
30
|
+
import { u as uo } from "./netsuite-s1S33-lP.js";
|
|
31
31
|
import { P as co, J as mo } from "./app-C39bYJmq.js";
|
|
32
32
|
var Ie = /* @__PURE__ */ ((A) => (A.History = "History", A.Convert = "Convert", A.Adjust = "Adjust", A))(Ie || {});
|
|
33
33
|
const fo = [
|
|
@@ -61,7 +61,7 @@ const fo = [
|
|
|
61
61
|
setup(A) {
|
|
62
62
|
const { t: c } = ye();
|
|
63
63
|
return (k, _) => (j(), q("div", po, [
|
|
64
|
-
e("div", yo,
|
|
64
|
+
e("div", yo, m(s(c)("inventory.stock.prediction.daysRemaining")), 1),
|
|
65
65
|
y(qe, {
|
|
66
66
|
tier: "standard",
|
|
67
67
|
category: "beta"
|
|
@@ -69,7 +69,7 @@ const fo = [
|
|
|
69
69
|
]));
|
|
70
70
|
}
|
|
71
71
|
}), Ft = Ot("stockActions", () => {
|
|
72
|
-
const A = Y(!1), c = Se(), k = Oe(), _ = gt(), w = we(), V = Le(), { t:
|
|
72
|
+
const A = Y(!1), c = Se(), k = Oe(), _ = gt(), w = we(), V = Le(), { t: f } = ye();
|
|
73
73
|
async function r() {
|
|
74
74
|
if (c._currentLocation) {
|
|
75
75
|
A.value = !0;
|
|
@@ -77,8 +77,8 @@ const fo = [
|
|
|
77
77
|
await k.readStockBalance(), await k.readProductBalance(), await _.readStockEstimateBalance();
|
|
78
78
|
} catch {
|
|
79
79
|
w.open({
|
|
80
|
-
title:
|
|
81
|
-
message:
|
|
80
|
+
title: f("inventory.stock.error.title"),
|
|
81
|
+
message: f("inventory.stock.error.message"),
|
|
82
82
|
type: "error"
|
|
83
83
|
});
|
|
84
84
|
} finally {
|
|
@@ -91,8 +91,8 @@ const fo = [
|
|
|
91
91
|
var $, E, N;
|
|
92
92
|
if (!!!((E = ($ = g.convert) == null ? void 0 : $.inventoryBindings) != null && E.length)) {
|
|
93
93
|
V.open({
|
|
94
|
-
title:
|
|
95
|
-
message:
|
|
94
|
+
title: f("inventory.stock.error.convert.title"),
|
|
95
|
+
message: f("inventory.stock.error.convert.message")
|
|
96
96
|
});
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
@@ -177,8 +177,8 @@ function ko() {
|
|
|
177
177
|
{
|
|
178
178
|
id: "UOM",
|
|
179
179
|
header: () => _("inventory.stock.balance"),
|
|
180
|
-
cell(
|
|
181
|
-
const r =
|
|
180
|
+
cell(f) {
|
|
181
|
+
const r = f.row.original, b = {
|
|
182
182
|
unit: r.unit,
|
|
183
183
|
sku: r,
|
|
184
184
|
amount: r.balance,
|
|
@@ -192,8 +192,8 @@ function ko() {
|
|
|
192
192
|
{
|
|
193
193
|
accessorKey: "isInactive",
|
|
194
194
|
header: () => be(Qe, {}, () => `${_("inventory.ingredient.status.title")}`),
|
|
195
|
-
cell(
|
|
196
|
-
const r =
|
|
195
|
+
cell(f) {
|
|
196
|
+
const r = f.row.original.isInactive;
|
|
197
197
|
return be(
|
|
198
198
|
"span",
|
|
199
199
|
{
|
|
@@ -214,15 +214,15 @@ function ko() {
|
|
|
214
214
|
header: () => be(_o),
|
|
215
215
|
enableSorting: !0,
|
|
216
216
|
sortUndefined: "last",
|
|
217
|
-
cell(
|
|
217
|
+
cell(f) {
|
|
218
218
|
var B, v;
|
|
219
|
-
const r =
|
|
219
|
+
const r = f.row.original.day, b = f.row.original.operator, R = (B = f.row.original.thresholds) == null ? void 0 : B.low, C = (v = f.row.original.thresholds) == null ? void 0 : v.mid;
|
|
220
220
|
if (typeof r != "number" || typeof R != "number" || typeof C != "number")
|
|
221
221
|
return be(Ke, {
|
|
222
222
|
days: r,
|
|
223
223
|
operator: b
|
|
224
224
|
});
|
|
225
|
-
const l = r <= R ?
|
|
225
|
+
const l = r <= R ? We.low : r <= C ? We.mid : We.high;
|
|
226
226
|
return be(Ke, {
|
|
227
227
|
days: r,
|
|
228
228
|
level: l
|
|
@@ -232,11 +232,11 @@ function ko() {
|
|
|
232
232
|
},
|
|
233
233
|
{
|
|
234
234
|
id: "action",
|
|
235
|
-
cell(
|
|
235
|
+
cell(f) {
|
|
236
236
|
var r;
|
|
237
237
|
return Ut(
|
|
238
238
|
((r = A._currentLocation) == null ? void 0 : r.type) === "restaurant" ? fo : vo,
|
|
239
|
-
(b) => c.onActionMenu(b,
|
|
239
|
+
(b) => c.onActionMenu(b, f.row.original)
|
|
240
240
|
);
|
|
241
241
|
},
|
|
242
242
|
enableSorting: !1,
|
|
@@ -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 _ = A, w = k, V = qt(),
|
|
298
|
+
const _ = A, w = k, V = qt(), f = Ne(), r = Ae(), b = we(), { t: R } = ye(), C = Y(0), l = Y(null), a = T(() => f.skus), B = T(
|
|
299
299
|
() => {
|
|
300
300
|
var x, F;
|
|
301
301
|
return (((F = (x = _.sku) == null ? void 0 : x.convert) == null ? void 0 : F.inventoryBindings) ?? []).filter(
|
|
302
|
-
(
|
|
302
|
+
(W) => W.type === lt.enum.SKU
|
|
303
303
|
);
|
|
304
304
|
}
|
|
305
305
|
), v = T({
|
|
@@ -327,37 +327,37 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
|
|
|
327
327
|
const F = (I = _.sku.convert) != null && I.measurement ? _.sku.unit.measurements.find((u) => {
|
|
328
328
|
var h;
|
|
329
329
|
return u.id === ((h = _.sku.convert) == null ? void 0 : h.measurement);
|
|
330
|
-
}) ?? null : null,
|
|
331
|
-
return vt(H).isInteger().max(
|
|
330
|
+
}) ?? null : null, W = $e(_.sku.unit, F), H = Yt(+x);
|
|
331
|
+
return vt(H).isInteger().max(W).error ? "Precision cannot be more than " + W : !0;
|
|
332
332
|
}
|
|
333
333
|
const $ = T(
|
|
334
334
|
() => {
|
|
335
335
|
var x, F;
|
|
336
|
-
return (x = _.sku.convert) != null && x.measurement ? (F = _.sku.unit.measurements.find((
|
|
336
|
+
return (x = _.sku.convert) != null && x.measurement ? (F = _.sku.unit.measurements.find((W) => {
|
|
337
337
|
var H;
|
|
338
|
-
return
|
|
338
|
+
return W.id === ((H = _.sku.convert) == null ? void 0 : H.measurement);
|
|
339
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
344
|
bindings: ((H = _.sku.convert) == null ? void 0 : H.inventoryBindings) ?? [],
|
|
345
|
-
skus:
|
|
346
|
-
skuGroups:
|
|
347
|
-
recipes:
|
|
345
|
+
skus: f.skus,
|
|
346
|
+
skuGroups: [],
|
|
347
|
+
recipes: f.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,
|
|
351
|
-
const u =
|
|
350
|
+
var ee, ae, Q, G, te;
|
|
351
|
+
const u = f.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
353
|
return le.id === ((ce = _.sku.convert) == null ? void 0 : ce.measurement);
|
|
354
|
-
}) ?? null : null,
|
|
354
|
+
}) ?? null : null, d = $e(_.sku.unit, p), i = n(`${C.value}`) === !0 ? he(
|
|
355
355
|
Lt(
|
|
356
356
|
I.amount,
|
|
357
|
-
Ee(+C.value,
|
|
357
|
+
Ee(+C.value, d)
|
|
358
358
|
),
|
|
359
359
|
!1
|
|
360
|
-
) : "0", S = (te = (
|
|
360
|
+
) : "0", S = (te = (G = l.value) == null ? void 0 : G.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,
|
|
@@ -380,7 +380,7 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
|
|
|
380
380
|
}
|
|
381
381
|
});
|
|
382
382
|
const O = Ye(_, "show");
|
|
383
|
-
async function L(x, F,
|
|
383
|
+
async function L(x, F, W) {
|
|
384
384
|
g.value = !0;
|
|
385
385
|
try {
|
|
386
386
|
await r.convertSku({
|
|
@@ -388,7 +388,7 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
|
|
|
388
388
|
{
|
|
389
389
|
doc: x,
|
|
390
390
|
amount: F,
|
|
391
|
-
overrides:
|
|
391
|
+
overrides: W == null ? void 0 : W.map((H) => ({
|
|
392
392
|
...H,
|
|
393
393
|
amount: {
|
|
394
394
|
...H.amount,
|
|
@@ -409,29 +409,29 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
|
|
|
409
409
|
g.value = !1;
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
|
-
function X(x, F,
|
|
412
|
+
function X(x, F, W) {
|
|
413
413
|
const H = +F;
|
|
414
|
-
let J =
|
|
415
|
-
F.length > 0 && isFinite(H) ? J =
|
|
414
|
+
let J = W;
|
|
415
|
+
F.length > 0 && isFinite(H) ? J = W.map((I) => (I.id !== x || (I.amount = xe(H)), I)) : J = W.map((I) => (I.id !== x || (I.amount = { amount: 0, precision: 0 }), I)), l.value = J;
|
|
416
416
|
}
|
|
417
417
|
function z(x) {
|
|
418
|
-
const F = a.value.find((
|
|
418
|
+
const F = a.value.find((W) => W._id === x);
|
|
419
419
|
return F ? bt(F.unit, !0) : [];
|
|
420
420
|
}
|
|
421
421
|
function K(x, F) {
|
|
422
|
-
const
|
|
422
|
+
const W = z(x), H = W.find((J) => J.value === F) ?? W.find((J) => J.value === null);
|
|
423
423
|
return H ? {
|
|
424
424
|
...H,
|
|
425
425
|
label: H.abbrev
|
|
426
426
|
} : null;
|
|
427
427
|
}
|
|
428
|
-
function U(x, F,
|
|
428
|
+
function U(x, F, W) {
|
|
429
429
|
let H;
|
|
430
430
|
if (F === null)
|
|
431
|
-
H =
|
|
431
|
+
H = W.map((J) => (J.id !== x || (J.measurement = null), J)) ?? [];
|
|
432
432
|
else {
|
|
433
433
|
const J = a.value.find((I) => I._id === x);
|
|
434
|
-
H =
|
|
434
|
+
H = W.map((I) => {
|
|
435
435
|
var u, h;
|
|
436
436
|
return I.id !== x || (I.measurement = (h = (u = J == null ? void 0 : J.unit) == null ? void 0 : u.measurements) == null ? void 0 : h.find((p) => p.id === F)), I;
|
|
437
437
|
}) ?? [];
|
|
@@ -439,8 +439,8 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
|
|
|
439
439
|
l.value = H;
|
|
440
440
|
}
|
|
441
441
|
function Z(x, F) {
|
|
442
|
-
const
|
|
443
|
-
l.value =
|
|
442
|
+
const W = F.filter((H) => H.id !== x);
|
|
443
|
+
l.value = W;
|
|
444
444
|
}
|
|
445
445
|
function re() {
|
|
446
446
|
const x = (l.value ?? []).map((F) => ({
|
|
@@ -459,8 +459,8 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
|
|
|
459
459
|
x || (l.value = null, C.value = 0);
|
|
460
460
|
}
|
|
461
461
|
), (x, F) => {
|
|
462
|
-
const
|
|
463
|
-
return j(), ne(
|
|
462
|
+
const W = D("FmTextField"), H = D("FmForm"), J = D("FmCard"), I = D("FmSwitch"), u = D("FmFormGroup"), h = D("FmSelect"), p = D("FmButton"), d = D("FmSideSheet");
|
|
463
|
+
return j(), ne(d, {
|
|
464
464
|
"dismiss-away": "",
|
|
465
465
|
modelValue: s(O),
|
|
466
466
|
"onUpdate:modelValue": F[3] || (F[3] = (i) => Pe(O) ? O.value = i : null),
|
|
@@ -468,7 +468,7 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
|
|
|
468
468
|
}, {
|
|
469
469
|
"side-sheet-header": M(() => [
|
|
470
470
|
e("div", bo, [
|
|
471
|
-
e("div", go,
|
|
471
|
+
e("div", go, m(s(R)("inventory.stock.convert.title", { name: x.sku.name })), 1)
|
|
472
472
|
])
|
|
473
473
|
]),
|
|
474
474
|
default: M(() => [
|
|
@@ -479,7 +479,7 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
|
|
|
479
479
|
onValidationSuccess: o
|
|
480
480
|
}, {
|
|
481
481
|
default: M(() => [
|
|
482
|
-
y(
|
|
482
|
+
y(W, {
|
|
483
483
|
disabled: g.value,
|
|
484
484
|
"model-value": C.value,
|
|
485
485
|
"onUpdate:modelValue": F[0] || (F[0] = (i) => C.value = i),
|
|
@@ -497,15 +497,15 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
|
|
|
497
497
|
}, {
|
|
498
498
|
default: M(() => [
|
|
499
499
|
e("div", So, [
|
|
500
|
-
e("div", wo,
|
|
500
|
+
e("div", wo, m(s(R)("inventory.stock.convert.deductionSummary")), 1),
|
|
501
501
|
(j(!0), q(ue, null, ve(E.value, (i) => {
|
|
502
502
|
var S, P;
|
|
503
503
|
return j(), q("div", {
|
|
504
504
|
key: (S = i.sku) == null ? void 0 : S._id,
|
|
505
505
|
class: "flex items-center"
|
|
506
506
|
}, [
|
|
507
|
-
e("div", Ao,
|
|
508
|
-
e("div", Fo, " -" +
|
|
507
|
+
e("div", Ao, m((P = i.sku) == null ? void 0 : P.name), 1),
|
|
508
|
+
e("div", Fo, " -" + m(i.convertAmount) + " " + m(i.abbrev), 1)
|
|
509
509
|
]);
|
|
510
510
|
}), 128))
|
|
511
511
|
])
|
|
@@ -525,16 +525,16 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
|
|
|
525
525
|
v.value ? (j(), q(ue, { key: 0 }, [
|
|
526
526
|
y(u, {
|
|
527
527
|
modelValue: l.value,
|
|
528
|
-
rules: [s(
|
|
528
|
+
rules: [s(Wt)(1, "Must have at least one ingredient binding")]
|
|
529
529
|
}, null, 8, ["modelValue", "rules"]),
|
|
530
530
|
e("div", jo, [
|
|
531
|
-
e("div", Vo,
|
|
531
|
+
e("div", Vo, m(s(R)("inventory.stock.convert.ingredients")), 1),
|
|
532
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(Gt)(
|
|
538
538
|
a.value.find((S) => S._id === i.id).unit,
|
|
539
539
|
i.measurement
|
|
540
540
|
),
|
|
@@ -545,8 +545,8 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
|
|
|
545
545
|
var P, ee, ae;
|
|
546
546
|
return [
|
|
547
547
|
e("div", Co, [
|
|
548
|
-
e("div", Bo,
|
|
549
|
-
y(
|
|
548
|
+
e("div", Bo, m((P = a.value.find((Q) => Q._id === i.id)) == null ? void 0 : P.name), 1),
|
|
549
|
+
y(W, {
|
|
550
550
|
class: "xs:col-span-2",
|
|
551
551
|
disabled: g.value,
|
|
552
552
|
modelValue: +s(he)(
|
|
@@ -618,7 +618,7 @@ function De(A, c) {
|
|
|
618
618
|
function pt(A, c) {
|
|
619
619
|
return Ee(Math.abs(A), c);
|
|
620
620
|
}
|
|
621
|
-
const
|
|
621
|
+
const Ge = {
|
|
622
622
|
[ie.enum.DAMAGE]: {
|
|
623
623
|
label: "Damage",
|
|
624
624
|
toAdjustmentAmount: De
|
|
@@ -655,8 +655,8 @@ const We = {
|
|
|
655
655
|
},
|
|
656
656
|
emits: ["update:modelValue", "click:delete"],
|
|
657
657
|
setup(A, { emit: c }) {
|
|
658
|
-
const k = A, _ = c, { t: w } = ye(), V = Oe(),
|
|
659
|
-
() => Object.keys(
|
|
658
|
+
const k = A, _ = c, { t: w } = ye(), V = Oe(), f = T(
|
|
659
|
+
() => Object.keys(Ge).map((t) => ({
|
|
660
660
|
label: Ht(t),
|
|
661
661
|
value: t
|
|
662
662
|
}))
|
|
@@ -670,7 +670,7 @@ const We = {
|
|
|
670
670
|
};
|
|
671
671
|
n.type = t;
|
|
672
672
|
const $ = ct(k.modelValue.amount);
|
|
673
|
-
n.amount =
|
|
673
|
+
n.amount = Ge[n.type].toAdjustmentAmount(
|
|
674
674
|
+he($),
|
|
675
675
|
$.precision
|
|
676
676
|
), _("update:modelValue", n);
|
|
@@ -684,7 +684,7 @@ const We = {
|
|
|
684
684
|
const n = {
|
|
685
685
|
...k.modelValue
|
|
686
686
|
}, $ = xe(t);
|
|
687
|
-
n.amount =
|
|
687
|
+
n.amount = Ge[b.value].toAdjustmentAmount(
|
|
688
688
|
t,
|
|
689
689
|
$.precision
|
|
690
690
|
), _("update:modelValue", n);
|
|
@@ -734,8 +734,8 @@ const We = {
|
|
|
734
734
|
default: M(() => [
|
|
735
735
|
e("div", Io, [
|
|
736
736
|
e("div", Ho, [
|
|
737
|
-
e("div", To,
|
|
738
|
-
e("div", Eo,
|
|
737
|
+
e("div", To, m(t.modelValue.doc.name), 1),
|
|
738
|
+
e("div", Eo, m(t.modelValue.doc.code), 1)
|
|
739
739
|
]),
|
|
740
740
|
y($, {
|
|
741
741
|
variant: "tertiary",
|
|
@@ -747,7 +747,7 @@ const We = {
|
|
|
747
747
|
disabled: t.disabled,
|
|
748
748
|
class: "col-span-2",
|
|
749
749
|
label: "Type",
|
|
750
|
-
items:
|
|
750
|
+
items: f.value,
|
|
751
751
|
modelValue: b.value,
|
|
752
752
|
"onUpdate:modelValue": n[1] || (n[1] = (L) => b.value = L),
|
|
753
753
|
rules: [s(Kt)()],
|
|
@@ -780,18 +780,18 @@ const We = {
|
|
|
780
780
|
"label-mark": "optional"
|
|
781
781
|
}, null, 8, ["disabled", "modelValue"]),
|
|
782
782
|
e("div", Uo, [
|
|
783
|
-
e("div", Po,
|
|
783
|
+
e("div", Po, m(s(w)("inventory.stock.stock_adjustment.stockAfter")), 1),
|
|
784
784
|
e("div", {
|
|
785
785
|
class: He(["fm-typo-en-body-lg-600", o.value ? "text-red-700" : "text-green-700"])
|
|
786
|
-
},
|
|
787
|
-
t.isBackdate ? (j(), q("div", Ro,
|
|
786
|
+
}, m(g.value), 3),
|
|
787
|
+
t.isBackdate ? (j(), q("div", Ro, m(s(w)("inventory.stock.stock_adjustment.backdatePreviewWarning")), 1)) : se("", !0)
|
|
788
788
|
])
|
|
789
789
|
]),
|
|
790
790
|
_: 1
|
|
791
791
|
});
|
|
792
792
|
};
|
|
793
793
|
}
|
|
794
|
-
}), No = { class: "flex items-center" }, Oo = { class: "fm-typo-en-title-md-800" }, Lo = { class: "flex items-center" }, Yo = { class: "fm-typo-en-title-sm-800 flex-1" }, zo = { class: "flex gap-8" },
|
|
794
|
+
}), No = { class: "flex items-center" }, Oo = { class: "fm-typo-en-title-md-800" }, Lo = { class: "flex items-center" }, Yo = { class: "fm-typo-en-title-sm-800 flex-1" }, zo = { class: "flex gap-8" }, Wo = /* @__PURE__ */ pe({
|
|
795
795
|
__name: "AdjustSkuDialog",
|
|
796
796
|
props: {
|
|
797
797
|
stock: {},
|
|
@@ -799,7 +799,7 @@ const We = {
|
|
|
799
799
|
},
|
|
800
800
|
emits: ["update:show", "submitted"],
|
|
801
801
|
setup(A, { expose: c, emit: k }) {
|
|
802
|
-
const _ = A, w = k, V = Ne(),
|
|
802
|
+
const _ = A, w = k, V = Ne(), f = Le(), r = Ae(), b = we(), R = Y(!1), { t: C } = ye();
|
|
803
803
|
function l() {
|
|
804
804
|
g(Re(v));
|
|
805
805
|
}
|
|
@@ -873,7 +873,7 @@ const We = {
|
|
|
873
873
|
sublabel: E.code,
|
|
874
874
|
value: E._id
|
|
875
875
|
})), $ = n.filter((E) => v.adjustments.find((N) => N.doc._id === E.value)).map((E) => E.value);
|
|
876
|
-
|
|
876
|
+
f.open({
|
|
877
877
|
title: "Select ingredients",
|
|
878
878
|
contentComponent: St,
|
|
879
879
|
contentComponentProps: {
|
|
@@ -918,7 +918,7 @@ const We = {
|
|
|
918
918
|
}, {
|
|
919
919
|
"side-sheet-header": M(() => [
|
|
920
920
|
e("div", No, [
|
|
921
|
-
e("div", Oo,
|
|
921
|
+
e("div", Oo, m(s(C)("inventory.stock.adjust.title")), 1)
|
|
922
922
|
])
|
|
923
923
|
]),
|
|
924
924
|
default: M(() => [
|
|
@@ -935,7 +935,7 @@ const We = {
|
|
|
935
935
|
"onUpdate:modelValue": $[0] || ($[0] = (X) => v.remark = X)
|
|
936
936
|
}, null, 8, ["label", "modelValue"]),
|
|
937
937
|
e("div", Lo, [
|
|
938
|
-
e("div", Yo,
|
|
938
|
+
e("div", Yo, m(s(C)("inventory.stock.adjust.adjustedItems")), 1),
|
|
939
939
|
y(N, {
|
|
940
940
|
"prepend-icon": "add",
|
|
941
941
|
variant: "tertiary",
|
|
@@ -969,7 +969,7 @@ const We = {
|
|
|
969
969
|
}, 8, ["modelValue"]);
|
|
970
970
|
};
|
|
971
971
|
}
|
|
972
|
-
}),
|
|
972
|
+
}), Go = { class: "flex items-center w-full gap-8" }, Ko = { class: "fm-typo-en-title-md-800 flex-1" }, qo = {
|
|
973
973
|
key: 0,
|
|
974
974
|
class: "flex flex-col gap-4"
|
|
975
975
|
}, Xo = { class: "fm-typo-en-body-md-600" }, Jo = { class: "flex gap-8 items-start" }, Qo = { class: "flex-1 min-w-0" }, Zo = { class: "flex-1 min-w-0" }, en = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, tn = { class: "flex items-center" }, on = { class: "fm-typo-en-title-sm-800 flex-1" }, nn = { class: "flex gap-8" }, yt = 14, sn = /* @__PURE__ */ pe({
|
|
@@ -979,7 +979,7 @@ const We = {
|
|
|
979
979
|
},
|
|
980
980
|
emits: ["update:show", "submitted"],
|
|
981
981
|
setup(A, { emit: c }) {
|
|
982
|
-
const k = A, _ = c, { t: w } = ye(), V = Ne(),
|
|
982
|
+
const k = A, _ = c, { t: w } = ye(), V = Ne(), f = 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: []
|
|
@@ -1068,10 +1068,10 @@ const We = {
|
|
|
1068
1068
|
C.value = !0;
|
|
1069
1069
|
try {
|
|
1070
1070
|
const K = l.adjustments.map(
|
|
1071
|
-
({ doc: Z, remark: re, type: x, amount: F, measurement:
|
|
1071
|
+
({ doc: Z, remark: re, type: x, amount: F, measurement: W }) => ({
|
|
1072
1072
|
id: Z._id,
|
|
1073
1073
|
amount: F,
|
|
1074
|
-
measurement:
|
|
1074
|
+
measurement: W,
|
|
1075
1075
|
remark: re,
|
|
1076
1076
|
doc: Z,
|
|
1077
1077
|
type: x
|
|
@@ -1081,7 +1081,7 @@ const We = {
|
|
|
1081
1081
|
adjustments: K,
|
|
1082
1082
|
...a.value ? { effectiveAt: l.effectiveAt.toISOString() } : {}
|
|
1083
1083
|
};
|
|
1084
|
-
await
|
|
1084
|
+
await f.adjustSku(Re(U)), _("submitted"), _("update:show", !1);
|
|
1085
1085
|
} catch (K) {
|
|
1086
1086
|
b.open({
|
|
1087
1087
|
title: w("inventory.stock.adjust.error.title"),
|
|
@@ -1093,7 +1093,7 @@ const We = {
|
|
|
1093
1093
|
}
|
|
1094
1094
|
}
|
|
1095
1095
|
return (K, U) => {
|
|
1096
|
-
const Z = D("FmTextarea"), re = D("FmSwitch"), x = D("FmDatePicker"), F = D("FmTimePicker"),
|
|
1096
|
+
const Z = D("FmTextarea"), re = D("FmSwitch"), x = D("FmDatePicker"), F = D("FmTimePicker"), W = D("FmFormGroup"), H = D("FmButton"), J = D("FmForm"), I = D("FmSideSheet");
|
|
1097
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),
|
|
@@ -1102,8 +1102,8 @@ const We = {
|
|
|
1102
1102
|
onAfterEnter: N
|
|
1103
1103
|
}, {
|
|
1104
1104
|
"side-sheet-header": M(() => [
|
|
1105
|
-
e("div",
|
|
1106
|
-
e("div", Ko,
|
|
1105
|
+
e("div", Go, [
|
|
1106
|
+
e("div", Ko, m(s(w)("inventory.stock.stock_adjustment.title")), 1)
|
|
1107
1107
|
])
|
|
1108
1108
|
]),
|
|
1109
1109
|
default: M(() => [
|
|
@@ -1129,7 +1129,7 @@ const We = {
|
|
|
1129
1129
|
labelPlacement: "right"
|
|
1130
1130
|
}, null, 8, ["model-value", "label", "sublabel"]),
|
|
1131
1131
|
a.value ? (j(), q("div", qo, [
|
|
1132
|
-
e("label", Xo,
|
|
1132
|
+
e("label", Xo, m(s(w)("inventory.stock.stock_adjustment.effectiveAt")), 1),
|
|
1133
1133
|
e("div", Jo, [
|
|
1134
1134
|
e("div", Qo, [
|
|
1135
1135
|
y(x, {
|
|
@@ -1148,14 +1148,14 @@ const We = {
|
|
|
1148
1148
|
}, null, 8, ["modelValue"])
|
|
1149
1149
|
])
|
|
1150
1150
|
]),
|
|
1151
|
-
y(
|
|
1151
|
+
y(W, {
|
|
1152
1152
|
"model-value": o.value,
|
|
1153
1153
|
rules: n.value
|
|
1154
1154
|
}, null, 8, ["model-value", "rules"]),
|
|
1155
|
-
e("div", en,
|
|
1155
|
+
e("div", en, m(s(w)("inventory.stock.stock_adjustment.immediateHint")), 1)
|
|
1156
1156
|
])) : se("", !0),
|
|
1157
1157
|
e("div", tn, [
|
|
1158
|
-
e("div", on,
|
|
1158
|
+
e("div", on, m(s(w)("inventory.stock.adjust.adjustedItems")), 1),
|
|
1159
1159
|
y(H, {
|
|
1160
1160
|
"prepend-icon": "add",
|
|
1161
1161
|
variant: "tertiary",
|
|
@@ -1199,19 +1199,19 @@ const We = {
|
|
|
1199
1199
|
}), an = Tt((A, c) => ({
|
|
1200
1200
|
// TODO: remove once latest inventory backend has been push
|
|
1201
1201
|
async findBillsByBusinessId(k, _, w) {
|
|
1202
|
-
const V = `${A.businessesBackendUrl}/${k}/reports/find-many`,
|
|
1202
|
+
const V = `${A.businessesBackendUrl}/${k}/reports/find-many`, f = {
|
|
1203
1203
|
// type: TYPE.bill,
|
|
1204
1204
|
type: "bill",
|
|
1205
1205
|
restaurantIds: _,
|
|
1206
1206
|
ids: w
|
|
1207
1207
|
};
|
|
1208
|
-
return await c.post(V,
|
|
1208
|
+
return await c.post(V, f);
|
|
1209
1209
|
},
|
|
1210
1210
|
async findBillsById(k) {
|
|
1211
|
-
const w = Se().currentLocationDBName, V = `${A.inventoryBackendUrl}/${w}/bill/search`,
|
|
1211
|
+
const w = Se().currentLocationDBName, V = `${A.inventoryBackendUrl}/${w}/bill/search`, f = {
|
|
1212
1212
|
ids: k
|
|
1213
1213
|
};
|
|
1214
|
-
return await c.post(V,
|
|
1214
|
+
return await c.post(V, f);
|
|
1215
1215
|
}
|
|
1216
1216
|
})), rn = {
|
|
1217
1217
|
key: 0,
|
|
@@ -1226,15 +1226,15 @@ const We = {
|
|
|
1226
1226
|
}),
|
|
1227
1227
|
emits: /* @__PURE__ */ st(["refreshHistory"], ["update:modelValue"]),
|
|
1228
1228
|
setup(A, { emit: c }) {
|
|
1229
|
-
const k = A, _ = c, w = Ae(), V = jt(A, "modelValue"),
|
|
1229
|
+
const k = A, _ = c, w = Ae(), V = jt(A, "modelValue"), f = 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
|
+
f.value = !0;
|
|
1235
1235
|
const o = await w.readSingleAdjustment(k.adjustmentId);
|
|
1236
1236
|
if (!o) throw new Error("Adjustment not found");
|
|
1237
|
-
R.value = o,
|
|
1237
|
+
R.value = o, f.value = !1;
|
|
1238
1238
|
});
|
|
1239
1239
|
async function l() {
|
|
1240
1240
|
var t, n;
|
|
@@ -1335,7 +1335,7 @@ const We = {
|
|
|
1335
1335
|
])
|
|
1336
1336
|
]),
|
|
1337
1337
|
default: M(() => [
|
|
1338
|
-
|
|
1338
|
+
f.value ? (j(), q("div", rn)) : (j(), ne(N, {
|
|
1339
1339
|
key: 1,
|
|
1340
1340
|
ref_key: "formRef",
|
|
1341
1341
|
ref: C,
|
|
@@ -1351,7 +1351,7 @@ 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(" " +
|
|
1354
|
+
me(" " + m(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 }, [
|
|
@@ -1362,17 +1362,17 @@ const We = {
|
|
|
1362
1362
|
}, {
|
|
1363
1363
|
default: M(() => [
|
|
1364
1364
|
e("div", cn, [
|
|
1365
|
-
e("span", dn,
|
|
1366
|
-
e("span", null,
|
|
1365
|
+
e("span", dn, m(z.sku.code), 1),
|
|
1366
|
+
e("span", null, m(z.sku.name), 1)
|
|
1367
1367
|
]),
|
|
1368
1368
|
t[12] || (t[12] = e("hr", { class: "m-2" }, null, -1)),
|
|
1369
1369
|
e("div", mn, [
|
|
1370
1370
|
t[8] || (t[8] = e("span", { class: "fm-typo-en-body-lg-600" }, "Adjustment type:", -1)),
|
|
1371
|
-
e("span", null,
|
|
1371
|
+
e("span", null, m(U.type), 1)
|
|
1372
1372
|
]),
|
|
1373
1373
|
e("div", fn, [
|
|
1374
1374
|
t[9] || (t[9] = e("span", { class: "fm-typo-en-body-lg-600" }, "Current amount:", -1)),
|
|
1375
|
-
e("span", null,
|
|
1375
|
+
e("span", null, m(s(_e).toFormatString({ value: U.amount })) + " " + m(v(z, U)), 1)
|
|
1376
1376
|
]),
|
|
1377
1377
|
y($, {
|
|
1378
1378
|
"max-fraction-digits": s($e)(z.sku.unit),
|
|
@@ -1398,7 +1398,7 @@ const We = {
|
|
|
1398
1398
|
e("div", vn, [
|
|
1399
1399
|
t[10] || (t[10] = e("span", { class: "fm-typo-en-body-lg-600" }, "Amount after amend:", -1)),
|
|
1400
1400
|
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)),
|
|
1401
|
-
me(" " +
|
|
1401
|
+
me(" " + m(g(
|
|
1402
1402
|
U.amount,
|
|
1403
1403
|
s(_e).fromNumber(
|
|
1404
1404
|
a({
|
|
@@ -1407,7 +1407,7 @@ const We = {
|
|
|
1407
1407
|
unit: z.sku.unit
|
|
1408
1408
|
}).value
|
|
1409
1409
|
)
|
|
1410
|
-
)) + " " +
|
|
1410
|
+
)) + " " + m(v(z, U)), 1)
|
|
1411
1411
|
])
|
|
1412
1412
|
]),
|
|
1413
1413
|
_: 2
|
|
@@ -1463,7 +1463,7 @@ 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 _ = Y(!1), w = Y(), V = Y(null),
|
|
1466
|
+
const _ = Y(!1), w = Y(), V = Y(null), f = T(() => V.value === null ? "unset" : _.value ? `${V.value}px` : "0px");
|
|
1467
1467
|
Xe(() => {
|
|
1468
1468
|
var C;
|
|
1469
1469
|
V.value = ((C = w.value) == null ? void 0 : C.scrollHeight) || 0;
|
|
@@ -1551,7 +1551,7 @@ const We = {
|
|
|
1551
1551
|
class: "flex items-center cursor-pointer mb-1",
|
|
1552
1552
|
onClick: l[0] || (l[0] = (g) => _.value = !_.value)
|
|
1553
1553
|
}, [
|
|
1554
|
-
e("div", hn,
|
|
1554
|
+
e("div", hn, m(C.record.date), 1),
|
|
1555
1555
|
y(a, {
|
|
1556
1556
|
name: _.value ? "expand_more" : "expand_less",
|
|
1557
1557
|
color: "#777777",
|
|
@@ -1563,21 +1563,21 @@ const We = {
|
|
|
1563
1563
|
class: "flex flex-row py-1",
|
|
1564
1564
|
style: { "font-size": "0.8rem" }
|
|
1565
1565
|
}, [
|
|
1566
|
-
e("div", bn,
|
|
1566
|
+
e("div", bn, m(s(b)(`inventory.inventoryAdjustment.type.${o}`)), 1),
|
|
1567
1567
|
e("div", {
|
|
1568
1568
|
class: He({
|
|
1569
1569
|
"text-fm-color-typo-error": g.startsWith("-"),
|
|
1570
1570
|
"text-fm-color-typo-success": !g.startsWith("-"),
|
|
1571
1571
|
"ml-auto": !0
|
|
1572
1572
|
})
|
|
1573
|
-
},
|
|
1573
|
+
}, m(g), 3)
|
|
1574
1574
|
]))), 128)),
|
|
1575
1575
|
e("div", {
|
|
1576
1576
|
ref_key: "detailRef",
|
|
1577
1577
|
ref: w,
|
|
1578
1578
|
style: kt({
|
|
1579
1579
|
fontSize: "0.8rem",
|
|
1580
|
-
maxHeight:
|
|
1580
|
+
maxHeight: f.value,
|
|
1581
1581
|
overflow: "hidden",
|
|
1582
1582
|
transition: "max-height 0.2s ease-out"
|
|
1583
1583
|
})
|
|
@@ -1587,7 +1587,7 @@ const We = {
|
|
|
1587
1587
|
key: g.time,
|
|
1588
1588
|
class: "flex gap-1 w-full"
|
|
1589
1589
|
}, [
|
|
1590
|
-
e("div", xn,
|
|
1590
|
+
e("div", xn, m(g.time), 1),
|
|
1591
1591
|
e("div", Sn, [
|
|
1592
1592
|
(j(!0), q(ue, null, ve(g.adjustments, (o) => {
|
|
1593
1593
|
var t;
|
|
@@ -1596,7 +1596,7 @@ const We = {
|
|
|
1596
1596
|
class: "flex gap-1"
|
|
1597
1597
|
}, [
|
|
1598
1598
|
e("div", wn, [
|
|
1599
|
-
me(
|
|
1599
|
+
me(m(s(b)(`inventory.inventoryAdjustment.type.${o.name}`)) + " ", 1),
|
|
1600
1600
|
o.backdateFrom ? (j(), ne(B, {
|
|
1601
1601
|
key: 0,
|
|
1602
1602
|
variant: "plain",
|
|
@@ -1604,7 +1604,7 @@ const We = {
|
|
|
1604
1604
|
"z-index": 50
|
|
1605
1605
|
}, {
|
|
1606
1606
|
content: M(() => [
|
|
1607
|
-
e("div", An,
|
|
1607
|
+
e("div", An, m(s(b)("inventory.stock.record.backdate", [
|
|
1608
1608
|
s(wt)(new Date(o.backdateFrom))
|
|
1609
1609
|
])), 1)
|
|
1610
1610
|
]),
|
|
@@ -1617,10 +1617,10 @@ const We = {
|
|
|
1617
1617
|
]),
|
|
1618
1618
|
_: 2
|
|
1619
1619
|
}, 1024)) : se("", !0),
|
|
1620
|
-
o.billRemark ? (j(), q("span", Fn, " # " +
|
|
1621
|
-
o.billRemark && o.remark ? (j(), q("span", $n, " (" +
|
|
1622
|
-
!o.billRemark && o.reason ? (j(), q("span", jn, " (" +
|
|
1623
|
-
!o.billRemark && o.remark ? (j(), q("span", Vn, " # " +
|
|
1620
|
+
o.billRemark ? (j(), q("span", Fn, " # " + m(o.billRemark), 1)) : se("", !0),
|
|
1621
|
+
o.billRemark && o.remark ? (j(), q("span", $n, " (" + m(o.remark) + ") ", 1)) : se("", !0),
|
|
1622
|
+
!o.billRemark && o.reason ? (j(), q("span", jn, " (" + m(o.reason) + ") ", 1)) : se("", !0),
|
|
1623
|
+
!o.billRemark && o.remark ? (j(), q("span", Vn, " # " + m(o.remark), 1)) : se("", !0),
|
|
1624
1624
|
(t = o.createdBy) != null && t.name ? (j(), ne(B, {
|
|
1625
1625
|
key: 5,
|
|
1626
1626
|
variant: "plain",
|
|
@@ -1628,7 +1628,7 @@ const We = {
|
|
|
1628
1628
|
"z-index": 50
|
|
1629
1629
|
}, {
|
|
1630
1630
|
content: M(() => [
|
|
1631
|
-
me(
|
|
1631
|
+
me(m(s(b)("inventory.stock.record.createdBy", [o.createdBy.name])), 1)
|
|
1632
1632
|
]),
|
|
1633
1633
|
default: M(() => [
|
|
1634
1634
|
e("span", Cn, [
|
|
@@ -1637,12 +1637,12 @@ const We = {
|
|
|
1637
1637
|
size: "sm",
|
|
1638
1638
|
color: "primary"
|
|
1639
1639
|
}),
|
|
1640
|
-
me(" " +
|
|
1640
|
+
me(" " + m(o.createdBy.name), 1)
|
|
1641
1641
|
])
|
|
1642
1642
|
]),
|
|
1643
1643
|
_: 2
|
|
1644
1644
|
}, 1024)) : se("", !0),
|
|
1645
|
-
o.name === s(ie).Enum.CLOSING ? (j(), q("span", Bn, " Actual Balance: " +
|
|
1645
|
+
o.name === s(ie).Enum.CLOSING ? (j(), q("span", Bn, " Actual Balance: " + m(o.toBalance) + " " + m(o.baseUnit), 1)) : se("", !0)
|
|
1646
1646
|
]),
|
|
1647
1647
|
e("div", {
|
|
1648
1648
|
class: He({
|
|
@@ -1650,13 +1650,13 @@ const We = {
|
|
|
1650
1650
|
"text-fm-color-typo-success": !o.amount.startsWith("-"),
|
|
1651
1651
|
"ml-auto": !0
|
|
1652
1652
|
})
|
|
1653
|
-
},
|
|
1653
|
+
}, m(o.amount), 3),
|
|
1654
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"))
|
|
1658
1658
|
}, null, 8, ["adjustmentId"])) : se("", !0),
|
|
1659
|
-
o.cost ? (j(), q("div", Dn, " (" +
|
|
1659
|
+
o.cost ? (j(), q("div", Dn, " (" + m(s(Me)(o.cost, !1, o.cost.precision)) + ") ", 1)) : se("", !0)
|
|
1660
1660
|
]);
|
|
1661
1661
|
}), 128))
|
|
1662
1662
|
])
|
|
@@ -1672,33 +1672,33 @@ const We = {
|
|
|
1672
1672
|
function In(A, c) {
|
|
1673
1673
|
var V;
|
|
1674
1674
|
const k = Object.keys(ie.enum).reduce(
|
|
1675
|
-
(
|
|
1675
|
+
(f, r) => (f[r] = { amount: 0, precision: 0 }, f),
|
|
1676
1676
|
{}
|
|
1677
1677
|
);
|
|
1678
1678
|
if (!c)
|
|
1679
1679
|
return Object.entries(k).reduce(
|
|
1680
|
-
(
|
|
1680
|
+
(f, [r]) => (f[r] = oe.fromNumber(0), f),
|
|
1681
1681
|
{}
|
|
1682
1682
|
);
|
|
1683
|
-
const w = A.flatMap((
|
|
1683
|
+
const w = A.flatMap((f) => {
|
|
1684
1684
|
var r;
|
|
1685
|
-
return ((r =
|
|
1686
|
-
}).flatMap((
|
|
1687
|
-
for (const
|
|
1688
|
-
const r =
|
|
1689
|
-
k[V =
|
|
1685
|
+
return ((r = f.skus) == null ? void 0 : r.filter((b) => b.sku._id === c._id)) ?? [];
|
|
1686
|
+
}).flatMap((f) => f.amounts);
|
|
1687
|
+
for (const f of w) {
|
|
1688
|
+
const r = f.measurement ? oe.multiply([f.measurement.conversion, f.amount]) : f.amount;
|
|
1689
|
+
k[V = f.type] ?? (k[V] = { amount: 0, precision: 0 }), k[f.type] = oe.add([r, k[f.type]]);
|
|
1690
1690
|
}
|
|
1691
1691
|
return Object.entries(k).reduce(
|
|
1692
|
-
(
|
|
1692
|
+
(f, [r, b]) => {
|
|
1693
1693
|
const R = {
|
|
1694
1694
|
...b,
|
|
1695
1695
|
amount: Math.abs(b.amount)
|
|
1696
1696
|
};
|
|
1697
|
-
return
|
|
1697
|
+
return f[r] = /// comment, because without it formatter makes code uglier
|
|
1698
1698
|
`${oe.toFormatString({
|
|
1699
1699
|
value: R,
|
|
1700
1700
|
precision: 4
|
|
1701
|
-
})} ${c.unit.abbrev}`,
|
|
1701
|
+
})} ${c.unit.abbrev}`, f;
|
|
1702
1702
|
},
|
|
1703
1703
|
{}
|
|
1704
1704
|
);
|
|
@@ -1708,15 +1708,15 @@ function Hn(A, c) {
|
|
|
1708
1708
|
return null;
|
|
1709
1709
|
let k = null;
|
|
1710
1710
|
const w = A.flatMap((V) => {
|
|
1711
|
-
var
|
|
1712
|
-
return ((
|
|
1711
|
+
var f;
|
|
1712
|
+
return ((f = V.skus) == null ? void 0 : f.filter((r) => r.sku._id === c._id)) ?? [];
|
|
1713
1713
|
}).flatMap((V) => {
|
|
1714
|
-
var
|
|
1715
|
-
return !V.history || ((
|
|
1714
|
+
var f;
|
|
1715
|
+
return !V.history || ((f = V.history) == null ? void 0 : f.length) === 0 ? [] : V.history[0];
|
|
1716
1716
|
});
|
|
1717
1717
|
for (const V of w) {
|
|
1718
|
-
const
|
|
1719
|
-
for (const r of
|
|
1718
|
+
const f = V.amounts;
|
|
1719
|
+
for (const r of f) {
|
|
1720
1720
|
if (r.type !== ie.Enum.SALES)
|
|
1721
1721
|
continue;
|
|
1722
1722
|
const b = r.measurement ? oe.multiply([r.measurement.conversion, r.amount]) : r.amount;
|
|
@@ -1734,10 +1734,10 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
1734
1734
|
}, On = { class: "fm-typo-en-body-lg-400 translate-x-4" }, Ln = {
|
|
1735
1735
|
key: 1,
|
|
1736
1736
|
class: "flex flex-col gap-12"
|
|
1737
|
-
}, Yn = { class: "pb-16" }, zn = { class: "fm-typo-cn-body-lg-600" },
|
|
1737
|
+
}, Yn = { class: "pb-16" }, zn = { class: "fm-typo-cn-body-lg-600" }, Wn = {
|
|
1738
1738
|
class: "grid gap-12 fm-typo-en-body-md-400",
|
|
1739
1739
|
style: { "grid-template-columns": "auto auto auto", "grid-auto-rows": "1fr" }
|
|
1740
|
-
},
|
|
1740
|
+
}, Gn = { 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
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 = {
|
|
@@ -1751,7 +1751,7 @@ 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 = Je(), k = Oe(), _ = Ae(), w = an(), V = Se(),
|
|
1754
|
+
const c = Je(), k = Oe(), _ = Ae(), w = an(), V = Se(), f = ao(), { t: r } = ye(), b = A, R = Y(!1), C = we(), l = Y("adjustment"), a = Y([
|
|
1755
1755
|
{ label: "Adjustment (Default)", value: "adjustment" }
|
|
1756
1756
|
]), B = Y([]), v = Y(no(0));
|
|
1757
1757
|
async function g() {
|
|
@@ -1779,18 +1779,18 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
1779
1779
|
}
|
|
1780
1780
|
function E(u, h) {
|
|
1781
1781
|
const p = u.reduce(
|
|
1782
|
-
(
|
|
1782
|
+
(d, i) => {
|
|
1783
1783
|
const S = i.effectiveAt ?? Te(i._id);
|
|
1784
1784
|
if (!S)
|
|
1785
|
-
return
|
|
1785
|
+
return d;
|
|
1786
1786
|
const P = $(new Date(S), h);
|
|
1787
|
-
return
|
|
1787
|
+
return d[P] ?? (d[P] = []), d[P].push(i), d;
|
|
1788
1788
|
},
|
|
1789
1789
|
{}
|
|
1790
1790
|
);
|
|
1791
|
-
return Object.keys(p).map((
|
|
1792
|
-
date:
|
|
1793
|
-
adjustments: p[
|
|
1791
|
+
return Object.keys(p).map((d) => ({
|
|
1792
|
+
date: d,
|
|
1793
|
+
adjustments: p[d]
|
|
1794
1794
|
}));
|
|
1795
1795
|
}
|
|
1796
1796
|
async function N() {
|
|
@@ -1801,10 +1801,10 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
1801
1801
|
);
|
|
1802
1802
|
o.value = u;
|
|
1803
1803
|
const h = u.filter(({ ref: p }) => p == null ? void 0 : p.startsWith("bill_")).map(({ ref: p }) => p);
|
|
1804
|
-
await O(h), t.value = E(u, "day").map(({ date: p, adjustments:
|
|
1804
|
+
await O(h), t.value = E(u, "day").map(({ date: p, adjustments: d }) => ({
|
|
1805
1805
|
date: p,
|
|
1806
|
-
adjustments:
|
|
1807
|
-
adjustmentsByTime: E(
|
|
1806
|
+
adjustments: d,
|
|
1807
|
+
adjustmentsByTime: E(d, "minute")
|
|
1808
1808
|
}));
|
|
1809
1809
|
try {
|
|
1810
1810
|
const p = await _.readUnitCostHistory(
|
|
@@ -1813,18 +1813,18 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
1813
1813
|
mt(new Date(v.value.endDate)).toISOString()
|
|
1814
1814
|
);
|
|
1815
1815
|
B.value = p;
|
|
1816
|
-
const
|
|
1816
|
+
const d = /* @__PURE__ */ new Set();
|
|
1817
1817
|
p.forEach((S) => {
|
|
1818
|
-
|
|
1818
|
+
d.add(S.mechanism);
|
|
1819
1819
|
});
|
|
1820
1820
|
const i = [{ label: "Default", value: "adjustment" }];
|
|
1821
|
-
|
|
1821
|
+
d.has(ge.Enum.weightedAverage) && i.push({
|
|
1822
1822
|
label: "Weighted Average (Beta)",
|
|
1823
1823
|
value: ge.Enum.weightedAverage
|
|
1824
|
-
}),
|
|
1824
|
+
}), d.has(ge.Enum.netsuite) && i.push({ label: "NetSuite (Beta)", value: ge.Enum.netsuite }), d.has(ge.Enum["netsuite-average"]) && i.push({
|
|
1825
1825
|
label: "NetSuite Average (Beta)",
|
|
1826
1826
|
value: ge.Enum["netsuite-average"]
|
|
1827
|
-
}), a.value = i, !
|
|
1827
|
+
}), a.value = i, !d.has(l.value) && l.value !== "adjustment" && (l.value = "adjustment");
|
|
1828
1828
|
} catch (p) {
|
|
1829
1829
|
console.error("Failed to fetch unit cost history:", p);
|
|
1830
1830
|
}
|
|
@@ -1833,8 +1833,8 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
1833
1833
|
u.length && (n.value = await w.findBillsById(u).catch((h) => {
|
|
1834
1834
|
var i;
|
|
1835
1835
|
console.error("Error on using latest bill API, retrying using legacy api", h);
|
|
1836
|
-
const p = ((i = c.currentBusiness.value) == null ? void 0 : i._id) ?? "",
|
|
1837
|
-
return w.findBillsByBusinessId(p, [
|
|
1836
|
+
const p = ((i = c.currentBusiness.value) == null ? void 0 : i._id) ?? "", d = V.currentLocation.doc._id;
|
|
1837
|
+
return w.findBillsByBusinessId(p, [d], u);
|
|
1838
1838
|
}));
|
|
1839
1839
|
}
|
|
1840
1840
|
const L = T(() => {
|
|
@@ -1846,8 +1846,8 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
1846
1846
|
}), z = T(() => {
|
|
1847
1847
|
const u = [...o.value].computeFirst((p) => {
|
|
1848
1848
|
var i, S;
|
|
1849
|
-
const
|
|
1850
|
-
return
|
|
1849
|
+
const d = (S = (i = p.skus) == null ? void 0 : i.find) == null ? void 0 : S.call(i, (P) => P.sku._id === b.sku._id);
|
|
1850
|
+
return d == null ? void 0 : d.fromBalance;
|
|
1851
1851
|
}) ?? {
|
|
1852
1852
|
amount: 0,
|
|
1853
1853
|
precision: 0
|
|
@@ -1859,8 +1859,8 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
1859
1859
|
}), K = T(() => {
|
|
1860
1860
|
const u = [...o.value].reverse().computeFirst((p) => {
|
|
1861
1861
|
var i, S;
|
|
1862
|
-
const
|
|
1863
|
-
return
|
|
1862
|
+
const d = (S = (i = p.skus) == null ? void 0 : i.find) == null ? void 0 : S.call(i, (P) => P.sku._id === b.sku._id);
|
|
1863
|
+
return d == null ? void 0 : d.toBalance;
|
|
1864
1864
|
}) ?? {
|
|
1865
1865
|
amount: 0,
|
|
1866
1866
|
precision: 0
|
|
@@ -1868,20 +1868,20 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
1868
1868
|
return h ? `${oe.toFormatString({ value: u, precision: 4 })} ${h.unit.abbrev}` : "";
|
|
1869
1869
|
}), U = T(() => {
|
|
1870
1870
|
var p;
|
|
1871
|
-
const h = o.value.flatMap((
|
|
1871
|
+
const h = o.value.flatMap((d) => {
|
|
1872
1872
|
var i;
|
|
1873
|
-
return ((i =
|
|
1874
|
-
}).filter((
|
|
1875
|
-
(
|
|
1873
|
+
return ((i = d.skus) == null ? void 0 : i.flatMap((S) => S.amounts)) ?? [];
|
|
1874
|
+
}).filter((d) => d.amount.amount < 0).reduce(
|
|
1875
|
+
(d, i) => {
|
|
1876
1876
|
const S = i.cost;
|
|
1877
|
-
if (!S) return
|
|
1877
|
+
if (!S) return d;
|
|
1878
1878
|
const P = {
|
|
1879
|
-
...zt(
|
|
1879
|
+
...zt(d, Math.max(d.precision, S.precision)),
|
|
1880
1880
|
currency: S.currency
|
|
1881
1881
|
};
|
|
1882
1882
|
return {
|
|
1883
1883
|
...Ze(P, S),
|
|
1884
|
-
currency:
|
|
1884
|
+
currency: d.currency
|
|
1885
1885
|
};
|
|
1886
1886
|
},
|
|
1887
1887
|
{
|
|
@@ -1907,60 +1907,60 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
1907
1907
|
(S) => S.mechanism === l.value && S.skuId === b.sku._id
|
|
1908
1908
|
);
|
|
1909
1909
|
if (p.length === 0) return null;
|
|
1910
|
-
const
|
|
1910
|
+
const d = p.find((S) => {
|
|
1911
1911
|
const P = S.meta;
|
|
1912
1912
|
return (P == null ? void 0 : P.adjustmentId) === u;
|
|
1913
1913
|
});
|
|
1914
|
-
if (
|
|
1914
|
+
if (d) return d.cost;
|
|
1915
1915
|
const i = [...p].filter((S) => new Date(S.snapshotAt) <= new Date(h)).sort((S, P) => new Date(P.snapshotAt).getTime() - new Date(S.snapshotAt).getTime());
|
|
1916
1916
|
return i.length > 0 ? i[0].cost : null;
|
|
1917
1917
|
}
|
|
1918
1918
|
const F = T(() => {
|
|
1919
|
-
var
|
|
1919
|
+
var d, i, S, P, ee, ae;
|
|
1920
1920
|
const u = [...o.value].reverse().find((Q) => {
|
|
1921
|
-
var
|
|
1922
|
-
return (te = (
|
|
1921
|
+
var G, te;
|
|
1922
|
+
return (te = (G = Q.skus) == null ? void 0 : G.find) == null ? void 0 : te.call(G, (le) => le.sku._id === b.sku._id);
|
|
1923
1923
|
});
|
|
1924
1924
|
if (!u) return "No data";
|
|
1925
|
-
const h = (
|
|
1925
|
+
const h = (d = u.skus) == null ? void 0 : d.find((Q) => Q.sku._id === b.sku._id);
|
|
1926
1926
|
if (!h) return "No data";
|
|
1927
1927
|
const p = h.toBalance;
|
|
1928
1928
|
if (l.value === "adjustment") {
|
|
1929
|
-
const Q = [...h.amounts].reverse()[0],
|
|
1929
|
+
const Q = [...h.amounts].reverse()[0], G = {
|
|
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
|
-
}, te = Q.amount, le = te.amount == 0 ? oe.fromNumber(0) : oe.divide([
|
|
1932
|
+
}, te = Q.amount, le = te.amount == 0 ? oe.fromNumber(0) : oe.divide([G, te]);
|
|
1933
1933
|
return {
|
|
1934
1934
|
...oe.multiply([le, p]),
|
|
1935
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
|
-
const Q = u.effectiveAt ?? Te(u._id),
|
|
1938
|
+
const Q = u.effectiveAt ?? Te(u._id), G = x(
|
|
1939
1939
|
u._id,
|
|
1940
1940
|
Q ?? (/* @__PURE__ */ new Date()).toISOString()
|
|
1941
1941
|
);
|
|
1942
|
-
if (!
|
|
1943
|
-
const te = oe.fromDinero(
|
|
1942
|
+
if (!G) return "No data";
|
|
1943
|
+
const te = oe.fromDinero(G);
|
|
1944
1944
|
return {
|
|
1945
1945
|
...oe.multiply([te, p]),
|
|
1946
|
-
currency:
|
|
1946
|
+
currency: G.currency || Ce(((ae = c.currentCountry) == null ? void 0 : ae.value) ?? it)
|
|
1947
1947
|
};
|
|
1948
1948
|
}
|
|
1949
|
-
}),
|
|
1949
|
+
}), W = T(() => {
|
|
1950
1950
|
var p;
|
|
1951
|
-
const u = [...o.value].reverse().computeFirst((
|
|
1951
|
+
const u = [...o.value].reverse().computeFirst((d) => {
|
|
1952
1952
|
var S, P;
|
|
1953
|
-
const i = (P = (S =
|
|
1953
|
+
const i = (P = (S = d.skus) == null ? void 0 : S.find) == null ? void 0 : P.call(S, (ee) => ee.sku._id === b.sku._id);
|
|
1954
1954
|
return i == null ? void 0 : i.toCostBalances;
|
|
1955
1955
|
});
|
|
1956
|
-
return !u || u.some((
|
|
1957
|
-
...u.reduce((
|
|
1956
|
+
return !u || u.some((d) => d.cost == null) ? "No data" : {
|
|
1957
|
+
...u.reduce((d, i) => oe.add([d, 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 === ut.Enum.FIFO ?
|
|
1963
|
+
}), H = T(() => b.sku.valuation === ut.Enum.FIFO ? W.value : F.value);
|
|
1964
1964
|
function J() {
|
|
1965
1965
|
const { startDate: u, endDate: h } = to(v.value);
|
|
1966
1966
|
u !== null && h !== null && (v.value = {
|
|
@@ -1970,7 +1970,7 @@ 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"),
|
|
1973
|
+
const p = D("FmButton"), d = D("FmField"), i = D("FmDateRangePicker"), S = D("FmSpacer"), P = D("FmCircularProgress"), ee = D("FmIcon"), ae = D("FmTooltip"), Q = D("FmMenuDivider"), G = D("FmChip"), te = D("FmSelect"), le = D("FmCardSection"), ce = D("FmCard"), je = D("FmSideSheet");
|
|
1974
1974
|
return j(), ne(je, {
|
|
1975
1975
|
"dismiss-away": "",
|
|
1976
1976
|
modelValue: s(I),
|
|
@@ -1980,7 +1980,7 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
1980
1980
|
}, {
|
|
1981
1981
|
"side-sheet-header": M(() => [
|
|
1982
1982
|
e("div", Tn, [
|
|
1983
|
-
e("div", En,
|
|
1983
|
+
e("div", En, m(s(r)("inventory.stock.history.title", [u.sku.name])), 1),
|
|
1984
1984
|
y(p, {
|
|
1985
1985
|
variant: "tertiary",
|
|
1986
1986
|
"prepend-icon": "close",
|
|
@@ -2003,12 +2003,12 @@ 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
|
-
y(
|
|
2006
|
+
y(d, {
|
|
2007
2007
|
"prepend-icon": "calendar_month",
|
|
2008
2008
|
focused: de
|
|
2009
2009
|
}, {
|
|
2010
2010
|
default: M(() => [
|
|
2011
|
-
me(
|
|
2011
|
+
me(m(v.value.startDate) + " - " + m(v.value.endDate), 1)
|
|
2012
2012
|
]),
|
|
2013
2013
|
_: 2
|
|
2014
2014
|
}, 1032, ["focused"])
|
|
@@ -2030,7 +2030,7 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
2030
2030
|
R.value ? (j(), q("div", Nn, [
|
|
2031
2031
|
y(S),
|
|
2032
2032
|
y(P, { size: "xl" }),
|
|
2033
|
-
e("div", On,
|
|
2033
|
+
e("div", On, m(s(r)("inventory.stock.history.loading")), 1),
|
|
2034
2034
|
y(S),
|
|
2035
2035
|
y(S)
|
|
2036
2036
|
])) : t.value && ((fe = t.value) == null ? void 0 : fe.length) > 0 ? (j(), q("div", Ln, [
|
|
@@ -2039,16 +2039,16 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
2039
2039
|
y(le, { class: "flex flex-col gap-4" }, {
|
|
2040
2040
|
default: M(() => [
|
|
2041
2041
|
e("div", Yn, [
|
|
2042
|
-
e("div", zn,
|
|
2042
|
+
e("div", zn, m(s(r)("inventory.stock.history.summary.title")), 1)
|
|
2043
2043
|
]),
|
|
2044
|
-
e("div",
|
|
2045
|
-
e("div",
|
|
2046
|
-
e("div", Kn,
|
|
2047
|
-
e("div", qn,
|
|
2044
|
+
e("div", Wn, [
|
|
2045
|
+
e("div", Gn, [
|
|
2046
|
+
e("div", Kn, m(s(r)("inventory.stock.history.summary.totalPurchase")), 1),
|
|
2047
|
+
e("div", qn, m(L.value.PURCHASE), 1)
|
|
2048
2048
|
]),
|
|
2049
2049
|
e("div", Xn, [
|
|
2050
2050
|
e("div", Jn, [
|
|
2051
|
-
me(
|
|
2051
|
+
me(m(s(r)("inventory.stock.history.summary.totalSales")) + " ", 1),
|
|
2052
2052
|
X.value != null ? (j(), ne(ae, {
|
|
2053
2053
|
key: 0,
|
|
2054
2054
|
variant: "plain",
|
|
@@ -2065,44 +2065,44 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
2065
2065
|
_: 1
|
|
2066
2066
|
}, 8, ["content"])) : se("", !0)
|
|
2067
2067
|
]),
|
|
2068
|
-
e("div", Qn,
|
|
2068
|
+
e("div", Qn, m(L.value.SALES), 1)
|
|
2069
2069
|
]),
|
|
2070
2070
|
e("div", Zn, [
|
|
2071
|
-
e("div", es,
|
|
2072
|
-
e("div", ts,
|
|
2071
|
+
e("div", es, m(s(r)("inventory.stock.history.summary.totalLose")), 1),
|
|
2072
|
+
e("div", ts, m(L.value.LOSE), 1)
|
|
2073
2073
|
]),
|
|
2074
2074
|
e("div", os, [
|
|
2075
|
-
e("div", ns,
|
|
2076
|
-
e("div", ss,
|
|
2075
|
+
e("div", ns, m(s(r)("inventory.stock.history.summary.totalRequest")), 1),
|
|
2076
|
+
e("div", ss, m(L.value.REQUEST), 1)
|
|
2077
2077
|
]),
|
|
2078
2078
|
e("div", as, [
|
|
2079
|
-
e("div", rs,
|
|
2080
|
-
e("div", ls,
|
|
2079
|
+
e("div", rs, m(s(r)("inventory.stock.history.summary.totalReceive")), 1),
|
|
2080
|
+
e("div", ls, m(L.value.RECEIVE), 1)
|
|
2081
2081
|
]),
|
|
2082
2082
|
e("div", is, [
|
|
2083
|
-
e("div", us,
|
|
2084
|
-
e("div", cs,
|
|
2083
|
+
e("div", us, m(s(r)("inventory.stock.history.summary.totalConvert")), 1),
|
|
2084
|
+
e("div", cs, m(L.value.CONVERT), 1)
|
|
2085
2085
|
]),
|
|
2086
2086
|
e("div", ds, [
|
|
2087
|
-
e("div", ms,
|
|
2088
|
-
e("div", fs,
|
|
2087
|
+
e("div", ms, m(s(r)("inventory.stock.history.summary.totalDamage")), 1),
|
|
2088
|
+
e("div", fs, m(L.value.DAMAGE), 1)
|
|
2089
2089
|
]),
|
|
2090
2090
|
e("div", vs, [
|
|
2091
|
-
e("div", ps,
|
|
2092
|
-
e("div", ys,
|
|
2091
|
+
e("div", ps, m(s(r)("inventory.stock.history.summary.openingBalance")), 1),
|
|
2092
|
+
e("div", ys, m(z.value), 1)
|
|
2093
2093
|
]),
|
|
2094
2094
|
e("div", _s, [
|
|
2095
|
-
e("div", ks,
|
|
2096
|
-
e("div", hs,
|
|
2095
|
+
e("div", ks, m(s(r)("inventory.stock.history.summary.lastStockBalance")), 1),
|
|
2096
|
+
e("div", hs, m(K.value), 1)
|
|
2097
2097
|
])
|
|
2098
2098
|
]),
|
|
2099
|
-
s(
|
|
2099
|
+
s(f).enableTotalCost ? (j(), q("div", bs, [
|
|
2100
2100
|
y(Q, { class: "w-full" }),
|
|
2101
2101
|
e("div", gs, [
|
|
2102
2102
|
e("div", xs, [
|
|
2103
2103
|
e("div", Ss, [
|
|
2104
2104
|
e("div", ws, [
|
|
2105
|
-
me(
|
|
2105
|
+
me(m(s(r)("inventory.stock.history.estimatedValue")) + " ", 1),
|
|
2106
2106
|
y(ae, {
|
|
2107
2107
|
variant: "plain",
|
|
2108
2108
|
placement: "top",
|
|
@@ -2126,17 +2126,17 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
2126
2126
|
]),
|
|
2127
2127
|
e("div", As, [
|
|
2128
2128
|
u.sku.valuation === s(ut).Enum.FIFO ? (j(), q(ue, { key: 0 }, [
|
|
2129
|
-
y(
|
|
2129
|
+
y(G, {
|
|
2130
2130
|
label: "FIFO",
|
|
2131
2131
|
compact: ""
|
|
2132
2132
|
}),
|
|
2133
|
-
me(" " +
|
|
2133
|
+
me(" " + m(typeof H.value != "string" ? s(Me)(
|
|
2134
2134
|
H.value,
|
|
2135
2135
|
!1,
|
|
2136
2136
|
H.value.precision
|
|
2137
2137
|
) : H.value), 1)
|
|
2138
2138
|
], 64)) : (j(), q(ue, { key: 1 }, [
|
|
2139
|
-
me(
|
|
2139
|
+
me(m(typeof H.value != "string" ? s(Me)(
|
|
2140
2140
|
H.value,
|
|
2141
2141
|
!1,
|
|
2142
2142
|
H.value.precision
|
|
@@ -2155,14 +2155,14 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
2155
2155
|
e("div", Fs, [
|
|
2156
2156
|
e("div", $s, [
|
|
2157
2157
|
e("div", js, [
|
|
2158
|
-
me(
|
|
2158
|
+
me(m(s(r)("inventory.stock.history.costSold")) + " ", 1),
|
|
2159
2159
|
y(ae, {
|
|
2160
2160
|
variant: "plain",
|
|
2161
2161
|
placement: "top",
|
|
2162
2162
|
"z-index": 50
|
|
2163
2163
|
}, {
|
|
2164
2164
|
content: M(() => [
|
|
2165
|
-
e("div", Vs,
|
|
2165
|
+
e("div", Vs, m(s(r)("inventory.stock.history.costSoldTooltip")), 1)
|
|
2166
2166
|
]),
|
|
2167
2167
|
default: M(() => [
|
|
2168
2168
|
y(ee, {
|
|
@@ -2179,7 +2179,7 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
2179
2179
|
"feature-key": "total-cost"
|
|
2180
2180
|
})
|
|
2181
2181
|
]),
|
|
2182
|
-
e("div", Cs,
|
|
2182
|
+
e("div", Cs, m(U.value), 1)
|
|
2183
2183
|
])
|
|
2184
2184
|
])
|
|
2185
2185
|
])) : se("", !0)
|
|
@@ -2211,8 +2211,8 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
2211
2211
|
alt: "List is empty"
|
|
2212
2212
|
}, null, 8, Ds)
|
|
2213
2213
|
]),
|
|
2214
|
-
e("div", Ms,
|
|
2215
|
-
e("div", Is,
|
|
2214
|
+
e("div", Ms, m(s(r)("inventory.stock.history.noRecords")), 1),
|
|
2215
|
+
e("div", Is, m(s(r)("inventory.stock.history.changeDateRange")), 1),
|
|
2216
2216
|
y(S),
|
|
2217
2217
|
y(S)
|
|
2218
2218
|
]))
|
|
@@ -2243,7 +2243,7 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
|
|
|
2243
2243
|
});
|
|
2244
2244
|
function Es(A) {
|
|
2245
2245
|
const c = io(), k = Se(), _ = Y(!1), w = Y(null), V = Y(null);
|
|
2246
|
-
let
|
|
2246
|
+
let f = null, r = !1, b = !1;
|
|
2247
2247
|
function R() {
|
|
2248
2248
|
if (b) return;
|
|
2249
2249
|
const a = k.currentLocationDBName;
|
|
@@ -2256,7 +2256,7 @@ function Es(A) {
|
|
|
2256
2256
|
B,
|
|
2257
2257
|
C
|
|
2258
2258
|
);
|
|
2259
|
-
|
|
2259
|
+
f = v, g.then((o) => {
|
|
2260
2260
|
o != null && o.initialState && C(o.initialState);
|
|
2261
2261
|
}).catch((o) => {
|
|
2262
2262
|
console.error("Failed to fetch refresh-balance initial state", o);
|
|
@@ -2287,7 +2287,7 @@ function Es(A) {
|
|
|
2287
2287
|
}
|
|
2288
2288
|
}
|
|
2289
2289
|
function l() {
|
|
2290
|
-
|
|
2290
|
+
f && (f(), f = null), b = !1, r = !1, _.value = !1, w.value = null;
|
|
2291
2291
|
}
|
|
2292
2292
|
return Ct(() => {
|
|
2293
2293
|
l();
|
|
@@ -2305,7 +2305,7 @@ const Us = {
|
|
|
2305
2305
|
}, 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({
|
|
2306
2306
|
__name: "StockView",
|
|
2307
2307
|
setup(A) {
|
|
2308
|
-
const { t: c } = ye(), k = Ne(), _ = Se(), w = Oe(), V = Ft(),
|
|
2308
|
+
const { t: c } = ye(), k = Ne(), _ = Se(), w = Oe(), V = Ft(), f = Ae(), r = gt(), b = uo(), { columnDefs: R } = ko(), C = Je(), { hasPermission: l } = At(
|
|
2309
2309
|
T(() => [
|
|
2310
2310
|
{
|
|
2311
2311
|
action: Be.Action.manage,
|
|
@@ -2339,12 +2339,12 @@ const Us = {
|
|
|
2339
2339
|
}), O = T(() => n.value || t.value);
|
|
2340
2340
|
async function L() {
|
|
2341
2341
|
E();
|
|
2342
|
-
const p = c("inventory.stock.stock_balance.refreshBalanceDescription"),
|
|
2342
|
+
const p = c("inventory.stock.stock_balance.refreshBalanceDescription"), d = $.value ? `${p}
|
|
2343
2343
|
|
|
2344
2344
|
Last refreshed: ${new Date($.value).toLocaleString()}` : p;
|
|
2345
2345
|
B.open({
|
|
2346
2346
|
title: c("inventory.stock.stock_balance.refreshBalance"),
|
|
2347
|
-
message:
|
|
2347
|
+
message: d,
|
|
2348
2348
|
closeButton: !0,
|
|
2349
2349
|
primaryActions: {
|
|
2350
2350
|
text: c("common.confirm"),
|
|
@@ -2362,7 +2362,7 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
|
|
|
2362
2362
|
if (!t.value) {
|
|
2363
2363
|
t.value = !0;
|
|
2364
2364
|
try {
|
|
2365
|
-
await
|
|
2365
|
+
await f.recalculation.refreshCurrentBalances();
|
|
2366
2366
|
} catch (i) {
|
|
2367
2367
|
console.log("Failed to queue refresh balan22ce", typeof i);
|
|
2368
2368
|
const S = typeof i == "object" ? JSON.stringify(i) : String(i);
|
|
@@ -2412,7 +2412,7 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
|
|
|
2412
2412
|
]
|
|
2413
2413
|
}), U = T(() => {
|
|
2414
2414
|
var i, S, P;
|
|
2415
|
-
const p = K.value ? co.build(K.value) : null,
|
|
2415
|
+
const p = K.value ? co.build(K.value) : null, d = [];
|
|
2416
2416
|
for (const ee of k.skus) {
|
|
2417
2417
|
let ae = !0;
|
|
2418
2418
|
if (b.isEnabled && re.value && g.value && ae && (ae = g.value.has(ee._id)), p && ae && (ae = mo(
|
|
@@ -2422,14 +2422,14 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
|
|
|
2422
2422
|
p
|
|
2423
2423
|
)), ae) {
|
|
2424
2424
|
const Q = ee.trackingMeasurement;
|
|
2425
|
-
let
|
|
2425
|
+
let G = (S = (i = w.stockBalance.skus) == null ? void 0 : i.find(
|
|
2426
2426
|
(ce) => ce.id === ee._id
|
|
2427
2427
|
)) == null ? void 0 : S.balance, te = r.inventoryForecast.skus.find(
|
|
2428
2428
|
(ce) => ce.id === ee._id
|
|
2429
2429
|
);
|
|
2430
2430
|
const le = {
|
|
2431
2431
|
...ee,
|
|
2432
|
-
balance:
|
|
2432
|
+
balance: G ?? {
|
|
2433
2433
|
amount: 0,
|
|
2434
2434
|
precision: 0
|
|
2435
2435
|
},
|
|
@@ -2437,11 +2437,11 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
|
|
|
2437
2437
|
day: (te == null ? void 0 : te.depletionDays) ?? void 0,
|
|
2438
2438
|
trackingUnitAbbrev: Q ? ((P = ee.unit.measurements.find((ce) => ce.id === Q)) == null ? void 0 : P.abbrev) ?? "" : ee.unit.abbrev
|
|
2439
2439
|
};
|
|
2440
|
-
|
|
2440
|
+
d.push(le);
|
|
2441
2441
|
}
|
|
2442
2442
|
}
|
|
2443
|
-
return
|
|
2444
|
-
}), Z = Y(""), re = Y(!0), { breakpoints: x } = Nt(), F = T(() => x.value.xs || x.value.sm),
|
|
2443
|
+
return d;
|
|
2444
|
+
}), Z = Y(""), re = Y(!0), { breakpoints: x } = Nt(), F = T(() => x.value.xs || x.value.sm), W = T(() => F.value ? 10 : 20), H = Dt(), J = T(() => {
|
|
2445
2445
|
const p = [
|
|
2446
2446
|
{
|
|
2447
2447
|
label: c("inventory.stock.stock_balance.refreshBalance"),
|
|
@@ -2478,7 +2478,7 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
|
|
|
2478
2478
|
return u();
|
|
2479
2479
|
}
|
|
2480
2480
|
}
|
|
2481
|
-
return (p,
|
|
2481
|
+
return (p, d) => {
|
|
2482
2482
|
const i = D("FmSwitch"), S = D("FmTable");
|
|
2483
2483
|
return j(), ne(Mt, {
|
|
2484
2484
|
title: s(c)("inventory.stock.title"),
|
|
@@ -2501,22 +2501,22 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
|
|
|
2501
2501
|
searchable: "",
|
|
2502
2502
|
"change-location": "",
|
|
2503
2503
|
search: Z.value,
|
|
2504
|
-
"onUpdate:search":
|
|
2504
|
+
"onUpdate:search": d[1] || (d[1] = (G) => Z.value = G),
|
|
2505
2505
|
"hide-filter-options": !0,
|
|
2506
2506
|
filterable: "",
|
|
2507
2507
|
"filter-attributes": z.value,
|
|
2508
2508
|
filter: K.value,
|
|
2509
|
-
"onUpdate:filter":
|
|
2509
|
+
"onUpdate:filter": d[2] || (d[2] = (G) => K.value = G)
|
|
2510
2510
|
}, {
|
|
2511
2511
|
default: M(() => [
|
|
2512
2512
|
s(b).isEnabled ? (j(), q("div", Us, [
|
|
2513
|
-
e("span", Ps,
|
|
2513
|
+
e("span", Ps, m(s(c)("inventory.integration.netsuite.subsidiaryHierarchy.filtering")), 1),
|
|
2514
2514
|
y(Rt),
|
|
2515
2515
|
y(Qe, null, {
|
|
2516
2516
|
default: M(() => [
|
|
2517
2517
|
y(i, {
|
|
2518
2518
|
modelValue: re.value,
|
|
2519
|
-
"onUpdate:modelValue":
|
|
2519
|
+
"onUpdate:modelValue": d[0] || (d[0] = (G) => re.value = G)
|
|
2520
2520
|
}, null, 8, ["modelValue"])
|
|
2521
2521
|
]),
|
|
2522
2522
|
_: 1
|
|
@@ -2532,12 +2532,12 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
|
|
|
2532
2532
|
"search-value": Z.value,
|
|
2533
2533
|
loading: o.value || s(n) || !s(_)._currentLocation,
|
|
2534
2534
|
key: (P = s(_)._currentLocation) == null ? void 0 : P.dbName,
|
|
2535
|
-
onRowClick:
|
|
2536
|
-
"page-size":
|
|
2535
|
+
onRowClick: d[3] || (d[3] = (G) => s(V).showSkuHistory(G.original)),
|
|
2536
|
+
"page-size": W.value
|
|
2537
2537
|
}, {
|
|
2538
|
-
"list-row": M((
|
|
2538
|
+
"list-row": M((G) => [
|
|
2539
2539
|
y(ro, {
|
|
2540
|
-
row:
|
|
2540
|
+
row: G,
|
|
2541
2541
|
onRowClick: s(V).showSkuHistory
|
|
2542
2542
|
}, {
|
|
2543
2543
|
default: M((te) => {
|
|
@@ -2560,16 +2560,16 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
|
|
|
2560
2560
|
]),
|
|
2561
2561
|
e("div", null, [
|
|
2562
2562
|
y(Ke, {
|
|
2563
|
-
days:
|
|
2563
|
+
days: G.original.day
|
|
2564
2564
|
}, null, 8, ["days"])
|
|
2565
2565
|
]),
|
|
2566
2566
|
e("div", null, [
|
|
2567
2567
|
y(ht, {
|
|
2568
2568
|
class: "xs:w-[160px]",
|
|
2569
|
-
unit:
|
|
2570
|
-
sku:
|
|
2571
|
-
amount:
|
|
2572
|
-
"default-tracking-measurement":
|
|
2569
|
+
unit: G.original.unit,
|
|
2570
|
+
sku: G.original,
|
|
2571
|
+
amount: G.original.balance,
|
|
2572
|
+
"default-tracking-measurement": G.original.trackingMeasurement ?? void 0
|
|
2573
2573
|
}, null, 8, ["unit", "sku", "amount", "default-tracking-measurement"])
|
|
2574
2574
|
])
|
|
2575
2575
|
])
|
|
@@ -2584,8 +2584,8 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
|
|
|
2584
2584
|
(j(), ne(Bt, { to: "body" }, [
|
|
2585
2585
|
(ee = s(V).stockHistoryProps) != null && ee.sku ? (j(), ne(Hs, rt(ze({ key: 0 }, s(V).stockHistoryProps)), null, 16)) : se("", !0),
|
|
2586
2586
|
(ae = s(V).convertSkuDialogProps) != null && ae.sku ? (j(), ne(Mo, rt(ze({ key: 1 }, s(V).convertSkuDialogProps)), null, 16)) : se("", !0),
|
|
2587
|
-
(Q = s(V).adjustSkuDialogProps) != null && Q.stock ? (j(), ne(
|
|
2588
|
-
onSubmitted:
|
|
2587
|
+
(Q = s(V).adjustSkuDialogProps) != null && Q.stock ? (j(), ne(Wo, ze({ key: 2 }, s(V).adjustSkuDialogProps, {
|
|
2588
|
+
onSubmitted: d[4] || (d[4] = (G) => X())
|
|
2589
2589
|
}), null, 16)) : se("", !0),
|
|
2590
2590
|
y(Ts, {
|
|
2591
2591
|
permission: {
|
|
@@ -2597,8 +2597,8 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
|
|
|
2597
2597
|
I.value ? (j(), ne(sn, {
|
|
2598
2598
|
key: 0,
|
|
2599
2599
|
show: I.value,
|
|
2600
|
-
"onUpdate:show":
|
|
2601
|
-
onSubmitted:
|
|
2600
|
+
"onUpdate:show": d[5] || (d[5] = (G) => I.value = G),
|
|
2601
|
+
onSubmitted: d[6] || (d[6] = (G) => X())
|
|
2602
2602
|
}, null, 8, ["show"])) : se("", !0)
|
|
2603
2603
|
]),
|
|
2604
2604
|
_: 1
|