@feedmepos/mf-inventory-portal 0.0.23-dev.2 → 0.0.23-dev.21

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 (112) hide show
  1. package/dist/{App-DRE3c1lJ.js → App-CvIvF0fg.js} +59 -51
  2. package/dist/{ApprovalView-B4ZYcS3B.js → ApprovalView-BOn2HDVY.js} +20 -23
  3. package/dist/{BindingsDialog-Df1yrWHU.js → BindingsDialog-9qfADiSA.js} +7 -7
  4. package/dist/{BindingsPicker-BERMWh4w.js → BindingsPicker-CpV9uOqj.js} +7 -8
  5. package/dist/{BindingsTable-DRIapOWW.js → BindingsTable-BYScxUTj.js} +16 -20
  6. package/dist/ClosingDraftView-DM7-3zOd.js +1116 -0
  7. package/dist/{ClosingTemplateView-CbFn3Sdy.js → ClosingTemplateView-Cye5VPAM.js} +66 -76
  8. package/dist/{FmDroppableField-8RzKjEdL.js → FmDroppableField-AIKfZo3H.js} +1 -1
  9. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CQUsooGm.js +282 -0
  10. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BHSGZyJL.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CFQc-CBX.js} +121 -119
  11. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DH5IQchQ.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-2r8mut0B.js} +7 -7
  12. package/dist/{IngredientGroupView-DoETcEvV.js → IngredientGroupView-RNokzPJa.js} +30 -36
  13. package/dist/IngredientsView-M7K_GAEO.js +1660 -0
  14. package/dist/{IntegrationView-D1HeBiGF.js → IntegrationView-D9a8d1sO.js} +18 -20
  15. package/dist/{InventoryBindingForm-Dmz9BQ37.js → InventoryBindingForm-B0Gx5N1p.js} +1 -1
  16. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DoyqVBOd.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DEOudgKD.js} +15 -17
  17. package/dist/{InventoryBindingSummary-DrpwiRGZ.js → InventoryBindingSummary-C16Nc5aN.js} +1 -1
  18. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-yNEswIEI.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CZiypEex.js} +1 -1
  19. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-Br4_VUza.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BbYZwclN.js} +8 -8
  20. package/dist/{PurchaseOrderPrintPreview-cp671yWE.js → PurchaseOrderPrintPreview-DdKF8g0J.js} +13 -14
  21. package/dist/ReceiveRequestView-DBPRR6fz.js +4186 -0
  22. package/dist/{RecipeView-CD_dAWLo.js → RecipeView-CzUgVxKz.js} +58 -63
  23. package/dist/{StockView-DfUzFC1b.js → StockView-DCO3N1FS.js} +1338 -1446
  24. package/dist/{SupplierView-DB-zrNxh.js → SupplierView-CzV6DYSj.js} +2345 -783
  25. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-00pcY0qu.js +1228 -0
  26. package/dist/TransferTemplateView-uL5PId9-.js +1265 -0
  27. package/dist/{UnitView-BlC9-WOA.js → UnitView-d-mCs-cS.js} +40 -44
  28. package/dist/{WarehouseView-CgEY87Lo.js → WarehouseView-B7z8m-Hv.js} +67 -73
  29. package/dist/api/adjustment-template.d.ts +23 -0
  30. package/dist/api/bill.d.ts +2 -2
  31. package/dist/api/closing-draft.d.ts +6 -0
  32. package/dist/api/closing.d.ts +1 -0
  33. package/dist/api/netsuite.d.ts +69 -0
  34. package/dist/app-CTCC1zfY.js +58871 -0
  35. package/dist/app.d.ts +56 -0
  36. package/dist/app.js +2 -2
  37. package/dist/components/FmMinMaxInputRules.d.ts +4 -1
  38. package/dist/components/FmMultiselectDialogProps.d.ts +1 -0
  39. package/dist/components/row-action.enum.d.ts +1 -0
  40. package/dist/composable/defineDeepModel.d.ts +1 -1
  41. package/dist/{decimal-D7BCubZO.js → decimal-DhUR6QsF.js} +1 -1
  42. package/dist/{feature-BR-MsGYt.js → feature-DiGS5Fa4.js} +23 -9
  43. package/dist/format-unit-display-MRARpSlY.js +1210 -0
  44. package/dist/index-BSN3RnCl.js +12087 -0
  45. package/dist/netsuite-CIibMNer.js +251 -0
  46. package/dist/router/name.d.ts +2 -0
  47. package/dist/stock-COHpOTJk.js +110 -0
  48. package/dist/stores/feature.d.ts +2 -0
  49. package/dist/stores/integration/netsuite.d.ts +81 -0
  50. package/dist/stores/inventory.d.ts +1 -4
  51. package/dist/style.css +1 -1
  52. package/dist/{supplier-aBuwVukl.js → supplier-csNwTHYl.js} +15 -15
  53. package/dist/tsconfig.app.tsbuildinfo +1 -1
  54. package/dist/{use-inventory-binding-dialog-CLQ0LUmW.js → use-inventory-binding-dialog-172A48Xx.js} +10 -11
  55. package/dist/views/adjustment-template/wastage-template/WastageTemplateDetails.vue.d.ts +2 -0
  56. package/dist/views/adjustment-template/wastage-template/WastageTemplateDialog.vue.d.ts +22 -0
  57. package/dist/views/adjustment-template/wastage-template/WastageTemplatePublish.vue.d.ts +6 -0
  58. package/dist/views/adjustment-template/wastage-template/WastageTemplateView.vue.d.ts +2 -0
  59. package/dist/views/adjustment-template/wastage-template/actions.d.ts +1295 -0
  60. package/dist/views/adjustment-template/wastage-template/form/WastageTemplateForm.vue.d.ts +16 -0
  61. package/dist/views/adjustment-template/wastage-template/form/WastageTemplateItemTable.vue.d.ts +35 -0
  62. package/dist/views/adjustment-template/wastage-template/form/useAdjustmentTemplateItems.d.ts +20 -0
  63. package/dist/views/adjustment-template/wastage-template/props.d.ts +29 -0
  64. package/dist/views/adjustment-template/wastage-template/table.d.ts +1273 -0
  65. package/dist/views/closing-draft/ClosingDraftView.vue.d.ts +2 -0
  66. package/dist/views/closing-draft/components/closing-draft-action/ClosingDraftAction.vue.d.ts +22 -0
  67. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +451 -0
  68. package/dist/views/closing-draft/composables/use-closing-draft-actions.d.ts +25 -0
  69. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +2601 -0
  70. package/dist/views/closing-draft/helpers/draft-status-to-class-name.helper.d.ts +1 -0
  71. package/dist/views/closing-draft/helpers/export-draft.helper.d.ts +19 -0
  72. package/dist/views/closing-draft/helpers/get-calculated-total.helper.d.ts +4 -0
  73. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +24 -192
  74. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +24 -192
  75. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +34 -34
  76. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +1 -0
  77. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +54 -54
  78. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +54 -54
  79. package/dist/views/receive-request/helper/check-netsuite-subsidiary.helper.d.ts +1 -0
  80. package/dist/views/stock/components/StockRecordCard.vue.d.ts +1 -1
  81. package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +2 -2
  82. package/dist/views/stock/helper/compute-summary-total.d.ts +2 -2
  83. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +8 -8
  84. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +96 -96
  85. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +96 -96
  86. package/dist/{xlsx-BbtURTDy.js → xlsx-CH-bhcOL.js} +1 -1
  87. package/dist/{xlsx.util-zYS4OJFi.js → xlsx.util-4aHI7W-Z.js} +1 -1
  88. package/package.json +3 -3
  89. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-7JYNssTm.js +0 -267
  90. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-KbYSywk2.js +0 -436
  91. package/dist/FmMultiselectDialog-Da9JMCYa.js +0 -415
  92. package/dist/IngredientsView-DHAhj9pV.js +0 -1613
  93. package/dist/ReceiveRequestView-C1WBlpho.js +0 -4082
  94. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js +0 -135
  95. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-2mzqFGCz.js +0 -1144
  96. package/dist/TransferTemplateView-CaAJrqU6.js +0 -1262
  97. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  98. package/dist/app-CAyFhmAz.js +0 -33457
  99. package/dist/date2-D9i5izMt.js +0 -117
  100. package/dist/dayjs.min-SJKP9zBL.js +0 -282
  101. package/dist/defineDeepModel-DS4Shctf.js +0 -13
  102. package/dist/format-time-from-id-CUby60uW.js +0 -15
  103. package/dist/format-unit-display-D25Al2JZ.js +0 -1198
  104. package/dist/fuzzy-BryBtMz_.js +0 -41
  105. package/dist/index-ByJbUSIQ.js +0 -45
  106. package/dist/index-CFA_VFyX.js +0 -10545
  107. package/dist/index-CTvgBOum.js +0 -22280
  108. package/dist/netsuite-D0G4B60k.js +0 -146
  109. package/dist/normalizeArguments-DP7Hrren.js +0 -1552
  110. package/dist/row-action.enum-PMKMRrZR.js +0 -50
  111. package/dist/rules-DxVY0b7F.js +0 -198
  112. package/dist/use-template-enabled-locations-2-BgTiwy_3.js +0 -86
