@feedmepos/mf-payment 1.0.0-beta.3 → 1.0.0-beta.4
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/{PayoutAccount-2--U2ftW.js → PayoutAccount-5-rCbHbF.js} +1 -1
- package/dist/{PayoutAccount-NCJHAy6W.js → PayoutAccount-BJJ26W9b.js} +1 -1
- package/dist/{Settlement-Crdfq22j.js → Settlement-C49oMOGR.js} +29 -29
- package/dist/{Settlement-JHOJNkhd.js → Settlement-CHwtH6hm.js} +27 -27
- package/dist/{SettlementTransactions-BxuLXUR-.js → SettlementTransactions-B17SVmmg.js} +1 -1
- package/dist/{SettlementTransactions-daWMAmtz.js → SettlementTransactions-C_4u7wU1.js} +1 -1
- package/dist/{TerminalTransaction-CCfrLWpi.js → TerminalTransaction-CfCURihE.js} +35 -35
- package/dist/{TerminalTransaction-B-8PEfAs.js → TerminalTransaction-DdESjZJo.js} +53 -53
- package/dist/{Transaction-DRQ_uZ30.js → Transaction-CP0EdPdb.js} +48 -50
- package/dist/{Transaction-8LlOLPeZ.js → Transaction-Cl5vz12a.js} +23 -23
- package/dist/{app-aEVoN1BQ.js → app-z59f3ZZg.js} +183 -183
- package/dist/app.js +1 -1
- package/dist/package.json +1 -1
- package/dist/{payout-account-aKqgNIJX.js → payout-account-C4SX3RTt.js} +1 -1
- package/dist/{transaction-CQiT7Y_s.js → transaction-B8q7vuqN.js} +19 -12
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -1,6 +1,6 @@
|
|
1
|
-
import { defineComponent as h, openBlock as y, createElementBlock as N, unref as i, createCommentVNode as
|
2
|
-
import { c as
|
3
|
-
import { h as
|
1
|
+
import { defineComponent as h, openBlock as y, createElementBlock as N, unref as i, createCommentVNode as V, createElementVNode as I, resolveComponent as _, createBlock as R, normalizeClass as q, withCtx as b, toDisplayString as S, createVNode as c, Fragment as $, renderList as K, ref as L, watch as C, isRef as x, h as T } from "vue";
|
2
|
+
import { c as g } from "./index-CWaKb7bG.js";
|
3
|
+
import { h as w } from "./moment-h96o7c8I.js";
|
4
4
|
import { u as P } from "./index-7KNaibcq.js";
|
5
5
|
import { _ as B } from "./index.vue_vue_type_script_setup_true_lang-JdAFa8vy.js";
|
6
6
|
import { _ as G } from "./AdminLayout.vue_vue_type_script_setup_true_lang-BTmMOzwx.js";
|
@@ -12,7 +12,7 @@ import { _ as H } from "./AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvY
|
|
12
12
|
import { _ as J } from "./AutoCopyCell.vue_vue_type_script_setup_true_lang-GXPXBEf5.js";
|
13
13
|
import { useRouter as X } from "vue-router";
|
14
14
|
import { w as Z } from "./Modal-DB8M9o1T.js";
|
15
|
-
import { u as
|
15
|
+
import { u as D } from "./error-K1CakhA9.js";
|
16
16
|
import { _ as ee } from "./SelectAll.vue_vue_type_script_setup_true_lang-DA4rs3tk.js";
|
17
17
|
const te = { class: "flex" }, ae = ["src"], ne = ["src"], re = /* @__PURE__ */ h({
|
18
18
|
__name: "Gateway",
|
@@ -26,8 +26,8 @@ const te = { class: "flex" }, ae = ["src"], ne = ["src"], re = /* @__PURE__ */ h
|
|
26
26
|
key: 0,
|
27
27
|
class: "bg-fm-color-overlay-background rounded-md m-auto border-transparent w-[32px] h-[32px]",
|
28
28
|
src: i(j)
|
29
|
-
}, null, 8, ae)) :
|
30
|
-
|
29
|
+
}, null, 8, ae)) : V("", !0),
|
30
|
+
I("img", {
|
31
31
|
class: "rounded-md m-auto border-transparent w-[32px] h-[32px]",
|
32
32
|
src: i(W)(a.row.original.gateway)
|
33
33
|
}, null, 8, ne)
|
@@ -42,16 +42,16 @@ const te = { class: "flex" }, ae = ["src"], ne = ["src"], re = /* @__PURE__ */ h
|
|
42
42
|
setup(p) {
|
43
43
|
const a = p;
|
44
44
|
function m() {
|
45
|
-
return a.data ===
|
45
|
+
return a.data === g.F_TERMINAL_TRANSACTION_ACTION.Enum.process ? "!w-[16px] !h-[16px] bg-yellow-400" : a.data === g.F_TERMINAL_TRANSACTION_ACTION.Enum.failed ? "!w-[16px] !h-[16px] bg-red-400" : a.data === g.F_TERMINAL_TRANSACTION_ACTION.Enum.refunded ? "!w-[16px] !h-[16px] bg-blue-400" : "!w-[16px] !h-[16px] bg-green-400";
|
46
46
|
}
|
47
47
|
return (r, l) => {
|
48
48
|
const s = _("FmBadge");
|
49
|
-
return y(),
|
49
|
+
return y(), R(s, {
|
50
50
|
inline: "",
|
51
|
-
class:
|
51
|
+
class: q(m())
|
52
52
|
}, {
|
53
53
|
default: b(() => [
|
54
|
-
|
54
|
+
I("div", null, S(r.data.toUpperCase()), 1)
|
55
55
|
]),
|
56
56
|
_: 1
|
57
57
|
}, 8, ["class"]);
|
@@ -73,7 +73,7 @@ const te = { class: "flex" }, ae = ["src"], ne = ["src"], re = /* @__PURE__ */ h
|
|
73
73
|
onClick: s[0] || (s[0] = (f) => {
|
74
74
|
f.stopPropagation(), r();
|
75
75
|
})
|
76
|
-
},
|
76
|
+
}, S(l.data), 1));
|
77
77
|
}
|
78
78
|
}), le = /* @__PURE__ */ h({
|
79
79
|
__name: "Actions",
|
@@ -107,7 +107,7 @@ const te = { class: "flex" }, ae = ["src"], ne = ["src"], re = /* @__PURE__ */ h
|
|
107
107
|
c(l, { name: "settings" })
|
108
108
|
]),
|
109
109
|
default: b(() => [
|
110
|
-
(y(), N(
|
110
|
+
(y(), N($, null, K(a, (u) => c(s, {
|
111
111
|
selectable: !0,
|
112
112
|
key: u.label,
|
113
113
|
sublabel: u.sublabel,
|
@@ -141,7 +141,7 @@ const ce = /* @__PURE__ */ h({
|
|
141
141
|
setup(p) {
|
142
142
|
return (a, m) => {
|
143
143
|
const r = _("FmListItem"), l = _("FmList");
|
144
|
-
return y(),
|
144
|
+
return y(), R(l, { class: "w-[180px]" }, {
|
145
145
|
default: b(() => [
|
146
146
|
c(r, {
|
147
147
|
label: "Created At",
|
@@ -160,23 +160,23 @@ const ce = /* @__PURE__ */ h({
|
|
160
160
|
});
|
161
161
|
};
|
162
162
|
}
|
163
|
-
}), ue = { class: "flex justify-between mb-6 items-start" }, me = { class: "flex space-x-4 items-start" }, de = { class: "flex space-x-4" },
|
163
|
+
}), ue = { class: "flex justify-between mb-6 items-start" }, me = { class: "flex space-x-4 items-start" }, de = { class: "flex space-x-4" }, Ce = /* @__PURE__ */ h({
|
164
164
|
__name: "TerminalTransaction",
|
165
165
|
setup(p) {
|
166
|
-
const a = U(), m = Q(), r =
|
166
|
+
const a = U(), m = Q(), r = L(), { dateRange: l, status: s, searchKey: f } = P({
|
167
167
|
searchKey: "",
|
168
|
-
status: [
|
168
|
+
status: [g.F_TERMINAL_TRANSACTION_ACTION.Enum.success],
|
169
169
|
dateRange: {
|
170
|
-
startDate:
|
171
|
-
endDate:
|
170
|
+
startDate: w().startOf("day").format("YYYY-MM-DD"),
|
171
|
+
endDate: w().endOf("day").format("YYYY-MM-DD")
|
172
172
|
}
|
173
173
|
});
|
174
|
-
|
174
|
+
C([l, s], () => {
|
175
175
|
var e;
|
176
176
|
return (e = r.value) == null ? void 0 : e.reset();
|
177
177
|
});
|
178
178
|
let u;
|
179
|
-
|
179
|
+
C(f, async () => {
|
180
180
|
u && clearTimeout(u), u = setTimeout(
|
181
181
|
() => {
|
182
182
|
var e;
|
@@ -185,8 +185,8 @@ const ce = /* @__PURE__ */ h({
|
|
185
185
|
700
|
186
186
|
);
|
187
187
|
});
|
188
|
-
async function
|
189
|
-
var o, d,
|
188
|
+
async function M(e) {
|
189
|
+
var o, d, A;
|
190
190
|
const t = (d = (o = r.value) == null ? void 0 : o.pageData()) == null ? void 0 : d.at(e);
|
191
191
|
if (!t) {
|
192
192
|
a.open({
|
@@ -206,7 +206,7 @@ const ce = /* @__PURE__ */ h({
|
|
206
206
|
}
|
207
207
|
try {
|
208
208
|
const n = await F.queryTransaction(t._id);
|
209
|
-
(
|
209
|
+
(A = r.value) == null || A.replaceData(e, n), a.open({
|
210
210
|
type: "success",
|
211
211
|
title: "Transaction queried and updated successfully."
|
212
212
|
});
|
@@ -214,11 +214,11 @@ const ce = /* @__PURE__ */ h({
|
|
214
214
|
a.open({
|
215
215
|
type: "error",
|
216
216
|
title: "Fail to query transaction.",
|
217
|
-
message:
|
217
|
+
message: D(n)
|
218
218
|
});
|
219
219
|
}
|
220
220
|
}
|
221
|
-
async function
|
221
|
+
async function k(e) {
|
222
222
|
var o, d;
|
223
223
|
const t = (d = (o = r.value) == null ? void 0 : o.pageData()) == null ? void 0 : d.at(e);
|
224
224
|
if (!t) {
|
@@ -242,14 +242,14 @@ const ce = /* @__PURE__ */ h({
|
|
242
242
|
"Refund Transaction",
|
243
243
|
"Are you sure to refund transaction? This action cannot be revert!",
|
244
244
|
async () => {
|
245
|
-
var
|
245
|
+
var A;
|
246
246
|
try {
|
247
247
|
const n = await F.refundTransaction({
|
248
248
|
transactionId: t._id,
|
249
249
|
reason: "portal transaction refund",
|
250
250
|
amount: t.details.amount
|
251
251
|
});
|
252
|
-
(
|
252
|
+
(A = r.value) == null || A.replaceData(e, n), a.open({
|
253
253
|
type: "success",
|
254
254
|
title: "Transaction queried and updated successfully."
|
255
255
|
});
|
@@ -257,30 +257,30 @@ const ce = /* @__PURE__ */ h({
|
|
257
257
|
a.open({
|
258
258
|
type: "error",
|
259
259
|
title: "Fail to query transaction.",
|
260
|
-
message:
|
260
|
+
message: D(n)
|
261
261
|
});
|
262
262
|
}
|
263
263
|
}
|
264
264
|
);
|
265
265
|
}
|
266
|
-
const
|
266
|
+
const v = [
|
267
267
|
{
|
268
268
|
label: "Success",
|
269
|
-
value:
|
269
|
+
value: g.F_TERMINAL_TRANSACTION_ACTION.Enum.success
|
270
270
|
},
|
271
271
|
{
|
272
272
|
label: "Refunded",
|
273
|
-
value:
|
273
|
+
value: g.F_TERMINAL_TRANSACTION_ACTION.Enum.refunded
|
274
274
|
},
|
275
275
|
{
|
276
276
|
label: "Process",
|
277
|
-
value:
|
277
|
+
value: g.F_TERMINAL_TRANSACTION_ACTION.Enum.process
|
278
278
|
},
|
279
279
|
{
|
280
280
|
label: "Failed",
|
281
|
-
value:
|
281
|
+
value: g.F_TERMINAL_TRANSACTION_ACTION.Enum.failed
|
282
282
|
}
|
283
|
-
],
|
283
|
+
], E = function(e) {
|
284
284
|
const t = e;
|
285
285
|
let o = "-";
|
286
286
|
t.details && t.details.amount && (console.log(t._id), o = z(t.details.amount).toFormat("$0.00"));
|
@@ -295,11 +295,11 @@ const ce = /* @__PURE__ */ h({
|
|
295
295
|
gateway: e.gateway,
|
296
296
|
ecrGateway: e.ecrGateway,
|
297
297
|
amount: o,
|
298
|
-
createdAt: d ?
|
299
|
-
transactionAt: e.transactionAt ?
|
300
|
-
refundedAt: e.refundedAt ?
|
298
|
+
createdAt: d ? w(d).format("YYYY-MM-DD hh:mm:ss") : "N/A",
|
299
|
+
transactionAt: e.transactionAt ? w(e.transactionAt).format("YYYY-MM-DD hh:mm:ss") : "N/A",
|
300
|
+
refundedAt: e.refundedAt ? w(e.refundedAt).format("YYYY-MM-DD hh:mm:ss") : "N/A"
|
301
301
|
};
|
302
|
-
},
|
302
|
+
}, Y = [
|
303
303
|
{
|
304
304
|
accessorKey: "id",
|
305
305
|
header: () => "Transaction ID",
|
@@ -393,9 +393,9 @@ const ce = /* @__PURE__ */ h({
|
|
393
393
|
const o = e.index;
|
394
394
|
switch (t) {
|
395
395
|
case "query":
|
396
|
-
return
|
396
|
+
return M(o);
|
397
397
|
case "refund":
|
398
|
-
return
|
398
|
+
return k(o);
|
399
399
|
}
|
400
400
|
}
|
401
401
|
});
|
@@ -403,14 +403,14 @@ const ce = /* @__PURE__ */ h({
|
|
403
403
|
}
|
404
404
|
];
|
405
405
|
return (e, t) => {
|
406
|
-
const o = _("FmSearch"), d = _("FmSelect"),
|
407
|
-
return y(),
|
406
|
+
const o = _("FmSearch"), d = _("FmSelect"), A = _("FmSimpleDateRangePicker");
|
407
|
+
return y(), R(G, {
|
408
408
|
title: "Offline Transactions",
|
409
409
|
loading: !1
|
410
410
|
}, {
|
411
411
|
default: b(() => [
|
412
|
-
|
413
|
-
|
412
|
+
I("div", ue, [
|
413
|
+
I("div", me, [
|
414
414
|
c(o, {
|
415
415
|
"model-value": i(f),
|
416
416
|
"onUpdate:modelValue": t[0] || (t[0] = (n) => x(f) ? f.value = n : null),
|
@@ -425,24 +425,24 @@ const ce = /* @__PURE__ */ h({
|
|
425
425
|
label: "Status",
|
426
426
|
"label-mark": "required",
|
427
427
|
multiselect: "",
|
428
|
-
items:
|
428
|
+
items: v
|
429
429
|
}, {
|
430
430
|
"prepend-menu": b(() => [
|
431
431
|
c(ee, {
|
432
432
|
modelValue: i(s),
|
433
433
|
"onUpdate:modelValue": t[1] || (t[1] = (n) => x(s) ? s.value = n : null),
|
434
|
-
items:
|
434
|
+
items: v
|
435
435
|
}, null, 8, ["modelValue"])
|
436
436
|
]),
|
437
437
|
_: 1
|
438
438
|
}, 8, ["modelValue"]),
|
439
|
-
c(
|
439
|
+
c(A, {
|
440
440
|
modelValue: i(l),
|
441
441
|
"onUpdate:modelValue": t[3] || (t[3] = (n) => x(l) ? l.value = n : null),
|
442
442
|
"show-predefined-range": ""
|
443
443
|
}, null, 8, ["modelValue"])
|
444
444
|
]),
|
445
|
-
|
445
|
+
I("div", de, [
|
446
446
|
c(H, {
|
447
447
|
button: {
|
448
448
|
appendIcon: "file_download",
|
@@ -459,15 +459,15 @@ const ce = /* @__PURE__ */ h({
|
|
459
459
|
c(B, {
|
460
460
|
ref_key: "controller",
|
461
461
|
ref: r,
|
462
|
-
"column-defs":
|
463
|
-
"rows-defs":
|
462
|
+
"column-defs": Y,
|
463
|
+
"rows-defs": E,
|
464
464
|
onRowClick: t[4] || (t[4] = () => {
|
465
465
|
}),
|
466
|
-
paginate: (n,
|
466
|
+
paginate: (n, O) => i(F).readTransactions({
|
467
467
|
status: i(s),
|
468
468
|
searchKey: i(f),
|
469
469
|
limit: n,
|
470
|
-
cursor:
|
470
|
+
cursor: O,
|
471
471
|
start: i(l).startDate,
|
472
472
|
end: i(l).endDate
|
473
473
|
})
|
@@ -479,5 +479,5 @@ const ce = /* @__PURE__ */ h({
|
|
479
479
|
}
|
480
480
|
});
|
481
481
|
export {
|
482
|
-
|
482
|
+
Ce as default
|
483
483
|
};
|
@@ -1,16 +1,16 @@
|
|
1
|
-
import { defineComponent as _, resolveComponent as T, openBlock as f, createBlock as N, normalizeClass as
|
2
|
-
import { t as
|
3
|
-
import { e as
|
4
|
-
import
|
1
|
+
import { defineComponent as _, resolveComponent as T, openBlock as f, createBlock as N, normalizeClass as O, withCtx as b, createElementVNode as y, toDisplayString as V, createElementBlock as I, unref as o, ref as S, h as x, onMounted as k, watch as E, createVNode as p, isRef as F } from "vue";
|
2
|
+
import { t as D, a as C } from "./transaction-B8q7vuqN.js";
|
3
|
+
import { e as A, u as M } from "./index-CWaKb7bG.js";
|
4
|
+
import "@feedmepos/ui-library";
|
5
5
|
import "./dinero-CIVmXLL-.js";
|
6
|
-
import { h as
|
7
|
-
import { g as
|
8
|
-
import { useCoreStore as
|
9
|
-
import { _ as
|
10
|
-
import { u as
|
11
|
-
import { _ as
|
12
|
-
import { _ as
|
13
|
-
const
|
6
|
+
import { h as R } from "./moment-h96o7c8I.js";
|
7
|
+
import { g as Y, a as P } from "./assets-NrCec-W0.js";
|
8
|
+
import { useCoreStore as $ } from "@feedmepos/mf-common";
|
9
|
+
import { _ as L } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
|
10
|
+
import { u as B } from "./index-7KNaibcq.js";
|
11
|
+
import { _ as U } from "./AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js";
|
12
|
+
import { _ as G } from "./RestaurantSelector.vue_vue_type_script_setup_true_lang-CY4ttpKj.js";
|
13
|
+
const q = /* @__PURE__ */ _({
|
14
14
|
__name: "Status",
|
15
15
|
props: {
|
16
16
|
row: {},
|
@@ -19,46 +19,46 @@ const J = /* @__PURE__ */ _({
|
|
19
19
|
setup(s) {
|
20
20
|
const n = s;
|
21
21
|
function a() {
|
22
|
-
return n.data ===
|
22
|
+
return n.data === A.F_PAYMENT_TRANSACTION_STATUS.Enum.PENDING ? "!w-[16px] !h-[16px] bg-yellow-400" : n.data === A.F_PAYMENT_TRANSACTION_STATUS.Enum.FAILED ? "!w-[16px] !h-[16px] bg-red-400" : n.data === A.F_PAYMENT_TRANSACTION_STATUS.Enum.REFUNDED ? "!w-[16px] !h-[16px] bg-blue-400" : "!w-[16px] !h-[16px] bg-green-400";
|
23
23
|
}
|
24
24
|
return (l, c) => {
|
25
25
|
const d = T("FmBadge");
|
26
26
|
return f(), N(d, {
|
27
27
|
inline: "",
|
28
|
-
class:
|
28
|
+
class: O(a())
|
29
29
|
}, {
|
30
|
-
default:
|
31
|
-
y("div", null,
|
30
|
+
default: b(() => [
|
31
|
+
y("div", null, V(l.data), 1)
|
32
32
|
]),
|
33
33
|
_: 1
|
34
34
|
}, 8, ["class"]);
|
35
35
|
};
|
36
36
|
}
|
37
|
-
}),
|
37
|
+
}), J = ["src"], j = /* @__PURE__ */ _({
|
38
38
|
__name: "Gateway",
|
39
39
|
props: {
|
40
40
|
row: {},
|
41
41
|
data: {}
|
42
42
|
},
|
43
43
|
setup(s) {
|
44
|
-
return (n, a) => (f(),
|
44
|
+
return (n, a) => (f(), I("img", {
|
45
45
|
class: "rounded-md m-auto border-transparent w-[32px] h-[32px]",
|
46
|
-
src: o(
|
47
|
-
}, null, 8,
|
46
|
+
src: o(Y)(n.row.original.gateway)
|
47
|
+
}, null, 8, J));
|
48
48
|
}
|
49
|
-
}),
|
49
|
+
}), z = ["src"], Q = /* @__PURE__ */ _({
|
50
50
|
__name: "Method",
|
51
51
|
props: {
|
52
52
|
row: {},
|
53
53
|
data: {}
|
54
54
|
},
|
55
55
|
setup(s) {
|
56
|
-
return (n, a) => (f(),
|
56
|
+
return (n, a) => (f(), I("img", {
|
57
57
|
class: "rounded-md m-auto border-transparent w-[32px] h-[32px]",
|
58
|
-
src: o(
|
59
|
-
}, null, 8,
|
58
|
+
src: o(P)(n.row.original.method.issuer)
|
59
|
+
}, null, 8, z));
|
60
60
|
}
|
61
|
-
}),
|
61
|
+
}), H = /* @__PURE__ */ _({
|
62
62
|
__name: "TransactionTable",
|
63
63
|
props: {
|
64
64
|
data: {
|
@@ -72,7 +72,7 @@ const J = /* @__PURE__ */ _({
|
|
72
72
|
},
|
73
73
|
emits: ["row-click"],
|
74
74
|
setup(s, { emit: n }) {
|
75
|
-
const a = s, l = n, c =
|
75
|
+
const a = s, l = n, c = S(""), d = [
|
76
76
|
{
|
77
77
|
header: () => "Transaction ID",
|
78
78
|
accessorKey: "id"
|
@@ -87,7 +87,7 @@ const J = /* @__PURE__ */ _({
|
|
87
87
|
meta: {
|
88
88
|
textAlign: "center"
|
89
89
|
},
|
90
|
-
cell: ({ cell: t, row: e }) => e.original.method ? x(
|
90
|
+
cell: ({ cell: t, row: e }) => e.original.method ? x(j, { row: e, data: t.getValue() }) : ""
|
91
91
|
},
|
92
92
|
{
|
93
93
|
header: () => "Method",
|
@@ -95,7 +95,7 @@ const J = /* @__PURE__ */ _({
|
|
95
95
|
meta: {
|
96
96
|
textAlign: "center"
|
97
97
|
},
|
98
|
-
cell: ({ cell: t, row: e }) => e.original.method ? x(
|
98
|
+
cell: ({ cell: t, row: e }) => e.original.method ? x(Q, { row: e, data: t.getValue() }) : ""
|
99
99
|
},
|
100
100
|
{
|
101
101
|
header: () => "Type",
|
@@ -113,7 +113,7 @@ const J = /* @__PURE__ */ _({
|
|
113
113
|
{
|
114
114
|
header: () => "Status",
|
115
115
|
accessorKey: "status",
|
116
|
-
cell: ({ cell: t, row: e }) => x(
|
116
|
+
cell: ({ cell: t, row: e }) => x(q, { row: e, data: t.getValue() })
|
117
117
|
},
|
118
118
|
{
|
119
119
|
header: () => "Transaction At",
|
@@ -147,29 +147,27 @@ const J = /* @__PURE__ */ _({
|
|
147
147
|
}, null, 8, ["modelValue", "row-data", "loading"]);
|
148
148
|
};
|
149
149
|
}
|
150
|
-
}),
|
150
|
+
}), W = { class: "flex justify-between mb-6 items-center" }, X = { class: "flex space-x-8" }, Z = { class: "flex space-x-4" }, me = /* @__PURE__ */ _({
|
151
151
|
__name: "Transaction",
|
152
152
|
setup(s) {
|
153
|
-
const { dateRange: n, searchKey: a } =
|
153
|
+
const { dateRange: n, searchKey: a } = B({
|
154
154
|
searchKey: "",
|
155
155
|
dateRange: {
|
156
|
-
startDate:
|
157
|
-
endDate:
|
156
|
+
startDate: R().startOf("day").format("YYYY-MM-DD"),
|
157
|
+
endDate: R().endOf("day").format("YYYY-MM-DD")
|
158
158
|
}
|
159
|
-
}), { isLoading: l, startAsyncCall: c } =
|
160
|
-
$();
|
161
|
-
const { currentRestaurant: d } = M(), t = A([]), e = A([]);
|
159
|
+
}), { isLoading: l, startAsyncCall: c } = M(!0), { currentRestaurant: d } = $(), t = S([]), e = S([]);
|
162
160
|
async function g() {
|
163
161
|
await c(async () => {
|
164
|
-
const { startDate: h, endDate: r } = n.value, u = await
|
162
|
+
const { startDate: h, endDate: r } = n.value, u = await D.readRestaurantTransactions({
|
165
163
|
start: h,
|
166
164
|
end: r
|
167
165
|
});
|
168
166
|
if (t.value = C(u), e.value = t.value, a.value > "") {
|
169
167
|
var v = new RegExp(a.value, "i");
|
170
168
|
e.value = t.value.filter((m) => {
|
171
|
-
const
|
172
|
-
return v.test(
|
169
|
+
const K = JSON.stringify(m);
|
170
|
+
return v.test(K);
|
173
171
|
});
|
174
172
|
}
|
175
173
|
});
|
@@ -177,7 +175,7 @@ const J = /* @__PURE__ */ _({
|
|
177
175
|
function i() {
|
178
176
|
g();
|
179
177
|
}
|
180
|
-
|
178
|
+
k(i), E(d, i);
|
181
179
|
let w;
|
182
180
|
return E(a, async () => {
|
183
181
|
w && clearTimeout(w), w = setTimeout(() => {
|
@@ -189,15 +187,15 @@ const J = /* @__PURE__ */ _({
|
|
189
187
|
}, 700);
|
190
188
|
}), (h, r) => {
|
191
189
|
const u = T("FmSearch"), v = T("FmSimpleDateRangePicker");
|
192
|
-
return f(), N(
|
190
|
+
return f(), N(L, {
|
193
191
|
title: "Online Transactions",
|
194
192
|
description: "Transactions are purchases or payments made over the internet using electronic methods like cards or digital wallets.",
|
195
193
|
loading: o(l)
|
196
194
|
}, {
|
197
|
-
default:
|
198
|
-
y("div",
|
199
|
-
y("div",
|
200
|
-
p(
|
195
|
+
default: b(() => [
|
196
|
+
y("div", W, [
|
197
|
+
y("div", X, [
|
198
|
+
p(G),
|
201
199
|
p(u, {
|
202
200
|
"model-value": o(a),
|
203
201
|
"onUpdate:modelValue": r[0] || (r[0] = (m) => F(a) ? a.value = m : null),
|
@@ -213,20 +211,20 @@ const J = /* @__PURE__ */ _({
|
|
213
211
|
"show-predefined-range": ""
|
214
212
|
}, null, 8, ["modelValue"])
|
215
213
|
]),
|
216
|
-
y("div",
|
217
|
-
p(
|
214
|
+
y("div", Z, [
|
215
|
+
p(U, {
|
218
216
|
button: {
|
219
217
|
appendIcon: "file_download",
|
220
218
|
variant: "primary",
|
221
219
|
label: "Export"
|
222
220
|
},
|
223
221
|
handler: async () => {
|
224
|
-
await o(
|
222
|
+
await o(D).downloadRestaurantTransactionReport(t.value);
|
225
223
|
}
|
226
224
|
}, null, 8, ["handler"])
|
227
225
|
])
|
228
226
|
]),
|
229
|
-
p(
|
227
|
+
p(H, {
|
230
228
|
loading: o(l),
|
231
229
|
data: e.value
|
232
230
|
}, null, 8, ["loading", "data"])
|
@@ -237,5 +235,5 @@ const J = /* @__PURE__ */ _({
|
|
237
235
|
}
|
238
236
|
});
|
239
237
|
export {
|
240
|
-
|
238
|
+
me as default
|
241
239
|
};
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import { defineComponent as h, resolveComponent as _, openBlock as g, createBlock as E, normalizeClass as
|
2
|
-
import { t as w, a as
|
3
|
-
import { e as S, u as
|
4
|
-
import { useSnackbar as
|
1
|
+
import { defineComponent as h, resolveComponent as _, openBlock as g, createBlock as E, normalizeClass as Y, withCtx as x, createElementVNode as b, toDisplayString as $, createElementBlock as F, unref as m, createVNode as y, Fragment as L, renderList as B, ref as N, h as T, onMounted as U, watch as D, isRef as k } from "vue";
|
2
|
+
import { t as w, a as G, b as M } from "./transaction-B8q7vuqN.js";
|
3
|
+
import { e as S, u as J } from "./index-CWaKb7bG.js";
|
4
|
+
import { useSnackbar as Q, useDialog as j } from "@feedmepos/ui-library";
|
5
5
|
import "./dinero-CIVmXLL-.js";
|
6
|
-
import { h as
|
6
|
+
import { h as R } from "./moment-h96o7c8I.js";
|
7
7
|
import { g as z, a as H } from "./assets-NrCec-W0.js";
|
8
8
|
import { _ as W } from "./AutoCopyCell.vue_vue_type_script_setup_true_lang-GXPXBEf5.js";
|
9
9
|
import { u as X } from "./index-7KNaibcq.js";
|
@@ -26,10 +26,10 @@ const te = /* @__PURE__ */ h({
|
|
26
26
|
const s = _("FmBadge");
|
27
27
|
return g(), E(s, {
|
28
28
|
inline: "",
|
29
|
-
class:
|
29
|
+
class: Y(o())
|
30
30
|
}, {
|
31
31
|
default: x(() => [
|
32
|
-
b("div", null,
|
32
|
+
b("div", null, $(l.data), 1)
|
33
33
|
]),
|
34
34
|
_: 1
|
35
35
|
}, 8, ["class"]);
|
@@ -97,7 +97,7 @@ const te = /* @__PURE__ */ h({
|
|
97
97
|
y(f, { name: "settings" })
|
98
98
|
]),
|
99
99
|
default: x(() => [
|
100
|
-
(g(), F(
|
100
|
+
(g(), F(L, null, B(n, (e) => y(s, {
|
101
101
|
selectable: !0,
|
102
102
|
key: e.label,
|
103
103
|
sublabel: e.sublabel,
|
@@ -213,17 +213,17 @@ const te = /* @__PURE__ */ h({
|
|
213
213
|
const { dateRange: n, searchKey: o } = X({
|
214
214
|
searchKey: "",
|
215
215
|
dateRange: {
|
216
|
-
startDate:
|
217
|
-
endDate:
|
216
|
+
startDate: R().startOf("day").format("YYYY-MM-DD"),
|
217
|
+
endDate: R().endOf("day").format("YYYY-MM-DD")
|
218
218
|
}
|
219
|
-
}), { isLoading: l, startAsyncCall: f } =
|
219
|
+
}), { isLoading: l, startAsyncCall: f } = J(!0), s = Q(), r = j(), e = N([]), c = N([]);
|
220
220
|
async function v() {
|
221
221
|
await f(async () => {
|
222
222
|
const { startDate: i, endDate: t } = n.value, a = await w.readTransactions({
|
223
223
|
start: i,
|
224
224
|
end: t
|
225
225
|
});
|
226
|
-
if (e.value =
|
226
|
+
if (e.value = G(a), c.value = e.value, o.value > "") {
|
227
227
|
var u = new RegExp(o.value, "i");
|
228
228
|
c.value = e.value.filter((d) => {
|
229
229
|
const C = JSON.stringify(d);
|
@@ -235,9 +235,9 @@ const te = /* @__PURE__ */ h({
|
|
235
235
|
function q() {
|
236
236
|
v();
|
237
237
|
}
|
238
|
-
|
238
|
+
U(q);
|
239
239
|
let A;
|
240
|
-
|
240
|
+
D(o, async () => {
|
241
241
|
A && clearTimeout(A), A = setTimeout(() => {
|
242
242
|
var i = new RegExp(o.value, "i");
|
243
243
|
c.value = e.value.filter((t) => {
|
@@ -245,7 +245,7 @@ const te = /* @__PURE__ */ h({
|
|
245
245
|
return i.test(a);
|
246
246
|
});
|
247
247
|
}, 700);
|
248
|
-
}),
|
248
|
+
}), D(e, async () => {
|
249
249
|
let i = e.value;
|
250
250
|
if (o.value) {
|
251
251
|
var t = new RegExp(o.value, "i");
|
@@ -268,7 +268,7 @@ const te = /* @__PURE__ */ h({
|
|
268
268
|
}
|
269
269
|
try {
|
270
270
|
const a = await w.refetchTransaction({ transactionId: t.id }), u = e.value.findIndex((d) => d.id === a._id);
|
271
|
-
e.value[u] =
|
271
|
+
e.value[u] = M(a), s.open({
|
272
272
|
type: "success",
|
273
273
|
title: "Transaction queried and updated successfully."
|
274
274
|
});
|
@@ -280,7 +280,7 @@ const te = /* @__PURE__ */ h({
|
|
280
280
|
});
|
281
281
|
}
|
282
282
|
}
|
283
|
-
async function
|
283
|
+
async function O(i) {
|
284
284
|
const t = c.value.at(i);
|
285
285
|
if (!t) {
|
286
286
|
s.open({
|
@@ -301,7 +301,7 @@ const te = /* @__PURE__ */ h({
|
|
301
301
|
reason: "portal transaction refund",
|
302
302
|
amount: t.fdoAmount
|
303
303
|
}), u = e.value.findIndex((d) => d.id === a._id);
|
304
|
-
e.value[u] =
|
304
|
+
e.value[u] = M(a), s.open({
|
305
305
|
type: "success",
|
306
306
|
title: "Transaction refund request initiated."
|
307
307
|
});
|
@@ -315,7 +315,7 @@ const te = /* @__PURE__ */ h({
|
|
315
315
|
}
|
316
316
|
);
|
317
317
|
}
|
318
|
-
async function
|
318
|
+
async function V(i) {
|
319
319
|
const t = c.value.at(i);
|
320
320
|
if (!t) {
|
321
321
|
s.open({
|
@@ -356,7 +356,7 @@ const te = /* @__PURE__ */ h({
|
|
356
356
|
b("div", le, [
|
357
357
|
y(a, {
|
358
358
|
"model-value": m(o),
|
359
|
-
"onUpdate:modelValue": t[0] || (t[0] = (d) =>
|
359
|
+
"onUpdate:modelValue": t[0] || (t[0] = (d) => k(o) ? o.value = d : null),
|
360
360
|
class: "mr-8",
|
361
361
|
label: "Search",
|
362
362
|
placeholder: "Search Transactions ..."
|
@@ -364,7 +364,7 @@ const te = /* @__PURE__ */ h({
|
|
364
364
|
y(u, {
|
365
365
|
modelValue: m(n),
|
366
366
|
"onUpdate:modelValue": [
|
367
|
-
t[1] || (t[1] = (d) =>
|
367
|
+
t[1] || (t[1] = (d) => k(n) ? n.value = d : null),
|
368
368
|
v
|
369
369
|
],
|
370
370
|
"show-predefined-range": ""
|
@@ -390,8 +390,8 @@ const te = /* @__PURE__ */ h({
|
|
390
390
|
loading: m(l),
|
391
391
|
data: c.value,
|
392
392
|
onQuery: K,
|
393
|
-
onRefund:
|
394
|
-
onNotify:
|
393
|
+
onRefund: O,
|
394
|
+
onNotify: V
|
395
395
|
}, null, 8, ["loading", "data"])
|
396
396
|
]),
|
397
397
|
_: 1
|