@feedmepos/mf-inventory-portal 1.2.24 → 1.2.25-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 (58) hide show
  1. package/dist/App-pG3igEbR.js +297 -0
  2. package/dist/{ApprovalView-D8SozxgZ.js → ApprovalView-JoTq2Bdf.js} +13 -13
  3. package/dist/{BindingsDialog-DpD-srnA.js → BindingsDialog-D44lDz_m.js} +2 -2
  4. package/dist/{BindingsPicker-TraPSRn0.js → BindingsPicker-BwaLwmiz.js} +1 -1
  5. package/dist/{BindingsTable-geCwbXg4.js → BindingsTable-C5y3yr5d.js} +1 -1
  6. package/dist/{ClosingDraftView-DsYJZvGk.js → ClosingDraftView-BxBEDZ8r.js} +5 -4
  7. package/dist/ClosingHistoryView-DU0Dv4IW.js +363 -0
  8. package/dist/{ClosingTemplateView-CHkzO1Nu.js → ClosingTemplateView-tigOzz56.js} +2 -2
  9. package/dist/{DeliveryOrderPrintPreview-skDykYOJ.js → DeliveryOrderPrintPreview-BSxjnk3a.js} +9 -9
  10. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BgSCX-LL.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-eUMrmGD4.js} +21 -21
  11. package/dist/{FmMultiselectDialog-CDbPF9Jh.js → FmMultiselectDialog-s0EntbOX.js} +1 -1
  12. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CqDOpQBo.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DQuvByaf.js} +1 -1
  13. package/dist/{ImportView-CskoJZ8f.js → ImportView-D6c6oNby.js} +4 -6
  14. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-IrrYBFeM.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-Ko8B7MYK.js} +1 -1
  15. package/dist/{IngredientGroupView-RledP9Ba.js → IngredientGroupView-oCZpkxZO.js} +2 -2
  16. package/dist/{IngredientsView-C3AXdYSs.js → IngredientsView-C8WzhNAH.js} +7 -7
  17. package/dist/{IntegrationView-B_mGrVu5.js → IntegrationView-DD1QWlE3.js} +141 -141
  18. package/dist/{InventoryBindingForm-CAqsJlFM.js → InventoryBindingForm-ChoO3SrA.js} +1 -1
  19. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-C3hmrMQB.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DXe0VwF9.js} +3 -3
  20. package/dist/{InventoryBindingSummary-CX05dIVw.js → InventoryBindingSummary-BGmUNPfu.js} +1 -1
  21. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-wWuCVuRM.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DDXfvqWA.js} +1 -1
  22. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BU0Npweo.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BwW92Whg.js} +1 -1
  23. package/dist/{PublishView-CfVJ65by.js → PublishView-CzS06kO-.js} +4 -4
  24. package/dist/{PurchaseOrderPrintPreview-DTsz2K_J.js → PurchaseOrderPrintPreview-YCg4lu_a.js} +10 -10
  25. package/dist/{ReceiveRequestView-CgJZis38.js → ReceiveRequestView-WjbYB-a0.js} +8 -8
  26. package/dist/{RecipeView-CLipp4YX.js → RecipeView-Cl4_vFBE.js} +3 -3
  27. package/dist/{StockView-BwZ2pl_P.js → StockView-dyF-JQbP.js} +18 -17
  28. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-jmEYs9QV.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-B-fQRg6q.js} +1 -1
  29. package/dist/{SupplierView-BpwchJuw.js → SupplierView-BN_pPxS7.js} +4 -4
  30. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CkkFDzSi.js → TransferDetails.vue_vue_type_script_setup_true_lang-DR9qQoBL.js} +174 -174
  31. package/dist/{TransferTemplateView-BoVhRHqn.js → TransferTemplateView-CSA2wNJR.js} +7 -7
  32. package/dist/{UnitView-DvOXmefs.js → UnitView-C69iwndm.js} +3 -3
  33. package/dist/{WarehouseView-CuSv-A_N.js → WarehouseView-BkSvBJg_.js} +1 -1
  34. package/dist/api/closing.d.ts +1 -0
  35. package/dist/api/stock.d.ts +2 -44
  36. package/dist/{app-Cl-v2EjQ.js → app-NmiyG_NE.js} +6561 -6389
  37. package/dist/app.d.ts +108 -0
  38. package/dist/app.js +1 -1
  39. package/dist/{decimal-Cd_xkdIL.js → decimal-B-SPLtwh.js} +1 -1
  40. package/dist/{format-unit-display-UAp-LCyp.js → format-unit-display-jXD4D_J4.js} +20 -20
  41. package/dist/{import-export.helper-0uVecFKH.js → import-export.helper-BOFJJxVC.js} +1 -1
  42. package/dist/{index-BO1KynNa.js → index-BvtleP-f.js} +1 -1
  43. package/dist/{index-CL9QvjgU.js → index-DY1lwU0l.js} +1 -1
  44. package/dist/{purchase-order-template-D7DZ6S2H.js → purchase-order-template-BNtdgrTt.js} +1 -1
  45. package/dist/router/name.d.ts +1 -0
  46. package/dist/stock-Basa-Xi7.js +74 -0
  47. package/dist/stock-F2A8gqHx.js +83 -0
  48. package/dist/stores/inventory.d.ts +1 -0
  49. package/dist/{supplier-D49_CDEa.js → supplier-CBUmza-i.js} +1 -1
  50. package/dist/tsconfig.app.tsbuildinfo +1 -1
  51. package/dist/{use-ingredient-select-dialog-CCLEsRrk.js → use-ingredient-select-dialog-ogRof947.js} +1 -1
  52. package/dist/{use-inventory-binding-dialog-CvRGlhsk.js → use-inventory-binding-dialog-D9P4uH3I.js} +1 -1
  53. package/dist/views/closing-history/ClosingHistoryView.vue.d.ts +2 -0
  54. package/dist/views/stock/components/dialog/RecalculationDialog.vue.d.ts +11 -0
  55. package/dist/views/stock/components/dialog/RecalculationDialogProps.d.ts +3 -0
  56. package/package.json +4 -4
  57. package/dist/App-hvbk1R9p.js +0 -286
  58. package/dist/stock-DJ9usOfe.js +0 -146