@@ -1,1144 +0,0 @@
1
- import { ref as L, computed as J, h as ce, defineComponent as Ue, resolveComponent as X, openBlock as h, createBlock as z, unref as l, isRef as Le, withCtx as ie, createElementVNode as e, createVNode as W, createElementBlock as A, Fragment as ee, toDisplayString as b, normalizeClass as ue, createCommentVNode as P, renderList as de } from "vue";
2
- import { i as je } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-KbYSywk2.js";
3
- import { j as Be, u as fe, B as R, D as Ke, c as xe, v as M, s as qe } from "./app-CAyFhmAz.js";
4
- import { t as Ve, b as Ge, h as Pe, d as De } from "./date2-D9i5izMt.js";
5
- import { F as ke, D as I, R as F } from "./row-action.enum-PMKMRrZR.js";
6
- import { useDialog as Ne, useSnackbar as Ce, useProxiedModel as He } from "@feedmepos/ui-library";
7
- import { p as ze, f as pe } from "./format-time-from-id-CUby60uW.js";
8
- import { u as Te } from "./feature-BR-MsGYt.js";
9
- import { b as Ye, u as Qe, f as Ee, P as me } from "./format-unit-display-D25Al2JZ.js";
10
- import { c as Ae } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
11
- import { i as $e, c as be, a as le, k as We, j as Je } from "./rules-DxVY0b7F.js";
12
- import { F as Xe } from "./decimal-D7BCubZO.js";
13
- import { useI18n as Fe } from "@feedmepos/mf-common";
14
- import { E as Ze } from "./empty-placeholder-wf6-BWE8.js";
15
- import { u as et } from "./netsuite-D0G4B60k.js";
16
- const Ie = Be((u, w) => {
17
- const p = fe();
18
- return {
19
- async readRequests(s) {
20
- const S = s ?? p.currentLocationDBName, O = `${u.inventoryBackendUrl}/${S}/purchase-request`;
21
- return await w.get(O);
22
- },
23
- async getPurchaseOrders({
24
- start: s,
25
- end: S
26
- }) {
27
- const O = p.currentLocationDBName, N = `${u.inventoryBackendUrl}/${O}/purchase-order`;
28
- return await w.get(`${N}?start=${s}&end=${S}`);
29
- },
30
- async getPurchaseOrderById(s) {
31
- const S = p.currentLocationDBName, O = `${u.inventoryBackendUrl}/${S}/purchase-order`;
32
- return await w.get(`${O}/${s}`);
33
- },
34
- async processPurchaseOrder(s, S) {
35
- const O = p.currentLocationDBName, N = S || O, E = `${u.inventoryBackendUrl}/${N}/purchase-order/run-operation`;
36
- return await w.put(E, s);
37
- },
38
- async createPurchaseOrder(s) {
39
- const S = p.currentLocationDBName, O = `${u.inventoryBackendUrl}/${S}/purchase-order`;
40
- return await w.post(O, s);
41
- },
42
- async updatePurchaseOrder(s) {
43
- const S = p.currentLocationDBName, O = `${u.inventoryBackendUrl}/${S}/purchase-order`;
44
- return await w.put(O, s);
45
- }
46
- };
47
- }), Me = {
48
- [R.enum.confirmDraft]: {
49
- primaryActions: {
50
- text: "Confirm draft",
51
- close: !0
52
- },
53
- title: "Confirm draft?",
54
- message: "Purchase order cannot be changed after confirm draft.",
55
- successMessage: "Purchase order draft has been confirmed"
56
- },
57
- [R.enum.cancelDraft]: {
58
- primaryActions: {
59
- text: "Cancel draft",
60
- close: !0,
61
- variant: "destructive"
62
- },
63
- title: "Cancel draft?",
64
- message: "Purchase order cannot be changed after cancelled draft.",
65
- successMessage: "Purchase order draft has been cancelled"
66
- },
67
- [R.enum.submitRequest]: {
68
- primaryActions: {
69
- text: "Submit request",
70
- close: !0
71
- },
72
- title: "Confirm draft?",
73
- message: "Purchase order cannot be changed after confirm draft.",
74
- successMessage: "Purchase order draft has been submitted"
75
- },
76
- [R.enum.completeReceive]: {
77
- primaryActions: {
78
- text: "Mark received",
79
- close: !0
80
- },
81
- title: "Mark as received",
82
- message: "Purchase order cannot be changed after it has complete receiving.",
83
- successMessage: "Purchase order has been marked as received"
84
- },
85
- [R.enum.approveRequest]: {
86
- primaryActions: {
87
- text: "Approve request",
88
- close: !0
89
- },
90
- title: "Approve request?",
91
- message: "Purchase order will be approved.",
92
- successMessage: "Purchase order has been approved"
93
- },
94
- [R.enum.rejectRequest]: {
95
- primaryActions: {
96
- text: "Reject request",
97
- close: !0,
98
- variant: "destructive"
99
- },
100
- title: "Reject request?",
101
- message: "Purchase order will be rejected.",
102
- successMessage: "Purchase order has been rejected"
103
- }
104
- }, oe = L();
105
- function kr(u, w) {
106
- const p = Ne(), s = fe(), S = Te(), O = Ye(), N = Qe(), E = L(!1), i = Ce(), U = Ie(), c = L(new Array()), d = L(
107
- w != null && w.startDate && (w != null && w.endDate) ? w : je()
108
- ), m = J(() => {
109
- const t = new Date(d.value.startDate), o = new Date(d.value.endDate);
110
- return {
111
- start: Ve(t).toISOString(),
112
- end: Ge(o).toISOString()
113
- };
114
- }), f = L(new Array()), j = Ke(), Y = L(null);
115
- async function re(t) {
116
- let o;
117
- if (S.mustUsePoTemplate && !(t != null && t.template) && (o = await O.getTemplateId(), !o))
118
- return;
119
- const g = {
120
- mode: ke.CREATE,
121
- modelValue: t || void 0,
122
- show: !0,
123
- "onUpdate:show"(_) {
124
- oe.value.show = _;
125
- },
126
- templateId: o,
127
- lastClosingDate: Y.value
128
- };
129
- oe.value = g;
130
- }
131
- function ve(t) {
132
- const o = {
133
- mode: ke.UPDATE,
134
- modelValue: xe(t),
135
- show: !0,
136
- "onUpdate:show"(g) {
137
- oe.value.show = g;
138
- },
139
- lastClosingDate: Y.value
140
- };
141
- oe.value = o;
142
- }
143
- async function G() {
144
- c.value = [], E.value = !0;
145
- try {
146
- c.value = await U.getPurchaseOrders(m.value).then((g) => g.sort((_, n) => n._id.localeCompare(_._id)));
147
- const t = await j.readLastClosing(!0), o = t == null ? void 0 : t._id;
148
- o && (Y.value = ze(o)), S.mustUsePoTemplate && await N.fetchTemplates();
149
- } catch {
150
- i.open({
151
- title: "Something went wrong",
152
- message: "Error at fetching purchase orders",
153
- type: "error"
154
- });
155
- } finally {
156
- E.value = !1;
157
- }
158
- }
159
- async function ye() {
160
- f.value = [], E.value = !0;
161
- try {
162
- f.value = await U.readRequests().then((t) => t.reverse());
163
- } catch {
164
- i.open({
165
- title: "Something went wrong",
166
- message: "Error at fetching purchase requests",
167
- type: "error"
168
- });
169
- } finally {
170
- E.value = !1;
171
- }
172
- }
173
- function Z() {
174
- switch (u) {
175
- case "receive/request":
176
- return G();
177
- case "approval":
178
- return ye();
179
- }
180
- }
181
- function he(t, o) {
182
- d.value = {
183
- startDate: t,
184
- endDate: o
185
- }, Z();
186
- }
187
- s.watchLocation(async (t) => {
188
- if (!t) {
189
- c.value = [];
190
- return;
191
- }
192
- await Z();
193
- });
194
- const Q = L(), H = L(Math.random().toString());
195
- async function a(t, o) {
196
- var v, x;
197
- const g = Math.random().toString();
198
- H.value = g;
199
- const _ = u === "receive/request" ? s.currentLocation : o == null ? void 0 : o.to, n = {
200
- poRequest: o,
201
- purchaseOrder: t,
202
- transferTo: _ == null ? void 0 : _.name,
203
- transferToDbName: _ == null ? void 0 : _.dbName,
204
- show: !0,
205
- canResubmit: !1,
206
- canApprove: u === "approval",
207
- "onUpdate:show"($) {
208
- Q.value.show = $;
209
- }
210
- };
211
- if (Q.value = n, !(o || t.status !== M.enum.REQUESTING)) {
212
- try {
213
- o = (await U.readRequests(
214
- `${t.supplier.internal}_${t.supplier._id}`
215
- )).find((D) => D.purchaseOrderId === t._id);
216
- } catch {
217
- console.error("Error at fetching po request to check");
218
- }
219
- g === H.value && (Q.value.canResubmit = !o, Q.value.transferTo = (v = o == null ? void 0 : o.to) == null ? void 0 : v.name, Q.value.transferToDbName = (x = o == null ? void 0 : o.to) == null ? void 0 : x.dbName);
220
- }
221
- }
222
- async function r(t, o, g, _) {
223
- E.value = !0;
224
- try {
225
- await U.processPurchaseOrder(
226
- {
227
- operation: o,
228
- doc: t,
229
- options: (
230
- // auto receive for supplier to warehouse
231
- (o === R.enum.confirmDraft || // auto receive for warehouse to warehouse
232
- o === R.enum.completeReceive) && S.autoReceiveWarehouse ? {
233
- autoReceive: !0
234
- } : void 0
235
- )
236
- },
237
- _
238
- ), await new Promise((x) => setTimeout(x, 1e3));
239
- const v = fe().currentLocationDBName.startsWith("restaurant_");
240
- o === R.enum.confirmDraft && t.effectiveAt && v ? i.open({
241
- title: "Success",
242
- message: `${g}. The backdate will be reflected once your POS has received this change.`,
243
- type: "success"
244
- }) : i.open({
245
- title: "Success",
246
- message: g,
247
- type: "success"
248
- });
249
- } catch (n) {
250
- i.open({
251
- title: "Something went wrong",
252
- message: "Please try again.",
253
- type: "error"
254
- }), console.error("Error when submitting PO operation", o, t, n);
255
- } finally {
256
- E.value = !1, Z();
257
- }
258
- }
259
- async function k(t, o, g) {
260
- const _ = Me[o];
261
- if (!_) {
262
- i.open({
263
- title: "Something went wrong",
264
- message: `Cannot process order: ${qe(o)}`,
265
- type: "error"
266
- });
267
- return;
268
- }
269
- const { successMessage: n, ...v } = _;
270
- p.open({
271
- title: v.title,
272
- message: v.message,
273
- primaryActions: v.primaryActions
274
- }).onPrimary(() => {
275
- r(t, o, n, g);
276
- });
277
- }
278
- return {
279
- purchaseOrders: c,
280
- purchaseRequests: f,
281
- updateDateRange: he,
282
- fetchData: Z,
283
- loading: E,
284
- transferDialogProps: oe,
285
- promptCreateTransferDialog: re,
286
- promptUpdateTransferDialog: ve,
287
- transferDetailsProps: Q,
288
- promptShowTransferDetails: a,
289
- submitAction: k
290
- };
291
- }
292
- function tt(u, w) {
293
- return w.reduce(
294
- (s, S) => {
295
- const O = S.received.find((N) => N.sku._id === u._id);
296
- return O && (s = $e(s, O.amount)), s;
297
- },
298
- Xe.toPrecision(be(0), u.unit.precision)
299
- );
300
- }
301
- function rt(u, w) {
302
- const { name: p, address: s, regNo: S } = w.doc.profile, O = {
303
- name: p,
304
- registrationNumber: S,
305
- line1: s == null ? void 0 : s.line1,
306
- line2: s == null ? void 0 : s.line2,
307
- postcode: s == null ? void 0 : s.postcode,
308
- city: s == null ? void 0 : s.city,
309
- state: s == null ? void 0 : s.state,
310
- country: s == null ? void 0 : s.country
311
- }, N = {
312
- name: u.supplier.name,
313
- registrationNumber: u.supplier.registrationNumber,
314
- line1: u.supplier.address.line1,
315
- line2: u.supplier.address.line2,
316
- postcode: u.supplier.address.postcode,
317
- city: u.supplier.address.city,
318
- state: u.supplier.address.state,
319
- country: u.supplier.address.country
320
- }, E = u.items.map((d) => {
321
- const { sku: m, measurement: f } = d, j = le(
322
- tt(d.sku, u.deliveryOrder || []),
323
- !1
324
- );
325
- return {
326
- code: m.code,
327
- description: m.name,
328
- quantity: Ee(d.quantity, m.unit, d.measurement),
329
- unit: (f == null ? void 0 : f.abbrev) || m.unit.abbrev,
330
- received: j
331
- };
332
- }), i = u.deliveryOrder.map((d) => ({
333
- createdAt: Pe(new Date(d.createdAt)),
334
- ref: d.deliveryOrderNumber,
335
- remark: d.remark || "",
336
- items: d.received.map((m) => {
337
- var f;
338
- return {
339
- code: m.sku.code,
340
- description: m.sku.name,
341
- quantity: le(m.amount),
342
- unit: ((f = m.measurement) == null ? void 0 : f.abbrev) || m.sku.unit.abbrev
343
- };
344
- })
345
- })), U = {
346
- orderNumber: u.seqNumber.toString(),
347
- createdAt: pe(u._id),
348
- ref: u.ref || "",
349
- remark: u.remark || "",
350
- buyer: O,
351
- supplier: N,
352
- items: E,
353
- status: u.status,
354
- deliveryOrders: i
355
- }, c = new URL(window.location.href);
356
- c.pathname = c.hostname.includes("inventory.feedme") ? "/receive-request/print-preview" : "/inventory/receive-request/print-preview", c.searchParams.append("data", JSON.stringify(U)), window.open(c.href, "_blank", "noreferrer");
357
- }
358
- const te = {
359
- submitRequest: {
360
- translationKey: "inventory.transfer.receiveRequest.actions.submitRequest",
361
- color: "text-fm-color-typo-primary",
362
- value: R.enum.submitRequest
363
- },
364
- confirmDraft: {
365
- translationKey: "inventory.transfer.receiveRequest.actions.confirmDraft",
366
- color: "text-fm-color-typo-primary",
367
- value: R.enum.confirmDraft
368
- },
369
- cancelDraft: {
370
- translationKey: "inventory.transfer.receiveRequest.actions.cancelDraft",
371
- color: "text-fm-color-typo-error",
372
- value: R.enum.cancelDraft
373
- },
374
- approveRequest: {
375
- translationKey: "inventory.transfer.receiveRequest.actions.approveRequest",
376
- color: "text-fm-color-typo-primary",
377
- value: R.enum.approveRequest
378
- },
379
- rejectRequest: {
380
- translationKey: "inventory.transfer.receiveRequest.actions.rejectRequest",
381
- color: "text-fm-color-typo-error",
382
- value: R.enum.rejectRequest
383
- },
384
- processRequest: {
385
- translationKey: "inventory.transfer.receiveRequest.actions.processRequest",
386
- color: "text-fm-color-typo-primary",
387
- value: R.enum.processRequest
388
- },
389
- receiveStock: {
390
- translationKey: "inventory.transfer.receiveRequest.actions.receiveStock",
391
- color: "text-fm-color-typo-primary",
392
- value: R.enum.receiveStock
393
- },
394
- completeReceive: {
395
- translationKey: "inventory.transfer.receiveRequest.actions.completeReceive",
396
- color: "text-fm-color-typo-primary",
397
- value: R.enum.completeReceive
398
- }
399
- };
400
- function Ar(u, w) {
401
- const p = fe(), { t: s } = Fe();
402
- function S(c) {
403
- switch (c.status) {
404
- case "DRAFT":
405
- return [
406
- I[F.Update],
407
- I[F.Details],
408
- c.supplier.internal === "restaurant" || c.supplier.internal === "warehouse" ? te[R.enum.submitRequest] : te[R.enum.confirmDraft],
409
- te[R.enum.cancelDraft],
410
- I[F.Print]
411
- ];
412
- case "RECEIVING":
413
- return [
414
- te[R.enum.completeReceive],
415
- I[F.Details],
416
- I[F.Print]
417
- ];
418
- case "REQUESTING":
419
- return u === "receive/request" ? [I[F.Details], I[F.Print]] : [
420
- te[R.enum.approveRequest],
421
- te[R.enum.rejectRequest],
422
- I[F.Details],
423
- I[F.Print]
424
- ];
425
- case "PROCESSING":
426
- return [I[F.Details], I[F.Print]];
427
- case "COMPLETE":
428
- case "CANCEL":
429
- default:
430
- return [I[F.Details], I[F.Print]];
431
- }
432
- }
433
- function O(c) {
434
- return Object.values(R.enum).includes(c);
435
- }
436
- async function N(c, d, m) {
437
- var j, Y;
438
- const f = xe(d);
439
- if (c === F.Print) {
440
- rt(f, p.currentLocation);
441
- return;
442
- }
443
- if (c === F.Details) {
444
- w.promptShowTransferDetails(f, m);
445
- return;
446
- }
447
- if (c === F.Update) {
448
- (j = w.promptUpdateTransferDialog) == null || j.call(w, f);
449
- return;
450
- }
451
- if (O(c)) {
452
- w.submitAction(d, c, (Y = m == null ? void 0 : m.to) == null ? void 0 : Y.dbName);
453
- return;
454
- }
455
- }
456
- function E() {
457
- return [
458
- {
459
- accessorKey: "seqNumber",
460
- header: () => s("inventory.transfer.table.seqNo"),
461
- enableSorting: !0,
462
- size: 80,
463
- sortUndefined: "last"
464
- },
465
- {
466
- accessorKey: "_id",
467
- header: () => s("inventory.transfer.table.createdAt"),
468
- cell(c) {
469
- return pe(`${c.getValue()}`);
470
- },
471
- enableSorting: !0
472
- },
473
- {
474
- accessorKey: "supplier.name",
475
- header: () => s("inventory.transfer.table.transferFrom"),
476
- enableSorting: !0,
477
- size: 200
478
- },
479
- {
480
- accessorKey: "items.length",
481
- header: () => s("inventory.transfer.table.noOfItems"),
482
- enableSorting: !1,
483
- meta: {
484
- width: "10rem"
485
- }
486
- },
487
- {
488
- accessorKey: "ref",
489
- header: () => s("inventory.transfer.table.reference"),
490
- enableSorting: !1,
491
- size: "auto"
492
- },
493
- {
494
- accessorKey: "status",
495
- header: () => s("inventory.transfer.table.status"),
496
- cell(c) {
497
- const d = s(`inventory.transfer.status.${c.getValue() ?? ""}`), m = `${c.getValue() ?? ""}`.toLocaleLowerCase("en-us");
498
- return ce(
499
- "div",
500
- {
501
- class: "flex"
502
- },
503
- ce(
504
- "div",
505
- {
506
- class: `fm-status-badge fm-status-badge-${m}`
507
- },
508
- d
509
- )
510
- );
511
- },
512
- enableSorting: !0,
513
- size: 200
514
- },
515
- {
516
- id: "action",
517
- cell(c) {
518
- const d = c.row.original, m = S(d);
519
- return Ae(m, (f) => N(f, d));
520
- },
521
- enableSorting: !1,
522
- size: 40,
523
- meta: {
524
- cellClass: "",
525
- headerClass: ""
526
- }
527
- }
528
- ];
529
- }
530
- function i() {
531
- return [
532
- {
533
- accessorKey: "purchaseOrder.seqNumber",
534
- header: () => s("inventory.transfer.table.seqNo"),
535
- enableSorting: !0,
536
- size: 80,
537
- sortUndefined: "last"
538
- },
539
- {
540
- accessorKey: "purchaseOrder._id",
541
- header: () => s("inventory.transfer.table.createdAt"),
542
- cell(c) {
543
- return pe(`${c.getValue()}`);
544
- },
545
- enableSorting: !0
546
- },
547
- {
548
- accessorKey: "to.name",
549
- header: () => s("inventory.transfer.table.transferTo"),
550
- enableSorting: !1,
551
- size: 200
552
- },
553
- {
554
- accessorKey: "purchaseOrder.items.length",
555
- header: () => s("inventory.transfer.table.noOfItems"),
556
- enableSorting: !1
557
- },
558
- {
559
- accessorKey: "purchaseOrder.ref",
560
- header: () => s("inventory.transfer.table.reference"),
561
- enableSorting: !1,
562
- size: "auto"
563
- },
564
- {
565
- accessorKey: "purchaseOrder.status",
566
- header: () => s("inventory.transfer.table.status"),
567
- cell(c) {
568
- const d = s(`inventory.transfer.status.${c.getValue() ?? ""}`), m = `${c.getValue() ?? ""}`.toLocaleLowerCase("en-us");
569
- return ce(
570
- "div",
571
- {
572
- class: "flex"
573
- },
574
- ce(
575
- "div",
576
- {
577
- class: `fm-status-badge fm-status-badge-${m}`
578
- },
579
- d
580
- )
581
- );
582
- },
583
- enableSorting: !0
584
- },
585
- {
586
- id: "action",
587
- cell(c) {
588
- const d = c.row.original, m = d.purchaseOrder ? S(d.purchaseOrder) : [];
589
- return Ae(
590
- m,
591
- (f) => d.purchaseOrder ? N(f, d.purchaseOrder, d) : void 0
592
- );
593
- },
594
- enableSorting: !1,
595
- size: 40,
596
- meta: {
597
- cellClass: "",
598
- headerClass: ""
599
- }
600
- }
601
- ];
602
- }
603
- const U = J(() => u === "receive/request" ? E() : i());
604
- return {
605
- get columnDefs() {
606
- return U.value;
607
- }
608
- };
609
- }
610
- const st = { class: "flex flex-col gap-16 w-full h-full" }, at = { class: "flex justify-between" }, nt = { class: "fm-typo-en-body-lg-600" }, ot = { class: "flex flex-col gap-8" }, lt = { class: "flex flex-col gap-4" }, ct = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, it = { class: "flex gap-1" }, ut = { class: "fm-typo-en-body-lg-600" }, dt = {
611
- key: 0,
612
- class: "flex flex-col gap-4"
613
- }, mt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ft = { class: "fm-typo-en-body-lg-600" }, pt = { class: "flex flex-col gap-4" }, vt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, yt = { class: "fm-typo-en-body-lg-600" }, ht = {
614
- key: 1,
615
- class: "flex flex-col gap-4"
616
- }, bt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, gt = { class: "fm-typo-en-body-lg-600" }, _t = {
617
- key: 2,
618
- class: "flex flex-col gap-4"
619
- }, wt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Rt = { class: "fm-typo-en-body-lg-600" }, St = {
620
- key: 3,
621
- class: "flex flex-col gap-4"
622
- }, Ot = { class: "fm-typo-en-body-lg-600" }, Dt = {
623
- key: 4,
624
- class: "flex flex-col gap-4"
625
- }, kt = { class: "fm-typo-en-body-lg-600" }, At = {
626
- key: 5,
627
- class: "flex flex-col gap-4"
628
- }, xt = { class: "fm-typo-en-body-lg-600" }, qt = {
629
- key: 6,
630
- class: "flex flex-col gap-4"
631
- }, Pt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Nt = { class: "fm-typo-en-body-lg-600" }, Ct = {
632
- key: 7,
633
- class: "flex flex-col gap-4"
634
- }, Tt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Et = { class: "fm-typo-en-body-lg-600" }, $t = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Ft = { class: "flex flex-col gap-8" }, It = { class: "fm-typo-en-body-lg-600" }, Mt = { class: "flex w-full gap-4" }, Ut = { class: "basis-1/2 shrink-0 grow fm-typo-en-body-lg-400 line-clamp-2" }, Lt = { class: "fm-typo-en-body-lg-600 line-clamp-2" }, jt = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, Bt = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-1" }, Kt = {
635
- key: 0,
636
- class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
637
- }, Vt = {
638
- key: 1,
639
- class: "flex-1 xs:w-screen xs:max-w-full"
640
- }, Gt = {
641
- key: 0,
642
- class: "flex flex-col items-center gap-8 h-full"
643
- }, Ht = ["src"], zt = { class: "fm-typo-en-body-lg-600" }, Yt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, Qt = {
644
- key: 1,
645
- class: "px-4 flex flex-col"
646
- }, Wt = { class: "flex gap-12 content-stretch" }, Jt = {
647
- class: "flex flex-col w-24",
648
- name: "circles"
649
- }, Xt = { class: "flex-1 flex flex-col items-center" }, Zt = { class: "flex-1 flex flex-col items-center" }, er = {
650
- class: "py-12 flex flex-col gap-4",
651
- name: "received-at header"
652
- }, tr = { class: "fm-typo-en-body-lg-400" }, rr = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, sr = { class: "flex gap-12 content-stretch" }, ar = {
653
- class: "flex flex-col w-24",
654
- name: "circles"
655
- }, nr = { class: "flex-1 flex flex-col items-center" }, or = {
656
- class: "py-12 flex flex-col gap-4 flex-1",
657
- name: "delivery details"
658
- }, lr = { class: "flex flex-col gap-8" }, cr = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ir = { class: "flex flex-col gap-4" }, ur = { class: "flex gap-8 xs:flex-col" }, xr = /* @__PURE__ */ Ue({
659
- __name: "TransferDetails",
660
- props: {
661
- poRequest: {},
662
- purchaseOrder: {},
663
- transferTo: {},
664
- transferToDbName: {},
665
- show: { type: Boolean },
666
- canResubmit: { type: Boolean },
667
- canApprove: { type: Boolean }
668
- },
669
- emits: ["update:show", "submitted"],
670
- setup(u, { emit: w }) {
671
- const p = u, s = w, S = Ne(), O = Ce(), N = et(), E = Te(), { t: i } = Fe(), U = J(
672
- () => {
673
- var a, r, k, t;
674
- return ((r = (a = p.purchaseOrder) == null ? void 0 : a.supplier) == null ? void 0 : r.internal) === "restaurant" || ((t = (k = p.purchaseOrder) == null ? void 0 : k.supplier) == null ? void 0 : t.internal) === "warehouse" ? me.TRANSFER : me.PURCHASE;
675
- }
676
- ), c = [
677
- {
678
- label: i("inventory.transfer.receiveRequest.details.overview"),
679
- value: "overview"
680
- },
681
- {
682
- label: i("inventory.transfer.receiveRequest.details.deliveryHistory"),
683
- value: "deliveryHistory"
684
- }
685
- ], d = L(c[0]), m = L(!1), f = L(""), j = L(!0), Y = Ie(), re = He(p, "show");
686
- async function ve(a, r, k) {
687
- f.value = r, m.value = !0, j.value = !1;
688
- try {
689
- await Y.processPurchaseOrder(
690
- {
691
- operation: r,
692
- doc: a,
693
- options: (
694
- // auto receive for supplier to warehouse
695
- (r === R.enum.confirmDraft || // auto receive for warehouse to warehouse
696
- r === R.enum.completeReceive) && E.autoReceiveWarehouse ? {
697
- autoReceive: !0
698
- } : void 0
699
- )
700
- },
701
- p.transferToDbName
702
- ), await new Promise((t) => setTimeout(t, 1e3)), O.open({
703
- title: "Success",
704
- message: k,
705
- type: "success"
706
- }), s("update:show", !1), s("submitted");
707
- } catch (t) {
708
- O.open({
709
- title: "Something went wrong",
710
- message: "Please try again.",
711
- type: "error"
712
- }), console.error("Error when submitting PO operation", r, a, t);
713
- } finally {
714
- f.value = "", m.value = !1, j.value = !0;
715
- }
716
- }
717
- async function G(a) {
718
- const r = Me[a];
719
- if (!r) {
720
- O.open({
721
- title: "Something went wrong",
722
- message: `Cannot process order: ${qe(a)}`,
723
- type: "error"
724
- });
725
- return;
726
- }
727
- const { successMessage: k, ...t } = r;
728
- S.open({
729
- title: t.title,
730
- message: t.message,
731
- primaryActions: t.primaryActions
732
- }).onPrimary(() => {
733
- p.purchaseOrder && ve(p.purchaseOrder, a, k);
734
- });
735
- }
736
- const ye = J(() => {
737
- var a, r;
738
- return ((a = p.purchaseOrder) == null ? void 0 : a.status) === M.enum.RECEIVING || ((r = p.purchaseOrder) == null ? void 0 : r.status) === M.enum.COMPLETE;
739
- }), Z = J(
740
- () => {
741
- var a, r, k, t, o, g;
742
- return N.getLocationSubsidiary(
743
- ((k = (r = (a = p.purchaseOrder) == null ? void 0 : a.netSuite) == null ? void 0 : r.subsidiary) == null ? void 0 : k.id) || ((g = (o = (t = p.poRequest) == null ? void 0 : t.netSuite) == null ? void 0 : o.subsidiary) == null ? void 0 : g.id)
744
- ).fullName;
745
- }
746
- ), he = J(() => {
747
- var a, r, k, t, o, g;
748
- return (r = (a = p.purchaseOrder) == null ? void 0 : a.deliveryFullfillment) != null && r.length && ((t = (k = p.purchaseOrder) == null ? void 0 : k.deliveryFullfillment) == null ? void 0 : t.length) > 0 ? (g = (o = p.purchaseOrder) == null ? void 0 : o.deliveryFullfillment) == null ? void 0 : g.map((_) => {
749
- var n;
750
- return (n = _.netSuite) == null ? void 0 : n.refNo;
751
- }).join(", ") : "-";
752
- }), Q = J(() => {
753
- var g, _, n;
754
- const k = (((g = p.purchaseOrder) == null ? void 0 : g.deliveryOrder) ?? []).flatMap((v) => v.received ?? []).reduce(
755
- (v, x) => {
756
- const $ = v[x.sku._id] ?? [];
757
- return v[x.sku._id] = [...$, x], v;
758
- },
759
- {}
760
- ), t = Object.entries(k).reduce(
761
- (v, [x, $]) => {
762
- const D = $.reduce((y, q) => {
763
- const C = We(
764
- y,
765
- Math.max(y.precision, q.amount.precision)
766
- );
767
- return $e(C, q.amount);
768
- }, be(0));
769
- return v[x] = D, v;
770
- },
771
- {}
772
- ), o = ((_ = p.purchaseOrder) == null ? void 0 : _.items) ?? [];
773
- for (const v of o)
774
- t[n = v.sku._id] ?? (t[n] = be(0));
775
- return t;
776
- }), H = J(() => {
777
- var g, _;
778
- const a = ((g = p.purchaseOrder) == null ? void 0 : g.deliveryOrder) ?? [], r = ((_ = p.purchaseOrder) == null ? void 0 : _.deliveryFullfillment) ?? [], k = [
779
- ...a.map((n) => ({
780
- createdAt: n.createdAt,
781
- type: "grn",
782
- doc: n
783
- })),
784
- ...r.map((n) => ({
785
- createdAt: n.createdAt,
786
- type: "fulfillment",
787
- doc: n
788
- }))
789
- ];
790
- k.reverse().sort((n, v) => n.createdAt.localeCompare(v.createdAt));
791
- function t(n) {
792
- var x, $, D, y, q, C, B;
793
- const v = r.findIndex((T) => T.id === n.fullfillmentId);
794
- return {
795
- header: "Received",
796
- date: De(new Date(n.createdAt)),
797
- info: [
798
- {
799
- label: "Received by",
800
- values: [(x = n.createdBy) == null ? void 0 : x.name]
801
- },
802
- {
803
- label: "Received items",
804
- values: n.received.map((T) => {
805
- var K;
806
- return `(${T.sku.code}) ${T.sku.name}: ${le(T.amount, !1)} ${((K = T.measurement) == null ? void 0 : K.abbrev) ?? T.sku.unit.abbrev}`;
807
- })
808
- },
809
- n.deliveryOrderNumber ? {
810
- label: "Delivery order no.",
811
- values: [n.deliveryOrderNumber]
812
- } : null,
813
- n.remark ? {
814
- label: "Remark",
815
- values: [n.remark]
816
- } : null,
817
- v > -1 ? {
818
- label: "Fulfilment's sequence",
819
- values: [`${v + 1}`]
820
- } : null,
821
- (D = ($ = r[v]) == null ? void 0 : $.netSuite) != null && D.refNo ? {
822
- label: "Fulfillment's ref no. (Netsuite)",
823
- values: [(q = (y = r[v]) == null ? void 0 : y.netSuite) == null ? void 0 : q.refNo]
824
- } : null,
825
- (C = n == null ? void 0 : n.netSuite) != null && C.refNo ? {
826
- label: "Item receipt (Netsuite)",
827
- values: [(B = n == null ? void 0 : n.netSuite) == null ? void 0 : B.refNo]
828
- } : null
829
- ].filter((T) => T)
830
- };
831
- }
832
- function o(n) {
833
- var x, $;
834
- const v = r.findIndex((D) => D.id === n.id);
835
- return {
836
- header: "Fulfillment",
837
- date: De(new Date(n.createdAt)),
838
- info: [
839
- {
840
- label: "Sequence",
841
- values: [String(v + 1)]
842
- },
843
- {
844
- label: "Receiveable items",
845
- values: n.items.map((D) => {
846
- var y;
847
- return `(${D.sku.code}) ${D.sku.name}: ${le(D.amount, !1)} ${((y = D.measurement) == null ? void 0 : y.abbrev) ?? D.sku.unit.abbrev}`;
848
- })
849
- },
850
- (x = n.netSuite) != null && x.refNo ? {
851
- label: "Ref no. (Netsuite)",
852
- values: [($ = n.netSuite) == null ? void 0 : $.refNo]
853
- } : null
854
- ].filter((D) => D)
855
- };
856
- }
857
- return k.map((n) => {
858
- switch (n.type) {
859
- case "grn":
860
- return t(n.doc);
861
- case "fulfillment":
862
- return o(n.doc);
863
- }
864
- });
865
- });
866
- return (a, r) => {
867
- var x, $;
868
- const k = X("FmButtonGroup"), t = X("FmChip"), o = X("FmMenuDivider"), g = X("FmCard"), _ = X("FmSpacer"), n = X("FmButton"), v = X("FmSideSheet");
869
- return h(), z(v, {
870
- header: l(i)("inventory.transfer.receiveRequest.details.title") + ((x = a.purchaseOrder) != null && x.seqNumber ? ` #${($ = a.purchaseOrder) == null ? void 0 : $.seqNumber}` : ""),
871
- modelValue: l(re),
872
- "onUpdate:modelValue": r[9] || (r[9] = (D) => Le(re) ? re.value = D : null),
873
- "dismiss-away": j.value,
874
- "close-button": "",
875
- "max-width": 500
876
- }, {
877
- default: ie(() => {
878
- var D;
879
- return [
880
- e("div", st, [
881
- e("div", null, [
882
- W(k, {
883
- items: c,
884
- modelValue: d.value,
885
- "onUpdate:modelValue": r[0] || (r[0] = (y) => d.value = y)
886
- }, null, 8, ["modelValue"])
887
- ]),
888
- d.value.value === "overview" ? (h(), A(ee, { key: 0 }, [
889
- e("div", null, [
890
- W(g, {
891
- variant: "outlined",
892
- class: "flex flex-col gap-8 px-12 py-16"
893
- }, {
894
- default: ie(() => {
895
- var y, q, C, B, T, K, se, ae, ne, V, ge, _e, we, Re, Se, Oe;
896
- return [
897
- e("div", at, [
898
- e("div", nt, b(l(i)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
899
- e("div", null, [
900
- W(t, {
901
- label: l(i)(`inventory.transfer.status.${(y = a.purchaseOrder) == null ? void 0 : y.status}`),
902
- class: ue(`fm-status-badge fm-status-badge-${(C = (q = a.purchaseOrder) == null ? void 0 : q.status) == null ? void 0 : C.toLocaleLowerCase("en-us")}`),
903
- compact: ""
904
- }, null, 8, ["label", "class"])
905
- ])
906
- ]),
907
- W(o),
908
- e("div", ot, [
909
- e("div", lt, [
910
- e("div", ct, [
911
- e("div", it, b(l(i)("inventory.transfer.receiveRequest.details.createdAt")), 1)
912
- ]),
913
- e("div", ut, b(l(pe)(((B = a.purchaseOrder) == null ? void 0 : B._id) ?? "")), 1)
914
- ]),
915
- (T = a.purchaseOrder) != null && T.effectiveAt ? (h(), A("div", dt, [
916
- e("div", mt, b(l(i)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
917
- e("div", ft, b(l(Pe)(new Date((K = a.purchaseOrder) == null ? void 0 : K.effectiveAt))), 1)
918
- ])) : P("", !0),
919
- e("div", pt, [
920
- e("div", vt, b(l(i)("inventory.transfer.receiveRequest.details.type.title")), 1),
921
- e("div", yt, b(l(i)(
922
- `inventory.transfer.receiveRequest.details.type.${U.value.toLocaleLowerCase("en-US")}`
923
- )), 1)
924
- ]),
925
- (ae = (se = a.purchaseOrder) == null ? void 0 : se.supplier) != null && ae.name ? (h(), A("div", ht, [
926
- e("div", bt, b(l(i)("inventory.transfer.receiveRequest.details.from")), 1),
927
- e("div", gt, b((V = (ne = a.purchaseOrder) == null ? void 0 : ne.supplier) == null ? void 0 : V.name), 1)
928
- ])) : P("", !0),
929
- a.transferTo ? (h(), A("div", _t, [
930
- e("div", wt, b(l(i)("inventory.transfer.receiveRequest.details.to")), 1),
931
- e("div", Rt, b(a.transferTo), 1)
932
- ])) : P("", !0),
933
- l(N).isEnabled ? (h(), A("div", St, [
934
- r[10] || (r[10] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite Subsidiary ", -1)),
935
- e("div", Ot, b(Z.value || "-"), 1)
936
- ])) : P("", !0),
937
- l(N).isEnabled ? (h(), A("div", Dt, [
938
- r[11] || (r[11] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite Transfer Order ", -1)),
939
- e("div", kt, b(((_e = (ge = a.purchaseOrder) == null ? void 0 : ge.netSuite) == null ? void 0 : _e.id) || ((Re = (we = a.poRequest) == null ? void 0 : we.netSuite) == null ? void 0 : Re.id) || "-"), 1)
940
- ])) : P("", !0),
941
- l(N).isEnabled ? (h(), A("div", At, [
942
- r[12] || (r[12] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite Fulfilment IDs ", -1)),
943
- e("div", xt, b(he.value), 1)
944
- ])) : P("", !0),
945
- (Se = a.purchaseOrder) != null && Se.ref ? (h(), A("div", qt, [
946
- e("div", Pt, b(l(i)("inventory.transfer.receiveRequest.details.reference")), 1),
947
- e("div", Nt, b(a.purchaseOrder.ref), 1)
948
- ])) : P("", !0),
949
- (Oe = a.purchaseOrder) != null && Oe.remark ? (h(), A("div", Ct, [
950
- e("div", Tt, b(l(i)("inventory.transfer.receiveRequest.details.remark")), 1),
951
- e("div", Et, b(a.purchaseOrder.remark), 1)
952
- ])) : P("", !0)
953
- ])
954
- ];
955
- }),
956
- _: 1
957
- })
958
- ]),
959
- e("div", $t, [
960
- e("div", Ft, [
961
- e("div", It, b(ye.value ? l(i)("inventory.transfer.receiveRequest.details.receivedItems") : l(i)("inventory.transfer.receiveRequest.details.requestedItems")), 1),
962
- (h(!0), A(ee, null, de(((D = a.purchaseOrder) == null ? void 0 : D.items) ?? [], (y) => (h(), A("div", {
963
- key: y.code,
964
- class: "flex flex-col"
965
- }, [
966
- e("div", Mt, [
967
- e("div", Ut, b(y.name), 1),
968
- e("div", Lt, b(l(le)(Q.value[y.sku._id], !1)) + "/" + b(l(Ee)(y.quantity, y.sku.unit, y.measurement)), 1)
969
- ]),
970
- e("div", jt, [
971
- e("div", Bt, b(y.code), 1),
972
- y.totalCost && l(E).enableTotalCost ? (h(), A("div", Kt, " (" + b(l(Je)(y.totalCost)) + ") ", 1)) : P("", !0)
973
- ])
974
- ]))), 128))
975
- ])
976
- ])
977
- ], 64)) : P("", !0),
978
- d.value.value === "deliveryHistory" ? (h(), A("div", Vt, [
979
- H.value.length ? (h(), A("div", Qt, [
980
- (h(!0), A(ee, null, de(H.value, (y, q) => (h(), A(ee, { key: q }, [
981
- e("div", Wt, [
982
- e("div", Jt, [
983
- e("div", Xt, [
984
- e("div", {
985
- class: ue([
986
- {
987
- "bg-fm-color-primary": q !== 0,
988
- "bg-white": q === 0
989
- },
990
- "w-[2px] h-full"
991
- ])
992
- }, null, 2)
993
- ]),
994
- r[13] || (r[13] = e("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
995
- e("div", Zt, [
996
- e("div", {
997
- class: ue([
998
- {
999
- "bg-fm-color-primary": q < H.value.length - 1,
1000
- "bg-white": q >= H.value.length - 1
1001
- },
1002
- "w-[2px] h-full"
1003
- ])
1004
- }, null, 2)
1005
- ])
1006
- ]),
1007
- e("div", er, [
1008
- e("div", tr, b(y.header), 1),
1009
- e("div", rr, b(y.date), 1)
1010
- ])
1011
- ]),
1012
- e("div", sr, [
1013
- e("div", ar, [
1014
- e("div", nr, [
1015
- e("div", {
1016
- class: ue([
1017
- {
1018
- "bg-fm-color-primary": q < H.value.length - 1,
1019
- "bg-white": q >= H.value.length - 1
1020
- },
1021
- "w-[2px] h-full"
1022
- ])
1023
- }, null, 2)
1024
- ])
1025
- ]),
1026
- e("div", or, [
1027
- W(g, {
1028
- variant: "outlined",
1029
- class: "py-12 px-16"
1030
- }, {
1031
- default: ie(() => [
1032
- e("div", lr, [
1033
- (h(!0), A(ee, null, de(y.info, (C, B) => (h(), A("div", {
1034
- key: B,
1035
- class: "flex flex-col gap-4"
1036
- }, [
1037
- e("div", cr, b(C == null ? void 0 : C.label), 1),
1038
- e("div", ir, [
1039
- (h(!0), A(ee, null, de(C == null ? void 0 : C.values, (T, K) => (h(), A("div", {
1040
- key: K,
1041
- class: "fm-typo-en-body-lg-600"
1042
- }, b(T), 1))), 128))
1043
- ])
1044
- ]))), 128))
1045
- ])
1046
- ]),
1047
- _: 2
1048
- }, 1024)
1049
- ])
1050
- ])
1051
- ], 64))), 128))
1052
- ])) : (h(), A("div", Gt, [
1053
- W(_),
1054
- e("div", null, [
1055
- e("img", {
1056
- src: l(Ze),
1057
- alt: "List is empty"
1058
- }, null, 8, Ht)
1059
- ]),
1060
- e("div", zt, b(l(i)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
1061
- e("div", Yt, b(l(i)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
1062
- W(_),
1063
- W(_)
1064
- ]))
1065
- ])) : P("", !0)
1066
- ])
1067
- ];
1068
- }),
1069
- "side-sheet-footer": ie(() => {
1070
- var D, y, q, C, B, T, K, se, ae, ne;
1071
- return [
1072
- e("div", ur, [
1073
- ((D = a.purchaseOrder) == null ? void 0 : D.status) === l(M).enum.DRAFT && U.value === l(me).PURCHASE ? (h(), z(n, {
1074
- key: 0,
1075
- label: l(i)("inventory.transfer.receiveRequest.actions.confirmDraft"),
1076
- onClick: r[1] || (r[1] = (V) => G("confirmDraft")),
1077
- loading: f.value === "confirmDraft",
1078
- disabled: f.value !== "confirmDraft" && m.value
1079
- }, null, 8, ["label", "loading", "disabled"])) : P("", !0),
1080
- ((y = a.purchaseOrder) == null ? void 0 : y.status) === l(M).enum.DRAFT && U.value === l(me).TRANSFER ? (h(), z(n, {
1081
- key: 1,
1082
- label: l(i)("inventory.transfer.receiveRequest.actions.submitRequest"),
1083
- onClick: r[2] || (r[2] = (V) => G("submitRequest")),
1084
- loading: f.value === "submitRequest",
1085
- disabled: f.value !== "submitRequest" && m.value
1086
- }, null, 8, ["label", "loading", "disabled"])) : P("", !0),
1087
- ((q = a.purchaseOrder) == null ? void 0 : q.status) === l(M).enum.DRAFT ? (h(), z(n, {
1088
- key: 2,
1089
- label: l(i)("inventory.transfer.receiveRequest.actions.cancelDraft"),
1090
- onClick: r[3] || (r[3] = (V) => G("cancelDraft")),
1091
- loading: f.value === "cancelDraft",
1092
- disabled: f.value !== "cancelDraft" && m.value,
1093
- variant: "destructive"
1094
- }, null, 8, ["label", "loading", "disabled"])) : P("", !0),
1095
- ((C = a.purchaseOrder) == null ? void 0 : C.status) === l(M).enum.RECEIVING ? (h(), z(n, {
1096
- key: 3,
1097
- label: l(i)("inventory.transfer.receiveRequest.actions.completeReceive"),
1098
- onClick: r[4] || (r[4] = (V) => G("completeReceive")),
1099
- loading: f.value === "completeReceive",
1100
- disabled: f.value !== "completeReceive" && m.value
1101
- }, null, 8, ["label", "loading", "disabled"])) : P("", !0),
1102
- a.canResubmit ? (h(), z(n, {
1103
- key: 4,
1104
- label: l(i)("inventory.transfer.receiveRequest.actions.resubmitRequest"),
1105
- onClick: r[5] || (r[5] = (V) => G("submitRequest")),
1106
- loading: f.value === "submitRequest",
1107
- disabled: f.value !== "submitRequest" && m.value
1108
- }, null, 8, ["label", "loading", "disabled"])) : P("", !0),
1109
- (((B = a.purchaseOrder) == null ? void 0 : B.status) === l(M).enum.REQUESTING || ((T = a.purchaseOrder) == null ? void 0 : T.status) === l(M).enum.PROCESSING) && a.canApprove ? (h(), z(n, {
1110
- key: 5,
1111
- label: l(i)("inventory.transfer.approval.actions.approveRequest"),
1112
- onClick: r[6] || (r[6] = (V) => G("approveRequest")),
1113
- loading: f.value === "approveRequest",
1114
- disabled: f.value !== "approveRequest" && m.value
1115
- }, null, 8, ["label", "loading", "disabled"])) : P("", !0),
1116
- ((K = a.purchaseOrder) == null ? void 0 : K.status) === l(M).enum.REQUESTING && a.canApprove ? (h(), z(n, {
1117
- key: 6,
1118
- label: l(i)("inventory.transfer.approval.actions.rejectRequest"),
1119
- onClick: r[7] || (r[7] = (V) => G("rejectRequest")),
1120
- loading: f.value === "rejectRequest",
1121
- disabled: f.value !== "rejectRequest" && m.value,
1122
- variant: "destructive"
1123
- }, null, 8, ["label", "loading", "disabled"])) : P("", !0),
1124
- ((se = a.purchaseOrder) == null ? void 0 : se.status) !== l(M).enum.COMPLETE && ((ae = a.purchaseOrder) == null ? void 0 : ae.status) !== l(M).enum.CANCEL && (((ne = a.purchaseOrder) == null ? void 0 : ne.status) !== l(M).enum.REQUESTING || a.canApprove) ? (h(), z(n, {
1125
- key: 7,
1126
- label: l(i)("common.close"),
1127
- variant: "tertiary",
1128
- onClick: r[8] || (r[8] = (V) => s("update:show", !1))
1129
- }, null, 8, ["label"])) : P("", !0)
1130
- ])
1131
- ];
1132
- }),
1133
- _: 1
1134
- }, 8, ["header", "modelValue", "dismiss-away"]);
1135
- };
1136
- }
1137
- });
1138
- export {
1139
- xr as _,
1140
- kr as a,
1141
- Ar as b,
1142
- tt as g,
1143
- Ie as u
1144
- };