@feedmepos/mf-inventory-portal 1.2.36 → 1.2.37-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.
Files changed (75) hide show
  1. package/dist/{App-CoRV0uPu.js → App-BNC_VGLY.js} +3 -3
  2. package/dist/{ApprovalView-D1RJwuTs.js → ApprovalView-C3-qwfBy.js} +5 -5
  3. package/dist/{BindingsDialog-DIjYRaBX.js → BindingsDialog-DJYcwvLj.js} +2 -2
  4. package/dist/{BindingsPicker-DWzm6wUk.js → BindingsPicker-BfjaThga.js} +2 -2
  5. package/dist/{BindingsTable-Cgt_1URn.js → BindingsTable-CxsJ7J29.js} +3 -3
  6. package/dist/{ClosingDraftView-BtmTem1i.js → ClosingDraftView-lWH-HNt8.js} +8 -8
  7. package/dist/ClosingHistoryView-tDq0ShBo.js +391 -0
  8. package/dist/{ClosingTemplateView-DldPeva3.js → ClosingTemplateView-VDIoPSGE.js} +14 -14
  9. package/dist/{DeliveryOrderPrintPreview-CN1ISr0X.js → DeliveryOrderPrintPreview-BB57thjw.js} +9 -9
  10. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-ClqAKJw7.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BFJquom_.js} +17 -17
  11. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-C4h5BXYx.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-D6nFHej1.js} +2 -2
  12. package/dist/{FmMultiselectDialog-C7l2zdfp.js → FmMultiselectDialog-ByhflquX.js} +2 -2
  13. package/dist/{FmMultiselectDialog-Dm6KX3jk.js → FmMultiselectDialog-pbQjC6ox.js} +1 -1
  14. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-C7SxuBsK.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BVkl9ATd.js} +3 -3
  15. package/dist/{ImportView-DoeGZffY.js → ImportView-BESMNYR1.js} +6 -6
  16. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CiK769eN.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-6nCLOWwx.js} +1 -1
  17. package/dist/{IngredientGroupView-CAGoKjAQ.js → IngredientGroupView-JdgXfEsA.js} +5 -5
  18. package/dist/{IngredientsView-CqiVcl6C.js → IngredientsView-Btcmhy3H.js} +14 -14
  19. package/dist/IntegrationView-CxHNZ7E3.js +4488 -0
  20. package/dist/{InventoryBindingForm-ABaQrODH.js → InventoryBindingForm-CpLif5mq.js} +1 -1
  21. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CCkqGDgP.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-B2AQxOn1.js} +4 -4
  22. package/dist/{InventoryBindingSummary-NKnKZi6q.js → InventoryBindingSummary-DGBAel1C.js} +1 -1
  23. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CgYH09wF.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-oQlPxFAX.js} +1 -1
  24. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CB1g11Ll.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DuWFQ6Q0.js} +2 -2
  25. package/dist/{PublishView-DksyQG3l.js → PublishView-C-UiGWym.js} +3 -3
  26. package/dist/{PurchaseOrderPrintPreview-03pZKACn.js → PurchaseOrderPrintPreview-mO_oxnft.js} +10 -10
  27. package/dist/{ReceiveRequestView-BeQfTd9r.js → ReceiveRequestView-Cr6Xrv4Q.js} +19 -19
  28. package/dist/{RecipeView-ifhPuBGA.js → RecipeView-Bk9O5UiN.js} +8 -8
  29. package/dist/{StockView-DedXRTWx.js → StockView-C2op154q.js} +15 -15
  30. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-ChlgF_bk.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CntpgdYL.js} +1 -1
  31. package/dist/{SupplierView-CrfsfuOf.js → SupplierView-2qjnAlnU.js} +11 -11
  32. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-Csi6RdZv.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-DqdgsUES.js} +2 -2
  33. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BAkZOh6P.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CbSWd397.js} +1 -1
  34. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-Drtj7Kd3.js → TransferDetails.vue_vue_type_script_setup_true_lang-U5KJ5_b2.js} +14 -14
  35. package/dist/{TransferTemplateView-BhdAu8px.js → TransferTemplateView-Dw4Ukcce.js} +15 -15
  36. package/dist/{UnitView-BiSvzbL6.js → UnitView-H4Sgdzg5.js} +6 -6
  37. package/dist/{WarehouseView-Dhi2uxnP.js → WarehouseView-DzR1A-Cr.js} +5 -5
  38. package/dist/{WastageTemplateView-DkvpRveY.js → WastageTemplateView-Sb2KtrF3.js} +14 -14
  39. package/dist/api/closing.d.ts +1 -0
  40. package/dist/api/netsuite.d.ts +96 -3
  41. package/dist/{app-Bwm5cx2b.js → app-Cnok7m8q.js} +3735 -3731
  42. package/dist/app.js +1 -1
  43. package/dist/{closing-template-kl2L1-wG.js → closing-template-u2ACSj7R.js} +1 -1
  44. package/dist/{date2-BkJijdu3.js → date2-DtnfdJTF.js} +1 -1
  45. package/dist/{dayjs.min-CHim5Kj5.js → dayjs.min-DcraCntx.js} +1 -1
  46. package/dist/{decimal-D6edjUO7.js → decimal-CIJMix9a.js} +2 -2
  47. package/dist/{defineDeepModel-Be2-pkT1.js → defineDeepModel-LcFLGZe5.js} +1 -1
  48. package/dist/{duplicate-template-DmG9P6zh.js → duplicate-template-Btr1_Yzf.js} +1 -1
  49. package/dist/{feature-BVjxI6j1.js → feature-DSy7PE3I.js} +2 -2
  50. package/dist/{format-time-from-id-F6jt6fTo.js → format-time-from-id-Dh_SXggJ.js} +1 -1
  51. package/dist/{format-unit-display-BPfoIQ5l.js → format-unit-display-BZ9AAp4V.js} +10 -10
  52. package/dist/{import-export.helper-CH-D34oH.js → import-export.helper-C3aWPNyJ.js} +5 -5
  53. package/dist/{index-DRQQwiwn.js → index-BTM5svgh.js} +1 -1
  54. package/dist/{index-Bgc84muo.js → index-DbWKRddg.js} +3 -3
  55. package/dist/{index-eJWoHNdw.js → index-eN7NxI-_.js} +1 -1
  56. package/dist/{lodash-C24hnHyT.js → lodash-DUlA5LSE.js} +1 -1
  57. package/dist/{netsuite-BhH6M8jR.js → netsuite-ekrD_FS6.js} +961 -928
  58. package/dist/{purchase-order-template-1sBeg568.js → purchase-order-template-C4S6XRoE.js} +1 -1
  59. package/dist/{rules-CCd7mYLv.js → rules-Buw1aczb.js} +3 -3
  60. package/dist/{stock-BWS0ZS6g.js → stock-CLvc2DUC.js} +3 -3
  61. package/dist/{stock-rD5kj1QP.js → stock-DqZP0ldB.js} +1 -1
  62. package/dist/stores/integration/netsuite.d.ts +13 -0
  63. package/dist/{supplier-BbyOdDkm.js → supplier-BA4riI7a.js} +2 -2
  64. package/dist/tsconfig.app.tsbuildinfo +1 -1
  65. package/dist/{use-ingredient-select-dialog-B5qh-1pZ.js → use-ingredient-select-dialog-BFI0Mdnw.js} +2 -2
  66. package/dist/{use-inventory-binding-dialog-Dvhw3xKV.js → use-inventory-binding-dialog-BIqgx607.js} +2 -2
  67. package/dist/{use-template-enabled-locations-2-CXYSdKKV.js → use-template-enabled-locations-2-CyBo9a3I.js} +2 -2
  68. package/dist/views/integration/components/netsuite/business/AddVendorDialog.vue.d.ts +743 -0
  69. package/dist/views/integration/components/netsuite/business/NetSuiteVendorField.vue.d.ts +73 -0
  70. package/dist/{vue-i18n-CKCDKj-z.js → vue-i18n-C62Txccp.js} +341 -341
  71. package/dist/{xlsx-CHsCI3Ao.js → xlsx-Cmu71X0Z.js} +1 -1
  72. package/dist/{xlsx.util-BgpaGhEM.js → xlsx.util-DI9MSTQE.js} +1 -1
  73. package/package.json +3 -3
  74. package/dist/ClosingHistoryView-Ao3Hm8IY.js +0 -367
  75. package/dist/IntegrationView-DBoAg8xQ.js +0 -4069