package/dist/app.d.ts CHANGED
@@ -144,6 +144,33 @@ export declare const i18nMessages: {
144
144
  refreshBalance: string;
145
145
  refreshBalanceDescription: string;
146
146
  };
147
+ recalculation: {
148
+ title: string;
149
+ description: string;
150
+ openingDate: string;
151
+ selectOpening: string;
152
+ untilDate: string;
153
+ selectDate: string;
154
+ selectByDate: string;
155
+ selectByClosing: string;
156
+ selectClosing: string;
157
+ info: string;
158
+ schedule: string;
159
+ recentRequests: string;
160
+ from: string;
161
+ to: string;
162
+ requestedBy: string;
163
+ requestedAt: string;
164
+ completedAt: string;
165
+ status: {
166
+ failed: string;
167
+ completed: string;
168
+ inProgress: string;
169
+ };
170
+ error: {
171
+ endDateBeforeOpening: string;
172
+ };
173
+ };
147
174
  title: string;
148
175
  code: string;
149
176
  product: string;
@@ -293,6 +320,14 @@ export declare const i18nMessages: {
293
320
  rejectDraft: string;
294
321
  markAsFailed: string;
295
322
  };
323
+ history: {
324
+ title: string;
325
+ closingId: string;
326
+ date: string;
327
+ time: string;
328
+ createdFrom: string;
329
+ noClosings: string;
330
+ };
296
331
  };
