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