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