297
332
  adjustment: {
298
333
  template: {
@@ -1281,6 +1316,33 @@ export declare const i18nMessages: {
1281
1316
  immediateHint: string;
1282
1317
  stockAfter: string;
1283
1318
  };
1319
+ recalculation: {
1320
+ title: string;
1321
+ description: string;
1322
+ openingDate: string;
1323
+ selectOpening: string;
1324
+ untilDate: string;
1325
+ selectDate: string;
1326
+ selectByDate: string;
1327
+ selectByClosing: string;
1328
+ selectClosing: string;
1329
+ info: string;
1330
+ schedule: string;
1331
+ recentRequests: string;
1332
+ from: string;
1333
+ to: string;
1334
+ requestedBy: string;
1335
+ requestedAt: string;
1336
+ completedAt: string;
1337
+ status: {
1338
+ failed: string;
1339
+ completed: string;
1340
+ inProgress: string;
1341
+ };
1342
+ error: {
1343
+ endDateBeforeOpening: string;
1344
+ };
1345
+ };
1284
1346
  };
1285
1347
  closing: {
1286
1348
  template: {
@@ -1350,6 +1412,14 @@ export declare const i18nMessages: {
1350
1412
  rejectDraft: string;
1351
1413
  markAsFailed: string;
1352
1414
  };
1415
+ history: {
1416
+ title: string;
1417
+ closingId: string;
1418
+ date: string;
1419
+ time: string;
1420
+ createdFrom: string;
1421
+ noClosings: string;
1422
+ };
1353
1423
  };
1354
1424
  adjustment: {
1355
1425
  template: {
@@ -2256,6 +2326,33 @@ export declare const i18nMessages: {
2256
2326
  stock_balance: {
2257
2327
  title: string;
2258
2328
  };
2329
+ recalculation: {
2330
+ title: string;
2331
+ description: string;
2332
+ openingDate: string;
2333
+ selectOpening: string;
2334
+ untilDate: string;
2335
+ selectDate: string;
2336
+ selectByDate: string;
2337
+ selectByClosing: string;
2338
+ selectClosing: string;
2339
+ info: string;
2340
+ schedule: string;
2341
+ recentRequests: string;
2342
+ from: string;
2343
+ to: string;
2344
+ requestedBy: string;
2345
+ requestedAt: string;
2346
+ completedAt: string;
2347
+ status: {
2348
+ failed: string;
2349
+ completed: string;
2350
+ inProgress: string;
2351
+ };
2352
+ error: {
2353
+ endDateBeforeOpening: string;
2354
+ };
2355
+ };
2259
2356
  title: string;
2260
2357
  code: string;
2261
2358
  product: string;
@@ -2502,6 +2599,9 @@ export declare const i18nMessages: {
2502
2599
  rejectDraft: string;
2503
2600
  markAsFailed: string;
2504
2601
  };
2602
+ history: {
2603
+ title: string;
2604
+ };
2505
2605
  };
2506
2606
  adjustment: {
2507
2607
  template: {
@@ -3195,6 +3295,14 @@ export declare const i18nMessages: {
3195
3295
  rejectDraft: string;
3196
3296
  markAsFailed: string;
3197
3297
  };
3298
+ history: {
3299
+ title: string;
3300
+ closingId: string;
3301
+ date: string;
3302
+ time: string;
3303
+ createdFrom: string;
3304
+ noClosings: string;
3305
+ };
3198
3306
  };
3199
3307
  adjustment: {
3200
3308
  template: {
package/dist/app.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "vue";
2
- import { bp as o, bq as a, br as e, bo as t, bs as i, a as m } from "./app-Cl-v2EjQ.js";
2
+ import { bp as o, bq as a, br as e, bo as t, bs as i, a as m } from "./app-NmiyG_NE.js";
3
3
  export {
4
4
  o as FmApp,
5
5
  a as InventoryBindingForm,
@@ -1,4 +1,4 @@
1
- import "./app-Cl-v2EjQ.js";
1
+ import "./app-NmiyG_NE.js";
2
2
  function m(a) {
3
3
  function t(o, n = !0) {
4
4
  const e = Math.round(Math.log10(o));
@@ -1,11 +1,11 @@
1
- import { a as q, a0 as Ie, ap as U, Y as Ne, aq as ye, X as he, u as X, n as L, ar as Oe, B as le, as as ve, b as te, t as G, z as Z, aV as De, aO as Fe, a6 as Pe, C as Me, E as Ue, at as Le, e as ce, f as re, R as me, x as Be, an as Qe, D as j, j as N, i as He } from "./app-Cl-v2EjQ.js";
1
+ import { a as q, a0 as Ie, ap as U, Y as Ne, aq as ye, X as he, u as X, n as L, ar as De, B as le, as as ve, b as te, t as G, z as Z, aW as Oe, aP as Fe, a6 as Pe, C as Me, E as Ue, at as Le, e as ce, f as re, R as me, x as Be, an as Qe, D as j, j as N, i as He } from "./app-NmiyG_NE.js";
2
2
  import { useCoreStore as ge, useI18n as ne } from "@feedmepos/mf-common";
3
3
  import { useDialogChild as Ve, useSnackbar as be, useDialog as qe, FmButtonVariant as z, components as J } from "@feedmepos/ui-library";
4
4
  import { defineStore as xe } from "pinia";
5
- import { u as Se } from "./purchase-order-template-D7DZ6S2H.js";
6
- import { defineComponent as oe, resolveComponent as Q, openBlock as _, createElementBlock as E, createElementVNode as C, normalizeClass as H, createTextVNode as je, toDisplayString as O, unref as I, createCommentVNode as V, createVNode as P, withCtx as ee, Fragment as B, renderList as K, ref as k, onMounted as ze, computed as ue, watch as Ye, createSlots as Ke, createBlock as Y, h as W } from "vue";
5
+ import { u as Se } from "./purchase-order-template-BNtdgrTt.js";
6
+ import { defineComponent as oe, resolveComponent as Q, openBlock as _, createElementBlock as E, createElementVNode as C, normalizeClass as H, createTextVNode as je, toDisplayString as D, unref as I, createCommentVNode as V, createVNode as P, withCtx as ee, Fragment as B, renderList as K, ref as k, onMounted as ze, computed as ue, watch as Ye, createSlots as Ke, createBlock as Y, h as W } from "vue";
7
7
  import { useRouter as We } from "vue-router";
8
- import { u as ae } from "./supplier-D49_CDEa.js";
8
+ import { u as ae } from "./supplier-CBUmza-i.js";
9
9
  function Te(e) {
10
10
  const t = q(), a = e.sku, u = t.skuById[a._id];
11
11
  if (u.unit._id !== a.unit._id) return !0;
@@ -400,7 +400,7 @@ function nt(e, t, a) {
400
400
  Z(l, o)
401
401
  );
402
402
  (Number.isNaN(Number(e.quantityStep)) || Number(e.quantityStep) <= 0) && f.push("Amount step must be more than 0");
403
- const h = De(c), d = rt(
403
+ const h = Oe(c), d = rt(
404
404
  e.minimumQuantity,
405
405
  e.maximumQuantity,
406
406
  Z(l, o)
@@ -432,7 +432,7 @@ function nt(e, t, a) {
432
432
  function ot(e) {
433
433
  const t = e.SheetNames.filter(
434
434
  (s) => !Object.values(se).map(String).includes(s)
435
- ), u = Ce().templates, i = Oe(u, "_id");
435
+ ), u = Ce().templates, i = De(u, "_id");
436
436
  try {
437
437
  return t.reduce(
438
438
  (s, f) => {
@@ -567,15 +567,15 @@ const st = { class: "flex items-center gap-12 pl-8" }, it = { class: "flex flex-
567
567
  "text-fm-color-system-error-300": t.errors.length
568
568
  })
569
569
  }, [
570
- je(O(t.name) + " ", 1),
571
- C("span", ct, " (" + O(I(Pe)(`${t.transferType}`)) + ") ", 1),
570
+ je(D(t.name) + " ", 1),
571
+ C("span", ct, " (" + D(I(Pe)(`${t.transferType}`)) + ") ", 1),
572
572
  t.type === "create" ? (_(), E("span", mt, "(new)")) : V("", !0)
573
573
  ], 2),
574
574
  t.errors.length ? (_(), E("div", ut, [
575
575
  P(i, { "z-index": 50 }, {
576
576
  content: ee(() => [
577
577
  C("ol", null, [
578
- (_(!0), E(B, null, K(t.errors, (o, c) => (_(), E("li", { key: c }, O(o), 1))), 128))
578
+ (_(!0), E(B, null, K(t.errors, (o, c) => (_(), E("li", { key: c }, D(o), 1))), 128))
579
579
  ])
580
580
  ]),
581
581
  default: ee(() => [
@@ -597,7 +597,7 @@ const st = { class: "flex items-center gap-12 pl-8" }, it = { class: "flex flex-
597
597
  "text-fm-color-typo-secondary": !t.errors.length
598
598
  }
599
599
  ])
600
- }, O((s = t.locations) != null && s.length ? `${(f = t.locations) == null ? void 0 : f.length} locations` : "All locations") + ", " + O(`${(l = t.items) == null ? void 0 : l.length} items`), 3)
600
+ }, D((s = t.locations) != null && s.length ? `${(f = t.locations) == null ? void 0 : f.length} locations` : "All locations") + ", " + D(`${(l = t.items) == null ? void 0 : l.length} items`), 3)
601
601
  ])
602
602
  ]);
603
603
  };
@@ -735,7 +735,7 @@ const st = { class: "flex items-center gap-12 pl-8" }, it = { class: "flex flex-
735
735
  }
736
736
  ])
737
737
  }, [
738
- C("div", yt, O(t.value.name), 1)
738
+ C("div", yt, D(t.value.name), 1)
739
739
  ], 2),
740
740
  i.value ? V("", !0) : (_(), E("div", ht, [
741
741
  P(S, {
@@ -756,7 +756,7 @@ const st = { class: "flex items-center gap-12 pl-8" }, it = { class: "flex flex-
756
756
  size: "sm",
757
757
  color: "system-error-300"
758
758
  }),
759
- C("div", gt, O(n), 1)
759
+ C("div", gt, D(n), 1)
760
760
  ]))), 128))
761
761
  ])) : V("", !0)
762
762
  ])
