@feedmepos/mf-inventory-portal 1.9.0-dev.2 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist/{App-0333Hh25.js → App-CjEtCJ3u.js} +10 -10
  2. package/dist/{ApprovalView-CZLYqnnT.js → ApprovalView-CWeB-z4R.js} +9 -9
  3. package/dist/{BindingsDialog-CA02lqel.js → BindingsDialog-B2WXjWQ0.js} +2 -2
  4. package/dist/{BindingsPicker-CwDLZ-ki.js → BindingsPicker-DTc0Q5Em.js} +2 -2
  5. package/dist/{BindingsTable-BX87v_kq.js → BindingsTable-x1FRAcgJ.js} +4 -4
  6. package/dist/{BulkReceiveRequestPage-Vh0Rfa8e.js → BulkReceiveRequestPage-Dk4K_vUX.js} +1022 -1047
  7. package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-0fI4-Pao.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-CPGujVFu.js} +1 -1
  8. package/dist/{ClosingDraftView-CxNgkVY_.js → ClosingDraftView-BqpTn8dY.js} +19 -19
  9. package/dist/{ClosingHistoryView-CUCepuA7.js → ClosingHistoryView-BJQWFz5X.js} +7 -7
  10. package/dist/ClosingTemplateView-Pj1Kj49d.js +2392 -0
  11. package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-B6Ge_6VY.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-Dxt4x9Ia.js} +1 -1
  12. package/dist/{DefaultView-V-9a_YfK.js → DefaultView-BIyIubVt.js} +2 -2
  13. package/dist/{DeliveryOrderPrintPreview-BiwT9953.js → DeliveryOrderPrintPreview-2nIVkxIe.js} +2 -2
  14. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-I_6Wu-P-.js → EmailDialog.vue_vue_type_script_setup_true_lang-BnJdt92Q.js} +9769 -9731
  15. package/dist/{FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-BV5mX5w5.js → FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-FraKTknm.js} +1 -1
  16. package/dist/{FeatureCapabilityGate-B4VGdv_F.js → FeatureCapabilityGate-6_6psomb.js} +2 -2
  17. package/dist/{FeaturePageGate.vue_vue_type_script_setup_true_lang-CvFbN-7h.js → FeaturePageGate.vue_vue_type_script_setup_true_lang-CbrcFNoj.js} +1 -1
  18. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-Qd3R-TWu.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-B-wMlDXd.js} +1 -1
  19. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C8QTtw9i.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CxOLg-J3.js} +2 -2
  20. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Cz5saN2u.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BeIfx9jE.js} +2 -2
  21. package/dist/{FmMultiselectDialog-BK0r-tyZ.js → FmMultiselectDialog-CcH__ggk.js} +2 -2
  22. package/dist/{FmMultiselectDialog-CFx8Qcyc.js → FmMultiselectDialog-snxpWhRm.js} +2 -2
  23. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-Cuyu_K9x.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DHlqvBTh.js} +5 -5
  24. package/dist/{ImportView-Ci9vufCx.js → ImportView-C7KyQ6wA.js} +7 -7
  25. package/dist/{IngredientsView-4s7vcW9U.js → IngredientsView-z4pObocZ.js} +15 -15
  26. package/dist/{IntegrationExplorerView-CtGuW0uI.js → IntegrationExplorerView-thWjNTPa.js} +6 -6
  27. package/dist/{IntegrationPlatformView-SpCAu3Fu.js → IntegrationPlatformView-BDe83nB1.js} +4472 -4425
  28. package/dist/{IntegrationView-DjQ4wbXh.js → IntegrationView-CyR9BK3D.js} +15 -15
  29. package/dist/{InventoryBindingForm-Bb5k9tav.js → InventoryBindingForm-CjTZYqzB.js} +1 -1
  30. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CISHYfRi.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DzXGyj0H.js} +4 -4
  31. package/dist/{InventoryBindingSummary-CkN9QdNL.js → InventoryBindingSummary-CnLEvpRL.js} +1 -1
  32. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-C9hasqsO.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DpysXAz4.js} +2 -2
  33. package/dist/{ProductionRunDetailPage-BTNY3v9C.js → ProductionRunDetailPage-DqlFNDov.js} +4 -4
  34. package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-CTOibYjJ.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-D-GoCIbB.js} +8 -8
  35. package/dist/{ProductionRunPage-GrWt4iw2.js → ProductionRunPage-xr34sye0.js} +4 -4
  36. package/dist/{PublishView-1sBMVk4p.js → PublishView-CfuP-tjm.js} +15 -15
  37. package/dist/{PurchaseOrderPrintPreview-DYwbSUVy.js → PurchaseOrderPrintPreview-DjAxJ2cK.js} +2 -2
  38. package/dist/ReceiveRequestView-CVw76dPw.js +692 -0
  39. package/dist/{RecipeView-CGkE2cX2.js → RecipeView-UlHc-Voo.js} +16 -16
  40. package/dist/{SettingsView-j5UKU2Z5.js → SettingsView-C1OGXlIE.js} +7 -7
  41. package/dist/{StockView-CMYUShkK.js → StockView-CrKLqz-6.js} +543 -543
  42. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CcomAJoj.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Cm5vtlP6.js} +1 -1
  43. package/dist/{SupplierView-whYEtaTf.js → SupplierView-DhH5eT5y.js} +13 -13
  44. package/dist/{SurchargeView-BqT_PfTk.js → SurchargeView-ByKH6JnI.js} +7 -7
  45. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-CpiuOVuT.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-ZSuKa-oz.js} +2 -2
  46. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-C5GOz40T.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CHvqcU44.js} +1 -1
  47. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-CHyAdS3A.js +5002 -0
  48. package/dist/{TransferTemplateView-ZJYWzTCZ.js → TransferTemplateView-DJ1XO2Vg.js} +19 -19
  49. package/dist/{UnitCostHistoryView-DWcB9nbL.js → UnitCostHistoryView-CrBs_s0L.js} +4 -4
  50. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-60B3tkI-.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-DRJptXCQ.js} +4 -4
  51. package/dist/{UnitView-BWX8BecE.js → UnitView--PWg-4ON.js} +7 -7
  52. package/dist/{WarehouseView-CfWLJlP2.js → WarehouseView-DoOwa0Zq.js} +8 -8
  53. package/dist/{WastageTemplateView-Gb64MBgD.js → WastageTemplateView-CiLs8nAz.js} +15 -15
  54. package/dist/api/purchase-order-template.d.ts +1 -1
  55. package/dist/{app-Coquqqkh.js → app-CFO3QhF-.js} +7558 -6916
  56. package/dist/app.d.ts +8 -0
  57. package/dist/app.js +1 -1
  58. package/dist/{bulk-edit-simulation.helper-DUAiYzrr.js → bulk-edit-simulation.helper-BjYd_yK4.js} +2 -2
  59. package/dist/{closing-template-BK-yS2H4.js → closing-template-DXfmztnK.js} +1 -1
  60. package/dist/{date2-79rkBzVf.js → date2-BMfqPhRQ.js} +1 -1
  61. package/dist/{dayjs.min-CciBGvaL.js → dayjs.min-BVjxIhrP.js} +1 -1
  62. package/dist/{decimal--BREmfoS.js → decimal-Drh1-c85.js} +2 -2
  63. package/dist/{defineDeepModel-BRSFHwsW.js → defineDeepModel-BuNVB2KT.js} +1 -1
  64. package/dist/{duplicate-template-CcEqsP8Q.js → duplicate-template-Dua82hTr.js} +1 -1
  65. package/dist/{feature-DdZZAV6X.js → feature-C1JuDWvs.js} +3 -3
  66. package/dist/feature-flags/plan-tier.d.ts +0 -2
  67. package/dist/{format-time-from-id-C7YvcXDM.js → format-time-from-id-Cq6U2Bxo.js} +1 -1
  68. package/dist/{format-unit-display-Dfiq_rw7.js → format-unit-display-DQLT3yWg.js} +99 -101
  69. package/dist/{id-to-date-6hzUYycs.js → id-to-date-F63bzmo9.js} +1 -1
  70. package/dist/{import-export.helper-D5QuDEDV.js → import-export.helper-C-wM1uvH.js} +5 -5
  71. package/dist/{index-CD9IHjp3.js → index-BI_mOT-T.js} +1 -1
  72. package/dist/{index-CPFsBIFO.js → index-CUK2ixs-.js} +3 -3
  73. package/dist/{index-Crdk73ES.js → index-CvbK4SMT.js} +1 -1
  74. package/dist/{lz-string-CCRQaGZF.js → lz-string-DaX9t6Vd.js} +1 -1
  75. package/dist/{netsuite-C_VLrQoH.js → netsuite-Zrpzr6d8.js} +2522 -2505
  76. package/dist/{netsuite-explorer-BCuM8JZ1.js → netsuite-explorer-C3fHF-PT.js} +1 -1
  77. package/dist/{predefined-templates-BV4NkB9O.js → predefined-templates-DG6CeFks.js} +1 -1
  78. package/dist/{publish-versions-BinCKAtn.js → publish-versions-Cr7-V-Br.js} +1 -1
  79. package/dist/purchase-order-template-wj3XUGRR.js +41 -0
  80. package/dist/{recalculationUtils-ISOYv_rW.js → recalculationUtils-B2fP6IRt.js} +1 -1
  81. package/dist/{row-action.enum-BQCb8S3i.js → row-action.enum-fy5kNv1e.js} +1 -1
  82. package/dist/{rules-CW08Pe1t.js → rules-BbnkP4bE.js} +3 -3
  83. package/dist/{stock-Bh5IJNfM.js → stock-2HrEwnse.js} +1 -1
  84. package/dist/{stock-Cv_zWpOe.js → stock-qgCoZCip.js} +2 -2
  85. package/dist/stores/inventory.in-flight.spec.d.ts +1 -0
  86. package/dist/{supplier-D3h2DfJz.js → supplier-jSpdakxP.js} +2 -2
  87. package/dist/{surcharge-9e8wa-vK.js → surcharge-BUcmyVUD.js} +1 -1
  88. package/dist/tsconfig.app.tsbuildinfo +1 -1
  89. package/dist/{uom-rules-BRmDOW0t.js → uom-rules-CRVV9zbT.js} +1 -1
  90. package/dist/{use-ingredient-select-dialog-D8ibotty.js → use-ingredient-select-dialog-BEpP8U3E.js} +2 -2
  91. package/dist/{use-inventory-binding-dialog-D2xL-vbo.js → use-inventory-binding-dialog-C71O7N8L.js} +2 -2
  92. package/dist/{use-template-enabled-locations-Bb7vUiAf.js → use-template-enabled-locations-DIN3OgYg.js} +2 -2
  93. package/dist/{use-transfer-locations-B2yday-I.js → use-transfer-locations-Bp60KXqJ.js} +2 -2
  94. package/dist/{useHrmPermission-CPEJKpoy.js → useHrmPermission-isSBKi_1.js} +1 -1
  95. package/dist/{useNavigationMenu-SHKOcKP-.js → useNavigationMenu-B7i0bnUj.js} +5 -5
  96. package/dist/{useSseClient-ED9mFSXt.js → useSseClient-DOVhr07c.js} +1 -1
  97. package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +5 -0
  98. package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.spec.d.ts +1 -0
  99. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-total-cost.d.ts +24 -0
  100. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-total-cost.spec.d.ts +1 -0
  101. package/dist/views/receive-request/helper/purchase-export.d.ts +26 -0
  102. package/dist/views/receive-request/helper/purchase-export.spec.d.ts +1 -0
  103. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +3 -3
  104. package/dist/{vue-Tmyz7_6a.js → vue-XyWi0ihT.js} +37 -30
  105. package/dist/{vue-i18n-BY0GeUdz.js → vue-i18n-B1LiOy9S.js} +479 -479
  106. package/dist/{xlsx.util-DQnB9ape.js → xlsx.util-CLxGkNhJ.js} +2 -2
  107. package/package.json +5 -7
  108. package/dist/ClosingTemplateView-BHe5gCFH.js +0 -2358
  109. package/dist/ReceiveRequestView-DuU5hqQU.js +0 -729
  110. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-ajtRmauo.js +0 -4961
  111. package/dist/purchase-order-template-BZUOWGmV.js +0 -41
