@feedmepos/mf-payment 1.1.0-beta.1 → 1.1.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/{PayoutAccount-BHJpjUqD.js → PayoutAccount-BpMu58oE.js} +5 -5
  2. package/dist/{PayoutAccount-DCkf_1yL.js → PayoutAccount-z-gdodfR.js} +360 -360
  3. package/dist/{PayoutAccountSetting-Bk-g7ucZ.js → PayoutAccountSetting-jZJu4WWL.js} +3 -3
  4. package/dist/{Restaurant-D2qq84VL.js → Restaurant-DfBX5uPS.js} +4 -4
  5. package/dist/RestaurantSelector.vue_vue_type_script_setup_true_lang-hJAJYKmE.js +33 -0
  6. package/dist/{RestaurantSetting-DAtrtX6S.js → RestaurantSetting-KPtRoif-.js} +3 -3
  7. package/dist/{Settlement-Cx1tc5wt.js → Settlement-DbMQAA0_.js} +3 -3
  8. package/dist/Settlement-smC2PDKA.js +445 -0
  9. package/dist/{SettlementTransactions-C82DyYlO.js → SettlementTransactions-Bs8Il-GO.js} +3 -3
  10. package/dist/SettlementTransactions-Cw9DnODr.js +291 -0
  11. package/dist/{Terminal-Az2k8E6F.js → Terminal-HLOGtr0x.js} +5 -5
  12. package/dist/{TerminalSetting-C-xlLYXa.js → TerminalSetting-DraCszpQ.js} +3 -3
  13. package/dist/Transaction-B8cHQbbP.js +250 -0
  14. package/dist/{Transaction-Y_mc0yQv.js → Transaction-_CB4VTT9.js} +5 -5
  15. package/dist/TransactionOld-BhzUSu5h.js +99 -0
  16. package/dist/{TransactionTable.vue_vue_type_script_setup_true_lang-dwwesT4_.js → TransactionTable.vue_vue_type_script_setup_true_lang-UcnQKwQ5.js} +87 -87
  17. package/dist/{app-OBp4HaEY.js → app-DWRPKvx2.js} +721 -448
  18. package/dist/app.d.ts +278 -0
  19. package/dist/app.js +4 -3
  20. package/dist/{assets-pLBp82yE.js → assets-BImh8bhR.js} +1 -1
  21. package/dist/{grafana-hv7inD36.js → grafana-CPOGSE20.js} +1 -1
  22. package/dist/{index-1xF00w89.js → index-8eCaI4jI.js} +1 -1
  23. package/dist/{index-DGKxdJVj.js → index-CNZFZxie.js} +1 -1
  24. package/dist/{index-DD5mEX0D.js → index-D5DlMaeB.js} +1 -1
  25. package/dist/{index-oM4Z9ffu.js → index-DtT3I2PI.js} +1 -1
  26. package/dist/{index-Cqq3p9PP.js → index-DuSw-EaU.js} +1 -1
  27. package/dist/{index-CFYD8Dv4.js → index-eznEOmAe.js} +1 -1
  28. package/dist/{index.vue_vue_type_script_setup_true_lang-C9tnqgzY.js → index.vue_vue_type_script_setup_true_lang-DNXWZt8k.js} +1 -1
  29. package/dist/package.json +8 -7
  30. package/dist/{payout-account-DPaS3dIs.js → payout-account-CjDkY3wf.js} +2 -2
  31. package/dist/tsconfig.app.tsbuildinfo +1 -1
  32. package/package.json +8 -7
  33. package/dist/RestaurantSelector.vue_vue_type_script_setup_true_lang-p4qddIbp.js +0 -33
  34. package/dist/Settlement-BVIsszEJ.js +0 -447
  35. package/dist/SettlementTransactions-CeN4SRWa.js +0 -291
  36. package/dist/Transaction-CC8hc8_r.js +0 -250
  37. package/dist/TransactionOld-BxhI-wwm.js +0 -99
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-payment",
3
- "version": "1.1.0-beta.1",
3
+ "version": "1.1.0-beta.2",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -32,7 +32,8 @@
32
32
  "dependencies": {
33
33
  "@casl/ability": "^3.2.0",
34
34
  "@feedmepos/core": "^2.6.0",
35
- "@feedmepos/mf-common": "^1.8.21",
35
+ "@feedmepos/mf-common": "^1.11.6",
36
+ "vue-i18n": "10.0.5",
36
37
  "@feedmepos/payment-entity": "^0.0.23",
37
38
  "@feedmepos/ui-library": "^1.3.9",
38
39
  "axios": "^0.27.2",
@@ -43,10 +44,6 @@
43
44
  "file-saver": "^2.0.5",
44
45
  "firebase": "^10.14.0",
45
46
  "google-maps": "^4.3.3",
46
- "i18next": "^21.8.8",
47
- "i18next-browser-languagedetector": "^6.1.4",
48
- "i18next-http-backend": "^1.4.1",
49
- "i18next-vue": "^2.0.0-beta.0",
50
47
  "jspdf": "^2.5.1",
51
48
  "jsurl": "^0.1.5",
52
49
  "jszip": "^3.10.1",
@@ -64,7 +61,11 @@
64
61
  "vue3-lottie": "^2.2.3",
65
62
  "vuedraggable": "^4.1.0",
66
63
  "xlsx": "^0.18.5",
67
- "zod": "^3.23.8"
64
+ "zod": "^3.23.8",
65
+ "i18next": "^21.8.8",
66
+ "i18next-browser-languagedetector": "^6.1.4",
67
+ "i18next-http-backend": "^1.4.1",
68
+ "i18next-vue": "^2.0.0-beta.0"
68
69
  },