@@ -765,7 +765,7 @@ const st = { class: "flex items-center gap-12 pl-8" }, it = { class: "flex flex-
765
765
  } : void 0
766
766
  ]), 1032, ["class", "label", "button-label"]),
767
767
  d.value ? (_(), E("div", bt, [
768
- C("div", xt, O(I(m)("inventory.ingredient.import.summary")), 1),
768
+ C("div", xt, D(I(m)("inventory.ingredient.import.summary")), 1),
769
769
  (_(!0), E(B, null, K(o.value, (p, n) => (_(), Y(pe, {
770
770
  key: n,
771
771
  name: p.template.name,
@@ -935,8 +935,8 @@ const _t = xe("transferTemplateActions", () => {
935
935
  const { promise: n, resolve: y } = Promise.withResolvers(), T = (g) => {
936
936
  y(g);
937
937
  }, $ = u.templates.filter((g) => {
938
- var D, F;
939
- return ((D = g.purchaseOrder.supplier) == null ? void 0 : D._id) === a.currentLocation.doc._id ? !1 : (F = g.locations) != null && F.length ? g.locations.find((M) => M.doc._id === a.currentLocation.doc._id) : !0;
938
+ var O, F;
939
+ return ((O = g.purchaseOrder.supplier) == null ? void 0 : O._id) === a.currentLocation.doc._id ? !1 : (F = g.locations) != null && F.length ? g.locations.find((M) => M.doc._id === a.currentLocation.doc._id) : !0;
940
940
  });
941
941
  if (!$.length)
942
942
  return e.open({
@@ -955,10 +955,10 @@ const _t = xe("transferTemplateActions", () => {
955
955
  }).onSecondary(() => T(void 0)).onClose(() => T(void 0)), n;
956
956
  const R = $.map((g) => {
957
957
  var ie;
958
- const D = !g.purchaseOrder.items.length || g.purchaseOrder.items.some(Te), F = !Tt(g.purchaseOrder.supplier), M = g.purchaseOrder.supplier.internal ? f.getNetSuiteLocation(
958
+ const O = !g.purchaseOrder.items.length || g.purchaseOrder.items.some(Te), F = !Tt(g.purchaseOrder.supplier), M = g.purchaseOrder.supplier.internal ? f.getNetSuiteLocation(
959
959
  `${g.purchaseOrder.supplier.internal}_${g.purchaseOrder.supplier._id}`
960
960
  ) : f.getNetSuiteVendor(g.purchaseOrder.supplier._id), Ee = F ? `The subsidiary of the request
961
- location is ${(ie = f.getLocationSubsidiary(M == null ? void 0 : M.netSuiteId)) == null ? void 0 : ie.fullName}.` : void 0, Re = D || F, ke = D ? "This template is invalid. Update this template." : F ? Ee : void 0, Ae = `${g.purchaseOrder.supplier.internal ? "Transfer" : "Purchase"} from ${g.purchaseOrder.supplier.name}`;
961
+ location is ${(ie = f.getLocationSubsidiary(M == null ? void 0 : M.netSuiteId)) == null ? void 0 : ie.fullName}.` : void 0, Re = O || F, ke = O ? "This template is invalid. Update this template." : F ? Ee : void 0, Ae = `${g.purchaseOrder.supplier.internal ? "Transfer" : "Purchase"} from ${g.purchaseOrder.supplier.name}`;
962
962
  return {
963
963
  label: g.name,
964
964
  value: g._id,
@@ -966,7 +966,7 @@ const _t = xe("transferTemplateActions", () => {
966
966
  sublabel: ke ?? Ae
967
967
  };
968
968
  });
969
- return R.sort((g, D) => +!!g.disabled - +!!D.disabled), e.open({
969
+ return R.sort((g, O) => +!!g.disabled - +!!O.disabled), e.open({
970
970
  title: "Select one template",
971
971
  contentComponent: Be,
972
972
  contentComponentProps: {
@@ -1244,14 +1244,14 @@ const Ce = xe(
1244
1244
  };
1245
1245
  }
1246
1246
  );
1247
- function Ot(e, t, a) {
1247
+ function Dt(e, t, a) {
1248
1248
  const u = (a == null ? void 0 : a.abbrev) ?? t.abbrev;
1249
1249
  return `${L(e, !1)} ${u}`;
1250
1250
  }
1251
1251
  export {
1252
1252
  A as P,
1253
1253
  _t as a,
1254
- Ot as f,
1254
+ Dt as f,
1255
1255
  Te as t,
1256
1256
  Ce as u
1257
1257
  };
@@ -1,4 +1,4 @@
1
- import { a as y, W as k, Y as w, X as N, n as H, o as $, ar as P, c as T, as as j, q as S, t as _, a4 as I, P as O } from "./app-Cl-v2EjQ.js";
1
+ import { a as y, W as k, Y as w, X as N, n as H, o as $, ar as P, c as T, as as j, q as S, t as _, a4 as I, P as O } from "./app-NmiyG_NE.js";
2
2
  import { useCoreStore as g } from "@feedmepos/mf-common";
3
3
  function R() {
4
4
  return {
@@ -1,4 +1,4 @@
1
- import { b8 as x, bg as V, bh as q, bi as Ne, bj as cl, bk as sr, bl as Lt, bm as fl, bn as $l } from "./app-Cl-v2EjQ.js";
1
+ import { b8 as x, bg as V, bh as q, bi as Ne, bj as cl, bk as sr, bl as Lt, bm as fl, bn as $l } from "./app-NmiyG_NE.js";
2
2
  function vl(t, e) {
3
3
  for (var r = 0; r < e.length; r++) {
4
4
  const n = e[r];
@@ -1,5 +1,5 @@
1
1
  import { ref as b, computed as u } from "vue";
2
- import { u as d, b9 as p, a$ as v, c as m, b as h } from "./app-Cl-v2EjQ.js";
2
+ import { u as d, b9 as p, aD as v, c as m, b as h } from "./app-NmiyG_NE.js";
3
3
  import { useSnackbar as E } from "@feedmepos/ui-library";
4
4
  function I() {
5
5
  return {
@@ -1,4 +1,4 @@
1
- import { aa as s } from "./app-Cl-v2EjQ.js";
1
+ import { aa as s } from "./app-NmiyG_NE.js";
2
2
  import { useCoreStore as c } from "@feedmepos/mf-common";
3
3
  const u = s((n, a) => {
4
4
  function o() {
@@ -6,6 +6,7 @@ export declare enum RouteName {
6
6
  STOCK = "STOCK",
7
7
  CLOSING_TEMPLATE = "CLOSING_TEMPLATE",
8
8
  CLOSING_DRAFT = "CLOSING_DRAFT",
9
+ CLOSING_HISTORY = "CLOSING_HISTORY",
9
10
  WASTAGE_TEMPLATE = "WASTAGE_TEMPLATE",
10
11
  WAREHOUSE = "WAREHOUSE",
11
12
  RECEIVE_REQUEST = "RECEIVE_REQUEST",
@@ -0,0 +1,74 @@
1
+ import { u as i } from "./stock-F2A8gqHx.js";
2
+ import { a as s, aC as p, a0 as k } from "./app-NmiyG_NE.js";
3
+ import { ref as B, computed as d } from "vue";
4
+ function v() {
5
+ return {
6
+ stockBalance: {
7
+ _id: "",
8
+ items: []
9
+ },
10
+ productBalance: []
11
+ };
12
+ }
13
+ const m = k(0), y = {
14
+ id: "",
15
+ balance: m,
16
+ closing: null,
17
+ costs: null
18
+ }, c = B(v()), h = () => {
19
+ const r = s(), u = d(() => {
20
+ var a;
21
+ const o = (a = c.value.stockBalance.skus) == null ? void 0 : a.groupBy((t) => t.id), n = (t) => {
22
+ var e;
23
+ return ((e = o == null ? void 0 : o.get(t)) == null ? void 0 : e[0]) ?? { ...y, id: t };
24
+ };
25
+ return r.skus.map((t) => n(t._id));
26
+ }), l = i();
27
+ return {
28
+ // state
29
+ get stockBalance() {
30
+ return {
31
+ ...c.value.stockBalance,
32
+ skus: u.value
33
+ };
34
+ },
35
+ set stockBalance(o) {
36
+ c.value.stockBalance = o;
37
+ },
38
+ get productBalance() {
39
+ return c.value.productBalance;
40
+ },
41
+ set productBalance(o) {
42
+ c.value.productBalance = o;
43
+ },
44
+ // actions
45
+ async readStockBalance() {
46
+ this.stockBalance = await l.readStockBalance();
47
+ },
48
+ async readProductBalance() {
49
+ this.productBalance = [];
50
+ const o = s(), n = p({
51
+ recipes: o.recipes,
52
+ skus: o.skus,
53
+ skuGroups: o.skuGroups,
54
+ inventoryBindingMapping: {},
55
+ stockBalance: this.stockBalance
56
+ // silent: true
57
+ });
58
+ function a(t, e) {
59
+ return Object.prototype.hasOwnProperty.call(t, e);
60
+ }
61
+ for (const t in n.convertCountdown)
62
+ if (a(n.convertCountdown, t)) {
63
+ const e = n.convertCountdown[t];
64
+ this.productBalance.push({
65
+ id: t,
66
+ count: e
67
+ });
68
+ }
69
+ }
70
+ };
71
+ };
72
+ export {
73
+ h as u
74
+ };
@@ -0,0 +1,83 @@
1
+ import { aa as d, u as m } from "./app-NmiyG_NE.js";
2
+ import { useCoreStore as l } from "@feedmepos/mf-common";
3
+ import { useSnackbar as $ } from "@feedmepos/ui-library";
4
+ const y = d((o, r) => {
5
+ const s = m(), u = l(), i = $();
6
+ return r.onError(async (e) => {
7
+ e.name === "SvcForbiddenError" && (i == null || i.open({
8
+ title: e.title,
9
+ message: e.message,
10
+ type: "error"
11
+ }));
12
+ }), {
13
+ async readStockBalance() {
14
+ const e = s.currentLocationDBName, t = `${o.inventoryBackendUrl}/${e}/stock-balance`;
15
+ return await r.get(t);
16
+ },
17
+ async readSkuBalance() {
18
+ var a;
19
+ const e = s.currentLocationDBName, t = `${o.inventoryBackendUrl}/${e}/sku/balance`;
20
+ return (((a = u.currentBusiness.value) == null ? void 0 : a.menuVersion) ?? "") === "v3" ? await r.get(t) : await r.get(`${t}?useInventoryDoc=true`);
21
+ },
22
+ async readSingleAdjustment(e) {
23
+ const t = s.currentLocationDBName, n = `${o.inventoryBackendUrl}/${t}/adjustment`;
24
+ return await r.get(`${n}?adjustmentId=${e}`);
25
+ },
26
+ async readStockAdjustment(e, t, n) {
27
+ const a = s.currentLocationDBName, c = `${o.inventoryBackendUrl}/${a}/sku`;
28
+ return await r.get(`${c}?skuId=${e}&start=${t}&end=${n}`);
29
+ },
30
+ async readAdjustmentById(e) {
31
+ const t = s.currentLocationDBName, n = `${o.inventoryBackendUrl}/${t}/adjustment`;
32
+ return await r.get(`${n}?adjustmentId=${e}`);
33
+ },
34
+ async convertSku(e) {
35
+ var c;
36
+ const t = s.currentLocationDBName, n = `${o.inventoryBackendUrl}/${t}/sku/convert`;
37
+ return (((c = u.currentBusiness.value) == null ? void 0 : c.menuVersion) ?? "") === "v3" ? await r.post(n, e) : await r.post(`${n}?useInventoryDoc=true`, e);
38
+ },
39
+ async adjustSku(e) {
40
+ var c;
41
+ const t = s.currentLocationDBName, n = `${o.inventoryBackendUrl}/${t}/sku/adjust`;
42
+ return (((c = u.currentBusiness.value) == null ? void 0 : c.menuVersion) ?? "") === "v3" ? await r.post(n, e) : await r.post(`${n}?useInventoryDoc=true`, e);
43
+ },
44
+ async revertWastageAdjustment(e) {
45
+ const t = s.currentLocationDBName, n = `${o.inventoryBackendUrl}/${t}/sku/revert-wastage-adjustment`;
46
+ return await r.post(n, e);
47
+ },
48
+ recalculation: {
49
+ getRecalculateAbility() {
50
+ var a;
51
+ const t = `business_${(a = u.currentBusiness.value) == null ? void 0 : a._id}`, n = `${o.inventoryBackendUrl}/${t}/stock/operations/recalculate`;
52
+ return r.get(n);
53
+ },
54
+ startRecalculateTask() {
55
+ var a;
56
+ const t = `business_${(a = u.currentBusiness.value) == null ? void 0 : a._id}`, n = `${o.inventoryBackendUrl}/${t}/stock/operations/recalculate?refundFromPreviousAdjustment=true`;
57
+ return r.post(n);
58
+ },
59
+ refreshCurrentBalances() {
60
+ const e = s.currentLocationDBName, t = `${o.inventoryBackendUrl}/${e}/stock/operations/recalculate/refresh-current-balances`;
61
+ return r.post(t);
62
+ },
63
+ scheduleCalculateStockSnapshotAtDate(e, t) {
64
+ const n = s.currentLocationDBName, a = `${o.inventoryBackendUrl}/${n}/stock/operations/recalculate/schedule/calculate-at-date?effectiveAt=${encodeURIComponent(e)}&closingDraftId=${encodeURIComponent(t)}`;
65
+ return r.get(a);
66
+ },
67
+ recalculationRequests() {
68
+ const e = s.currentLocationDBName, t = `${o.inventoryBackendUrl}/${e}/stock/operations/recalculate/recalculation/requests`;
69
+ return r.get(t);
70
+ },
71
+ scheduleRecalculation(e, t) {
72
+ const n = s.currentLocationDBName, a = `${o.inventoryBackendUrl}/${n}/stock/operations/recalculate/schedule/recalculation`;
73
+ return r.post(a, {
74
+ openingId: e,
75
+ untilDate: t
76
+ });
77
+ }
78
+ }
79
+ };
80
+ });
81
+ export {
82
+ y as u
83
+ };
@@ -2062,6 +2062,7 @@ export declare function useInventoryStore(): {
2062
2062
  unitUsedBy: Record<string, UnitUsedBy[]>;
2063
2063
  };
2064
2064
  closing: {
2065
+ ref?: string | null | undefined;
2065
2066
  effectiveAt?: string | null | undefined;
2066
2067
  closedBy?: {
2067
2068
  name: string;
@@ -1,4 +1,4 @@
1
- import { aa as m, u, c as b, ar as w, aD as v, aE as $ } from "./app-Cl-v2EjQ.js";
1
+ import { aa as m, u, c as b, ar as w, aE as v, aF as $ } from "./app-NmiyG_NE.js";
2
2
  import { useCoreStore as c } from "@feedmepos/mf-common";
3
3
  import { defineStore as A } from "pinia";
4
4
  import { ref as l, computed as d } from "vue";