@feedmepos/mf-payment 1.5.34 → 1.5.36-dev

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 (31) hide show
  1. package/dist/{Actions.vue_vue_type_script_setup_true_lang-BMLg-uol.js → Actions.vue_vue_type_script_setup_true_lang-CSmRCpz2.js} +14 -14
  2. package/dist/{Chargeback-BkVFinyh.js → Chargeback-F4uNGOcy.js} +1 -1
  3. package/dist/{OnboardForm-B04cZaFV.js → OnboardForm-CmJck1RQ.js} +1 -1
  4. package/dist/{OnboardForm--wUvq0Bz.js → OnboardForm-DWKPrjY-.js} +1 -1
  5. package/dist/{PayoutAccount-jlCtwsaD.js → PayoutAccount-Cn7cy7kV.js} +1 -1
  6. package/dist/{PayoutAccount-E5ujCJqw.js → PayoutAccount-yNSUSaHi.js} +1 -1
  7. package/dist/Settlement-BAeQCoUt.js +610 -0
  8. package/dist/{Settlement-DJ6ETp2U.js → Settlement-CRlYjp36.js} +1 -1
  9. package/dist/{SettlementTransactions-cYUYH2RJ.js → SettlementTransactions-DEoxfkFL.js} +22 -18
  10. package/dist/{SettlementTransactions-DF2ybUos.js → SettlementTransactions-DN9uCpiR.js} +3 -3
  11. package/dist/Transaction-CvUypCQq.js +490 -0
  12. package/dist/{Transaction-A-sOT2PE.js → Transaction-HTemq8TC.js} +149 -156
  13. package/dist/{TransactionOld-DttRuS3v.js → TransactionOld-BEfflWka.js} +3 -3
  14. package/dist/api/settlement/index.d.ts +10 -4
  15. package/dist/api/transaction/index.d.ts +1 -1
  16. package/dist/{app-qtpxMy1_.js → app-D3WWgJ8i.js} +141 -132
  17. package/dist/app.js +1 -1
  18. package/dist/{assets-gWQvONT9.js → assets-t2kJFjI9.js} +72 -71
  19. package/dist/components/SettlementSelector.vue.d.ts +12 -0
  20. package/dist/components/SourceSelector.vue.d.ts +2 -0
  21. package/dist/composable/transaction/index.d.ts +4 -0
  22. package/dist/index-CPf8YYLa.js +9 -0
  23. package/dist/{index-BcmesiC4.js → index-_EfmUlsc.js} +21 -19
  24. package/dist/{index-BRhAeH7J.js → index-jfRfVr4R.js} +14 -8
  25. package/dist/model/transaction.d.ts +1 -0
  26. package/dist/package.json +1 -1
  27. package/dist/{payout-account-Ca3Ayv7S.js → payout-account-BviNeOr7.js} +1 -1
  28. package/dist/tsconfig.app.tsbuildinfo +1 -1
  29. package/package.json +1 -1
  30. package/dist/Settlement-SoOQIN8y.js +0 -490
  31. package/dist/Transaction-CbZRbUDH.js +0 -482
@@ -1,12 +1,12 @@
1
- import { defineComponent as $, resolveComponent as f, openBlock as C, createBlock as K, withCtx as i, createElementVNode as n, unref as a, ref as h, onMounted as D, watch as L, createVNode as o, toDisplayString as l, createTextVNode as d, h as k } from "vue";
1
+ import { defineComponent as $, resolveComponent as f, openBlock as C, createBlock as K, withCtx as i, createElementVNode as n, unref as a, ref as h, onMounted as R, watch as L, createVNode as o, toDisplayString as l, createTextVNode as d, h as k } from "vue";
2
2
  import { u as G } from "./index-T2CVm7-_.js";
3
3
  import "@feedmepos/ui-library";
4
4
  import { d as I } from "./dinero-CIVmXLL-.js";
