@feedmepos/mf-inventory-portal 1.9.0-dev.5 → 1.9.1

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 (100) hide show
  1. package/dist/{App-DDALXIcF.js → App-ChwM2mdj.js} +10 -10
  2. package/dist/{ApprovalView-BJVCW2q7.js → ApprovalView-6nGsV69S.js} +9 -9
  3. package/dist/{BindingsDialog-DDMJjWjv.js → BindingsDialog-OGTf0sNI.js} +2 -2
  4. package/dist/{BindingsPicker-twbdYEAL.js → BindingsPicker-BQsDrDd0.js} +2 -2
  5. package/dist/{BindingsTable-Cpx3vSvk.js → BindingsTable-C03Zlp_f.js} +4 -4
  6. package/dist/{BulkReceiveRequestPage-DD33ulSC.js → BulkReceiveRequestPage-Bo4JDMkv.js} +1022 -1047
  7. package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-CtHsMnkV.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-DZvWlqzW.js} +1 -1
  8. package/dist/{ClosingDraftView-BUc5bGIU.js → ClosingDraftView-CCU_VR6a.js} +19 -19
  9. package/dist/{ClosingHistoryView-DPz6D5S2.js → ClosingHistoryView-IeBJW27N.js} +7 -7
  10. package/dist/{ClosingTemplateView-DabFVZCc.js → ClosingTemplateView-Dc2EI6Ir.js} +18 -18
  11. package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-izGh8Myj.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-Cv18okDy.js} +1 -1
  12. package/dist/{DefaultView-DURO6g6_.js → DefaultView-BFnkhq_H.js} +2 -2
  13. package/dist/{DeliveryOrderPrintPreview-BJBheF-Y.js → DeliveryOrderPrintPreview-DXgt1t1x.js} +2 -2
  14. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-BDZaoowM.js → EmailDialog.vue_vue_type_script_setup_true_lang-DGbAG3eM.js} +4795 -4757
  15. package/dist/{FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-lABO5UTH.js → FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-CVQNcS4i.js} +1 -1
  16. package/dist/{FeatureCapabilityGate-4YBofjM5.js → FeatureCapabilityGate-Ddg6XQEe.js} +2 -2
  17. package/dist/{FeaturePageGate.vue_vue_type_script_setup_true_lang-VwGbsXYy.js → FeaturePageGate.vue_vue_type_script_setup_true_lang-AyCP8jjY.js} +1 -1
  18. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-CrYonFQ4.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-3BBkd3fK.js} +1 -1
  19. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-D0cZr3AO.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DxiyDPE4.js} +2 -2
  20. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CvIVLMp-.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-NbqdrNZC.js} +2 -2
  21. package/dist/{FmMultiselectDialog-lXXaY5lK.js → FmMultiselectDialog-C6v0K8O_.js} +2 -2
  22. package/dist/{FmMultiselectDialog-Cwd47xa5.js → FmMultiselectDialog-CbjJjImr.js} +2 -2
  23. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CqqOESle.js → FmUnitInput.vue_vue_type_script_setup_true_lang-WmoFkpEY.js} +5 -5
  24. package/dist/{ImportView-hEJUxq3v.js → ImportView-CWp4v9Fw.js} +7 -7
  25. package/dist/{IngredientsView-DEhTu1Jk.js → IngredientsView-CA1_zt7Z.js} +15 -15
  26. package/dist/{IntegrationExplorerView-KpAJ2V3E.js → IntegrationExplorerView-De9Kzwnn.js} +6 -6
  27. package/dist/{IntegrationPlatformView-qrPYWqT5.js → IntegrationPlatformView-B50Phqtk.js} +2 -2
  28. package/dist/{IntegrationView-BcZjB2Df.js → IntegrationView-B6uYjzkw.js} +15 -15
  29. package/dist/{InventoryBindingForm-BVW5nyBI.js → InventoryBindingForm-DJ30AwVX.js} +1 -1
  30. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-ClC9JScP.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-Bz-ZlZr0.js} +4 -4
  31. package/dist/{InventoryBindingSummary-karaxDWz.js → InventoryBindingSummary-DeBaiXQl.js} +1 -1
  32. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DC-dWx9K.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DWr79uhC.js} +2 -2
  33. package/dist/{ProductionRunDetailPage-CRoWs8GL.js → ProductionRunDetailPage-C1bTPmbW.js} +4 -4
  34. package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-lzagKc6P.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-DBIoS4Lh.js} +3972 -4089
  35. package/dist/{ProductionRunPage-DeEzvebS.js → ProductionRunPage-BjvU_1VH.js} +4 -4
  36. package/dist/{PublishView-BG0YVyQ_.js → PublishView-hNen_JwE.js} +15 -15
  37. package/dist/{PurchaseOrderPrintPreview-DZs6nzcB.js → PurchaseOrderPrintPreview-CsUbnmIe.js} +2 -2
  38. package/dist/ReceiveRequestView-0InxDJ3M.js +692 -0
  39. package/dist/{RecipeView-D-u82Imb.js → RecipeView-bCcgkdE6.js} +16 -16
  40. package/dist/{SettingsView-CavH72Zf.js → SettingsView-C4pni2wW.js} +7 -7
  41. package/dist/{StockView-Mbbag4gi.js → StockView-C0XG_9B6.js} +543 -543
  42. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-I8S3lE8n.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CA8HcdSr.js} +1 -1
  43. package/dist/{SupplierView-BKjQQMUB.js → SupplierView-_PvNpWiU.js} +13 -13
  44. package/dist/{SurchargeView-tG9jxSHT.js → SurchargeView-3rxIcCh2.js} +7 -7
  45. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-f3MH8VXz.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-BziSnRwh.js} +2 -2
  46. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CVPc0HNQ.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CapbC0-B.js} +1 -1
  47. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BzJkA7ub.js → TransferDetails.vue_vue_type_script_setup_true_lang-u_wcCBvQ.js} +24 -24
  48. package/dist/{TransferTemplateView-DUvgcoFR.js → TransferTemplateView-D0LPeds-.js} +19 -19
  49. package/dist/{UnitCostHistoryView-DXFlnpzI.js → UnitCostHistoryView-CT9_LcqD.js} +4 -4
  50. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-T4rShFa9.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-DjUxPx5x.js} +4 -4
  51. package/dist/{UnitView-ChPy6-nH.js → UnitView-B0b_LWAr.js} +7 -7
  52. package/dist/{WarehouseView-B4rRtSI3.js → WarehouseView-WwtqpXFc.js} +8 -8
  53. package/dist/{WastageTemplateView-BWvFXjS6.js → WastageTemplateView-BrJb7i3s.js} +15 -15
  54. package/dist/{app-DMflhu6b.js → app-DMR8lGeI.js} +37 -29
  55. package/dist/app.d.ts +8 -0
  56. package/dist/app.js +1 -1
  57. package/dist/{bulk-edit-simulation.helper-DezcOq8o.js → bulk-edit-simulation.helper-BodN3Ovb.js} +2 -2
  58. package/dist/{closing-template-BGERrbIQ.js → closing-template-D8-w7dJR.js} +1 -1
  59. package/dist/{date2-DIxf2HSS.js → date2-gSK_CaAD.js} +1 -1
  60. package/dist/{dayjs.min-W80OrMgJ.js → dayjs.min-DYqzr2b4.js} +1 -1
  61. package/dist/{decimal-BTK7NAET.js → decimal-CV2CbIP_.js} +2 -2
  62. package/dist/{defineDeepModel-DJ9LqqzR.js → defineDeepModel-Cgts0baA.js} +1 -1
  63. package/dist/{duplicate-template-BC7pMF-s.js → duplicate-template-_QC3-Dg0.js} +1 -1
  64. package/dist/{feature-h3MFKUcz.js → feature-Bzo4okfR.js} +129 -32
  65. package/dist/{format-time-from-id-DSAFHO8d.js → format-time-from-id-D_mE0jBr.js} +1 -1
  66. package/dist/{format-unit-display-wiLcRFDI.js → format-unit-display-Dd20Rit0.js} +12 -12
  67. package/dist/{id-to-date-Di8Eschw.js → id-to-date-BuMcKhAt.js} +1 -1
  68. package/dist/{import-export.helper-avwvLBKD.js → import-export.helper-rzwKzV8j.js} +5 -5
  69. package/dist/{index-CXhgWYdX.js → index-4hXkHXmU.js} +1 -1
  70. package/dist/{index-C-uWBaU4.js → index-B9qwc0uO.js} +3 -3
  71. package/dist/{index-CcmysfjG.js → index-D2cksjKT.js} +1 -1
  72. package/dist/{lz-string-MCnthIwP.js → lz-string-COQMQMdP.js} +1 -1
  73. package/dist/{netsuite-CsMFS8uH.js → netsuite-DpV5ZMba.js} +2 -2
  74. package/dist/{netsuite-explorer-CLsdKVZp.js → netsuite-explorer-CIr8qGIj.js} +1 -1
  75. package/dist/{predefined-templates-B4URhizE.js → predefined-templates-BtUdyeYn.js} +1 -1
  76. package/dist/{publish-versions-BGoX_gD4.js → publish-versions-BqVzJN6P.js} +1 -1
  77. package/dist/{purchase-order-template-Cn2JQYD0.js → purchase-order-template-DxLHYHnX.js} +1 -1
  78. package/dist/{recalculationUtils-sCuVobBd.js → recalculationUtils-Bo2_wEwi.js} +1 -1
  79. package/dist/{row-action.enum-BM2HgD4R.js → row-action.enum-CHpsNnrw.js} +1 -1
  80. package/dist/{rules-BaYKzbRv.js → rules-xgpOOQLG.js} +3 -3
  81. package/dist/{stock-BZMbxbyg.js → stock-DBLaI4RH.js} +1 -1
  82. package/dist/{stock-B4uI5_D4.js → stock-DrM-LYXO.js} +2 -2
  83. package/dist/{supplier-B0dtsWm4.js → supplier-C476fF0r.js} +2 -2
  84. package/dist/{surcharge-Djbv5SzM.js → surcharge-Nr5deDxT.js} +1 -1
  85. package/dist/tsconfig.app.tsbuildinfo +1 -1
  86. package/dist/{uom-rules-jR6owpw7.js → uom-rules-BfpbgbnI.js} +1 -1
  87. package/dist/{use-ingredient-select-dialog-VfIKtgzP.js → use-ingredient-select-dialog-IuYDEpDR.js} +2 -2
  88. package/dist/{use-inventory-binding-dialog-BdgHGwC_.js → use-inventory-binding-dialog-C2QWjvLV.js} +2 -2
  89. package/dist/{use-template-enabled-locations-B1xMD71z.js → use-template-enabled-locations-DdOyqrZw.js} +2 -2
  90. package/dist/{use-transfer-locations-NrMDt6DD.js → use-transfer-locations-C96gYh0y.js} +2 -2
  91. package/dist/{useHrmPermission-DT0o2-yP.js → useHrmPermission-D35mRgdj.js} +1 -1
  92. package/dist/{useNavigationMenu-CMjxTTiM.js → useNavigationMenu-9aQZjIuP.js} +5 -5
  93. package/dist/{useSseClient-D4n-A1ST.js → useSseClient-CrK7D2Lk.js} +1 -1
  94. package/dist/views/receive-request/helper/purchase-export.d.ts +26 -0
  95. package/dist/views/receive-request/helper/purchase-export.spec.d.ts +1 -0
  96. package/dist/{vue-i18n-69kj_U4j.js → vue-i18n-C9MdGWJ_.js} +364 -364
  97. package/dist/{vue-BOcyAWzp.js → vue-ueg1t-sr.js} +2 -2
  98. package/dist/{xlsx.util-CJm8uh4D.js → xlsx.util-kkTKpxAB.js} +2 -2
  99. package/package.json +4 -4
  100. package/dist/ReceiveRequestView-B5jmw3_m.js +0 -729