@@ -1,9 +1,9 @@
1
1
  import { ref as B, onUnmounted as D, defineComponent as w, watch as L, onMounted as M, computed as P, resolveComponent as y, openBlock as R, createElementBlock as A, unref as T, createVNode as g, createElementVNode as v, toDisplayString as x, createBlock as F, createCommentVNode as W } from "vue";
2
- import { u as K, a as $, R as e, m as _, g as a, b as V } from "./app-Bwm5cx2b.js";
2
+ import { u as K, a as $, R as e, m as _, g as a, b as V } from "./app-Cnok7m8q.js";
3
3
  import { useCoreStore as U, useI18n as k } from "@feedmepos/mf-common";
4
4
  import { useRouter as O, useRoute as j } from "vue-router";
5
- import { u as H } from "./feature-BVjxI6j1.js";
6
- import { u as z } from "./netsuite-BhH6M8jR.js";
5
+ import { u as H } from "./feature-DSy7PE3I.js";
6
+ import { u as z } from "./netsuite-ekrD_FS6.js";
7
7
  import { u as Q } from "./useTabStorage-BkIVScW_.js";
8
8
  import { u as Y } from "./googlemap-Dm8ERVai.js";
9
9
  function q() {
@@ -1,14 +1,14 @@
1
1
  import { defineComponent as ue, ref as y, watch as ie, computed as d, resolveComponent as ce, openBlock as x, createBlock as X, unref as n, withCtx as k, createElementVNode as c, normalizeClass as pe, createVNode as i, normalizeStyle as de, toDisplayString as me, createElementBlock as fe, createCommentVNode as ve, Teleport as he, mergeProps as _e } from "vue";
2
- import { u as De, m as b } from "./app-Bwm5cx2b.js";
3
- import { a as ge, _ as ye } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-C4h5BXYx.js";
4
- import { u as be, P as q, a as Oe, _ as Re } from "./TransferDetails.vue_vue_type_script_setup_true_lang-Drtj7Kd3.js";
5
- import { d as Z } from "./date2-BkJijdu3.js";
2
+ import { u as De, m as b } from "./app-Cnok7m8q.js";
3
+ import { a as ge, _ as ye } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-D6nFHej1.js";
4
+ import { u as be, P as q, a as Oe, _ as Re } from "./TransferDetails.vue_vue_type_script_setup_true_lang-U5KJ5_b2.js";
5
+ import { d as Z } from "./date2-DtnfdJTF.js";
6
6
  import { u as Se, _ as xe } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
7
7
  import { _ as ke, F as O } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
8
8
  import { useBreakpoints as qe } from "@feedmepos/ui-library";
9
9
  import { useI18n as we } from "@feedmepos/mf-common";
10
10
  import { N as Pe, H as Ne } from "./app-uBuHtW8m.js";
11
- import { u as Te } from "./netsuite-BhH6M8jR.js";
11
+ import { u as Te } from "./netsuite-ekrD_FS6.js";
12
12
  const Ae = { class: "flex flex-col py-8" }, Ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Me = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, Ve = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1" }, Fe = {
13
13
  key: 0,
14
14
  class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1"
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as C, ref as o, onMounted as M, onUnmounted as F, watch as x, resolveComponent as l, openBlock as i, createElementBlock as d, createBlock as I, withCtx as R, createVNode as a, createCommentVNode as z, createElementVNode as P } from "vue";
2
- import { _ as V } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-CCkqGDgP.js";
3
- import { a as L, ad as S } from "./app-Bwm5cx2b.js";
2
+ import { _ as V } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-B2AQxOn1.js";
3
+ import { a as L, ad as S } from "./app-Cnok7m8q.js";
4
4
  const U = {
5
5
  key: 0,
6
6
  class: "flex justify-end gap-8 items-center"
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as S, computed as r, ref as l, onMounted as U, onUnmounted as V, resolveComponent as E, openBlock as p, createElementBlock as f, createVNode as u, createElementVNode as k } from "vue";
2
- import { a as M } from "./FmMultiselectDialog-C7l2zdfp.js";
3
- import { a as x, ad as z } from "./app-Bwm5cx2b.js";
2
+ import { a as M } from "./FmMultiselectDialog-ByhflquX.js";
3
+ import { a as x, ad as z } from "./app-Cnok7m8q.js";
4
4
  const F = {
5
5
  key: 0,
6
6
  class: "flex flex-col gap-16"
@@ -1,11 +1,11 @@
1
1
  import { defineComponent as x, ref as r, provide as C, computed as g, resolveComponent as h, openBlock as l, createElementBlock as u, createStaticVNode as F, Fragment as L, renderList as I, createElementVNode as p, toDisplayString as v, createVNode as w, withModifiers as N, onMounted as E, onUnmounted as z, createBlock as M } from "vue";
2
- import { F as b, a as P, ad as R } from "./app-Bwm5cx2b.js";
3
- import "./dayjs.min-CHim5Kj5.js";
2
+ import { F as b, a as P, ad as R } from "./app-Cnok7m8q.js";
3
+ import "./dayjs.min-DcraCntx.js";
4
4
  import "@feedmepos/ui-library";
5
5
  /* empty css */
6
6
  import "@feedmepos/mf-common";
7
7
  import "./app-uBuHtW8m.js";
8
- import "./lodash-C24hnHyT.js";
8
+ import "./lodash-DUlA5LSE.js";
9
9
  const U = { class: "" }, D = ["onClick"], O = { class: "flex-grow-0 flex-shrink-0 basis-5/12 py-8 pl-8" }, V = { class: "flex-grow-0 flex-shrink-0 basis-3/12 py-8" }, S = { class: "flex-grow-0 flex-shrink-0 basis-3/12 py-8" }, $ = { class: "flex-grow-0 flex-shrink-0 basis-1/12 py-4" }, T = /* @__PURE__ */ x({
10
10
  __name: "binding-ui",
11
11
  props: {
@@ -2,17 +2,17 @@ import { defineComponent as Ee, ref as Y, computed as V, onMounted as qe, resolv
2
2
  import { F as vt, u as Pt, _ as Rt } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
3
3
  import { useCoreStore as Mt, useI18n as gt } from "@feedmepos/mf-common";
4
4
  import { useSnackbar as We, useDialog as Vt, useProxiedModel as Lt, components as be, useBreakpoints as Nt } from "@feedmepos/ui-library";
5
- import { o as Et, u as ze, E as O, s as M, G as yt, H as he, z as Qe, t as Me, c as zt, a as Ht } from "./app-Bwm5cx2b.js";
5
+ import { o as Et, u as ze, G as O, s as M, H as yt, I as he, z as Qe, t as Me, c as zt, a as Ht } from "./app-Cnok7m8q.js";
6
6
  import { defineStore as bt, storeToRefs as Ot } from "pinia";
7
- import { d as Le, e as ht, f as Yt, a as ke } from "./date2-BkJijdu3.js";
8
- import { R as Kt, f as Ze, a as Ge, t as Qt, d as Be, o as kt, p as xt, m as Dt, l as Gt } from "./rules-CCd7mYLv.js";
9
- import { b as qt, d as Wt } from "./xlsx.util-BgpaGhEM.js";
10
- import { u as At } from "./stock-BWS0ZS6g.js";
11
- import { u as Je } from "./stock-rD5kj1QP.js";
7
+ import { d as Le, e as ht, f as Yt, a as ke } from "./date2-DtnfdJTF.js";
8
+ import { R as Kt, f as Ze, a as Ge, t as Qt, d as Be, o as kt, p as xt, m as Dt, l as Gt } from "./rules-Buw1aczb.js";
9
+ import { b as qt, d as Wt } from "./xlsx.util-DI9MSTQE.js";
10
+ import { u as At } from "./stock-CLvc2DUC.js";
11
+ import { u as Je } from "./stock-DqZP0ldB.js";
12
12
  import { D as dt, R as Pe } from "./row-action.enum-BcW_L_nE.js";
13
13
  import { c as Zt, _ as Jt, F as Re } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
14
- import { f as Xt } from "./format-time-from-id-F6jt6fTo.js";
15
- import { _ as ea } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-C4h5BXYx.js";
14
+ import { f as Xt } from "./format-time-from-id-Dh_SXggJ.js";
15
+ import { _ as ea } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-D6nFHej1.js";
16
16
  import { E as ta } from "./empty-placeholder-wf6-BWE8.js";
17
17
  const He = Et((s, o) => {
18
18
  function e() {
@@ -0,0 +1,391 @@
1
+ import { defineComponent as H, ref as f, computed as k, resolveComponent as w, openBlock as d, createElementBlock as y, createVNode as p, withModifiers as oe, withCtx as R, createElementVNode as n, toDisplayString as s, unref as a, Fragment as M, createTextVNode as z, createBlock as B, createCommentVNode as V, renderList as le, normalizeClass as ae, h as ne, onMounted as se, Teleport as ie } from "vue";
2
+ import { F as ce, _ as re } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
3
+ import { useI18n as j, useCoreStore as ue } from "@feedmepos/mf-common";
4
+ import { C as G, z as S, u as de } from "./app-Cnok7m8q.js";
5
+ import { _ as me } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-D6nFHej1.js";
6
+ import { useSnackbar as J, useDialog as ve } from "@feedmepos/ui-library";
7
+ import { u as ye } from "./stock-DqZP0ldB.js";
8
+ const fe = { class: "fm-typo-en-heading-lg-600" }, pe = { class: "flex flex-col gap-16" }, ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _e = { class: "flex flex-col gap-8" }, be = { class: "fm-typo-en-body-md-600" }, he = { class: "flex flex-col gap-8" }, ke = { class: "fm-typo-en-body-md-600" }, xe = { class: "flex items-center gap-8 mb-8" }, De = {
9
+ key: 2,
10
+ class: "text-red-500 text-sm mt-2"
11
+ }, Ve = { class: "fm-typo-en-body-sm-400" }, we = {
12
+ key: 1,
13
+ class: "flex flex-col gap-8"
14
+ }, Se = { class: "fm-typo-en-body-md-600" }, Ce = { class: "flex flex-col gap-8 max-h-[300px] overflow-y-auto" }, Ae = { class: "flex items-center justify-between" }, Fe = { class: "fm-typo-en-body-sm-600" }, Re = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Be = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Le = {
15
+ key: 0,
16
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
17
+ }, Te = {
18
+ key: 1,
19
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
20
+ }, Oe = {
21
+ key: 2,
22
+ class: "fm-typo-en-body-xs-400 text-fm-color-system-error-500"
23
+ }, $e = {
24
+ key: 0,
25
+ class: "flex gap-8 ml-auto"
26
+ }, Ee = {
27
+ key: 1,
28
+ class: "flex gap-8 ml-auto"
29
+ }, Ie = /* @__PURE__ */ H({
30
+ __name: "RecalculationDialog",
31
+ emits: ["submitted"],
32
+ setup(Q, { expose: b, emit: L }) {
33
+ const C = L, { t: l } = j(), T = ye(), O = G(), x = J(), v = f(!1), u = f(""), i = f(""), g = f(!1), A = f([]), c = f(!1), D = f([]), r = f(!1), m = k(() => A.value.map((e) => {
34
+ const o = S(e._id), _ = new Date(o);
35
+ return {
36
+ label: `${_.toLocaleDateString()} ${_.toLocaleTimeString()}`,
37
+ value: e._id
38
+ };
39
+ })), h = k(() => u.value ? m.value.filter((e) => e.value > u.value) : []), F = k({
40
+ get: () => {
41
+ if (g.value && i.value) {
42
+ const e = A.value.find((o) => S(o._id) === i.value);
43
+ return (e == null ? void 0 : e._id) || i.value;
44
+ }
45
+ return i.value;
46
+ },
47
+ set: (e) => {
48
+ g.value && e ? i.value = S(e) : i.value = e;
49
+ }
50
+ }), W = k(() => {
51
+ if (u.value)
52
+ try {
53
+ const e = S(u.value);
54
+ if (e)
55
+ return e;
56
+ } catch (e) {
57
+ console.error("Error parsing date from closing ID:", e);
58
+ }
59
+ }), $ = k(() => {
60
+ if (!u.value || !i.value) return "";
61
+ const e = S(u.value), o = i.value;
62
+ if (e && o) {
63
+ const _ = new Date(e).getTime();
64
+ if (new Date(o).getTime() <= _)
65
+ return l("inventory.stock.recalculation.error.endDateBeforeOpening");
66
+ }
67
+ return "";
68
+ }), I = k(() => !!u.value && !!i.value && !$.value), N = k(() => D.value.some(
69
+ (e) => !e.completedAt && !e.failedReason
70
+ ));
71
+ async function P() {
72
+ v.value = !0, await Promise.all([Y(), U()]), u.value = "", i.value = "", g.value = !1;
73
+ }
74
+ function X() {
75
+ v.value = !1;
76
+ }
77
+ b({
78
+ open: P,
79
+ close: X
80
+ });
81
+ async function Y() {
82
+ c.value = !0;
83
+ try {
84
+ const e = await O.getLastNClosings(30);
85
+ A.value = e;
86
+ } catch (e) {
87
+ console.error("Error fetching recent closings:", e), x.open({
88
+ title: l("common.error"),
89
+ message: "Failed to fetch recent closings",
90
+ type: "error"
91
+ });
92
+ } finally {
93
+ c.value = !1;
94
+ }
95
+ }
96
+ async function U() {
97
+ r.value = !0;
98
+ try {
99
+ const e = await T.recalculation.recalculationRequests();
100
+ D.value = e;
101
+ } catch (e) {
102
+ console.error("Error fetching recalculation requests:", e);
103
+ } finally {
104
+ r.value = !1;
105
+ }
106
+ }
107
+ async function Z() {
108
+ if (I.value) {
109
+ c.value = !0;
110
+ try {
111
+ await T.recalculation.scheduleRecalculation(u.value, i.value), x.open({
112
+ title: l("common.success"),
113
+ message: "Stock recalculation has been scheduled successfully",
114
+ type: "success"
115
+ }), await U(), v.value = !1, C("submitted");
116
+ } catch (e) {
117
+ console.error("Error scheduling recalculation:", e), x.open({
118
+ title: l("common.error"),
119
+ message: "Failed to schedule stock recalculation",
120
+ type: "error"
121
+ });
122
+ } finally {
123
+ c.value = !1;
124
+ }
125
+ }
126
+ }
127
+ return (e, o) => {
128
+ const _ = w("FmButton"), E = w("FmSelect"), K = w("FmRadio"), q = w("FmDatePicker"), ee = w("FmAlert"), te = w("FmDialog");
129
+ return d(), y("div", null, [
130
+ p(_, {
131
+ "prepend-icon": "info",
132
+ variant: "tertiary",
133
+ onClick: oe(P, ["stop"])
134
+ }),
135
+ p(te, {
136
+ modelValue: v.value,
137
+ "onUpdate:modelValue": o[7] || (o[7] = (t) => v.value = t),
138
+ "close-button": "",
139
+ dismissAway: "",
140
+ "max-width": "600px"
141
+ }, {
142
+ "dialog-header": R(() => [
143
+ n("div", fe, s(a(l)("inventory.stock.recalculation.title")), 1)
144
+ ]),
145
+ "dialog-footer": R(() => [
146
+ N.value ? (d(), y("div", Ee, [
147
+ p(_, {
148
+ variant: "tertiary",
149
+ onClick: o[6] || (o[6] = (t) => v.value = !1),
150
+ label: a(l)("common.close")
151
+ }, null, 8, ["label"])
152
+ ])) : (d(), y("div", $e, [
153
+ p(_, {
154
+ variant: "tertiary",
155
+ onClick: o[5] || (o[5] = (t) => v.value = !1),
156
+ disabled: c.value,
157
+ label: a(l)("common.cancel")
158
+ }, null, 8, ["disabled", "label"]),
159
+ p(_, {
160
+ variant: "primary",
161
+ onClick: Z,
162
+ disabled: !I.value || c.value,
163
+ loading: c.value,
164
+ label: a(l)("inventory.stock.recalculation.schedule")
165
+ }, null, 8, ["disabled", "loading", "label"])
166
+ ]))
167
+ ]),
168
+ default: R(() => [
169
+ n("div", pe, [
170
+ n("div", ge, s(a(l)("inventory.stock.recalculation.description")), 1),
171
+ N.value ? V("", !0) : (d(), y(M, { key: 0 }, [
172
+ n("div", _e, [
173
+ n("p", be, [
174
+ z(s(a(l)("inventory.stock.recalculation.openingDate")) + " ", 1),
175
+ o[8] || (o[8] = n("span", { class: "text-fm-color-system-error-300" }, "*", -1))
176
+ ]),
177
+ o[9] || (o[9] = n("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary mb-4" }, " Showing the last 30 closing records. Select the opening date to start recalculation. ", -1)),
178
+ p(E, {
179
+ modelValue: u.value,
180
+ "onUpdate:modelValue": o[0] || (o[0] = (t) => u.value = t),
181
+ items: m.value,
182
+ placeholder: a(l)("inventory.stock.recalculation.selectOpening"),
183
+ loading: c.value,
184
+ disabled: c.value
185
+ }, null, 8, ["modelValue", "items", "placeholder", "loading", "disabled"])
186
+ ]),
187
+ n("div", he, [
188
+ n("p", ke, [
189
+ z(s(a(l)("inventory.stock.recalculation.untilDate")) + " ", 1),
190
+ o[10] || (o[10] = n("span", { class: "text-fm-color-system-error-300" }, "*", -1))
191
+ ]),
192
+ n("div", xe, [
193
+ p(K, {
194
+ modelValue: g.value,
195
+ "onUpdate:modelValue": o[1] || (o[1] = (t) => g.value = t),
196
+ value: !1,
197
+ label: a(l)("inventory.stock.recalculation.selectByDate")
198
+ }, null, 8, ["modelValue", "label"]),
199
+ p(K, {
200
+ modelValue: g.value,
201
+ "onUpdate:modelValue": o[2] || (o[2] = (t) => g.value = t),
202
+ value: !0,
203
+ label: a(l)("inventory.stock.recalculation.selectByClosing")
204
+ }, null, 8, ["modelValue", "label"])
205
+ ]),
206
+ g.value ? (d(), B(E, {
207
+ key: 1,
208
+ modelValue: F.value,
209
+ "onUpdate:modelValue": o[4] || (o[4] = (t) => F.value = t),
210
+ items: h.value,
211
+ placeholder: a(l)("inventory.stock.recalculation.selectClosing"),
212
+ loading: c.value,
213
+ disabled: !u.value || c.value
214
+ }, null, 8, ["modelValue", "items", "placeholder", "loading", "disabled"])) : (d(), B(q, {
215
+ key: 0,
216
+ modelValue: i.value,
217
+ "onUpdate:modelValue": o[3] || (o[3] = (t) => i.value = t),
218
+ placeholder: a(l)("inventory.stock.recalculation.selectDate"),
219
+ min: W.value,
220
+ disabled: !u.value || c.value
221
+ }, null, 8, ["modelValue", "placeholder", "min", "disabled"])),
222
+ $.value ? (d(), y("div", De, s($.value), 1)) : V("", !0)
223
+ ]),
224
+ u.value && i.value && !$.value ? (d(), B(ee, {
225
+ key: 0,
226
+ type: "info"
227
+ }, {
228
+ default: R(() => [
229
+ n("div", Ve, s(a(l)("inventory.stock.recalculation.info")), 1)
230
+ ]),
231
+ _: 1
232
+ })) : V("", !0)
233
+ ], 64)),
234
+ D.value.length > 0 ? (d(), y("div", we, [
235
+ n("p", Se, s(a(l)("inventory.stock.recalculation.recentRequests")), 1),
236
+ n("div", Ce, [
237
+ (d(!0), y(M, null, le(D.value, (t) => (d(), y("div", {
238
+ key: t._id,
239
+ class: "p-12 border border-fm-color-border-primary rounded-8 flex flex-col gap-4"
240
+ }, [
241
+ n("div", Ae, [
242
+ n("div", Fe, s(a(l)("inventory.stock.recalculation.requestedAt")) + ": " + s(new Date(t.createdAt).toLocaleString()), 1),
243
+ n("div", {
244
+ class: ae(["fm-typo-en-body-xs-600 px-8 py-4 rounded-4", {
245
+ "bg-fm-color-system-error-100 text-fm-color-system-error-500": t.failedReason,
246
+ "bg-fm-color-system-success-100 text-fm-color-system-success-500": t.completedAt,
247
+ "bg-fm-color-system-info-100 text-fm-color-system-info-500": !t.failedReason && !t.completedAt
248
+ }])
249
+ }, s(t.failedReason ? a(l)("inventory.stock.recalculation.status.failed") : t.completedAt ? a(l)("inventory.stock.recalculation.status.completed") : a(l)("inventory.stock.recalculation.status.inProgress")), 3)
250
+ ]),
251
+ n("div", Re, s(a(l)("inventory.stock.recalculation.from")) + ": " + s(new Date(t.recalculateStartDate).toLocaleDateString()), 1),
252
+ n("div", Be, s(a(l)("inventory.stock.recalculation.to")) + ": " + s(new Date(t.recalculateEndDate).toLocaleDateString()), 1),
253
+ t.createdBy ? (d(), y("div", Le, s(a(l)("inventory.stock.recalculation.requestedBy")) + ": " + s(t.createdBy.name || t.createdBy.id), 1)) : V("", !0),
254
+ t.completedAt ? (d(), y("div", Te, s(a(l)("inventory.stock.recalculation.completedAt")) + ": " + s(new Date(t.completedAt).toLocaleString()), 1)) : V("", !0),
255
+ t.failedReason ? (d(), y("div", Oe, s(t.failedReason), 1)) : V("", !0)
256
+ ]))), 128))
257
+ ])
258
+ ])) : V("", !0)
259
+ ])
260
+ ]),
261
+ _: 1
262
+ }, 8, ["modelValue"])
263
+ ]);
264
+ };
265
+ }
266
+ }), Ne = { class: "flex flex-col gap-16 p-16" }, Ge = /* @__PURE__ */ H({
267
+ __name: "ClosingHistoryView",
268
+ setup(Q) {
269
+ var D;
270
+ const { t: b } = j(), L = G(), C = de(), l = ue(), T = ve(), O = J(), x = f([]), v = f(!1), u = k(() => [
271
+ {
272
+ label: b("inventory.stock.recalculation.title", "Stock Recalculation"),
273
+ value: "recalculation",
274
+ prependIcon: "history",
275
+ isAdminOnly: !0
276
+ },
277
+ {
278
+ label: b("inventory.closing.history.recalculate", "Initiate Opening"),
279
+ value: "initiateOpening",
280
+ prependIcon: "add_box",
281
+ isAdminOnly: !0
282
+ }
283
+ ]), i = f();
284
+ function g(r) {
285
+ var m;
286
+ switch (r) {
287
+ case "recalculation":
288
+ return (m = i.value) == null ? void 0 : m.open();
289
+ case "initiateOpening":
290
+ T.open({
291
+ title: "Initiate Opening Balance",
292
+ message: "Initiate opening balance if no opening balance exists for the current location.",
293
+ primaryActions: { text: "Confirm", close: !0 }
294
+ }).onPrimary(async () => {
295
+ try {
296
+ await L.initiateClosing(), O.open({
297
+ message: "Opening balance initiated successfully.",
298
+ type: "success"
299
+ }), await c();
300
+ } catch (h) {
301
+ O.open({
302
+ message: h.message || "Failed to initiate opening balance. Please try again.",
303
+ type: "error"
304
+ });
305
+ }
306
+ });
307
+ }
308
+ }
309
+ const A = [
310
+ ...(D = l.sessionUser.value) != null && D.role.isAdmin ? [
311
+ {
312
+ accessorKey: "_id",
313
+ header: () => ne(ce, {}, () => `${b("inventory.closing.history.closingId")}`),
314
+ cell: (r) => r.getValue()
315
+ }
316
+ ] : [],
317
+ {
318
+ accessorKey: "_id",
319
+ id: "date",
320
+ header: () => b("inventory.closing.history.date"),
321
+ cell: (r) => {
322
+ const m = r.getValue(), h = S(m);
323
+ return new Date(h).toLocaleDateString();
324
+ }
325
+ },
326
+ {
327
+ accessorKey: "_id",
328
+ id: "time",
329
+ header: () => b("inventory.closing.history.time"),
330
+ cell: (r) => {
331
+ const m = r.getValue(), h = S(m);
332
+ return new Date(h).toLocaleTimeString();
333
+ }
334
+ },
335
+ {
336
+ accessorKey: "ref",
337
+ header: () => b("inventory.closing.history.createdFrom"),
338
+ cell: (r) => r.getValue() || "-"
339
+ }
340
+ ];
341
+ async function c() {
342
+ if (C.currentLocationDBName) {
343
+ v.value = !0;
344
+ try {
345
+ const r = await L.getLastNClosings(30);
346
+ x.value = r;
347
+ } catch (r) {
348
+ console.error("Error fetching closings:", r), x.value = [];
349
+ } finally {
350
+ v.value = !1;
351
+ }
352
+ }
353
+ }
354
+ return se(async () => {
355
+ C.currentLocationDBName && await c();
356
+ }), C.watchLocation(c), (r, m) => {
357
+ const h = w("FmTable");
358
+ return d(), B(re, {
359
+ actions: u.value,
360
+ title: a(b)("inventory.closing.history.title"),
361
+ "onClick:action": g
362
+ }, {
363
+ default: R(() => [
364
+ n("div", Ne, [
365
+ p(me, {
366
+ "change-location": "",
367
+ "hide-filter-options": !0
368
+ }),
369
+ m[1] || (m[1] = n("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Displaying the last 30 closing records. ", -1)),
370
+ p(h, {
371
+ loading: v.value,
372
+ "row-data": x.value,
373
+ "column-defs": A
374
+ }, null, 8, ["loading", "row-data"])
375
+ ]),
376
+ (d(), B(ie, { to: "body" }, [
377
+ p(Ie, {
378
+ ref_key: "recalculationDialogRef",
379
+ ref: i,
380
+ onSubmitted: m[0] || (m[0] = (F) => c())
381
+ }, null, 512)
382
+ ]))
383
+ ]),
384
+ _: 1
385
+ }, 8, ["actions", "title"]);
386
+ };
387
+ }
388
+ });
389
+ export {
390
+ Ge as default
391
+ };
@@ -4,23 +4,23 @@ import { useI18n as W, useCoreStore as de } from "@feedmepos/mf-common";
4
4
  import { useDialog as pe, useDialogChild as Ze, useSnackbar as ce, FmButtonVariant as oe, components as Y, FmAdvancedSort as et, useProxiedModel as tt, useBreakpoints as nt } from "@feedmepos/ui-library";
5
5
  import { defineStore as Ve, storeToRefs as Ue } from "pinia";
6
6
  import { F as G } from "./form-mode.enum-BKiNVH6A.js";
7
- import { a as me } from "./closing-template-kl2L1-wG.js";
8
- import { u as fe, c as Ne, a as ve, n as ot } from "./app-Bwm5cx2b.js";
9
- import { t as re, a as ge, d as ye, s as Le, r as st } from "./xlsx.util-BgpaGhEM.js";
7
+ import { a as me } from "./closing-template-u2ACSj7R.js";
8
+ import { u as fe, c as Ne, a as ve, n as ot } from "./app-Cnok7m8q.js";
9
+ import { t as re, a as ge, d as ye, s as Le, r as st } from "./xlsx.util-DI9MSTQE.js";
10
10
  import { F as lt } from "./FmDroppableField-J0xUsOTV.js";
11
- import { f as Be, a as le } from "./date2-BkJijdu3.js";
11
+ import { f as Be, a as le } from "./date2-DtnfdJTF.js";
12
12
  import { D as se, R as z } from "./row-action.enum-BcW_L_nE.js";
13
13
  import { c as at, F as X, _ as ze } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
14
- import { f as rt } from "./format-time-from-id-F6jt6fTo.js";
15
- import { _ as it } from "./TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BAkZOh6P.js";
16
- import { u as ct } from "./netsuite-BhH6M8jR.js";
17
- import { u as mt } from "./duplicate-template-DmG9P6zh.js";
18
- import { _ as ut } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-C4h5BXYx.js";
19
- import { R as dt, A as pt } from "./rules-CCd7mYLv.js";
20
- import { u as ft } from "./use-ingredient-select-dialog-B5qh-1pZ.js";
21
- import { d as vt } from "./defineDeepModel-Be2-pkT1.js";
22
- import { u as gt } from "./use-template-enabled-locations-2-CXYSdKKV.js";
23
- import { _ as yt } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-Csi6RdZv.js";
14
+ import { f as rt } from "./format-time-from-id-Dh_SXggJ.js";
15
+ import { _ as it } from "./TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CbSWd397.js";
16
+ import { u as ct } from "./netsuite-ekrD_FS6.js";
17
+ import { u as mt } from "./duplicate-template-Btr1_Yzf.js";
18
+ import { _ as ut } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-D6nFHej1.js";
19
+ import { R as dt, A as pt } from "./rules-Buw1aczb.js";
20
+ import { u as ft } from "./use-ingredient-select-dialog-BFI0Mdnw.js";
21
+ import { d as vt } from "./defineDeepModel-LcFLGZe5.js";
22
+ import { u as gt } from "./use-template-enabled-locations-2-CyBo9a3I.js";
23
+ import { _ as yt } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-DqdgsUES.js";
24
24
  import { _ as ht } from "./_plugin-vue_export-helper-CHgC5LLL.js";
25
25
  const ue = Ve(
26
26
  "closingTemplateTable",
@@ -1,14 +1,14 @@
1
1
  import { defineComponent as x, computed as f, ref as h, onMounted as _, openBlock as u, createElementBlock as i, createElementVNode as t, createTextVNode as n, toDisplayString as e, createCommentVNode as d, Fragment as o, renderList as p, normalizeClass as g } from "vue";
2
2
  import { useRoute as k } from "vue-router";
3
- import { J as y } from "./app-Bwm5cx2b.js";
3
+ import { K as y } from "./app-Cnok7m8q.js";
4
4
  import { _ as w } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
5
  const c = { class: "purchase-box" }, A = { valign: "bottom" }, N = { class: "sub-header" }, O = ["src"], P = { style: { "padding-left": "10px" } }, C = { class: "address" }, D = { class: "text-right" }, R = {
6
6
  key: 0,
7
7
  class: "subtitle"
8
- }, S = { class: "sub-header" }, E = { class: "caption" }, T = { class: "address" }, q = { class: "text-right" }, F = { class: "sub-header" }, I = { class: "address" }, U = { class: "purchase-body" }, B = { class: "text-left" }, H = { class: "text-left" }, J = { class: "text-left" }, L = { class: "text-left" }, M = { class: "text-left" }, V = { class: "text-right" }, j = { key: 0 }, z = {
8
+ }, S = { class: "sub-header" }, E = { class: "caption" }, T = { class: "address" }, q = { class: "text-right" }, F = { class: "sub-header" }, I = { class: "address" }, U = { class: "purchase-body" }, B = { class: "text-left" }, H = { class: "text-left" }, L = { class: "text-left" }, M = { class: "text-left" }, V = { class: "text-left" }, J = { class: "text-right" }, j = { key: 0 }, z = {
9
9
  key: 1,
10
10
  style: { "padding-top": "30px" }
11
- }, G = { valign: "bottom" }, Q = { class: "header" }, K = { class: "caption" }, W = {
11
+ }, G = { valign: "bottom" }, K = { class: "header" }, Q = { class: "caption" }, W = {
12
12
  class: "text-left",
13
13
  style: { width: "20%" }
14
14
  }, X = { class: "text-left" }, Y = {
@@ -129,7 +129,7 @@ const c = { class: "purchase-box" }, A = { valign: "bottom" }, N = { class: "sub
129
129
  t("tr", null, [
130
130
  t("td", B, e(s.value.orderNumber), 1),
131
131
  t("td", H, e(s.value.ref), 1),
132
- t("td", J, e(s.value.supplier.phoneNumber), 1)
132
+ t("td", L, e(s.value.supplier.phoneNumber), 1)
133
133
  ])
134
134
  ])
135
135
  ]),
@@ -153,8 +153,8 @@ const c = { class: "purchase-box" }, A = { valign: "bottom" }, N = { class: "sub
153
153
  ], -1)),
154
154
  t("tbody", null, [
155
155
  (u(!0), i(o, null, p(s.value.items, (r, a) => (u(), i("tr", { key: a }, [
156
- t("td", L, e(a + 1), 1),
157
- t("td", M, e(r.description), 1),
156
+ t("td", M, e(a + 1), 1),
157
+ t("td", V, e(r.description), 1),
158
158
  t("td", {
159
159
  class: g(["text-right", {
160
160
  "text-green-5": r.received == r.quantity,
@@ -162,7 +162,7 @@ const c = { class: "purchase-box" }, A = { valign: "bottom" }, N = { class: "sub
162
162
  "text-warning": r.received != r.quantity
163
163
  }])
164
164
  }, e(r.received + "/" + r.quantity), 3),
165
- t("td", V, e(r.unit), 1)
165
+ t("td", J, e(r.unit), 1)
166
166
  ]))), 128))
167
167
  ])
168
168
  ])
@@ -179,8 +179,8 @@ const c = { class: "purchase-box" }, A = { valign: "bottom" }, N = { class: "sub
179
179
  t("table", null, [
180
180
  t("tr", G, [
181
181
  t("td", null, [
182
- t("div", Q, "Ref: " + e(r.ref), 1),
183
- t("div", K, e(r.createdAt), 1),
182
+ t("div", K, "Ref: " + e(r.ref), 1),
183
+ t("div", Q, e(r.createdAt), 1),
184
184
  t("div", null, "Remark: " + e(r.remark), 1)
185
185
  ])
186
186
  ])