5
- import { g as H, a as P, _ as U, t as q } from "./assets-gWQvONT9.js";
6
- import { t as J } from "./index-BRhAeH7J.js";
5
+ import { g as H, a as P, _ as U, t as q } from "./assets-t2kJFjI9.js";
6
+ import { t as J } from "./index-jfRfVr4R.js";
7
7
  import { _ as Q } from "./Layout.vue_vue_type_script_setup_true_lang-BKIvkgA_.js";
8
8
  import { useRouter as W } from "vue-router";
9
- import { s as X } from "./index-BcmesiC4.js";
9
+ import { s as X } from "./index-_EfmUlsc.js";
10
10
  import { useI18n as Z, useCoreStore as ee } from "@feedmepos/mf-common";
11
11
  import { h as te } from "./moment-h96o7c8I.js";
12
12
  const ae = ["src"], ne = /* @__PURE__ */ $({
@@ -69,18 +69,22 @@ const ae = ["src"], ne = /* @__PURE__ */ $({
69
69
  },
70
70
  setup(u) {
71
71
  const { t } = Z(), b = u, { isLoading: y, startAsyncCall: E } = G(!0), { currentRestaurant: M } = ee(), O = W(), m = h(), x = h([]), w = h([]);
72
- async function R(s = !1) {
72
+ async function Y(s = !1) {
73
73
  E(async () => {
74
- s || (m.value = await X.readRestaurantSettlementById(b.settlementId));
75
- const e = await J.readRestaurantTransactionsBySettlementId(b.settlementId);
74
+ s || (m.value = await X.readBusinessSettlementById(
75
+ b.settlementId
76
+ ));
77
+ const e = await J.readBusinessTransactionsBySettlementId(
78
+ b.settlementId
79
+ );
76
80
  x.value = q(e), w.value = x.value;
77
81
  });
78
82
  }
79
83
  function N() {
80
- R();
84
+ Y();
81
85
  }
82
- D(N), L(M, N);
83
- const S = h(""), Y = [
86
+ R(N), L(M, N);
87
+ const S = h(""), j = [
84
88
  {
85
89
  header: () => t("payment.settlements.dialog.feedme.id"),
86
90
  accessorKey: "id"
@@ -157,11 +161,11 @@ const ae = ["src"], ne = /* @__PURE__ */ $({
157
161
  });
158
162
  }, 700);
159
163
  }), (s, e) => {
160
- var V, A;
161
- const v = f("FmCardHeader"), g = f("FmCardSection"), T = f("FmCard"), j = f("FmSearch"), z = f("FmTable");
164
+ var V, B;
165
+ const v = f("FmCardHeader"), g = f("FmCardSection"), T = f("FmCard"), z = f("FmSearch"), D = f("FmTable");
162
166
  return C(), K(Q, {
163
167
  title: `${a(t)("payment.settlements.dialog.title")} (${(V = m.value) == null ? void 0 : V._id})`,
164
- description: `${a(t)("payment.settlements.dialog.date")}: ${a(te)((A = m.value) == null ? void 0 : A.createdAt).format("YYYY-MM-DD")}`,
168
+ description: `${a(t)("payment.settlements.dialog.date")}: ${a(te)((B = m.value) == null ? void 0 : B.createdAt).format("YYYY-MM-DD")}`,
165
169
  loading: a(y),
166
170
  onBack: a(O).back
167
171
  }, {
@@ -182,13 +186,13 @@ const ae = ["src"], ne = /* @__PURE__ */ $({
182
186
  }, null, 8, ["title"]),
183
187
  o(g, { class: "p-0" }, {
184
188
  default: i(() => {
185
- var r, c, p, B;
189
+ var r, c, p, A;
186
190
  return [
187
191
  n("b", null, l(a(t)("payment.settlements.dialog.info.transaction.for")), 1),
188
192
  d(": " + l((c = (r = m.value) == null ? void 0 : r.store) == null ? void 0 : c.event) + " ", 1),
189
193
  e[2] || (e[2] = n("br", null, null, -1)),
190
194
  n("b", null, l(a(t)("payment.settlements.dialog.info.transaction.reference")), 1),
191
- d(": " + l((B = (p = m.value) == null ? void 0 : p.store) == null ? void 0 : B.id), 1),
195
+ d(": " + l((A = (p = m.value) == null ? void 0 : p.store) == null ? void 0 : A.id), 1),
192
196
  e[3] || (e[3] = n("br", null, null, -1)),
193
197
  n("b", null, l(a(t)("payment.settlements.dialog.info.transaction.count")), 1),
194
198
  d(": " + l(x.value.length), 1)
@@ -274,19 +278,19 @@ const ae = ["src"], ne = /* @__PURE__ */ $({
274
278
  })
275
279
  ]),
276
280
  n("div", re, [
277
- o(j, {
281
+ o(z, {
278
282
  modelValue: _.value,
279
283
  "onUpdate:modelValue": e[0] || (e[0] = (r) => _.value = r),
280
284
  placeholder: a(t)("payment.settlements.dialog.search")
281
285
  }, null, 8, ["modelValue", "placeholder"])
282
286
  ]),
283
- o(z, {
287
+ o(D, {
284
288
  modelValue: S.value,
285
289
  "onUpdate:modelValue": e[1] || (e[1] = (r) => S.value = r),
286
290
  "shrink-at": !1,
287
291
  "search-value": _.value,
288
292
  "row-data": w.value,
289
- "column-defs": Y,
293
+ "column-defs": j,
290
294
  loading: a(y)
291
295
  }, null, 8, ["modelValue", "search-value", "row-data", "loading"])
292
296
  ]),
@@ -2,11 +2,11 @@ import { defineComponent as h, resolveComponent as p, openBlock as A, createBloc
2
2
  import { u as H } from "./index-T2CVm7-_.js";
3
3
  import { useDialog as U, useSnackbar as q } from "@feedmepos/ui-library";
4
4
  import { d as B } from "./dinero-CIVmXLL-.js";
5
- import { g as J, a as Q, _ as W, t as X } from "./assets-gWQvONT9.js";
6
- import { t as L } from "./index-BRhAeH7J.js";
5
+ import { g as J, a as Q, _ as W, t as X } from "./assets-t2kJFjI9.js";
6
+ import { t as L } from "./index-jfRfVr4R.js";
7
7
  import { _ as Z } from "./Layout.vue_vue_type_script_setup_true_lang-BKIvkgA_.js";
8
8
  import { useRouter as ee } from "vue-router";
9
- import { s as te } from "./index-BcmesiC4.js";
9
+ import { s as te } from "./index-_EfmUlsc.js";
10
10
  import { u as ae } from "./error-K1CakhA9.js";
11
11
  import { w as ne } from "./Modal-DB8M9o1T.js";
12
12
  import { h as oe } from "./moment-h96o7c8I.js";
@@ -0,0 +1,490 @@
1
+ import { defineComponent as w, ref as I, watch as D, onMounted as j, resolveComponent as T, unref as s, openBlock as R, createBlock as Y, createElementBlock as q, createVNode as y, withCtx as M, createElementVNode as S, Fragment as J, renderList as Q, createTextVNode as H, toDisplayString as W, isRef as E, h as F } from "vue";
2
+ import { t as C } from "./index-jfRfVr4R.js";
3
+ import { h as B } from "./moment-h96o7c8I.js";
4
+ import { useI18n as G, useCoreStore as z } from "@feedmepos/mf-common";
5
+ import { _ as X } from "./Layout.vue_vue_type_script_setup_true_lang-BKIvkgA_.js";
6
+ import { t as Z, b as ee, _ as te } from "./assets-t2kJFjI9.js";
7
+ import { u as ae } from "./index-Q0ELb0wB.js";
8
+ import { _ as ne } from "./AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js";
9
+ import { _ as re } from "./SelectAll.vue_vue_type_script_setup_true_lang-BNZTqdoF.js";
10
+ import { _ as se } from "./DateRangePicker.vue_vue_type_script_setup_true_lang-kymnzYpd.js";
11
+ import { p as oe } from "./index-Dq4IAN2N.js";
12
+ import { t as le } from "./index-DGqWjywh.js";
13
+ import { u as ie, p as x } from "./index-T2CVm7-_.js";
14
+ import { useSnackbar as ce, useDialog as ue } from "@feedmepos/ui-library";
15
+ import { _ as me, a as de, b as pe } from "./Actions.vue_vue_type_script_setup_true_lang-CSmRCpz2.js";
16
+ import { g as ye } from "./grafana-VY3mqepx.js";
17
+ import { w as O } from "./Modal-DB8M9o1T.js";
18
+ import { u as L } from "./error-K1CakhA9.js";
19
+ import { _ as fe } from "./index.vue_vue_type_script_setup_true_lang-CkzD8rQP.js";
20
+ import { u as _e } from "./index-CPf8YYLa.js";
21
+ const be = {
22
+ key: 1,
23
+ class: "inline-flex"
24
+ }, ve = { class: "relative" }, ge = { class: "sticky top-0 py-8 bg-white translate-y-[-12px]" }, Te = /* @__PURE__ */ w({
25
+ __name: "SourceSelector",
26
+ props: {
27
+ id: {},
28
+ by: {},
29
+ excludePayoutAccount: { type: Boolean },
30
+ excludeOrderingPayoutAccount: { type: Boolean },
31
+ excludeMarketingPayoutAccount: { type: Boolean },
32
+ excludeRestaurant: { type: Boolean },
33
+ excludeDevice: { type: Boolean }
34
+ },
35
+ emits: ["update:id", "update:by"],
36
+ setup(P, { emit: f }) {
37
+ const b = P, m = f, { t: o } = G(), { currentBusiness: U, readRestaurants: v } = z(), { isLoading: p, startAsyncCall: g } = ie(!0), d = I([]), u = I(), _ = I(""), A = I([]);
38
+ let N;
39
+ D(_, async () => {
40
+ N && clearTimeout(N), N = setTimeout(() => {
41
+ var i = new RegExp(_.value, "i");
42
+ A.value = d.value.filter((r) => {
43
+ const a = JSON.stringify(r);
44
+ return i.test(a);
45
+ });
46
+ }, 700);
47
+ }), D(u, () => {
48
+ var i, r;
49
+ m("update:id", (i = u.value) == null ? void 0 : i.value), m("update:by", (r = u.value) == null ? void 0 : r.by);
50
+ });
51
+ async function $() {
52
+ return g(async () => {
53
+ let i = await oe.readBusinessPayoutAccounts();
54
+ if (i.length !== 0)
55
+ return i;
56
+ });
57
+ }
58
+ async function K() {
59
+ return g(async () => {
60
+ let i = await le.getBusinessTerminals();
61
+ if (i.length !== 0)
62
+ return i;
63
+ });
64
+ }
65
+ async function k() {
66
+ p.value = !0;
67
+ const i = [];
68
+ if (!b.excludePayoutAccount) {
69
+ let r = await $();
70
+ b.excludeMarketingPayoutAccount && (r = r == null ? void 0 : r.filter((a) => a.store.event !== "MARKETING")), b.excludeOrderingPayoutAccount && (r = r == null ? void 0 : r.filter((a) => a.store.event !== "ORDERING")), i.push(
71
+ ...(r || []).map((a) => {
72
+ var h, t, e, n;
73
+ return {
74
+ by: "PAYOUT_ACCOUNT",
75
+ value: a._id,
76
+ prefix: o("payment.components.payout_account"),
77
+ type: "Payout Account - " + a.store.event,
78
+ label: ((t = (h = a.ref) == null ? void 0 : h.profile) == null ? void 0 : t.name) ?? a.ref.name,
79
+ chipLabel: "Payout Account: " + (((n = (e = a.ref) == null ? void 0 : e.profile) == null ? void 0 : n.name) ?? a.ref.name)
80
+ };
81
+ })
82
+ );
83
+ }
84
+ if (!b.excludeRestaurant) {
85
+ const r = await v();
86
+ i.push(
87
+ ...(r || []).map((a) => ({
88
+ by: "RESTAURANT",
89
+ value: a._id,
90
+ prefix: o("payment.components.restaurant"),
91
+ type: "Restaurant",
92
+ label: a.profile.name + " (" + (a.profile.code ?? "--") + ")",
93
+ chipLabel: "Restaurant: " + a.profile.name + " (" + (a.profile.code ?? "--") + ")"
94
+ }))
95
+ );
96
+ }
97
+ if (!b.excludeDevice) {
98
+ const r = await K();
99
+ i.push(
100
+ ...(r || []).map((a) => ({
101
+ by: "DEVICE",
102
+ value: a._id,
103
+ prefix: o("payment.components.device"),
104
+ type: "Device - " + a.deviceType,
105
+ label: a.deviceType === "TERMINAL" ? a.name : a.restaurant.profile.name,
106
+ chipLabel: a.deviceType + ": " + (a.deviceType === "TERMINAL" ? a.name : a.restaurant.profile.name)
107
+ }))
108
+ );
109
+ }
110
+ d.value = i, A.value = d.value, p.value = !1;
111
+ }
112
+ return j(k), D(U, k), (i, r) => {
113
+ const a = T("FmCircularProgress"), h = T("FmChip"), t = T("FmSearch"), e = T("FmMenuItem"), n = T("FmMenu");
114
+ return s(p) ? (R(), Y(a, {
115
+ key: 0,
116
+ size: "md"
117
+ })) : (R(), q("div", be, [
118
+ y(n, { "close-on-click": !0 }, {
119
+ "menu-button": M(() => {
120
+ var l;
121
+ return [
122
+ y(h, {
123
+ icon: "account_box",
124
+ label: ((l = u.value) == null ? void 0 : l.chipLabel) ?? s(o)("payment.components.select"),
125
+ removable: !!u.value,
126
+ onChipClosed: r[0] || (r[0] = (c) => u.value = void 0)
127
+ }, null, 8, ["label", "removable"])
128
+ ];
129
+ }),
130
+ default: M(() => [
131
+ S("div", ve, [
132
+ S("div", ge, [
133
+ y(t, {
134
+ "model-value": _.value,
135
+ "onUpdate:modelValue": r[1] || (r[1] = (l) => _.value = l),
136
+ placeholder: s(o)("payment.components.select")
137
+ }, null, 8, ["model-value", "placeholder"])
138
+ ]),
139
+ S("div", null, [
140
+ (R(!0), q(J, null, Q(A.value, (l) => (R(), Y(e, {
141
+ key: l.value,
142
+ label: l.label,
143
+ sublabel: l.type,
144
+ onClick: () => u.value = l
145
+ }, null, 8, ["label", "sublabel", "onClick"]))), 128))
146
+ ])
147
+ ])
148
+ ]),
149
+ _: 1
150
+ })
151
+ ]));
152
+ };
153
+ }
154
+ }), Ae = { class: "flex items-center gap-1" }, he = /* @__PURE__ */ w({
155
+ __name: "BillSeqNumber",
156
+ props: {
157
+ row: {},
158
+ data: {}
159
+ },
160
+ setup(P) {
161
+ return (f, b) => {
162
+ const m = T("FmIcon");
163
+ return R(), q("span", Ae, [
164
+ H(W(P.row.original.seqNumber) + " ", 1),
165
+ y(m, {
166
+ size: "md",
167
+ name: "check",
168
+ color: "#16a34a"
169
+ })
170
+ ]);
171
+ };
172
+ }
173
+ }), Se = { class: "flex justify-between mb-6 items-center" }, Ne = { class: "flex space-x-8 items-start" }, Ee = { class: "flex space-x-4 self-center" }, Fe = { class: "flex space-x-12 mb-6" }, je = /* @__PURE__ */ w({
174
+ __name: "Transaction",
175
+ setup(P) {
176
+ var a, h;
177
+ const f = ce(), b = ue(), { sessionUser: m } = z(), { t: o } = G(), { getBillLink: U } = _e(), v = I(), { dateRange: p, searchKey: g, status: d, id: u, by: _ } = ae({
178
+ by: "",
179
+ id: "",
180
+ searchKey: "",
181
+ status: [x.F_PAYMENT_TRANSACTION_STATUS.Enum.SUCCESS],
182
+ dateRange: {
183
+ startDate: B().startOf("day").format("YYYY-MM-DD"),
184
+ endDate: B().endOf("day").format("YYYY-MM-DD")
185
+ }
186
+ });
187
+ let A;
188
+ D(g, async () => {
189
+ A && clearTimeout(A), A = setTimeout(
190
+ () => {
191
+ var t;
192
+ return (t = v.value) == null ? void 0 : t.reset();
193
+ },
194
+ 700
195
+ );
196
+ }), D([p, d, u, _], () => {
197
+ var t;
198
+ (t = v.value) == null || t.reset();
199
+ });
200
+ const N = [
201
+ {
202
+ label: "Success",
203
+ value: x.F_PAYMENT_TRANSACTION_STATUS.Enum.SUCCESS
204
+ },
205
+ {
206
+ label: "Refunded",
207
+ value: x.F_PAYMENT_TRANSACTION_STATUS.Enum.REFUNDED
208
+ },
209
+ {
210
+ label: "Process",
211
+ value: x.F_PAYMENT_TRANSACTION_STATUS.Enum.PENDING
212
+ },
213
+ {
214
+ label: "Pending Settlement",
215
+ value: x.F_PAYMENT_TRANSACTION_STATUS.Enum.PENDING_SETTLEMENT
216
+ },
217
+ {
218
+ label: "Failed",
219
+ value: x.F_PAYMENT_TRANSACTION_STATUS.Enum.FAILED
220
+ }
221
+ ];
222
+ async function $(t, e) {
223
+ var n;
224
+ try {
225
+ const l = await C.refetchTransaction({ transactionId: t.id });
226
+ (n = v.value) == null || n.replaceData(e, l), f.open({
227
+ type: "success",
228
+ title: "Transaction queried and updated successfully."
229
+ });
230
+ } catch (l) {
231
+ f.open({
232
+ type: "error",
233
+ title: "Fail to query transaction.",
234
+ message: L(l)
235
+ });
236
+ }
237
+ }
238
+ async function K(t, e) {
239
+ O(
240
+ b,
241
+ "Refund Transaction",
242
+ "Are you sure to refund transaction? This action cannot be revert!",
243
+ async () => {
244
+ var n;
245
+ try {
246
+ const l = await C.refundTransaction({
247
+ transactionId: t.id,
248
+ reason: "portal transaction refund",
249
+ amount: t.fdoAmount
250
+ });
251
+ (n = v.value) == null || n.replaceData(e, l), f.open({
252
+ type: "success",
253
+ title: "Transaction refund request initiated."
254
+ });
255
+ } catch (l) {
256
+ f.open({
257
+ type: "error",
258
+ title: "Fail to request refund transaction.",
259
+ message: L(l)
260
+ });
261
+ }
262
+ }
263
+ );
264
+ }
265
+ async function k(t, e) {
266
+ O(
267
+ b,
268
+ "Notify Transaction",
269
+ "Are you sure to perform notify transaction?",
270
+ async () => {
271
+ try {
272
+ await C.renotifyTransaction(t.id), f.open({
273
+ type: "success",
274
+ title: "Transaction notify successfully."
275
+ });
276
+ } catch (n) {
277
+ f.open({
278
+ type: "error",
279
+ title: "Fail to notify transaction.",
280
+ message: L(n)
281
+ });
282
+ }
283
+ }
284
+ );
285
+ }
286
+ async function i(t, e) {
287
+ const n = ye([
288
+ {
289
+ type: "span",
290
+ queryKey: "transaction.id",
291
+ queryValue: t.id
292
+ }
293
+ ], t.transactionAt);
294
+ window.open(n, "_blank");
295
+ }
296
+ I("");
297
+ const r = [
298
+ {
299
+ header: () => o("payment.transactions.table.id"),
300
+ accessorKey: "id",
301
+ cell: ({ cell: t, row: e }) => {
302
+ var n, l;
303
+ return ((n = m.value) != null && n.role.isStaff || (l = m.value) != null && l.role.isAdmin) && e.original.transactionId ? e.original.id + `
304
+ ID: ` + e.original.transactionId : e.original.id;
305
+ }
306
+ },
307
+ {
308
+ header: () => o("payment.transactions.table.pay_id"),
309
+ accessorKey: "payId",
310
+ cell: ({ cell: t, row: e }) => {
311
+ const n = U(e.original);
312
+ return n ? F("a", {
313
+ href: n,
314
+ class: "text-blue-600 underline"
315
+ }, t.getValue()) : t.getValue();
316
+ }
317
+ },
318
+ {
319
+ header: () => o("payment.transactions.table.gateway_id"),
320
+ accessorKey: "gatewayTransactionId"
321
+ },
322
+ {
323
+ header: () => o("payment.transactions.table.bill_seq"),
324
+ accessorKey: "seqNumber",
325
+ cell: ({ cell: t, row: e }) => e.original.seqNumberBinded ? F(he, { row: e, data: t.getValue() }) : e.original.seqNumber
326
+ },
327
+ {
328
+ header: () => o("payment.transactions.table.gateway"),
329
+ accessorKey: "gateway",
330
+ meta: {
331
+ textAlign: "center"
332
+ },
333
+ cell: ({ cell: t, row: e }) => e.original.gateway ? F(me, { row: e, data: t.getValue() }) : ""
334
+ },
335
+ {
336
+ header: () => o("payment.transactions.table.method"),
337
+ accessorKey: "method",
338
+ meta: {
339
+ textAlign: "center"
340
+ },
341
+ cell: ({ cell: t, row: e }) => e.original.method ? F(de, { row: e, data: t.getValue() }) : ""
342
+ },
343
+ {
344
+ header: () => o("payment.transactions.table.type"),
345
+ accessorKey: "payFor",
346
+ meta: {
347
+ textAlign: "center"
348
+ }
349
+ },
350
+ {
351
+ header: () => o("payment.transactions.table.status"),
352
+ accessorKey: "status",
353
+ cell: ({ cell: t }) => F(te, { data: t.getValue() })
354
+ },
355
+ {
356
+ header: () => o("payment.transactions.table.restaurant"),
357
+ accessorKey: "restaurantId"
358
+ },
359
+ {
360
+ header: () => o("payment.transactions.table.source"),
361
+ accessorKey: "source",
362
+ cell: ({ cell: t, row: e }) => `(${e.original.sourceType}) ${e.original.source}`
363
+ },
364
+ {
365
+ header: () => o("payment.transactions.table.transaction_at"),
366
+ accessorKey: "transactionAt",
367
+ meta: {
368
+ width: "180px"
369
+ },
370
+ cell: ({ cell: t, row: e }) => e.original.status === "REFUNDED" ? e.original.refundedAt : e.original.transactionAt
371
+ },
372
+ {
373
+ header: () => o("payment.transactions.table.sales_amount"),
374
+ accessorKey: "amount",
375
+ cell: ({ cell: t, row: e }) => {
376
+ var n, l;
377
+ return ((n = m.value) != null && n.role.isStaff || (l = m.value) != null && l.role.isAdmin) && e.original.flags.isDelivery ? e.original.amount + "( " + e.original.gatewayAmount + ")" : e.original.amount;
378
+ }
379
+ }
380
+ ];
381
+ return ((a = m.value) != null && a.role.isStaff || (h = m.value) != null && h.role.isAdmin) && r.push({
382
+ header: () => o("payment.transactions.table.actions"),
383
+ accessorKey: "actions",
384
+ cell: ({ row: t }) => F(pe, {
385
+ transaction: t.original,
386
+ onAction: (e) => {
387
+ var n;
388
+ switch (e) {
389
+ case "notify":
390
+ return k(t.original, t.index);
391
+ case "query":
392
+ return $(t.original, t.index);
393
+ case "refund":
394
+ return (n = m.value) != null && n.role.isStaff ? f.open({
395
+ type: "error",
396
+ title: "You are not allowed to refund transaction."
397
+ }) : K(t.original, t.index);
398
+ case "history":
399
+ return i(t.original, t.index);
400
+ }
401
+ }
402
+ })
403
+ }), (t, e) => {
404
+ const n = T("FmSearch"), l = T("FmSelect");
405
+ return R(), Y(X, {
406
+ title: s(o)("payment.transactions.title"),
407
+ description: s(o)("payment.transactions.description"),
408
+ loading: !1
409
+ }, {
410
+ default: M(() => [
411
+ S("div", Se, [
412
+ S("div", Ne, [
413
+ y(n, {
414
+ "model-value": s(g),
415
+ "onUpdate:modelValue": e[0] || (e[0] = (c) => E(g) ? g.value = c : null),
416
+ class: "mr-8",
417
+ label: s(o)("payment.transactions.search.title"),
418
+ placeholder: s(o)("payment.transactions.search.placeholder")
419
+ }, null, 8, ["model-value", "label", "placeholder"]),
420
+ y(l, {
421
+ modelValue: s(d),
422
+ "onUpdate:modelValue": e[2] || (e[2] = (c) => E(d) ? d.value = c : null),
423
+ class: "mr-6 w-[300px]",
424
+ label: s(o)("payment.transactions.status"),
425
+ "label-mark": "required",
426
+ multiselect: "",
427
+ items: N
428
+ }, {
429
+ "prepend-menu": M(() => [
430
+ y(re, {
431
+ modelValue: s(d),
432
+ "onUpdate:modelValue": e[1] || (e[1] = (c) => E(d) ? d.value = c : null),
433
+ items: N
434
+ }, null, 8, ["modelValue"])
435
+ ]),
436
+ _: 1
437
+ }, 8, ["modelValue", "label"])
438
+ ]),
439
+ S("div", Ee, [
440
+ y(ne, {
441
+ button: {
442
+ appendIcon: "file_download",
443
+ variant: "primary",
444
+ label: s(o)("payment.transactions.button.export")
445
+ },
446
+ handler: async () => {
447
+ var V;
448
+ const c = await ((V = v.value) == null ? void 0 : V.allData());
449
+ c != null && await s(C).downloadPortalTransactionReport(s(p), s(Z)(c));
450
+ }
451
+ }, null, 8, ["button", "handler"])
452
+ ])
453
+ ]),
454
+ S("div", Fe, [
455
+ y(Te, {
456
+ id: s(u),
457
+ "onUpdate:id": e[3] || (e[3] = (c) => E(u) ? u.value = c : null),
458
+ by: s(_),
459
+ "onUpdate:by": e[4] || (e[4] = (c) => E(_) ? _.value = c : null)
460
+ }, null, 8, ["id", "by"]),
461
+ y(se, {
462
+ modelValue: s(p),
463
+ "onUpdate:modelValue": e[5] || (e[5] = (c) => E(p) ? p.value = c : null)
464
+ }, null, 8, ["modelValue"])
465
+ ]),
466
+ y(fe, {
467
+ ref_key: "controller",
468
+ ref: v,
469
+ "column-defs": r,
470
+ "rows-defs": s(ee),
471
+ paginate: (c, V) => s(C).readTransactionsV2({
472
+ limit: c,
473
+ cursor: V,
474
+ status: s(d),
475
+ by: s(_),
476
+ id: s(u),
477
+ search: s(g),
478
+ start: s(p).startDate,
479
+ end: s(p).endDate
480
+ })
481
+ }, null, 8, ["rows-defs", "paginate"])
482
+ ]),
483
+ _: 1
484
+ }, 8, ["title", "description"]);
485
+ };
486
+ }
487
+ });
488
+ export {
489
+ je as default
490
+ };