@@ -1,729 +0,0 @@
1
- import { ref as V, computed as T, watch as le, defineComponent as oe, resolveComponent as U, createElementBlock as x, openBlock as h, createVNode as S, createElementVNode as m, createCommentVNode as $, normalizeClass as B, toDisplayString as C, createTextVNode as ie, Fragment as ae, renderList as Ce, createBlock as L, unref as r, isRef as Re, withCtx as j, mergeProps as A, normalizeStyle as Le, Teleport as Ve, normalizeProps as se, guardReactiveProps as Ue } from "vue";
2
- import { $ as Be, y as Ae, u as Oe, a0 as je, R as He, D as ee } from "./app-Coquqqkh.js";
3
- import { i as Se } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-Qd3R-TWu.js";
4
- import { u as Ye, P as ne, a as ze, _ as Qe, g as Ke } from "./TransferDetails.vue_vue_type_script_setup_true_lang-ajtRmauo.js";
5
- import { a as xe, d as Ge } from "./rules-CW08Pe1t.js";
6
- import { i as Je } from "./id-to-date-6hzUYycs.js";
7
- import { d as re } from "./dayjs.min-CciBGvaL.js";
8
- import { e as Xe } from "./UnitDisplayControl.vue_vue_type_script_setup_true_lang-60B3tkI-.js";
9
- import { u as We } from "./useTabStorage-BkIVScW_.js";
10
- import { u as Ze, _ as et } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
11
- import { useProxiedModel as tt, useSnackbar as at, useBreakpoints as rt } from "@feedmepos/ui-library";
12
- import { b as ot, g as st, _ as nt, a as lt, c as it } from "./EmailDialog.vue_vue_type_script_setup_true_lang-I_6Wu-P-.js";
13
- import { useRouter as ut } from "vue-router";
14
- import { u as dt } from "./useHrmPermission-CPEJKpoy.js";
15
- import { u as Pe } from "./netsuite-C_VLrQoH.js";
16
- import { b as ct, c as mt, t as pt } from "./format-unit-display-Dfiq_rw7.js";
17
- import { p as ft } from "./format-time-from-id-C7YvcXDM.js";
18
- import { _ as vt } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-gJQQKKAC.js";
19
- import { F as te } from "./index-eGvSlWMU.js";
20
- import { u as yt } from "./feature-DdZZAV6X.js";
21
- import { _ as ht } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Cz5saN2u.js";
22
- import { useI18n as bt } from "@feedmepos/mf-common";
23
- import { _ as gt } from "./CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-B6Ge_6VY.js";
24
- import { P as _t, J as kt } from "./app-C39bYJmq.js";
25
- import { f as St } from "./predefined-templates-BV4NkB9O.js";
26
- var $e = { exports: {} };
27
- (function(D, y) {
28
- (function(u, d) {
29
- D.exports = d();
30
- })(Be, function() {
31
- return function(u, d, e) {
32
- u = u || {};
33
- var t = d.prototype, v = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" };
34
- function g(c, l, a, E) {
35
- return t.fromToBase(c, l, a, E);
36
- }
37
- e.en.relativeTime = v, t.fromToBase = function(c, l, a, E, F) {
38
- for (var q, s, n, w = a.$locale().relativeTime || v, H = u.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], Y = H.length, R = 0; R < Y; R += 1) {
39
- var O = H[R];
40
- O.d && (q = E ? e(c).diff(a, O.d, !0) : a.diff(c, O.d, !0));
41
- var N = (u.rounding || Math.round)(Math.abs(q));
42
- if (n = q > 0, N <= O.r || !O.r) {
43
- N <= 1 && R > 0 && (O = H[R - 1]);
44
- var M = w[O.l];
45
- F && (N = F("" + N)), s = typeof M == "string" ? M.replace("%d", N) : M(N, l, O.l, n);
46
- break;
47
- }
48
- }
49
- if (l) return s;
50
- var z = n ? w.future : w.past;
51
- return typeof z == "function" ? z(s) : z.replace("%s", s);
52
- }, t.to = function(c, l) {
53
- return g(c, l, this, !0);
54
- }, t.from = function(c, l) {
55
- return g(c, l, this);
56
- };
57
- var o = function(c) {
58
- return c.$u ? e.utc() : e();
59
- };
60
- t.toNow = function(c) {
61
- return this.to(o(this), c);
62
- }, t.fromNow = function(c) {
63
- return this.from(o(this), c);
64
- };
65
- };
66
- });
67
- })($e);
68
- var xt = $e.exports;
69
- const wt = /* @__PURE__ */ Ae(xt), Ee = {
70
- sidebar: null,
71
- templateList: null,
72
- blankOrder: null
73
- };
74
- re.extend(wt);
75
- const we = {
76
- supplier: "Vendor",
77
- warehouse: "Warehouse",
78
- restaurant: "Outlet"
79
- };
80
- function Tt() {
81
- const D = Oe(), y = Pe(), u = ct(), d = /* @__PURE__ */ new Map();
82
- for (const e of Object.values(Ee)) {
83
- if (!e || d.has(e)) continue;
84
- const t = je(e).validationManifest.requiredCaslPermissions;
85
- d.set(e, dt(t).hasPermission);
86
- }
87
- return {
88
- templates: {
89
- list: () => u.templates,
90
- loading: () => u.loading
91
- },
92
- sources: {
93
- currentLocationId: () => D.currentLocation.doc._id
94
- },
95
- permissions: {
96
- has: (e) => {
97
- var t;
98
- return !e || !!((t = d.get(e)) != null && t.value);
99
- }
100
- },
101
- netsuite: {
102
- subsidiaryError(e) {
103
- var v;
104
- if (mt(e)) return;
105
- const t = e.internal ? y.getNetSuiteLocation(`${e.internal}_${e._id}`) : y.getNetSuiteVendor(e._id);
106
- return `The subsidiary of the request location is ${(v = y.getLocationSubsidiary(t == null ? void 0 : t.netSuiteId)) == null ? void 0 : v.fullName}.`;
107
- }
108
- }
109
- };
110
- }
111
- function Dt(D, y, u = Tt()) {
112
- const d = V(null), e = V(""), t = V("");
113
- function v(s) {
114
- const { items: n, supplier: w } = s.purchaseOrder;
115
- return !n.length || n.some(pt) ? "This template is invalid. Update this template." : u.netsuite.subsidiaryError(w);
116
- }
117
- const g = T(
118
- () => ot(
119
- u.templates.list(),
120
- u.sources.currentLocationId(),
121
- v
122
- )
123
- ), o = T(() => st(g.value)), c = T(() => {
124
- const s = e.value.trim().toLowerCase();
125
- return o.value.filter((n) => !s || n.source.name.toLowerCase().includes(s));
126
- }), l = T(
127
- () => o.value.find((s) => s.source._id === d.value)
128
- ), a = T(() => {
129
- var n;
130
- const s = t.value.trim().toLowerCase();
131
- return (((n = l.value) == null ? void 0 : n.templates) ?? g.value).filter(
132
- (w) => !s || w.template.name.toLowerCase().includes(s)
133
- );
134
- });
135
- function E(s) {
136
- const n = s.updatedAt ?? ft(s._id);
137
- return n ? re(n).fromNow() : "";
138
- }
139
- const F = T(() => {
140
- var s;
141
- return {
142
- loading: u.templates.loading(),
143
- sidebar: {
144
- groups: c.value.map((n) => ({
145
- id: n.source._id,
146
- name: n.source.name,
147
- kind: n.kind,
148
- kindLabel: we[n.kind],
149
- count: n.templates.length
150
- })),
151
- selectedId: d.value,
152
- query: e.value,
153
- total: g.value.length
154
- },
155
- templates: {
156
- title: ((s = l.value) == null ? void 0 : s.source.name) ?? "All templates",
157
- kind: l.value ? we[l.value.kind] : void 0,
158
- showSource: !l.value,
159
- showBlank: !l.value && !t.value.trim() && u.permissions.has(Ee.blankOrder),
160
- query: t.value,
161
- entries: a.value.map((n) => ({
162
- id: n.template._id,
163
- name: n.template.name,
164
- invalidReason: n.invalidReason,
165
- sourceName: n.supplier.name,
166
- itemCount: n.template.purchaseOrder.items.length,
167
- time: E(n.template)
168
- }))
169
- }
170
- };
171
- }), q = {
172
- selectSidebar(s) {
173
- d.value = s, t.value = "";
174
- },
175
- searchSidebar(s) {
176
- e.value = s;
177
- },
178
- searchTemplates(s) {
179
- t.value = s;
180
- },
181
- pickTemplate(s) {
182
- const n = g.value.find((w) => w.template._id === s);
183
- !n || n.invalidReason || y({ templateId: s });
184
- },
185
- startBlank() {
186
- y({});
187
- }
188
- };
189
- return le(
190
- () => D().show,
191
- (s) => {
192
- s && (e.value = "", t.value = "", d.value = D().supplierId ?? null);
193
- }
194
- ), { viewState: F, actions: q };
195
- }
196
- const Ct = { class: "flex flex-col w-[260px] shrink-0 gap-8 pr-16 border-r border-fm-color-neutral-gray-200" }, Rt = { class: "flex flex-col flex-1 overflow-y-auto" }, Ot = {
197
- key: 0,
198
- "data-testid": "templates-loading",
199
- class: "flex items-center gap-8 px-12 py-8 text-fm-color-typo-secondary fm-typo-en-body-sm-400"
200
- }, Pt = {
201
- key: 0,
202
- class: "px-12 pt-12 pb-4 fm-typo-en-body-sm-600 uppercase text-fm-color-typo-secondary"
203
- }, $t = ["onClick"], Et = { class: "flex-1 truncate" }, Te = "shrink-0 min-w-[24px] px-8 text-center rounded-full bg-fm-color-neutral-gray-200 fm-typo-en-body-sm-600", Nt = /* @__PURE__ */ oe({
204
- __name: "TemplateSidebar",
205
- props: {
206
- groups: {},
207
- selectedId: {},
208
- query: {},
209
- total: {},
210
- loading: { type: Boolean }
211
- },
212
- emits: ["select", "search"],
213
- setup(D, { emit: y }) {
214
- const u = y;
215
- function d(e) {
216
- return [
217
- "flex items-center gap-8 px-12 py-4 fm-corner-radius-md text-left fm-typo-en-body-md-400",
218
- e ? "bg-fm-color-neutral-gray-100 fm-typo-en-body-md-600" : "hover:bg-fm-color-neutral-gray-100"
219
- ];
220
- }
221
- return (e, t) => {
222
- const v = U("FmSearch"), g = U("FmCircularProgress");
223
- return h(), x("aside", Ct, [
224
- S(v, {
225
- "model-value": e.query,
226
- placeholder: "Search location",
227
- "onUpdate:modelValue": t[0] || (t[0] = (o) => u("search", o))
228
- }, null, 8, ["model-value"]),
229
- m("div", Rt, [
230
- m("button", {
231
- "data-testid": "sidebar-all",
232
- class: B(d(!e.selectedId)),
233
- onClick: t[1] || (t[1] = (o) => u("select", null))
234
- }, [
235
- t[2] || (t[2] = m("span", { class: "flex-1 truncate" }, "All templates", -1)),
236
- m("span", {
237
- class: B(Te)
238
- }, C(e.total), 1)
239
- ], 2),
240
- e.loading ? (h(), x("div", Ot, [
241
- S(g, {
242
- size: "md",
243
- color: "neutral-gray-400"
244
- }),
245
- t[3] || (t[3] = ie(" Loading… "))
246
- ])) : $("", !0),
247
- (h(!0), x(ae, null, Ce(e.groups, (o, c) => (h(), x(ae, {
248
- key: o.id
249
- }, [
250
- c === 0 || e.groups[c - 1].kind !== o.kind ? (h(), x("div", Pt, C(o.kindLabel), 1)) : $("", !0),
251
- m("button", {
252
- "data-testid": "sidebar-source",
253
- class: B(d(e.selectedId === o.id)),
254
- onClick: (l) => u("select", o.id)
255
- }, [
256
- m("span", Et, C(o.name), 1),
257
- m("span", {
258
- class: B(Te)
259
- }, C(o.count), 1)
260
- ], 10, $t)
261
- ], 64))), 128))
262
- ])
263
- ]);
264
- };
265
- }
266
- }), Ft = { class: "flex flex-col flex-1 min-w-0 gap-8" }, qt = { class: "flex items-center gap-8 min-h-[32px]" }, Mt = { class: "fm-typo-en-body-lg-600 truncate" }, It = { class: "flex flex-col flex-1 overflow-y-auto" }, Lt = ["disabled", "onClick"], Vt = { class: "flex-1 min-w-0" }, Ut = { class: "fm-typo-en-body-md-600 truncate" }, Bt = {
267
- key: 0,
268
- class: "fm-typo-en-body-sm-400 text-fm-color-typo-error truncate"
269
- }, At = {
270
- key: 1,
271
- class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary truncate"
272
- }, jt = { class: "shrink-0 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ht = {
273
- key: 1,
274
- class: "py-40 text-center text-fm-color-typo-secondary"
275
- }, Yt = /* @__PURE__ */ oe({
276
- __name: "TemplateList",
277
- props: {
278
- title: {},
279
- kind: {},
280
- entries: {},
281
- showSource: { type: Boolean },
282
- query: {},
283
- loading: { type: Boolean },
284
- showBlank: { type: Boolean }
285
- },
286
- emits: ["pick", "search", "blank"],
287
- setup(D, { emit: y }) {
288
- const u = y;
289
- return (d, e) => {
290
- const t = U("FmChip"), v = U("FmSearch"), g = U("FmIcon");
291
- return h(), x("section", Ft, [
292
- m("div", qt, [
293
- m("span", Mt, C(d.title), 1),
294
- d.kind ? (h(), L(t, {
295
- key: 0,
296
- label: d.kind,
297
- compact: ""
298
- }, null, 8, ["label"])) : $("", !0)
299
- ]),
300
- S(v, {
301
- "model-value": d.query,
302
- placeholder: "Search template",
303
- "onUpdate:modelValue": e[0] || (e[0] = (o) => u("search", o))
304
- }, null, 8, ["model-value"]),
305
- m("div", It, [
306
- d.showBlank ? (h(), x("button", {
307
- key: 0,
308
- "data-testid": "start-blank",
309
- class: "flex w-full items-center gap-12 px-12 py-8 text-left border-b border-fm-color-neutral-gray-200 hover:bg-fm-color-neutral-gray-100",
310
- onClick: e[1] || (e[1] = (o) => u("blank"))
311
- }, [
312
- S(g, {
313
- name: "add",
314
- color: "primary"
315
- }),
316
- e[2] || (e[2] = m("div", { class: "flex-1 min-w-0" }, [
317
- m("div", { class: "fm-typo-en-body-md-600" }, "Blank"),
318
- m("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Start without a template and choose the source in the form ")
319
- ], -1))
320
- ])) : $("", !0),
321
- (h(!0), x(ae, null, Ce(d.entries, (o) => (h(), x("button", {
322
- key: o.id,
323
- "data-testid": "template-row",
324
- disabled: !!o.invalidReason,
325
- class: B([
326
- "flex w-full items-center gap-12 px-12 py-8 text-left border-b border-fm-color-neutral-gray-200",
327
- o.invalidReason ? "opacity-50 cursor-not-allowed" : "hover:bg-fm-color-neutral-gray-100"
328
- ]),
329
- onClick: (c) => u("pick", o.id)
330
- }, [
331
- m("div", Vt, [
332
- m("div", Ut, C(o.name), 1),
333
- o.invalidReason ? (h(), x("div", Bt, C(o.invalidReason), 1)) : d.showSource ? (h(), x("div", At, " from " + C(o.sourceName), 1)) : $("", !0)
334
- ]),
335
- m("div", jt, [
336
- ie(C(o.itemCount) + " items ", 1),
337
- o.time ? (h(), x(ae, { key: 0 }, [
338
- ie(" · " + C(o.time), 1)
339
- ], 64)) : $("", !0)
340
- ])
341
- ], 10, Lt))), 128)),
342
- !d.loading && !d.entries.length && !d.showBlank ? (h(), x("div", Ht, " No template matches. ")) : $("", !0)
343
- ])
344
- ]);
345
- };
346
- }
347
- }), zt = { class: "flex w-full h-[454px] gap-16" }, Qt = /* @__PURE__ */ oe({
348
- __name: "CreateOrderDialog",
349
- props: {
350
- show: { type: Boolean },
351
- supplierId: {},
352
- supplierName: {}
353
- },
354
- emits: ["update:show", "select"],
355
- setup(D, { emit: y }) {
356
- const u = D, d = y, e = ut(), t = tt(u, "show"), { viewState: v, actions: g } = Dt(
357
- () => ({ show: u.show, supplierId: u.supplierId }),
358
- (c) => {
359
- d("select", c), t.value = !1;
360
- }
361
- );
362
- function o() {
363
- t.value = !1, e.push({ name: He.TRANSFER_TEMPLATE });
364
- }
365
- return (c, l) => {
366
- const a = U("FmDialog");
367
- return h(), L(a, {
368
- modelValue: r(t),
369
- "onUpdate:modelValue": l[0] || (l[0] = (E) => Re(t) ? t.value = E : null),
370
- "dismiss-away": "",
371
- "close-button": "",
372
- "max-width": 1100
373
- }, {
374
- "dialog-header": j(() => l[1] || (l[1] = [
375
- m("div", { class: "fm-typo-en-title-md-800" }, "Create", -1)
376
- ])),
377
- "dialog-footer": j(() => [
378
- m("div", { class: "flex w-full justify-end" }, [
379
- m("button", {
380
- class: "text-fm-color-primary fm-typo-en-body-md-600",
381
- onClick: o
382
- }, " Manage templates → ")
383
- ])
384
- ]),
385
- default: j(() => [
386
- m("div", zt, [
387
- S(Nt, A(r(v).sidebar, {
388
- loading: r(v).loading,
389
- onSelect: r(g).selectSidebar,
390
- onSearch: r(g).searchSidebar
391
- }), null, 16, ["loading", "onSelect", "onSearch"]),
392
- S(Yt, A(r(v).templates, {
393
- loading: r(v).loading,
394
- onPick: r(g).pickTemplate,
395
- onSearch: r(g).searchTemplates,
396
- onBlank: r(g).startBlank
397
- }), null, 16, ["loading", "onPick", "onSearch", "onBlank"])
398
- ])
399
- ]),
400
- _: 1
401
- }, 8, ["modelValue"]);
402
- };
403
- }
404
- }), Kt = { class: "flex flex-col py-8" }, Gt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Jt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, Xt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1" }, Wt = {
405
- key: 0,
406
- class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1"
407
- }, Zt = { class: "pt-8" }, De = "ReceiveRequestViewSearchCriteria", Ta = /* @__PURE__ */ oe({
408
- __name: "ReceiveRequestView",
409
- setup(D) {
410
- const { t: y } = bt(), u = at();
411
- St().fetchTemplates(), ee.object({
412
- name: ee.string().optional().nullable(),
413
- startDate: ee.string().optional().nullable(),
414
- endDate: ee.string().optional().nullable()
415
- });
416
- const e = T(
417
- () => !w._currentLocation || a.loading.value
418
- ), t = We(), v = yt(), g = Pe();
419
- function o() {
420
- const b = {
421
- name: "",
422
- ...Se()
423
- }, p = t.getItem(De);
424
- if (!p)
425
- return b;
426
- try {
427
- return JSON.parse(p);
428
- } catch {
429
- return b;
430
- }
431
- }
432
- function c() {
433
- t.setItem(De, JSON.stringify(l.value));
434
- }
435
- const l = V(o()), a = Ye(
436
- ne.RECEIVE_REQUEST,
437
- l.value
438
- ), {
439
- columnDefs: E,
440
- showCustomPrintDialog: F,
441
- customPrintHtml: q,
442
- customPrintTemplateName: s,
443
- customPrintIsDefault: n
444
- } = ze(
445
- ne.RECEIVE_REQUEST,
446
- a,
447
- a.shipments
448
- ), w = Oe();
449
- async function H() {
450
- const b = `inventory-record_${re(l.value.startDate).format("DD-MM-YYYY_HH-mm")}-${re(l.value.endDate).format("DD-MM-YYYY_HH-mm")}.xlsx`, p = a.purchaseOrders.value.flatMap(
451
- (f) => f.items.map((_) => {
452
- var I;
453
- const k = new Date(Je(f._id) ?? ""), P = f.effectiveAt ? new Date(f.effectiveAt) : void 0, K = xe(
454
- Ke(_.sku, f.deliveryOrder || [])
455
- ), G = xe(_.quantity), J = ((I = _ == null ? void 0 : _.measurement) == null ? void 0 : I.abbrev) || _.sku.unit.abbrev;
456
- return {
457
- "SKU code": _.code,
458
- "SKU name": _.name,
459
- "PO #": f.seqNumber,
460
- "Effective at": P,
461
- Date: k,
462
- Status: f.status,
463
- Reference: f.ref ?? "",
464
- "Received quantity": K,
465
- "Ordered quantity": G,
466
- Unit: J,
467
- "Total cost": _.totalCost ? Ge(_.totalCost) : null
468
- };
469
- })
470
- ), i = [
471
- "SKU code",
472
- "SKU name",
473
- "PO #",
474
- "Date",
475
- "Status",
476
- "Reference",
477
- "Received quantity",
478
- "Ordered quantity",
479
- "Unit"
480
- ];
481
- v.enableBackdatePo && i.insert("Effective at", 4), v.enableTotalCost && i.push("Total cost"), await Xe(
482
- [
483
- {
484
- name: "purchases",
485
- data: p,
486
- columns: i
487
- }
488
- ],
489
- b
490
- ), u.open({
491
- title: y("inventory.transfer.receiveRequest.export.success"),
492
- message: y("inventory.transfer.receiveRequest.export.message", [b]),
493
- type: "success"
494
- });
495
- }
496
- const Y = V(Se()), R = V("");
497
- le([() => Y.value], ([b]) => {
498
- !b.startDate || !b.endDate || (l.value.startDate = b.startDate, l.value.endDate = b.endDate, a.updateDateRange(
499
- l.value.startDate,
500
- l.value.endDate
501
- ), c());
502
- }), le([() => R.value], () => {
503
- c();
504
- });
505
- function O(b) {
506
- if (b === "create") {
507
- if (e.value) {
508
- u.open({
509
- title: "Loading data...",
510
- message: "Please wait.",
511
- type: "info"
512
- });
513
- return;
514
- }
515
- return a.promptCreateTransferDialog();
516
- }
517
- if (b === "upload" && v.enableXilnexTransferNote)
518
- return a.promptUploadTransferDialog();
519
- if (b === "refresh")
520
- return a.fetchData();
521
- if (b === "export")
522
- return H();
523
- }
524
- const { breakpoints: N } = rt(), M = T(() => N.value.xs || N.value.sm), z = T(() => M.value ? 10 : 20), Ne = Ze(), Fe = T(() => [
525
- {
526
- label: y("inventory.transfer.receiveRequest.actions.create"),
527
- value: "create",
528
- isPrimary: !0,
529
- prependIcon: "add"
530
- },
531
- ...v.enableXilnexTransferNote ? [
532
- {
533
- label: y("inventory.common.upload"),
534
- value: "upload"
535
- }
536
- ] : [],
537
- {
538
- label: y("inventory.common.refresh"),
539
- value: "refresh"
540
- },
541
- {
542
- label: y("inventory.common.export"),
543
- value: "export"
544
- }
545
- ]), qe = T(() => {
546
- const b = [
547
- {
548
- type: "string",
549
- key: "status",
550
- entity: "purchaseOrder",
551
- values: Array.from(
552
- new Set(a.purchaseOrders.value.map((i) => i.status))
553
- )
554
- },
555
- {
556
- type: "string",
557
- key: "transferFrom",
558
- entity: "purchaseOrder",
559
- values: Array.from(
560
- new Set(a.purchaseOrders.value.map((i) => i.supplier.name).filter((i) => !!i))
561
- )
562
- }
563
- ], p = [
564
- {
565
- type: "string",
566
- key: "netsuiteTransactionNumber",
567
- entity: "purchaseOrder",
568
- values: a.purchaseOrders.value.map((i) => {
569
- var f, _;
570
- return (_ = (f = i.netSuite) == null ? void 0 : f.additionalInfo) == null ? void 0 : _.transactionnumber;
571
- }).filter((i) => i != null)
572
- },
573
- {
574
- type: "string",
575
- key: "netsuiteOrderNo",
576
- entity: "purchaseOrder",
577
- values: a.purchaseOrders.value.map((i) => {
578
- var f;
579
- return (f = i.netSuite) == null ? void 0 : f.refNo;
580
- }).filter((i) => i != null)
581
- },
582
- {
583
- type: "string",
584
- key: "netsuiteOrderId",
585
- entity: "purchaseOrder",
586
- values: a.purchaseOrders.value.map((i) => {
587
- var f;
588
- return (f = i.netSuite) == null ? void 0 : f.id;
589
- }).filter((i) => i != null)
590
- }
591
- ];
592
- return [...b, ...g.isEnabled ? p : []];
593
- }), Q = V(null), Me = T(() => {
594
- if (!Q.value)
595
- return a.purchaseOrders.value;
596
- const b = _t.build(Q.value);
597
- return a.purchaseOrders.value.filter((p) => {
598
- var i, f, _, k;
599
- return kt(
600
- {
601
- netsuiteTransactionNumber: (f = (i = p.netSuite) == null ? void 0 : i.additionalInfo) == null ? void 0 : f.transactionnumber,
602
- netsuiteOrderNo: (_ = p.netSuite) == null ? void 0 : _.refNo,
603
- netsuiteOrderId: (k = p.netSuite) == null ? void 0 : k.id,
604
- status: p.status,
605
- transferFrom: p.supplier.name
606
- },
607
- b
608
- );
609
- });
610
- });
611
- return (b, p) => {
612
- const i = U("FmTable");
613
- return h(), L(et, {
614
- title: r(y)("inventory.transfer.receiveRequest.title2"),
615
- actions: Fe.value,
616
- "onClick:action": O
617
- }, {
618
- default: j(() => {
619
- var f, _;
620
- return [
621
- m("div", {
622
- class: B([
623
- "flex flex-col gap-8 max-h-full",
624
- {
625
- "p-0": M.value,
626
- "px-24 ": !M.value
627
- }
628
- ])
629
- }, [
630
- S(ht, {
631
- "date-range-query": "",
632
- "date-range": Y.value,
633
- "onUpdate:dateRange": p[0] || (p[0] = (k) => Y.value = k),
634
- searchable: "",
635
- "change-location": "",
636
- search: R.value,
637
- "onUpdate:search": p[1] || (p[1] = (k) => R.value = k),
638
- filterable: "",
639
- "filter-attributes": qe.value,
640
- filter: Q.value,
641
- "onUpdate:filter": p[2] || (p[2] = (k) => Q.value = k)
642
- }, null, 8, ["date-range", "search", "filter-attributes", "filter"]),
643
- (h(), L(i, {
644
- style: Le(r(Ne).tableHeight),
645
- "column-defs": r(E),
646
- "row-data": Me.value,
647
- "search-value": R.value,
648
- loading: e.value,
649
- onRowClick: p[3] || (p[3] = (k) => r(a).promptShowTransferDetails(k.original)),
650
- key: (f = r(w)._currentLocation) == null ? void 0 : f.dbName,
651
- "page-size": z.value
652
- }, {
653
- "list-row": j((k) => [
654
- S(vt, {
655
- row: k,
656
- onRowClick: r(a).promptShowTransferDetails
657
- }, {
658
- default: j((P) => {
659
- var K, G, J, I, ue, de, ce, me, X, pe, fe, ve, ye, W, he, be, ge, _e, Z, ke;
660
- return [
661
- m("div", Kt, [
662
- m("div", Gt, [
663
- S(r(te), {
664
- render: (J = (G = (K = P._id) == null ? void 0 : K.column) == null ? void 0 : G.columnDef) == null ? void 0 : J.cell,
665
- props: (ue = (I = P._id) == null ? void 0 : I.getContext) == null ? void 0 : ue.call(I)
666
- }, null, 8, ["render", "props"])
667
- ]),
668
- m("div", Jt, [
669
- S(r(te), {
670
- render: (me = (ce = (de = P.supplier_name) == null ? void 0 : de.column) == null ? void 0 : ce.columnDef) == null ? void 0 : me.cell,
671
- props: (pe = (X = P.supplier_name) == null ? void 0 : X.getContext) == null ? void 0 : pe.call(X)
672
- }, null, 8, ["render", "props"])
673
- ]),
674
- m("div", Xt, C(k.original.items.map((Ie) => `${Ie.name}`).join(", ")), 1),
675
- k.original.ref ? (h(), x("div", Wt, [
676
- S(r(te), {
677
- render: (ye = (ve = (fe = P.ref) == null ? void 0 : fe.column) == null ? void 0 : ve.columnDef) == null ? void 0 : ye.cell,
678
- props: (he = (W = P.ref) == null ? void 0 : W.getContext) == null ? void 0 : he.call(W)
679
- }, null, 8, ["render", "props"])
680
- ])) : $("", !0),
681
- m("div", Zt, [
682
- S(r(te), {
683
- render: (_e = (ge = (be = P.status) == null ? void 0 : be.column) == null ? void 0 : ge.columnDef) == null ? void 0 : _e.cell,
684
- props: (ke = (Z = P.status) == null ? void 0 : Z.getContext) == null ? void 0 : ke.call(Z)
685
- }, null, 8, ["render", "props"])
686
- ])
687
- ])
688
- ];
689
- }),
690
- _: 2
691
- }, 1032, ["row", "onRowClick"])
692
- ]),
693
- _: 1
694
- }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
695
- ], 2),
696
- (h(), L(Ve, { to: "body" }, [
697
- r(v).enablePurchaseOrderEmail ? (h(), L(nt, se(A({ key: 0 }, r(a).emailDialogProps.value)), null, 16)) : $("", !0),
698
- r(a).createOrderDialogProps.value ? (h(), L(Qt, se(A({ key: 1 }, r(a).createOrderDialogProps.value)), null, 16)) : $("", !0),
699
- S(lt, A(r(a).transferDialogProps.value, {
700
- onSubmitted: r(a).fetchData
701
- }), null, 16, ["onSubmitted"]),
702
- S(Qe, A({
703
- scope: r(ne).RECEIVE_REQUEST
704
- }, {
705
- ...r(a).transferDetailsProps.value,
706
- receivedMap: ((_ = r(a).transferDetailsProps.value) == null ? void 0 : _.receivedMap) ?? {},
707
- shipments: r(a).shipments.value ?? []
708
- }, {
709
- onSubmitted: r(a).fetchData
710
- }), null, 16, ["scope", "onSubmitted"]),
711
- S(it, se(Ue(r(a).xilnexImportDialogProps.value)), null, 16),
712
- S(gt, {
713
- modelValue: r(F),
714
- "onUpdate:modelValue": p[4] || (p[4] = (k) => Re(F) ? F.value = k : null),
715
- html: r(q),
716
- "template-name": r(s),
717
- "is-default": r(n)
718
- }, null, 8, ["modelValue", "html", "template-name", "is-default"])
719
- ]))
720
- ];
721
- }),
722
- _: 1
723
- }, 8, ["title", "actions"]);
724
- };
725
- }
726
- });
727
- export {
728
- Ta as default
729
- };