@@ -0,0 +1,692 @@
1
+ import { ref as q, computed as w, watch as oe, defineComponent as te, resolveComponent as V, createElementBlock as x, openBlock as y, createVNode as k, createElementVNode as c, createCommentVNode as P, normalizeClass as B, toDisplayString as D, createTextVNode as se, Fragment as Z, renderList as De, createBlock as L, unref as r, isRef as Ce, withCtx as A, mergeProps as U, normalizeStyle as Le, Teleport as qe, normalizeProps as ae, guardReactiveProps as Ve } from "vue";
2
+ import { $ as Be, y as Ue, u as Re, a0 as Ae, R as He, D as K } from "./app-DMR8lGeI.js";
3
+ import { i as xe } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-3BBkd3fK.js";
4
+ import { u as Ye, P as re, a as je, _ as ze } from "./TransferDetails.vue_vue_type_script_setup_true_lang-u_wcCBvQ.js";
5
+ import { b as Qe, g as Ge, _ as Je, a as Xe, c as Ke, p as We } from "./EmailDialog.vue_vue_type_script_setup_true_lang-DGbAG3eM.js";
6
+ import { d as ee } from "./dayjs.min-DYqzr2b4.js";
7
+ import { e as Ze } from "./UnitDisplayControl.vue_vue_type_script_setup_true_lang-DjUxPx5x.js";
8
+ import { u as et } from "./useTabStorage-BkIVScW_.js";
9
+ import { u as tt, _ as at } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
10
+ import { useProxiedModel as rt, useSnackbar as ot, useBreakpoints as st } from "@feedmepos/ui-library";
11
+ import { useRouter as nt } from "vue-router";
12
+ import { u as lt } from "./useHrmPermission-D35mRgdj.js";
13
+ import { u as $e } from "./netsuite-DpV5ZMba.js";
14
+ import { b as it, c as ut, t as mt } from "./format-unit-display-Dd20Rit0.js";
15
+ import { p as dt } from "./format-time-from-id-D_mE0jBr.js";
16
+ import { _ as ct } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-gJQQKKAC.js";
17
+ import { F as W } from "./index-eGvSlWMU.js";
18
+ import { u as pt } from "./feature-Bzo4okfR.js";
19
+ import { _ as ft } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-NbqdrNZC.js";
20
+ import { useI18n as vt } from "@feedmepos/mf-common";
21
+ import { _ as yt } from "./CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-Cv18okDy.js";
22
+ import { P as ht, J as bt } from "./app-C39bYJmq.js";
23
+ import { f as gt } from "./predefined-templates-BtUdyeYn.js";
24
+ var Pe = { exports: {} };
25
+ (function(T, v) {
26
+ (function(i, u) {
27
+ T.exports = u();
28
+ })(Be, function() {
29
+ return function(i, u, e) {
30
+ i = i || {};
31
+ var t = u.prototype, f = { 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" };
32
+ function b(d, l, a, O) {
33
+ return t.fromToBase(d, l, a, O);
34
+ }
35
+ e.en.relativeTime = f, t.fromToBase = function(d, l, a, O, N) {
36
+ for (var M, s, n, S = a.$locale().relativeTime || f, H = i.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, C = 0; C < Y; C += 1) {
37
+ var R = H[C];
38
+ R.d && (M = O ? e(d).diff(a, R.d, !0) : a.diff(d, R.d, !0));
39
+ var E = (i.rounding || Math.round)(Math.abs(M));
40
+ if (n = M > 0, E <= R.r || !R.r) {
41
+ E <= 1 && C > 0 && (R = H[C - 1]);
42
+ var I = S[R.l];
43
+ N && (E = N("" + E)), s = typeof I == "string" ? I.replace("%d", E) : I(E, l, R.l, n);
44
+ break;
45
+ }
46
+ }
47
+ if (l) return s;
48
+ var j = n ? S.future : S.past;
49
+ return typeof j == "function" ? j(s) : j.replace("%s", s);
50
+ }, t.to = function(d, l) {
51
+ return b(d, l, this, !0);
52
+ }, t.from = function(d, l) {
53
+ return b(d, l, this);
54
+ };
55
+ var o = function(d) {
56
+ return d.$u ? e.utc() : e();
57
+ };
58
+ t.toNow = function(d) {
59
+ return this.to(o(this), d);
60
+ }, t.fromNow = function(d) {
61
+ return this.from(o(this), d);
62
+ };
63
+ };
64
+ });
65
+ })(Pe);
66
+ var _t = Pe.exports;
67
+ const kt = /* @__PURE__ */ Ue(_t), Oe = {
68
+ sidebar: null,
69
+ templateList: null,
70
+ blankOrder: null
71
+ };
72
+ ee.extend(kt);
73
+ const Se = {
74
+ supplier: "Vendor",
75
+ warehouse: "Warehouse",
76
+ restaurant: "Outlet"
77
+ };
78
+ function xt() {
79
+ const T = Re(), v = $e(), i = it(), u = /* @__PURE__ */ new Map();
80
+ for (const e of Object.values(Oe)) {
81
+ if (!e || u.has(e)) continue;
82
+ const t = Ae(e).validationManifest.requiredCaslPermissions;
83
+ u.set(e, lt(t).hasPermission);
84
+ }
85
+ return {
86
+ templates: {
87
+ list: () => i.templates,
88
+ loading: () => i.loading
89
+ },
90
+ sources: {
91
+ currentLocationId: () => T.currentLocation.doc._id
92
+ },
93
+ permissions: {
94
+ has: (e) => {
95
+ var t;
96
+ return !e || !!((t = u.get(e)) != null && t.value);
97
+ }
98
+ },
99
+ netsuite: {
100
+ subsidiaryError(e) {
101
+ var f;
102
+ if (ut(e)) return;
103
+ const t = e.internal ? v.getNetSuiteLocation(`${e.internal}_${e._id}`) : v.getNetSuiteVendor(e._id);
104
+ return `The subsidiary of the request location is ${(f = v.getLocationSubsidiary(t == null ? void 0 : t.netSuiteId)) == null ? void 0 : f.fullName}.`;
105
+ }
106
+ }
107
+ };
108
+ }
109
+ function St(T, v, i = xt()) {
110
+ const u = q(null), e = q(""), t = q("");
111
+ function f(s) {
112
+ const { items: n, supplier: S } = s.purchaseOrder;
113
+ return !n.length || n.some(mt) ? "This template is invalid. Update this template." : i.netsuite.subsidiaryError(S);
114
+ }
115
+ const b = w(
116
+ () => Qe(
117
+ i.templates.list(),
118
+ i.sources.currentLocationId(),
119
+ f
120
+ )
121
+ ), o = w(() => Ge(b.value)), d = w(() => {
122
+ const s = e.value.trim().toLowerCase();
123
+ return o.value.filter((n) => !s || n.source.name.toLowerCase().includes(s));
124
+ }), l = w(
125
+ () => o.value.find((s) => s.source._id === u.value)
126
+ ), a = w(() => {
127
+ var n;
128
+ const s = t.value.trim().toLowerCase();
129
+ return (((n = l.value) == null ? void 0 : n.templates) ?? b.value).filter(
130
+ (S) => !s || S.template.name.toLowerCase().includes(s)
131
+ );
132
+ });
133
+ function O(s) {
134
+ const n = s.updatedAt ?? dt(s._id);
135
+ return n ? ee(n).fromNow() : "";
136
+ }
137
+ const N = w(() => {
138
+ var s;
139
+ return {
140
+ loading: i.templates.loading(),
141
+ sidebar: {
142
+ groups: d.value.map((n) => ({
143
+ id: n.source._id,
144
+ name: n.source.name,
145
+ kind: n.kind,
146
+ kindLabel: Se[n.kind],
147
+ count: n.templates.length
148
+ })),
149
+ selectedId: u.value,
150
+ query: e.value,
151
+ total: b.value.length
152
+ },
153
+ templates: {
154
+ title: ((s = l.value) == null ? void 0 : s.source.name) ?? "All templates",
155
+ kind: l.value ? Se[l.value.kind] : void 0,
156
+ showSource: !l.value,
157
+ showBlank: !l.value && !t.value.trim() && i.permissions.has(Oe.blankOrder),
158
+ query: t.value,
159
+ entries: a.value.map((n) => ({
160
+ id: n.template._id,
161
+ name: n.template.name,
162
+ invalidReason: n.invalidReason,
163
+ sourceName: n.supplier.name,
164
+ itemCount: n.template.purchaseOrder.items.length,
165
+ time: O(n.template)
166
+ }))
167
+ }
168
+ };
169
+ }), M = {
170
+ selectSidebar(s) {
171
+ u.value = s, t.value = "";
172
+ },
173
+ searchSidebar(s) {
174
+ e.value = s;
175
+ },
176
+ searchTemplates(s) {
177
+ t.value = s;
178
+ },
179
+ pickTemplate(s) {
180
+ const n = b.value.find((S) => S.template._id === s);
181
+ !n || n.invalidReason || v({ templateId: s });
182
+ },
183
+ startBlank() {
184
+ v({});
185
+ }
186
+ };
187
+ return oe(
188
+ () => T().show,
189
+ (s) => {
190
+ s && (e.value = "", t.value = "", u.value = T().supplierId ?? null);
191
+ }
192
+ ), { viewState: N, actions: M };
193
+ }
194
+ const wt = { class: "flex flex-col w-[260px] shrink-0 gap-8 pr-16 border-r border-fm-color-neutral-gray-200" }, Tt = { class: "flex flex-col flex-1 overflow-y-auto" }, Dt = {
195
+ key: 0,
196
+ "data-testid": "templates-loading",
197
+ class: "flex items-center gap-8 px-12 py-8 text-fm-color-typo-secondary fm-typo-en-body-sm-400"
198
+ }, Ct = {
199
+ key: 0,
200
+ class: "px-12 pt-12 pb-4 fm-typo-en-body-sm-600 uppercase text-fm-color-typo-secondary"
201
+ }, Rt = ["onClick"], $t = { class: "flex-1 truncate" }, we = "shrink-0 min-w-[24px] px-8 text-center rounded-full bg-fm-color-neutral-gray-200 fm-typo-en-body-sm-600", Pt = /* @__PURE__ */ te({
202
+ __name: "TemplateSidebar",
203
+ props: {
204
+ groups: {},
205
+ selectedId: {},
206
+ query: {},
207
+ total: {},
208
+ loading: { type: Boolean }
209
+ },
210
+ emits: ["select", "search"],
211
+ setup(T, { emit: v }) {
212
+ const i = v;
213
+ function u(e) {
214
+ return [
215
+ "flex items-center gap-8 px-12 py-4 fm-corner-radius-md text-left fm-typo-en-body-md-400",
216
+ e ? "bg-fm-color-neutral-gray-100 fm-typo-en-body-md-600" : "hover:bg-fm-color-neutral-gray-100"
217
+ ];
218
+ }
219
+ return (e, t) => {
220
+ const f = V("FmSearch"), b = V("FmCircularProgress");
221
+ return y(), x("aside", wt, [
222
+ k(f, {
223
+ "model-value": e.query,
224
+ placeholder: "Search location",
225
+ "onUpdate:modelValue": t[0] || (t[0] = (o) => i("search", o))
226
+ }, null, 8, ["model-value"]),
227
+ c("div", Tt, [
228
+ c("button", {
229
+ "data-testid": "sidebar-all",
230
+ class: B(u(!e.selectedId)),
231
+ onClick: t[1] || (t[1] = (o) => i("select", null))
232
+ }, [
233
+ t[2] || (t[2] = c("span", { class: "flex-1 truncate" }, "All templates", -1)),
234
+ c("span", {
235
+ class: B(we)
236
+ }, D(e.total), 1)
237
+ ], 2),
238
+ e.loading ? (y(), x("div", Dt, [
239
+ k(b, {
240
+ size: "md",
241
+ color: "neutral-gray-400"
242
+ }),
243
+ t[3] || (t[3] = se(" Loading… "))
244
+ ])) : P("", !0),
245
+ (y(!0), x(Z, null, De(e.groups, (o, d) => (y(), x(Z, {
246
+ key: o.id
247
+ }, [
248
+ d === 0 || e.groups[d - 1].kind !== o.kind ? (y(), x("div", Ct, D(o.kindLabel), 1)) : P("", !0),
249
+ c("button", {
250
+ "data-testid": "sidebar-source",
251
+ class: B(u(e.selectedId === o.id)),
252
+ onClick: (l) => i("select", o.id)
253
+ }, [
254
+ c("span", $t, D(o.name), 1),
255
+ c("span", {
256
+ class: B(we)
257
+ }, D(o.count), 1)
258
+ ], 10, Rt)
259
+ ], 64))), 128))
260
+ ])
261
+ ]);
262
+ };
263
+ }
264
+ }), Ot = { class: "flex flex-col flex-1 min-w-0 gap-8" }, Et = { class: "flex items-center gap-8 min-h-[32px]" }, Nt = { class: "fm-typo-en-body-lg-600 truncate" }, Ft = { class: "flex flex-col flex-1 overflow-y-auto" }, Mt = ["disabled", "onClick"], It = { class: "flex-1 min-w-0" }, Lt = { class: "fm-typo-en-body-md-600 truncate" }, qt = {
265
+ key: 0,
266
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-error truncate"
267
+ }, Vt = {
268
+ key: 1,
269
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary truncate"
270
+ }, Bt = { class: "shrink-0 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ut = {
271
+ key: 1,
272
+ class: "py-40 text-center text-fm-color-typo-secondary"
273
+ }, At = /* @__PURE__ */ te({
274
+ __name: "TemplateList",
275
+ props: {
276
+ title: {},
277
+ kind: {},
278
+ entries: {},
279
+ showSource: { type: Boolean },
280
+ query: {},
281
+ loading: { type: Boolean },
282
+ showBlank: { type: Boolean }
283
+ },
284
+ emits: ["pick", "search", "blank"],
285
+ setup(T, { emit: v }) {
286
+ const i = v;
287
+ return (u, e) => {
288
+ const t = V("FmChip"), f = V("FmSearch"), b = V("FmIcon");
289
+ return y(), x("section", Ot, [
290
+ c("div", Et, [
291
+ c("span", Nt, D(u.title), 1),
292
+ u.kind ? (y(), L(t, {
293
+ key: 0,
294
+ label: u.kind,
295
+ compact: ""
296
+ }, null, 8, ["label"])) : P("", !0)
297
+ ]),
298
+ k(f, {
299
+ "model-value": u.query,
300
+ placeholder: "Search template",
301
+ "onUpdate:modelValue": e[0] || (e[0] = (o) => i("search", o))
302
+ }, null, 8, ["model-value"]),
303
+ c("div", Ft, [
304
+ u.showBlank ? (y(), x("button", {
305
+ key: 0,
306
+ "data-testid": "start-blank",
307
+ 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",
308
+ onClick: e[1] || (e[1] = (o) => i("blank"))
309
+ }, [
310
+ k(b, {
311
+ name: "add",
312
+ color: "primary"
313
+ }),
314
+ e[2] || (e[2] = c("div", { class: "flex-1 min-w-0" }, [
315
+ c("div", { class: "fm-typo-en-body-md-600" }, "Blank"),
316
+ c("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Start without a template and choose the source in the form ")
317
+ ], -1))
318
+ ])) : P("", !0),
319
+ (y(!0), x(Z, null, De(u.entries, (o) => (y(), x("button", {
320
+ key: o.id,
321
+ "data-testid": "template-row",
322
+ disabled: !!o.invalidReason,
323
+ class: B([
324
+ "flex w-full items-center gap-12 px-12 py-8 text-left border-b border-fm-color-neutral-gray-200",
325
+ o.invalidReason ? "opacity-50 cursor-not-allowed" : "hover:bg-fm-color-neutral-gray-100"
326
+ ]),
327
+ onClick: (d) => i("pick", o.id)
328
+ }, [
329
+ c("div", It, [
330
+ c("div", Lt, D(o.name), 1),
331
+ o.invalidReason ? (y(), x("div", qt, D(o.invalidReason), 1)) : u.showSource ? (y(), x("div", Vt, " from " + D(o.sourceName), 1)) : P("", !0)
332
+ ]),
333
+ c("div", Bt, [
334
+ se(D(o.itemCount) + " items ", 1),
335
+ o.time ? (y(), x(Z, { key: 0 }, [
336
+ se(" · " + D(o.time), 1)
337
+ ], 64)) : P("", !0)
338
+ ])
339
+ ], 10, Mt))), 128)),
340
+ !u.loading && !u.entries.length && !u.showBlank ? (y(), x("div", Ut, " No template matches. ")) : P("", !0)
341
+ ])
342
+ ]);
343
+ };
344
+ }
345
+ }), Ht = { class: "flex w-full h-[454px] gap-16" }, Yt = /* @__PURE__ */ te({
346
+ __name: "CreateOrderDialog",
347
+ props: {
348
+ show: { type: Boolean },
349
+ supplierId: {},
350
+ supplierName: {}
351
+ },
352
+ emits: ["update:show", "select"],
353
+ setup(T, { emit: v }) {
354
+ const i = T, u = v, e = nt(), t = rt(i, "show"), { viewState: f, actions: b } = St(
355
+ () => ({ show: i.show, supplierId: i.supplierId }),
356
+ (d) => {
357
+ u("select", d), t.value = !1;
358
+ }
359
+ );
360
+ function o() {
361
+ t.value = !1, e.push({ name: He.TRANSFER_TEMPLATE });
362
+ }
363
+ return (d, l) => {
364
+ const a = V("FmDialog");
365
+ return y(), L(a, {
366
+ modelValue: r(t),
367
+ "onUpdate:modelValue": l[0] || (l[0] = (O) => Ce(t) ? t.value = O : null),
368
+ "dismiss-away": "",
369
+ "close-button": "",
370
+ "max-width": 1100
371
+ }, {
372
+ "dialog-header": A(() => l[1] || (l[1] = [
373
+ c("div", { class: "fm-typo-en-title-md-800" }, "Create", -1)
374
+ ])),
375
+ "dialog-footer": A(() => [
376
+ c("div", { class: "flex w-full justify-end" }, [
377
+ c("button", {
378
+ class: "text-fm-color-primary fm-typo-en-body-md-600",
379
+ onClick: o
380
+ }, " Manage templates → ")
381
+ ])
382
+ ]),
383
+ default: A(() => [
384
+ c("div", Ht, [
385
+ k(Pt, U(r(f).sidebar, {
386
+ loading: r(f).loading,
387
+ onSelect: r(b).selectSidebar,
388
+ onSearch: r(b).searchSidebar
389
+ }), null, 16, ["loading", "onSelect", "onSearch"]),
390
+ k(At, U(r(f).templates, {
391
+ loading: r(f).loading,
392
+ onPick: r(b).pickTemplate,
393
+ onSearch: r(b).searchTemplates,
394
+ onBlank: r(b).startBlank
395
+ }), null, 16, ["loading", "onPick", "onSearch", "onBlank"])
396
+ ])
397
+ ]),
398
+ _: 1
399
+ }, 8, ["modelValue"]);
400
+ };
401
+ }
402
+ }), jt = { class: "flex flex-col py-8" }, zt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, Gt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1" }, Jt = {
403
+ key: 0,
404
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1"
405
+ }, Xt = { class: "pt-8" }, Te = "ReceiveRequestViewSearchCriteria", _a = /* @__PURE__ */ te({
406
+ __name: "ReceiveRequestView",
407
+ setup(T) {
408
+ const { t: v } = vt(), i = ot();
409
+ gt().fetchTemplates(), K.object({
410
+ name: K.string().optional().nullable(),
411
+ startDate: K.string().optional().nullable(),
412
+ endDate: K.string().optional().nullable()
413
+ });
414
+ const e = w(
415
+ () => !S._currentLocation || a.loading.value
416
+ ), t = et(), f = pt(), b = $e();
417
+ function o() {
418
+ const h = {
419
+ name: "",
420
+ ...xe()
421
+ }, p = t.getItem(Te);
422
+ if (!p)
423
+ return h;
424
+ try {
425
+ return JSON.parse(p);
426
+ } catch {
427
+ return h;
428
+ }
429
+ }
430
+ function d() {
431
+ t.setItem(Te, JSON.stringify(l.value));
432
+ }
433
+ const l = q(o()), a = Ye(
434
+ re.RECEIVE_REQUEST,
435
+ l.value
436
+ ), {
437
+ columnDefs: O,
438
+ showCustomPrintDialog: N,
439
+ customPrintHtml: M,
440
+ customPrintTemplateName: s,
441
+ customPrintIsDefault: n
442
+ } = je(
443
+ re.RECEIVE_REQUEST,
444
+ a,
445
+ a.shipments
446
+ ), S = Re();
447
+ async function H() {
448
+ var g;
449
+ const h = `inventory-record_${ee(l.value.startDate).format("DD-MM-YYYY_HH-mm")}-${ee(l.value.endDate).format("DD-MM-YYYY_HH-mm")}.xlsx`, p = ((g = S._currentLocation) == null ? void 0 : g.name) ?? "", m = We(
450
+ a.purchaseOrders.value.map(($) => ({ po: $, destination: p })),
451
+ { backdate: f.enableBackdatePo, totalCost: f.enableTotalCost }
452
+ );
453
+ await Ze([m], h), i.open({
454
+ title: v("inventory.transfer.receiveRequest.export.success"),
455
+ message: v("inventory.transfer.receiveRequest.export.message", [h]),
456
+ type: "success"
457
+ });
458
+ }
459
+ const Y = q(xe()), C = q("");
460
+ oe([() => Y.value], ([h]) => {
461
+ !h.startDate || !h.endDate || (l.value.startDate = h.startDate, l.value.endDate = h.endDate, a.updateDateRange(
462
+ l.value.startDate,
463
+ l.value.endDate
464
+ ), d());
465
+ }), oe([() => C.value], () => {
466
+ d();
467
+ });
468
+ function R(h) {
469
+ if (h === "create") {
470
+ if (e.value) {
471
+ i.open({
472
+ title: "Loading data...",
473
+ message: "Please wait.",
474
+ type: "info"
475
+ });
476
+ return;
477
+ }
478
+ return a.promptCreateTransferDialog();
479
+ }
480
+ if (h === "upload" && f.enableXilnexTransferNote)
481
+ return a.promptUploadTransferDialog();
482
+ if (h === "refresh")
483
+ return a.fetchData();
484
+ if (h === "export")
485
+ return H();
486
+ }
487
+ const { breakpoints: E } = st(), I = w(() => E.value.xs || E.value.sm), j = w(() => I.value ? 10 : 20), Ee = tt(), Ne = w(() => [
488
+ {
489
+ label: v("inventory.transfer.receiveRequest.actions.create"),
490
+ value: "create",
491
+ isPrimary: !0,
492
+ prependIcon: "add"
493
+ },
494
+ ...f.enableXilnexTransferNote ? [
495
+ {
496
+ label: v("inventory.common.upload"),
497
+ value: "upload"
498
+ }
499
+ ] : [],
500
+ {
501
+ label: v("inventory.common.refresh"),
502
+ value: "refresh"
503
+ },
504
+ {
505
+ label: v("inventory.common.export"),
506
+ value: "export"
507
+ }
508
+ ]), Fe = w(() => {
509
+ const h = [
510
+ {
511
+ type: "string",
512
+ key: "status",
513
+ entity: "purchaseOrder",
514
+ values: Array.from(
515
+ new Set(a.purchaseOrders.value.map((m) => m.status))
516
+ )
517
+ },
518
+ {
519
+ type: "string",
520
+ key: "transferFrom",
521
+ entity: "purchaseOrder",
522
+ values: Array.from(
523
+ new Set(a.purchaseOrders.value.map((m) => m.supplier.name).filter((m) => !!m))
524
+ )
525
+ }
526
+ ], p = [
527
+ {
528
+ type: "string",
529
+ key: "netsuiteTransactionNumber",
530
+ entity: "purchaseOrder",
531
+ values: a.purchaseOrders.value.map((m) => {
532
+ var g, $;
533
+ return ($ = (g = m.netSuite) == null ? void 0 : g.additionalInfo) == null ? void 0 : $.transactionnumber;
534
+ }).filter((m) => m != null)
535
+ },
536
+ {
537
+ type: "string",
538
+ key: "netsuiteOrderNo",
539
+ entity: "purchaseOrder",
540
+ values: a.purchaseOrders.value.map((m) => {
541
+ var g;
542
+ return (g = m.netSuite) == null ? void 0 : g.refNo;
543
+ }).filter((m) => m != null)
544
+ },
545
+ {
546
+ type: "string",
547
+ key: "netsuiteOrderId",
548
+ entity: "purchaseOrder",
549
+ values: a.purchaseOrders.value.map((m) => {
550
+ var g;
551
+ return (g = m.netSuite) == null ? void 0 : g.id;
552
+ }).filter((m) => m != null)
553
+ }
554
+ ];
555
+ return [...h, ...b.isEnabled ? p : []];
556
+ }), z = q(null), Me = w(() => {
557
+ if (!z.value)
558
+ return a.purchaseOrders.value;
559
+ const h = ht.build(z.value);
560
+ return a.purchaseOrders.value.filter((p) => {
561
+ var m, g, $, _;
562
+ return bt(
563
+ {
564
+ netsuiteTransactionNumber: (g = (m = p.netSuite) == null ? void 0 : m.additionalInfo) == null ? void 0 : g.transactionnumber,
565
+ netsuiteOrderNo: ($ = p.netSuite) == null ? void 0 : $.refNo,
566
+ netsuiteOrderId: (_ = p.netSuite) == null ? void 0 : _.id,
567
+ status: p.status,
568
+ transferFrom: p.supplier.name
569
+ },
570
+ h
571
+ );
572
+ });
573
+ });
574
+ return (h, p) => {
575
+ const m = V("FmTable");
576
+ return y(), L(at, {
577
+ title: r(v)("inventory.transfer.receiveRequest.title2"),
578
+ actions: Ne.value,
579
+ "onClick:action": R
580
+ }, {
581
+ default: A(() => {
582
+ var g, $;
583
+ return [
584
+ c("div", {
585
+ class: B([
586
+ "flex flex-col gap-8 max-h-full",
587
+ {
588
+ "p-0": I.value,
589
+ "px-24 ": !I.value
590
+ }
591
+ ])
592
+ }, [
593
+ k(ft, {
594
+ "date-range-query": "",
595
+ "date-range": Y.value,
596
+ "onUpdate:dateRange": p[0] || (p[0] = (_) => Y.value = _),
597
+ searchable: "",
598
+ "change-location": "",
599
+ search: C.value,
600
+ "onUpdate:search": p[1] || (p[1] = (_) => C.value = _),
601
+ filterable: "",
602
+ "filter-attributes": Fe.value,
603
+ filter: z.value,
604
+ "onUpdate:filter": p[2] || (p[2] = (_) => z.value = _)
605
+ }, null, 8, ["date-range", "search", "filter-attributes", "filter"]),
606
+ (y(), L(m, {
607
+ style: Le(r(Ee).tableHeight),
608
+ "column-defs": r(O),
609
+ "row-data": Me.value,
610
+ "search-value": C.value,
611
+ loading: e.value,
612
+ onRowClick: p[3] || (p[3] = (_) => r(a).promptShowTransferDetails(_.original)),
613
+ key: (g = r(S)._currentLocation) == null ? void 0 : g.dbName,
614
+ "page-size": j.value
615
+ }, {
616
+ "list-row": A((_) => [
617
+ k(ct, {
618
+ row: _,
619
+ onRowClick: r(a).promptShowTransferDetails
620
+ }, {
621
+ default: A((F) => {
622
+ var ne, le, ie, Q, ue, me, de, ce, G, pe, fe, ve, ye, J, he, be, ge, _e, X, ke;
623
+ return [
624
+ c("div", jt, [
625
+ c("div", zt, [
626
+ k(r(W), {
627
+ render: (ie = (le = (ne = F._id) == null ? void 0 : ne.column) == null ? void 0 : le.columnDef) == null ? void 0 : ie.cell,
628
+ props: (ue = (Q = F._id) == null ? void 0 : Q.getContext) == null ? void 0 : ue.call(Q)
629
+ }, null, 8, ["render", "props"])
630
+ ]),
631
+ c("div", Qt, [
632
+ k(r(W), {
633
+ render: (ce = (de = (me = F.supplier_name) == null ? void 0 : me.column) == null ? void 0 : de.columnDef) == null ? void 0 : ce.cell,
634
+ props: (pe = (G = F.supplier_name) == null ? void 0 : G.getContext) == null ? void 0 : pe.call(G)
635
+ }, null, 8, ["render", "props"])
636
+ ]),
637
+ c("div", Gt, D(_.original.items.map((Ie) => `${Ie.name}`).join(", ")), 1),
638
+ _.original.ref ? (y(), x("div", Jt, [
639
+ k(r(W), {
640
+ render: (ye = (ve = (fe = F.ref) == null ? void 0 : fe.column) == null ? void 0 : ve.columnDef) == null ? void 0 : ye.cell,
641
+ props: (he = (J = F.ref) == null ? void 0 : J.getContext) == null ? void 0 : he.call(J)
642
+ }, null, 8, ["render", "props"])
643
+ ])) : P("", !0),
644
+ c("div", Xt, [
645
+ k(r(W), {
646
+ render: (_e = (ge = (be = F.status) == null ? void 0 : be.column) == null ? void 0 : ge.columnDef) == null ? void 0 : _e.cell,
647
+ props: (ke = (X = F.status) == null ? void 0 : X.getContext) == null ? void 0 : ke.call(X)
648
+ }, null, 8, ["render", "props"])
649
+ ])
650
+ ])
651
+ ];
652
+ }),
653
+ _: 2
654
+ }, 1032, ["row", "onRowClick"])
655
+ ]),
656
+ _: 1
657
+ }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
658
+ ], 2),
659
+ (y(), L(qe, { to: "body" }, [
660
+ r(f).enablePurchaseOrderEmail ? (y(), L(Je, ae(U({ key: 0 }, r(a).emailDialogProps.value)), null, 16)) : P("", !0),
661
+ r(a).createOrderDialogProps.value ? (y(), L(Yt, ae(U({ key: 1 }, r(a).createOrderDialogProps.value)), null, 16)) : P("", !0),
662
+ k(Xe, U(r(a).transferDialogProps.value, {
663
+ onSubmitted: r(a).fetchData
664
+ }), null, 16, ["onSubmitted"]),
665
+ k(ze, U({
666
+ scope: r(re).RECEIVE_REQUEST
667
+ }, {
668
+ ...r(a).transferDetailsProps.value,
669
+ receivedMap: (($ = r(a).transferDetailsProps.value) == null ? void 0 : $.receivedMap) ?? {},
670
+ shipments: r(a).shipments.value ?? []
671
+ }, {
672
+ onSubmitted: r(a).fetchData
673
+ }), null, 16, ["scope", "onSubmitted"]),
674
+ k(Ke, ae(Ve(r(a).xilnexImportDialogProps.value)), null, 16),
675
+ k(yt, {
676
+ modelValue: r(N),
677
+ "onUpdate:modelValue": p[4] || (p[4] = (_) => Ce(N) ? N.value = _ : null),
678
+ html: r(M),
679
+ "template-name": r(s),
680
+ "is-default": r(n)
681
+ }, null, 8, ["modelValue", "html", "template-name", "is-default"])
682
+ ]))
683
+ ];
684
+ }),
685
+ _: 1
686
+ }, 8, ["title", "actions"]);
687
+ };
688
+ }
689
+ });
690
+ export {
691
+ _a as default
692
+ };