69
70
  "devDependencies": {
70
71
  "@babel/preset-env": "^7.22.10",
@@ -1,33 +0,0 @@
1
- import { defineComponent as c, computed as o, resolveComponent as i, openBlock as d, createBlock as _, unref as l } from "vue";
2
- import { useCoreStore as v } from "@feedmepos/mf-common";
3
- const b = /* @__PURE__ */ c({
4
- __name: "RestaurantSelector",
5
- setup(f) {
6
- const t = v(), r = o(() => {
7
- var e;
8
- return (e = t.currentRestaurant.value) == null ? void 0 : e._id;
9
- }), u = o(() => t.restaurants.value.filter((e) => e.managable).map((e) => ({
10
- label: e.profile.name,
11
- value: e._id
12
- })));
13
- return (e, a) => {
14
- const s = i("FmSelect");
15
- return d(), _(s, {
16
- label: "Restaurant",
17
- modelValue: r.value,
18
- "onUpdate:modelValue": [
19
- a[0] || (a[0] = (n) => r.value = n),
20
- a[1] || (a[1] = (n) => {
21
- const m = l(t).restaurants.value.find((p) => p._id == n);
22
- l(t).changeRestaurant(m);
23
- })
24
- ],
25
- class: "w-[220px]",
26
- items: u.value
27
- }, null, 8, ["modelValue", "items"]);
28
- };
29
- }
30
- });
31
- export {
32
- b as _
33
- };
@@ -1,447 +0,0 @@
1
- import { defineComponent as T, ref as x, computed as R, resolveComponent as w, openBlock as V, createBlock as C, h as Y, watch as h, createElementBlock as P, Fragment as I, createElementVNode as a, createVNode as n, withCtx as p, createTextVNode as b, toDisplayString as v, unref as u, onMounted as U, isRef as N, createCommentVNode as _ } from "vue";
2
- import { u as j } from "./index-DGKxdJVj.js";
3
- import { h as D } from "./moment-h96o7c8I.js";
4
- import { useCoreStore as q } from "@feedmepos/mf-common";
5
- import { _ as z } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
6
- import { s as K } from "./index-DD5mEX0D.js";
7
- import { useDialogChild as E, useDialog as O } from "@feedmepos/ui-library";
8
- import { d as i } from "./dinero-CIVmXLL-.js";
9
- import { _ as M } from "./AutoCopyCell.vue_vue_type_script_setup_true_lang-CdmfrBoW.js";
10
- import { useRouter as L } from "vue-router";
11
- import { u as H } from "./index-1xF00w89.js";
12
- import { _ as J } from "./AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js";
13
- import { _ as Q } from "./RestaurantSelector.vue_vue_type_script_setup_true_lang-p4qddIbp.js";
14
- import { _ as W } from "./DateRangePicker.vue_vue_type_script_setup_true_lang-dP_5WjEJ.js";
15
- const G = /* @__PURE__ */ T({
16
- __name: "SettlementTable",
17
- props: {
18
- data: {
19
- type: Array,
20
- required: !0
21
- },
22
- loading: {
23
- type: Boolean,
24
- required: !0
25
- }
26
- },
27
- emits: ["row-click"],
28
- setup(m, { emit: g }) {
29
- const r = m, l = g, d = x(""), S = [
30
- {
31
- header: () => "Settlement ID",
32
- accessorKey: "id",
33
- cell: ({ cell: t }) => Y(M, { data: t.getValue() })
34
- },
35
- {
36
- header: () => "Bank",
37
- accessorKey: "bank"
38
- },
39
- {
40
- header: () => "Account No",
41
- accessorKey: "accountNo"
42
- },
43
- {
44
- header: () => "Created At",
45
- accessorKey: "transactionAt",
46
- meta: {
47
- width: "180px"
48
- }
49
- },
50
- {
51
- header: () => "Sales Amount",
52
- accessorKey: "amount"
53
- },
54
- {
55
- header: () => "Fee",
56
- accessorKey: "fee"
57
- },
58
- {
59
- header: () => "Settlement Amount",
60
- accessorKey: "payout"
61
- }
62
- ], c = R(() => r.data.map((t) => ({
63
- id: t._id,
64
- bank: t.beneficiaryBank.name,
65
- accountNo: t.beneficiaryBank.accountNumber,
66
- transactionAt: D(t.createdAt).format("YYYY-MM-DD"),
67
- amount: i(t.totalAmount).toFormat("$0.00"),
68
- fee: i(t.totalFee).toFormat("$0.00"),
69
- payout: i(t.totalPayout).toFormat("$0.00")
70
- })));
71
- return (t, o) => {
72
- const e = w("FmTable");
73
- return V(), C(e, {
74
- modelValue: d.value,
75
- "onUpdate:modelValue": o[0] || (o[0] = (s) => d.value = s),
76
- "row-data": c.value,
77
- "shrink-at": !1,
78
- "column-defs": S,
79
- loading: r.loading,
80
- onRowClick: o[1] || (o[1] = (s) => l("row-click", r.data.at(s.index)))
81
- }, null, 8, ["modelValue", "row-data", "loading"]);
82
- };
83
- }
84
- }), X = /* @__PURE__ */ T({
85
- __name: "FiuuSettlementTable",
86
- props: {
87
- data: {
88
- type: Array,
89
- required: !0
90
- },
91
- loading: {
92
- type: Boolean,
93
- required: !0
94
- }
95
- },
96
- emits: ["row-click"],
97
- setup(m, { emit: g }) {
98
- const r = m, l = g, d = x(""), S = [
99
- {
100
- header: () => "Settlement ID",
101
- accessorKey: "id",
102
- cell: ({ cell: t }) => Y(M, { data: t.getValue() })
103
- },
104
- {
105
- header: () => "Bank",
106
- accessorKey: "bank"
107
- },
108
- {
109
- header: () => "Account No",
110
- accessorKey: "accountNo"
111
- },
112
- {
113
- header: () => "Created At",
114
- accessorKey: "transactionAt",
115
- meta: {
116
- width: "180px"
117
- }
118
- },
119
- {
120
- header: () => "Sales Amount",
121
- accessorKey: "amount"
122
- },
123
- {
124
- header: () => "Fee",
125
- accessorKey: "fee"
126
- },
127
- {
128
- header: () => "Settlement Amount",
129
- accessorKey: "payout"
130
- }
131
- ], c = R(() => r.data.map((t) => ({
132
- id: t.summary.referenceNo,
133
- bank: t.summary.bank.name,
134
- accountNo: t.summary.bank.accountNo,
135
- transactionAt: D(t.summary.completedAt).format("YYYY-MM-DD"),
136
- amount: i(t.summary.amount).toFormat("$0.00"),
137
- fee: i(t.summary.commission).toFormat("$0.00"),
138
- payout: i(t.summary.payout).toFormat("$0.00")
139
- })));
140
- return (t, o) => {
141
- const e = w("FmTable");
142
- return V(), C(e, {
143
- modelValue: d.value,
144
- "onUpdate:modelValue": o[0] || (o[0] = (s) => d.value = s),
145
- "row-data": c.value,
146
- "shrink-at": !1,
147
- "column-defs": S,
148
- loading: r.loading,
149
- onRowClick: o[1] || (o[1] = (s) => l("row-click", r.data.at(s.index)))
150
- }, null, 8, ["modelValue", "row-data", "loading"]);
151
- };
152
- }
153
- }), Z = {
154
- id: "fiuu-settlement-dialog",
155
- class: "flex mb-6"
156
- }, ee = { class: "my-6 w-[240px]" }, te = /* @__PURE__ */ T({
157
- __name: "FiuuSettlementTransactions",
158
- props: {
159
- settlement: {
160
- type: Object,
161
- required: !0
162
- }
163
- },
164
- setup(m) {
165
- const g = m;
166
- E();
167
- const r = x(g.settlement.record), l = x(g.settlement.record), d = x(""), S = [
168
- {
169
- header: () => "Transaction ID",
170
- accessorKey: "referenceNo"
171
- },
172
- {
173
- header: () => "Type",
174
- accessorKey: "group"
175
- },
176
- {
177
- header: () => "Transaction At",
178
- accessorKey: "completedAt",
179
- meta: {
180
- width: "180px"
181
- }
182
- },
183
- {
184
- header: () => "Sales Amount",
185
- accessorKey: "amount",
186
- cell: ({ cell: o }) => i(o.getValue()).toFormat("$0.00")
187
- },
188
- {
189
- header: () => "Fee",
190
- accessorKey: "commission",
191
- cell: ({ cell: o }) => i(o.getValue()).toFormat("$0.00")
192
- },
193
- {
194
- header: () => "Settlement Amount",
195
- accessorKey: "netAmount",
196
- cell: ({ cell: o }) => i(o.getValue()).toFormat("$0.00")
197
- }
198
- ], c = x("");
199
- let t;
200
- return h(c, async () => {
201
- t && clearTimeout(t), t = setTimeout(() => {
202
- var o = new RegExp(c.value, "i");
203
- l.value = r.value.filter((e) => {
204
- const s = JSON.stringify(e);
205
- return o.test(s);
206
- });
207
- }, 700);
208
- }), (o, e) => {
209
- const s = w("FmCardHeader"), F = w("FmCardSection"), k = w("FmCard"), $ = w("FmSearch"), y = w("FmTable");
210
- return V(), P(I, null, [
211
- a("div", Z, [
212
- n(k, {
213
- horizontal: "",
214
- class: "flex-1 p-6",
215
- variant: "elevated"
216
- }, {
217
- default: p(() => [
218
- n(F, { class: "flex flex-col gap-16 justify-between" }, {
219
- default: p(() => [
220
- n(s, {
221
- class: "p-0",
222
- title: "Transaction Info",
223
- subtitle: ""
224
- }),
225
- n(F, { class: "p-0" }, {
226
- default: p(() => [
227
- e[2] || (e[2] = a("b", null, "For", -1)),
228
- b(": " + v(m.settlement.summary.group) + " ", 1),
229
- e[3] || (e[3] = a("br", null, null, -1)),
230
- e[4] || (e[4] = a("b", null, "Reference", -1)),
231
- b(": " + v(m.settlement.summary.referenceNo), 1),
232
- e[5] || (e[5] = a("br", null, null, -1)),
233
- e[6] || (e[6] = a("b", null, "Transaction", -1)),
234
- b(": " + v(r.value.length), 1)
235
- ]),
236
- _: 1
237
- })
238
- ]),
239
- _: 1
240
- })
241
- ]),
242
- _: 1
243
- }),
244
- n(k, {
245
- horizontal: "",
246
- class: "flex-1 p-6 mx-6",
247
- variant: "elevated"
248
- }, {
249
- default: p(() => [
250
- n(F, { class: "flex flex-col gap-16 justify-between" }, {
251
- default: p(() => [
252
- n(s, {
253
- class: "p-0",
254
- title: "Bank Info",
255
- subtitle: ""
256
- }),
257
- n(F, { class: "p-0" }, {
258
- default: p(() => [
259
- e[7] || (e[7] = a("b", null, "Bank", -1)),
260
- b(": " + v(m.settlement.summary.bank.name), 1),
261
- e[8] || (e[8] = a("br", null, null, -1)),
262
- e[9] || (e[9] = a("b", null, "Name", -1)),
263
- b(": " + v(m.settlement.summary.bank.holderName), 1),
264
- e[10] || (e[10] = a("br", null, null, -1)),
265
- e[11] || (e[11] = a("b", null, "Number", -1)),
266
- b(": " + v(m.settlement.summary.bank.accountNo), 1)
267
- ]),
268
- _: 1
269
- })
270
- ]),
271
- _: 1
272
- })
273
- ]),
274
- _: 1
275
- }),
276
- n(k, {
277
- horizontal: "",
278
- class: "flex-1 p-6",
279
- variant: "elevated"
280
- }, {
281
- default: p(() => [
282
- n(F, { class: "flex flex-col gap-16 justify-between" }, {
283
- default: p(() => [
284
- n(s, {
285
- class: "p-0",
286
- title: "Payout Info",
287
- subtitle: ""
288
- }),
289
- n(F, { class: "p-0" }, {
290
- default: p(() => [
291
- e[12] || (e[12] = a("b", null, "Amount", -1)),
292
- b(": " + v(u(i)(m.settlement.summary.amount).toFormat("$0.00")), 1),
293
- e[13] || (e[13] = a("br", null, null, -1)),
294
- e[14] || (e[14] = a("b", null, "Fee", -1)),
295
- b(": " + v(u(i)(m.settlement.summary.commission).toFormat("$0.00")), 1),
296
- e[15] || (e[15] = a("br", null, null, -1)),
297
- e[16] || (e[16] = a("b", null, "Payout", -1)),
298
- b(": " + v(u(i)(m.settlement.summary.payout).toFormat("$0.00")), 1)
299
- ]),
300
- _: 1
301
- })
302
- ]),
303
- _: 1
304
- })
305
- ]),
306
- _: 1
307
- })
308
- ]),
309
- a("div", ee, [
310
- n($, {
311
- modelValue: c.value,
312
- "onUpdate:modelValue": e[0] || (e[0] = (f) => c.value = f),
313
- placeholder: "Search Transactions ..."
314
- }, null, 8, ["modelValue"])
315
- ]),
316
- n(y, {
317
- modelValue: d.value,
318
- "onUpdate:modelValue": e[1] || (e[1] = (f) => d.value = f),
319
- "shrink-at": !1,
320
- "search-value": c.value,
321
- "row-data": l.value,
322
- "column-defs": S
323
- }, null, 8, ["modelValue", "search-value", "row-data"])
324
- ], 64);
325
- };
326
- }
327
- }), ae = { class: "flex justify-between items-center mb-6" }, oe = { class: "flex space-x-8 items-center" }, ne = { class: "flex space-x-4 self-center" }, le = { class: "mb-6" }, re = { class: "mb-6" }, xe = /* @__PURE__ */ T({
328
- __name: "Settlement",
329
- setup(m) {
330
- const g = L(), { tab: r, dateRange: l } = H({
331
- tab: "feedme",
332
- dateRange: {
333
- startDate: D().startOf("day").format("YYYY-MM-DD"),
334
- endDate: D().endOf("day").format("YYYY-MM-DD")
335
- }
336
- }), { isLoading: d, startAsyncCall: S } = j(!0), { currentRestaurant: c } = q(), t = O(), o = x([]), e = x([]);
337
- async function s() {
338
- const y = await K.readRestaurantSettlements(
339
- {
340
- start: l.value.startDate,
341
- end: l.value.endDate
342
- }
343
- );
344
- o.value = y;
345
- }
346
- async function F() {
347
- const y = await K.readRestaurantRMSSettlements(
348
- {
349
- start: l.value.startDate,
350
- end: l.value.endDate
351
- }
352
- );
353
- e.value = y;
354
- }
355
- async function k() {
356
- await S(async () => Promise.all([
357
- s(),
358
- F()
359
- ]));
360
- }
361
- async function $(y) {
362
- t.open({
363
- title: `Settlement Transactions (${y.summary.referenceNo})`,
364
- minWidth: "90%",
365
- primaryActions: { text: "Close", close: !0 },
366
- contentComponent: te,
367
- contentComponentProps: { settlement: y }
368
- });
369
- }
370
- return U(k), h([c, l], k), (y, f) => {
371
- const B = w("FmTabs");
372
- return V(), C(z, {
373
- title: "Settlements",
374
- description: "Settlements are the finalization of financial transactions, transferring funds to complete payments.",
375
- loading: !1
376
- }, {
377
- default: p(() => [
378
- a("div", ae, [
379
- a("div", oe, [
380
- n(Q)
381
- ]),
382
- a("div", ne, [
383
- n(J, {
384
- button: {
385
- appendIcon: "file_download",
386
- variant: "primary",
387
- label: "Export"
388
- },
389
- handler: async () => {
390
- await u(K).downloadRestaurantSettlementReport({
391
- start: u(l).startDate,
392
- end: u(l).endDate
393
- });
394
- }
395
- }, null, 8, ["handler"])
396
- ])
397
- ]),
398
- a("div", le, [
399
- n(W, {
400
- modelValue: u(l),
401
- "onUpdate:modelValue": f[0] || (f[0] = (A) => N(l) ? l.value = A : null)
402
- }, null, 8, ["modelValue"])
403
- ]),
404
- a("div", re, [
405
- n(B, {
406
- modelValue: u(r),
407
- "onUpdate:modelValue": f[1] || (f[1] = (A) => N(r) ? r.value = A : null),
408
- items: [
409
- {
410
- label: "FeedMe",
411
- value: "feedme",
412
- icon: "summarize"
413
- },
414
- {
415
- label: "Fiuu (RMS)",
416
- value: "fiuu",
417
- icon: "overview"
418
- }
419
- ]
420
- }, null, 8, ["modelValue"])
421
- ]),
422
- u(r) === "fiuu" ? (V(), C(X, {
423
- key: 0,
424
- loading: u(d),
425
- data: e.value,
426
- onRowClick: $
427
- }, null, 8, ["loading", "data"])) : _("", !0),
428
- u(r) === "feedme" ? (V(), C(G, {
429
- key: 1,
430
- loading: u(d),
431
- data: o.value,
432
- onRowClick: f[2] || (f[2] = (A) => u(g).push({
433
- name: "mf-payment-settlement-transaction",
434
- params: {
435
- settlementId: A._id
436
- }
437
- }))
438
- }, null, 8, ["loading", "data"])) : _("", !0)
439
- ]),
440
- _: 1
441
- });
442
- };
443
- }
444
- });
445
- export {
446
- xe as default
447
- };