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