@feedmepos/mf-payment 1.5.36-dev → 1.5.38-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-DWKPrjY-.js → OnboardForm-C9C-VZag.js} +1 -1
- package/dist/{OnboardForm-CmJck1RQ.js → OnboardForm-Dl7WDzai.js} +1 -1
- package/dist/{PayoutAccount-Cn7cy7kV.js → PayoutAccount-CZhXRXXY.js} +1 -1
- package/dist/{PayoutAccount-yNSUSaHi.js → PayoutAccount-Diqrft60.js} +1 -1
- package/dist/{Settlement-CRlYjp36.js → Settlement-Bp5hjyx1.js} +1 -1
- package/dist/Settlement-XhN_oxNt.js +616 -0
- package/dist/Transaction-DCR4UV7_.js +502 -0
- package/dist/{Transaction-HTemq8TC.js → Transaction-lBwjJiov.js} +142 -131
- package/dist/{TransactionOld-BEfflWka.js → TransactionOld-BGnHifKa.js} +1 -1
- package/dist/{app-D3WWgJ8i.js → app-D6iM53je.js} +10 -10
- package/dist/app.js +1 -1
- package/dist/composable/transaction-id-date-suggestion/index.d.ts +15 -0
- package/dist/index-Blj3xQ6H.js +59 -0
- package/dist/package.json +2 -2
- package/dist/{payout-account-BviNeOr7.js → payout-account-CaR8L0b2.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/Settlement-BAeQCoUt.js +0 -610
- package/dist/Transaction-CvUypCQq.js +0 -490
- package/dist/index-CPf8YYLa.js +0 -9
|
@@ -0,0 +1,616 @@
|
|
|
1
|
+
import { defineComponent as x, resolveComponent as k, openBlock as $, createBlock as N, ref as A, computed as j, createElementBlock as P, Fragment as G, unref as e, withDirectives as Q, vShow as W, createCommentVNode as E, createVNode as p, h as L, watch as D, createElementVNode as i, withCtx as S, toDisplayString as _, createTextVNode as R, onMounted as z, renderList as X, isRef as U } from "vue";
|
|
2
|
+
import { u as q } from "./index-T2CVm7-_.js";
|
|
3
|
+
import { h as Y } from "./moment-h96o7c8I.js";
|
|
4
|
+
import { useCoreStore as H, useI18n as M } from "@feedmepos/mf-common";
|
|
5
|
+
import { _ as Z } from "./Layout.vue_vue_type_script_setup_true_lang-BKIvkgA_.js";
|
|
6
|
+
import { s as B } from "./index-_EfmUlsc.js";
|
|
7
|
+
import { useDialog as ee } from "@feedmepos/ui-library";
|
|
8
|
+
import { d as h } from "./dinero-CIVmXLL-.js";
|
|
9
|
+
import { _ as J } from "./AutoCopyCell.vue_vue_type_script_setup_true_lang-DrBLdVka.js";
|
|
10
|
+
import { useRouter as te } from "vue-router";
|
|
11
|
+
import { u as ae } from "./index-Q0ELb0wB.js";
|
|
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-BNVnvrVY.js";
|
|
14
|
+
import { p as le } from "./index-Dq4IAN2N.js";
|
|
15
|
+
const se = /* @__PURE__ */ x({
|
|
16
|
+
__name: "InvoiceStatus",
|
|
17
|
+
props: {
|
|
18
|
+
data: {}
|
|
19
|
+
},
|
|
20
|
+
setup(v) {
|
|
21
|
+
const a = v;
|
|
22
|
+
function c() {
|
|
23
|
+
return a.data && a.data !== "" ? "#66BB6A" : "#EF5350";
|
|
24
|
+
}
|
|
25
|
+
function u() {
|
|
26
|
+
return a.data && a.data !== "" ? "check" : "close";
|
|
27
|
+
}
|
|
28
|
+
return (d, r) => {
|
|
29
|
+
const g = k("FmIcon");
|
|
30
|
+
return $(), N(g, {
|
|
31
|
+
name: u(),
|
|
32
|
+
color: c(),
|
|
33
|
+
size: "lg"
|
|
34
|
+
}, null, 8, ["name", "color"]);
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}), re = /* @__PURE__ */ x({
|
|
38
|
+
__name: "SettlementTable",
|
|
39
|
+
props: {
|
|
40
|
+
data: {
|
|
41
|
+
type: Array,
|
|
42
|
+
required: !0
|
|
43
|
+
},
|
|
44
|
+
loading: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
required: !0
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
emits: ["row-click"],
|
|
50
|
+
setup(v, { emit: a }) {
|
|
51
|
+
const { currentCountry: c, currentBusiness: u, namespace: d } = H(), { t: r } = M(), g = A(!0), b = v, y = a, n = A(""), t = [
|
|
52
|
+
{
|
|
53
|
+
header: () => r("payment.settlements.table.id"),
|
|
54
|
+
accessorKey: "id",
|
|
55
|
+
cell: ({ cell: m }) => L(J, { data: m.getValue() })
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
header: () => r("payment.settlements.table.bank"),
|
|
59
|
+
accessorKey: "bank"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
header: () => r("payment.settlements.table.account"),
|
|
63
|
+
accessorKey: "accountNo"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
header: () => r("payment.settlements.table.created_at"),
|
|
67
|
+
accessorKey: "transactionAt",
|
|
68
|
+
meta: {
|
|
69
|
+
width: "180px"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
header: () => r("payment.settlements.table.sales_amount"),
|
|
74
|
+
accessorKey: "amount"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
header: () => r("payment.settlements.table.fee"),
|
|
78
|
+
accessorKey: "fee"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
header: () => r("payment.settlements.table.settlement_amount"),
|
|
82
|
+
accessorKey: "payout"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
header: () => r("payment.settlements.table.invoice_status"),
|
|
86
|
+
accessorKey: "invoiceId",
|
|
87
|
+
cell: ({ cell: m }) => L(se, { data: m.getValue() })
|
|
88
|
+
}
|
|
89
|
+
], f = j(() => b.data.map((m) => ({
|
|
90
|
+
id: m._id,
|
|
91
|
+
bank: m.beneficiaryBank.name,
|
|
92
|
+
accountNo: m.beneficiaryBank.accountNumber,
|
|
93
|
+
transactionAt: Y(m.createdAt).format("YYYY-MM-DD"),
|
|
94
|
+
amount: h(m.totalAmount).toFormat("$0.00"),
|
|
95
|
+
fee: h(m.totalFee).toFormat("$0.00"),
|
|
96
|
+
payout: h(m.totalPayout).toFormat("$0.00"),
|
|
97
|
+
invoiceId: m.invoiceId
|
|
98
|
+
}))), w = () => {
|
|
99
|
+
var T;
|
|
100
|
+
let m = "https://license.feedme.cc/invoices";
|
|
101
|
+
d.value === "dev" && (m = "https://license.feedmedev.cc/invoices");
|
|
102
|
+
const F = new URLSearchParams({
|
|
103
|
+
businessId: ((T = u.value) == null ? void 0 : T._id) ?? "",
|
|
104
|
+
country: c.value ?? "MY"
|
|
105
|
+
});
|
|
106
|
+
open(`${m}?${F.toString()}`, "_blank");
|
|
107
|
+
};
|
|
108
|
+
return (m, F) => {
|
|
109
|
+
const T = k("FmSnackbar"), o = k("FmTable");
|
|
110
|
+
return $(), P(G, null, [
|
|
111
|
+
e(c) === "MY" ? Q(($(), N(T, {
|
|
112
|
+
key: 0,
|
|
113
|
+
class: "mb-10",
|
|
114
|
+
title: e(r)("payment.settlements.invoice.title"),
|
|
115
|
+
description: e(r)("payment.settlements.invoice.description"),
|
|
116
|
+
action: e(r)("payment.settlements.invoice.action"),
|
|
117
|
+
variant: "info",
|
|
118
|
+
dismissable: "",
|
|
119
|
+
onOnDismiss: F[0] || (F[0] = (l) => g.value = !1),
|
|
120
|
+
onOnAction: w
|
|
121
|
+
}, null, 8, ["title", "description", "action"])), [
|
|
122
|
+
[W, g.value]
|
|
123
|
+
]) : E("", !0),
|
|
124
|
+
p(o, {
|
|
125
|
+
modelValue: n.value,
|
|
126
|
+
"onUpdate:modelValue": F[1] || (F[1] = (l) => n.value = l),
|
|
127
|
+
"row-data": f.value,
|
|
128
|
+
"shrink-at": !1,
|
|
129
|
+
"column-defs": t,
|
|
130
|
+
loading: b.loading,
|
|
131
|
+
onRowClick: F[2] || (F[2] = (l) => y("row-click", b.data.at(l.index)))
|
|
132
|
+
}, null, 8, ["modelValue", "row-data", "loading"])
|
|
133
|
+
], 64);
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
}), me = /* @__PURE__ */ x({
|
|
137
|
+
__name: "FiuuSettlementTable",
|
|
138
|
+
props: {
|
|
139
|
+
data: {
|
|
140
|
+
type: Array,
|
|
141
|
+
required: !0
|
|
142
|
+
},
|
|
143
|
+
loading: {
|
|
144
|
+
type: Boolean,
|
|
145
|
+
required: !0
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
emits: ["row-click"],
|
|
149
|
+
setup(v, { emit: a }) {
|
|
150
|
+
const { t: c } = M(), u = v, d = a, r = A(""), g = [
|
|
151
|
+
{
|
|
152
|
+
header: () => c("payment.settlements.table.id"),
|
|
153
|
+
accessorKey: "id",
|
|
154
|
+
cell: ({ cell: y }) => L(J, { data: y.getValue() })
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
header: () => c("payment.settlements.table.bank"),
|
|
158
|
+
accessorKey: "bank"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
header: () => c("payment.settlements.table.account"),
|
|
162
|
+
accessorKey: "accountNo"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
header: () => c("payment.settlements.table.created_at"),
|
|
166
|
+
accessorKey: "transactionAt",
|
|
167
|
+
meta: {
|
|
168
|
+
width: "180px"
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
header: () => c("payment.settlements.table.sales_amount"),
|
|
173
|
+
accessorKey: "amount"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
header: () => c("payment.settlements.table.fee"),
|
|
177
|
+
accessorKey: "fee"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
header: () => c("payment.settlements.table.settlement_amount"),
|
|
181
|
+
accessorKey: "payout"
|
|
182
|
+
}
|
|
183
|
+
], b = j(() => u.data.map((y) => ({
|
|
184
|
+
id: y.summary.referenceNo,
|
|
185
|
+
bank: y.summary.bank.name,
|
|
186
|
+
accountNo: y.summary.bank.accountNo,
|
|
187
|
+
transactionAt: Y(y.summary.completedAt).format("YYYY-MM-DD"),
|
|
188
|
+
amount: h(y.summary.amount).toFormat("$0.00"),
|
|
189
|
+
fee: h(y.summary.commission).toFormat("$0.00"),
|
|
190
|
+
payout: h(y.summary.payout).toFormat("$0.00")
|
|
191
|
+
})));
|
|
192
|
+
return (y, n) => {
|
|
193
|
+
const t = k("FmTable");
|
|
194
|
+
return $(), N(t, {
|
|
195
|
+
modelValue: r.value,
|
|
196
|
+
"onUpdate:modelValue": n[0] || (n[0] = (f) => r.value = f),
|
|
197
|
+
"row-data": b.value,
|
|
198
|
+
"shrink-at": !1,
|
|
199
|
+
"column-defs": g,
|
|
200
|
+
loading: u.loading,
|
|
201
|
+
onRowClick: n[1] || (n[1] = (f) => d("row-click", u.data.at(f.index)))
|
|
202
|
+
}, null, 8, ["modelValue", "row-data", "loading"]);
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
}), ue = {
|
|
206
|
+
id: "fiuu-settlement-dialog",
|
|
207
|
+
class: "flex mb-6"
|
|
208
|
+
}, ie = { class: "my-6 w-[240px]" }, ce = /* @__PURE__ */ x({
|
|
209
|
+
__name: "FiuuSettlementTransactions",
|
|
210
|
+
props: {
|
|
211
|
+
settlement: {
|
|
212
|
+
type: Object,
|
|
213
|
+
required: !0
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
setup(v) {
|
|
217
|
+
const { t: a } = M(), u = A(
|
|
218
|
+
v.settlement.record.map((n) => (Object.assign(n, {
|
|
219
|
+
__localAmount: h(n.amount).toFormat("0.00"),
|
|
220
|
+
__localComission: h(n.commission).toFormat("0.00"),
|
|
221
|
+
__localNetAMount: h(n.netAmount).toFormat("0.00")
|
|
222
|
+
}), n))
|
|
223
|
+
), d = A(u.value), r = A(""), g = [
|
|
224
|
+
{
|
|
225
|
+
header: () => a("payment.settlements.dialog.fiuu.id"),
|
|
226
|
+
accessorKey: "referenceNo"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
header: () => a("payment.settlements.dialog.fiuu.type"),
|
|
230
|
+
accessorKey: "group"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
header: () => a("payment.settlements.dialog.fiuu.transaction_at"),
|
|
234
|
+
accessorKey: "completedAt",
|
|
235
|
+
meta: {
|
|
236
|
+
width: "180px"
|
|
237
|
+
},
|
|
238
|
+
cell: ({ cell: n }) => Y(n.getValue()).format("YYYY-MM-DD HH:mm:ss")
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
header: () => a("payment.settlements.dialog.fiuu.sales_amount"),
|
|
242
|
+
accessorKey: "amount",
|
|
243
|
+
cell: ({ cell: n }) => h(n.getValue()).toFormat("$0.00")
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
header: () => a("payment.settlements.dialog.fiuu.fee"),
|
|
247
|
+
accessorKey: "commission",
|
|
248
|
+
cell: ({ cell: n }) => h(n.getValue()).toFormat("$0.00")
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
header: () => a("payment.settlements.dialog.fiuu.settlement_amount"),
|
|
252
|
+
accessorKey: "netAmount",
|
|
253
|
+
cell: ({ cell: n }) => h(n.getValue()).toFormat("$0.00")
|
|
254
|
+
}
|
|
255
|
+
], b = A("");
|
|
256
|
+
let y;
|
|
257
|
+
return D(b, async () => {
|
|
258
|
+
y && clearTimeout(y), y = setTimeout(() => {
|
|
259
|
+
var n = new RegExp(b.value, "i");
|
|
260
|
+
d.value = u.value.filter((t) => {
|
|
261
|
+
const f = JSON.stringify(t);
|
|
262
|
+
return n.test(f);
|
|
263
|
+
});
|
|
264
|
+
}, 700);
|
|
265
|
+
}), (n, t) => {
|
|
266
|
+
const f = k("FmCardHeader"), w = k("FmCardSection"), m = k("FmCard"), F = k("FmSearch"), T = k("FmTable");
|
|
267
|
+
return $(), P(G, null, [
|
|
268
|
+
i("div", ue, [
|
|
269
|
+
p(m, {
|
|
270
|
+
horizontal: "",
|
|
271
|
+
class: "flex-1 p-6",
|
|
272
|
+
variant: "elevated"
|
|
273
|
+
}, {
|
|
274
|
+
default: S(() => [
|
|
275
|
+
p(w, { class: "flex flex-col gap-16 justify-between" }, {
|
|
276
|
+
default: S(() => [
|
|
277
|
+
p(f, {
|
|
278
|
+
class: "p-0",
|
|
279
|
+
title: e(a)("payment.settlements.dialog.info.transaction.title"),
|
|
280
|
+
subtitle: ""
|
|
281
|
+
}, null, 8, ["title"]),
|
|
282
|
+
p(w, { class: "p-0" }, {
|
|
283
|
+
default: S(() => [
|
|
284
|
+
i("b", null, _(e(a)("payment.settlements.dialog.info.transaction.for")), 1),
|
|
285
|
+
R(": " + _(v.settlement.summary.group) + " ", 1),
|
|
286
|
+
t[2] || (t[2] = i("br", null, null, -1)),
|
|
287
|
+
i("b", null, _(e(a)("payment.settlements.dialog.info.transaction.reference")), 1),
|
|
288
|
+
R(": " + _(v.settlement.summary.referenceNo), 1),
|
|
289
|
+
t[3] || (t[3] = i("br", null, null, -1)),
|
|
290
|
+
i("b", null, _(e(a)("payment.settlements.dialog.info.transaction.count")), 1),
|
|
291
|
+
R(": " + _(u.value.length), 1)
|
|
292
|
+
]),
|
|
293
|
+
_: 1
|
|
294
|
+
})
|
|
295
|
+
]),
|
|
296
|
+
_: 1
|
|
297
|
+
})
|
|
298
|
+
]),
|
|
299
|
+
_: 1
|
|
300
|
+
}),
|
|
301
|
+
p(m, {
|
|
302
|
+
horizontal: "",
|
|
303
|
+
class: "flex-1 p-6 mx-6",
|
|
304
|
+
variant: "elevated"
|
|
305
|
+
}, {
|
|
306
|
+
default: S(() => [
|
|
307
|
+
p(w, { class: "flex flex-col gap-16 justify-between" }, {
|
|
308
|
+
default: S(() => [
|
|
309
|
+
p(f, {
|
|
310
|
+
class: "p-0",
|
|
311
|
+
title: e(a)("payment.settlements.dialog.info.bank.title"),
|
|
312
|
+
subtitle: ""
|
|
313
|
+
}, null, 8, ["title"]),
|
|
314
|
+
p(w, { class: "p-0" }, {
|
|
315
|
+
default: S(() => [
|
|
316
|
+
i("b", null, _(e(a)("payment.settlements.dialog.info.bank.for")), 1),
|
|
317
|
+
R(": " + _(v.settlement.summary.bank.name), 1),
|
|
318
|
+
t[4] || (t[4] = i("br", null, null, -1)),
|
|
319
|
+
i("b", null, _(e(a)("payment.settlements.dialog.info.bank.name")), 1),
|
|
320
|
+
R(": " + _(v.settlement.summary.bank.holderName), 1),
|
|
321
|
+
t[5] || (t[5] = i("br", null, null, -1)),
|
|
322
|
+
i("b", null, _(e(a)("payment.settlements.dialog.info.bank.number")), 1),
|
|
323
|
+
R(": " + _(v.settlement.summary.bank.accountNo), 1)
|
|
324
|
+
]),
|
|
325
|
+
_: 1
|
|
326
|
+
})
|
|
327
|
+
]),
|
|
328
|
+
_: 1
|
|
329
|
+
})
|
|
330
|
+
]),
|
|
331
|
+
_: 1
|
|
332
|
+
}),
|
|
333
|
+
p(m, {
|
|
334
|
+
horizontal: "",
|
|
335
|
+
class: "flex-1 p-6",
|
|
336
|
+
variant: "elevated"
|
|
337
|
+
}, {
|
|
338
|
+
default: S(() => [
|
|
339
|
+
p(w, { class: "flex flex-col gap-16 justify-between" }, {
|
|
340
|
+
default: S(() => [
|
|
341
|
+
p(f, {
|
|
342
|
+
class: "p-0",
|
|
343
|
+
title: e(a)("payment.settlements.dialog.info.payout.title"),
|
|
344
|
+
subtitle: ""
|
|
345
|
+
}, null, 8, ["title"]),
|
|
346
|
+
p(w, { class: "p-0" }, {
|
|
347
|
+
default: S(() => [
|
|
348
|
+
i("b", null, _(e(a)("payment.settlements.dialog.info.payout.amount")), 1),
|
|
349
|
+
R(": " + _(e(h)(v.settlement.summary.amount).toFormat("$0.00")), 1),
|
|
350
|
+
t[6] || (t[6] = i("br", null, null, -1)),
|
|
351
|
+
i("b", null, _(e(a)("payment.settlements.dialog.info.payout.fee")), 1),
|
|
352
|
+
R(": " + _(e(h)(v.settlement.summary.commission).toFormat("$0.00")), 1),
|
|
353
|
+
t[7] || (t[7] = i("br", null, null, -1)),
|
|
354
|
+
i("b", null, _(e(a)("payment.settlements.dialog.info.payout.payout")), 1),
|
|
355
|
+
R(": " + _(e(h)(v.settlement.summary.payout).toFormat("$0.00")), 1)
|
|
356
|
+
]),
|
|
357
|
+
_: 1
|
|
358
|
+
})
|
|
359
|
+
]),
|
|
360
|
+
_: 1
|
|
361
|
+
})
|
|
362
|
+
]),
|
|
363
|
+
_: 1
|
|
364
|
+
})
|
|
365
|
+
]),
|
|
366
|
+
i("div", ie, [
|
|
367
|
+
p(F, {
|
|
368
|
+
modelValue: b.value,
|
|
369
|
+
"onUpdate:modelValue": t[0] || (t[0] = (o) => b.value = o),
|
|
370
|
+
placeholder: e(a)("payment.settlements.dialog.search")
|
|
371
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
372
|
+
]),
|
|
373
|
+
p(T, {
|
|
374
|
+
modelValue: r.value,
|
|
375
|
+
"onUpdate:modelValue": t[1] || (t[1] = (o) => r.value = o),
|
|
376
|
+
"shrink-at": !1,
|
|
377
|
+
"row-data": d.value,
|
|
378
|
+
"column-defs": g
|
|
379
|
+
}, null, 8, ["modelValue", "row-data"])
|
|
380
|
+
], 64);
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
}), de = {
|
|
384
|
+
key: 1,
|
|
385
|
+
class: "inline-flex"
|
|
386
|
+
}, pe = { class: "relative" }, ye = { class: "sticky top-0 py-8 bg-white translate-y-[-12px]" }, fe = /* @__PURE__ */ x({
|
|
387
|
+
__name: "SettlementSelector",
|
|
388
|
+
props: {
|
|
389
|
+
id: {},
|
|
390
|
+
by: {}
|
|
391
|
+
},
|
|
392
|
+
emits: ["update:id", "update:by"],
|
|
393
|
+
setup(v, { emit: a }) {
|
|
394
|
+
const c = v, u = a, { t: d } = M(), { currentBusiness: r, readRestaurants: g } = H(), { isLoading: b, startAsyncCall: y } = q(!0), n = A([]), t = A(), f = A(""), w = A([]);
|
|
395
|
+
let m;
|
|
396
|
+
D(f, async () => {
|
|
397
|
+
m && clearTimeout(m), m = setTimeout(() => {
|
|
398
|
+
var o = new RegExp(f.value, "i");
|
|
399
|
+
w.value = n.value.filter((l) => {
|
|
400
|
+
const V = JSON.stringify(l);
|
|
401
|
+
return o.test(V);
|
|
402
|
+
});
|
|
403
|
+
}, 700);
|
|
404
|
+
}), D(t, () => {
|
|
405
|
+
var o, l;
|
|
406
|
+
u("update:id", (o = t.value) == null ? void 0 : o.value), u("update:by", (l = t.value) == null ? void 0 : l.by);
|
|
407
|
+
});
|
|
408
|
+
async function F() {
|
|
409
|
+
return y(async () => {
|
|
410
|
+
let o = await le.readBusinessPayoutAccounts();
|
|
411
|
+
if (o.length !== 0)
|
|
412
|
+
return o;
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
async function T() {
|
|
416
|
+
b.value = !0;
|
|
417
|
+
const o = [];
|
|
418
|
+
let l = await F();
|
|
419
|
+
o.push(
|
|
420
|
+
...(l || []).filter((s) => s.store.event !== "ORDERING").map((s) => {
|
|
421
|
+
var K, I, O, C;
|
|
422
|
+
return {
|
|
423
|
+
by: "PAYOUT_ACCOUNT",
|
|
424
|
+
value: s.store.id,
|
|
425
|
+
prefix: d("payment.components.payout_account"),
|
|
426
|
+
type: "Payout Account - " + s.store.event,
|
|
427
|
+
label: ((I = (K = s.ref) == null ? void 0 : K.profile) == null ? void 0 : I.name) ?? s.ref.name,
|
|
428
|
+
chipLabel: "Marketing: " + (((C = (O = s.ref) == null ? void 0 : O.profile) == null ? void 0 : C.name) ?? s.ref.name)
|
|
429
|
+
};
|
|
430
|
+
})
|
|
431
|
+
);
|
|
432
|
+
const V = await g();
|
|
433
|
+
o.push(
|
|
434
|
+
...(V || []).map((s) => ({
|
|
435
|
+
by: "RESTAURANT",
|
|
436
|
+
value: s._id,
|
|
437
|
+
prefix: d("payment.components.restaurant"),
|
|
438
|
+
type: "Restaurant",
|
|
439
|
+
label: s.profile.name + " (" + (s.profile.code ?? "--") + ")",
|
|
440
|
+
chipLabel: "Restaurant: " + s.profile.name + " (" + (s.profile.code ?? "--") + ")"
|
|
441
|
+
}))
|
|
442
|
+
), n.value = o, w.value = n.value, t.value = o.find((s) => s.value === c.id && s.by === c.by) ?? o[0], b.value = !1;
|
|
443
|
+
}
|
|
444
|
+
return z(T), D(r, T), (o, l) => {
|
|
445
|
+
const V = k("FmCircularProgress"), s = k("FmChip"), K = k("FmSearch"), I = k("FmMenuItem"), O = k("FmMenu");
|
|
446
|
+
return e(b) ? ($(), N(V, {
|
|
447
|
+
key: 0,
|
|
448
|
+
size: "md"
|
|
449
|
+
})) : ($(), P("div", de, [
|
|
450
|
+
p(O, { "close-on-click": !0 }, {
|
|
451
|
+
"menu-button": S(() => {
|
|
452
|
+
var C;
|
|
453
|
+
return [
|
|
454
|
+
p(s, {
|
|
455
|
+
icon: "account_box",
|
|
456
|
+
label: ((C = t.value) == null ? void 0 : C.chipLabel) ?? e(d)("payment.components.select"),
|
|
457
|
+
removable: !!t.value,
|
|
458
|
+
onChipClosed: l[0] || (l[0] = (Fe) => t.value = void 0)
|
|
459
|
+
}, null, 8, ["label", "removable"])
|
|
460
|
+
];
|
|
461
|
+
}),
|
|
462
|
+
default: S(() => [
|
|
463
|
+
i("div", pe, [
|
|
464
|
+
i("div", ye, [
|
|
465
|
+
p(K, {
|
|
466
|
+
"model-value": f.value,
|
|
467
|
+
"onUpdate:modelValue": l[1] || (l[1] = (C) => f.value = C),
|
|
468
|
+
placeholder: e(d)("payment.components.select")
|
|
469
|
+
}, null, 8, ["model-value", "placeholder"])
|
|
470
|
+
]),
|
|
471
|
+
i("div", null, [
|
|
472
|
+
($(!0), P(G, null, X(w.value, (C) => ($(), N(I, {
|
|
473
|
+
key: C.value,
|
|
474
|
+
label: C.label,
|
|
475
|
+
sublabel: C.type,
|
|
476
|
+
onClick: () => t.value = C
|
|
477
|
+
}, null, 8, ["label", "sublabel", "onClick"]))), 128))
|
|
478
|
+
])
|
|
479
|
+
])
|
|
480
|
+
]),
|
|
481
|
+
_: 1
|
|
482
|
+
})
|
|
483
|
+
]));
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
}), ve = { class: "flex justify-between items-center mb-6" }, be = { class: "flex space-x-8 items-center" }, _e = { class: "flex space-x-4 self-center" }, ge = { class: "mb-6" }, Me = /* @__PURE__ */ x({
|
|
487
|
+
__name: "Settlement",
|
|
488
|
+
setup(v) {
|
|
489
|
+
const a = te(), { tab: c, dateRange: u, id: d, by: r } = ae({
|
|
490
|
+
id: "",
|
|
491
|
+
by: "",
|
|
492
|
+
tab: "feedme",
|
|
493
|
+
dateRange: {
|
|
494
|
+
startDate: Y().startOf("day").format("YYYY-MM-DD"),
|
|
495
|
+
endDate: Y().endOf("day").format("YYYY-MM-DD")
|
|
496
|
+
}
|
|
497
|
+
}), { t: g } = M(), { isLoading: b, startAsyncCall: y } = q(!0), n = ee(), t = A([]), f = A([]);
|
|
498
|
+
async function w() {
|
|
499
|
+
const o = await B.readBusinessSettlements({
|
|
500
|
+
start: u.value.startDate,
|
|
501
|
+
end: u.value.endDate,
|
|
502
|
+
event: r.value === "PAYOUT_ACCOUNT" ? "MARKETING" : "ORDERING",
|
|
503
|
+
id: d.value
|
|
504
|
+
});
|
|
505
|
+
t.value = o;
|
|
506
|
+
}
|
|
507
|
+
async function m() {
|
|
508
|
+
const o = await B.readBusinessRMSSettlements({
|
|
509
|
+
start: u.value.startDate,
|
|
510
|
+
end: u.value.endDate,
|
|
511
|
+
event: r.value === "PAYOUT_ACCOUNT" ? "MARKETING" : "ORDERING",
|
|
512
|
+
id: d.value
|
|
513
|
+
});
|
|
514
|
+
f.value = o;
|
|
515
|
+
}
|
|
516
|
+
async function F() {
|
|
517
|
+
if (!d.value || d.value === "") {
|
|
518
|
+
b.value = !1, t.value = [], f.value = [];
|
|
519
|
+
return;
|
|
520
|
+
}
|
|
521
|
+
await y(async () => Promise.all([w(), m()]));
|
|
522
|
+
}
|
|
523
|
+
async function T(o) {
|
|
524
|
+
const l = Y(o.summary.completedAt).format("YYYY/MM/DD");
|
|
525
|
+
n.open({
|
|
526
|
+
title: `${g("payment.settlements.dialog.title")} (${o.summary.referenceNo})`,
|
|
527
|
+
subTitle: `${g("payment.settlements.dialog.date")}: ${l}`,
|
|
528
|
+
minWidth: "90%",
|
|
529
|
+
primaryActions: { text: "Close", close: !0 },
|
|
530
|
+
contentComponent: ce,
|
|
531
|
+
contentComponentProps: { settlement: o }
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
return z(F), D([d, u], F), (o, l) => {
|
|
535
|
+
const V = k("FmTabs");
|
|
536
|
+
return $(), N(Z, {
|
|
537
|
+
title: e(g)("payment.settlements.title"),
|
|
538
|
+
description: e(g)("payment.settlements.description"),
|
|
539
|
+
loading: !1
|
|
540
|
+
}, {
|
|
541
|
+
default: S(() => [
|
|
542
|
+
i("div", ve, [
|
|
543
|
+
i("div", be, [
|
|
544
|
+
p(fe, {
|
|
545
|
+
id: e(d),
|
|
546
|
+
"onUpdate:id": l[0] || (l[0] = (s) => U(d) ? d.value = s : null),
|
|
547
|
+
by: e(r),
|
|
548
|
+
"onUpdate:by": l[1] || (l[1] = (s) => U(r) ? r.value = s : null)
|
|
549
|
+
}, null, 8, ["id", "by"]),
|
|
550
|
+
p(oe, {
|
|
551
|
+
modelValue: e(u),
|
|
552
|
+
"onUpdate:modelValue": l[2] || (l[2] = (s) => U(u) ? u.value = s : null)
|
|
553
|
+
}, null, 8, ["modelValue"])
|
|
554
|
+
]),
|
|
555
|
+
i("div", _e, [
|
|
556
|
+
p(ne, {
|
|
557
|
+
button: {
|
|
558
|
+
appendIcon: "file_download",
|
|
559
|
+
variant: "primary",
|
|
560
|
+
label: "Export"
|
|
561
|
+
},
|
|
562
|
+
handler: async () => {
|
|
563
|
+
await e(B).downloadBusinessSettlementReport({
|
|
564
|
+
start: e(u).startDate,
|
|
565
|
+
end: e(u).endDate,
|
|
566
|
+
event: e(r) === "PAYOUT_ACCOUNT" ? "MARKETING" : "ORDERING",
|
|
567
|
+
id: e(d)
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
}, null, 8, ["handler"])
|
|
571
|
+
])
|
|
572
|
+
]),
|
|
573
|
+
i("div", ge, [
|
|
574
|
+
p(V, {
|
|
575
|
+
modelValue: e(c),
|
|
576
|
+
"onUpdate:modelValue": l[3] || (l[3] = (s) => U(c) ? c.value = s : null),
|
|
577
|
+
items: [
|
|
578
|
+
{
|
|
579
|
+
label: "FeedMe",
|
|
580
|
+
value: "feedme",
|
|
581
|
+
icon: "summarize"
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
label: "Fiuu (RMS)",
|
|
585
|
+
value: "fiuu",
|
|
586
|
+
icon: "overview"
|
|
587
|
+
}
|
|
588
|
+
]
|
|
589
|
+
}, null, 8, ["modelValue"])
|
|
590
|
+
]),
|
|
591
|
+
e(c) === "fiuu" ? ($(), N(me, {
|
|
592
|
+
key: 0,
|
|
593
|
+
loading: e(b),
|
|
594
|
+
data: f.value,
|
|
595
|
+
onRowClick: T
|
|
596
|
+
}, null, 8, ["loading", "data"])) : E("", !0),
|
|
597
|
+
e(c) === "feedme" ? ($(), N(re, {
|
|
598
|
+
key: 1,
|
|
599
|
+
loading: e(b),
|
|
600
|
+
data: t.value,
|
|
601
|
+
onRowClick: l[4] || (l[4] = (s) => e(a).push({
|
|
602
|
+
name: "mf-payment-settlement-transaction",
|
|
603
|
+
params: {
|
|
604
|
+
settlementId: s._id
|
|
605
|
+
}
|
|
606
|
+
}))
|
|
607
|
+
}, null, 8, ["loading", "data"])) : E("", !0)
|
|
608
|
+
]),
|
|
609
|
+
_: 1
|
|
610
|
+
}, 8, ["title", "description"]);
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
});
|
|
614
|
+
export {
|
|
615
|
+
Me as default
|
|
616
|
+
};
|