@feedmepos/mf-connect 0.1.98-beta.69 → 0.1.98-beta.71
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/{App-BiKMxixG.js → App-B-Onur9k.js} +8 -8
- package/dist/{AuditLogs-hcUTD8r2.js → AuditLogs-BnEeKG1C.js} +11 -11
- package/dist/{Bin-BEIYu4Wb.js → Bin-BH9_nATR.js} +8 -8
- package/dist/{Broadcast-CdsOnoex.js → Broadcast-Gt2ZLLpZ.js} +11 -11
- package/dist/{CampaignAnalytic-tfJk4uHv.js → CampaignAnalytic-BT6zTgNk.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DCfa5b54.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-nNLLEzii.js} +6 -6
- package/dist/{Card-DD2E58eg.js → Card-dD52oor7.js} +21 -21
- package/dist/{Collections-BJ3-qcPo.js → Collections-7bwYNl3M.js} +8 -8
- package/dist/{Credit-CaNsiUeh.js → Credit-qZdlqXqR.js} +12 -12
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BYl60g2P.js → DateRangeChip.vue_vue_type_script_setup_true_lang-DeNn_k19.js} +1 -1
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-CVnXbrDQ.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-C09W9Qja.js} +35 -35
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-C6j2U0CU.js → EffectSheet.vue_vue_type_style_index_0_lang-Bz1HRBMa.js} +6 -6
- package/dist/{Experience-WVRmN3BW.js → Experience-CAaWgWXP.js} +12 -12
- package/dist/{FileSaver.min-B0P2vo_g.js → FileSaver.min-BpfY6VnX.js} +1 -1
- package/dist/{Game-B72C_2ZX.js → Game-fhrbFb_5.js} +13 -13
- package/dist/{GiftCardSetup-BXrBTdxF.js → GiftCardSetup-CTwmNKim.js} +10 -10
- package/dist/{Grab-DkkVMS8x.js → Grab-BnPfb92x.js} +9 -9
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-DOz5RTkO.js → ImageInput.vue_vue_type_script_setup_true_lang-BySju1oT.js} +1 -1
- package/dist/{Index-CsTSWAqg.js → Index-DRwvmm_j.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-Bqjz1_TS.js → LocationPicker.vue_vue_type_script_setup_true_lang-Ya4r9NNE.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CDy7s43a.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CDwtqqLQ.js} +1 -1
- package/dist/{LoyaltyDashboard-Cv1bGSmQ.js → LoyaltyDashboard-8jn6SIWo.js} +13 -13
- package/dist/{MainLayout-fHF57JEF.js → MainLayout-Bf42AcB1.js} +3 -3
- package/dist/{Marketing-DSR9Ltbm.js → Marketing-DruTMjiR.js} +4 -4
- package/dist/{MarketingMaterialEdit-DPiuYUe2.js → MarketingMaterialEdit-moEHd_gP.js} +6 -6
- package/dist/{Member-DS0JP4GM.js → Member-C9VTQqIm.js} +155 -150
- package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-Pf9idXlV.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-DEsVSWmv.js} +23 -23
- package/dist/{MemberImportHistory-DhWnUZlE.js → MemberImportHistory-DZVwya9v.js} +7 -7
- package/dist/{MemberList-BxVGAat6.js → MemberList-KusIfy1u.js} +14 -14
- package/dist/{MemberTransactions-Brwauef3.js → MemberTransactions-msyjdzlI.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-B9t6HRkS.js → MessageInput.vue_vue_type_script_setup_true_lang-DbV-m3cC.js} +10 -10
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-pUeLVYJs.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-1DYGpJnD.js} +1 -1
- package/dist/{Mission-BU_Broks.js → Mission-CUUxpBUF.js} +13 -13
- package/dist/{Overview-BCb7SrPX.js → Overview-C9jyKXHX.js} +19 -19
- package/dist/{Overview-Nx3E9gxA.js → Overview-CYKoF8Hp.js} +4 -4
- package/dist/{Point-DxHE0zpA.js → Point-CPpQ07yp.js} +12 -12
- package/dist/{Promotion-DkXyrAWE.js → Promotion-CJ95m9Qb.js} +13 -13
- package/dist/{Queue-DcqW6gFI.js → Queue-CX39ILh_.js} +11 -11
- package/dist/{Record-T7-Qn-BL.js → Record-6I0qyXB5.js} +9 -9
- package/dist/{Review-C0ORLjPk.js → Review-DoWu2XNT.js} +2 -2
- package/dist/{ReviewFacebookCallback-BamFJii5.js → ReviewFacebookCallback-Co-5TnI7.js} +5 -5
- package/dist/{ReviewGoogleCallback-BbogEq-S.js → ReviewGoogleCallback-Ca7ZuMcF.js} +5 -5
- package/dist/{Reward-Bs3PlUm1.js → Reward-Cx_N6qBJ.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-bt1XYaTg.js → RewardGroup.vue_vue_type_script_setup_true_lang-Cn5Yp37p.js} +12 -12
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BIhuiOQp.js → RuleGroup.vue_vue_type_script_setup_true_lang-M0c67Dyl.js} +13 -13
- package/dist/{Segment-ByHZvxzf.js → Segment-Bx0EW966.js} +24 -24
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-Chb-W_Sp.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-ahvrEUGa.js} +13 -13
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-v8tQQ_3M.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-C7zSfZdl.js} +4 -4
- package/dist/{Setting-CDDQh6Km.js → Setting-DzEK3dWj.js} +14 -14
- package/dist/{SettingAdvertisements-vNfSi0PM.js → SettingAdvertisements-BNALbI88.js} +12 -12
- package/dist/{Settings-Dr9vVMqi.js → Settings-Cw85-xzq.js} +5 -5
- package/dist/{Store-6jIdhWvV.js → Store-BSqW1gwf.js} +25 -25
- package/dist/{StoreRewards-Bi-vUQa8.js → StoreRewards-CJXnS8Qf.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-D_goMUgu.js → StoreTransactions.vue_vue_type_script_setup_true_lang-C6tUwHEj.js} +373 -373
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-Dg1Caqaz.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-iylphGuV.js} +2 -2
- package/dist/{Tier-DQxy11b5.js → Tier-DfitNxp2.js} +25 -25
- package/dist/{Title-BrYUm3dJ.js → Title-QCbtOvKB.js} +21 -21
- package/dist/{Transaction-BKaL8ft5.js → Transaction-dOCzlidD.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DO6LZkqJ.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Be5X1C-Y.js} +6 -6
- package/dist/{Voucher-fevudt4N.js → Voucher-BfoCDwjg.js} +14 -14
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-Cr4_aclC.js → VoucherEditor.vue_vue_type_script_setup_true_lang-0EIYoZ0F.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CeOuczNX.js → ZodTextField.vue_vue_type_script_setup_true_lang-UdStgKbX.js} +2 -2
- package/dist/{app-BTQMPUaZ.js → app-BxTElIm-.js} +162 -162
- package/dist/app.js +1 -1
- package/dist/{base.export-BvF6HW_b.js → base.export-BmUK8hMh.js} +2 -2
- package/dist/{business-1bynM2S3.js → business-DjAiT8tR.js} +1 -1
- package/dist/{campaign-x2kSthOl.js → campaign-DlR3KF9m.js} +9 -9
- package/dist/{campaign-61jHDGE4.js → campaign-tAmQNoq7.js} +2 -2
- package/dist/{campaign.enum-DPKrl7Yi.js → campaign.enum-BjwEQd11.js} +1 -1
- package/dist/{campaign.fn-DVkjEyJa.js → campaign.fn-C6kWWIQx.js} +61 -61
- package/dist/{collectible.enum-C-25_MsY.js → collectible.enum-BrtXpT9S.js} +1 -1
- package/dist/{collection.fn-CTN43Pnh.js → collection.fn-CDhfM3Eq.js} +2 -2
- package/dist/{currency-CPD7bsCi.js → currency-10nX5QnT.js} +1 -1
- package/dist/{duplicateCampaign-BDFXsGKJ.js → duplicateCampaign-6oMZOvfM.js} +2 -2
- package/dist/{effect-Dm8vqK1h.js → effect-T4YzuTc5.js} +1 -1
- package/dist/{email-addresses-DW8Sb8Cs.js → email-addresses-BjODnJMM.js} +2 -2
- package/dist/{helper-CCZQK8H8.js → helper-BCl5r5yZ.js} +1 -1
- package/dist/{index-irwaz38u.js → index-B9ZMIUMa.js} +679 -650
- package/dist/{index-C8LcgPDt.js → index-BBsK7TUw.js} +3 -3
- package/dist/{index-BHJFHHKZ.js → index-BQk6zTgf.js} +2 -2
- package/dist/{index-D-mVW2R4.js → index-Bd4clHfr.js} +5 -5
- package/dist/{index-CN7lBDQn.js → index-BeVWchv7.js} +4 -4
- package/dist/{index-Dpfl5fwR.js → index-Bht1Z11w.js} +7 -7
- package/dist/{index-DADAdGcF.js → index-BiolIgqR.js} +1 -1
- package/dist/{index-D5th1Ref.js → index-BxU--5J5.js} +3 -3
- package/dist/{index-BG6_axTA.js → index-Bz6oSli7.js} +2 -2
- package/dist/{index-pNqNL1yL.js → index-C5IfNJUl.js} +1 -1
- package/dist/{index-CqOxyfYn.js → index-CRvUvCMA.js} +1 -1
- package/dist/{index-WMXL77u3.js → index-CnaQt4Pn.js} +1 -1
- package/dist/{index-BdIWlpWJ.js → index-Ctja--IE.js} +1 -1
- package/dist/{index-B9nAyvGU.js → index-D8rGhchh.js} +1 -1
- package/dist/{index-elefz7dV.js → index-DJdTDF9C.js} +7 -7
- package/dist/{index-B0E21F7i.js → index-DXiJa8Cw.js} +2 -2
- package/dist/{index-Ru-8vt_3.js → index-DeQKLilv.js} +3 -3
- package/dist/{index-Cj_YiRca.js → index-DhtKt4OL.js} +3 -3
- package/dist/{index.esm2017-BFkcep8i.js → index.esm2017-CEOegJjn.js} +37 -37
- package/dist/{loading-DY5cgK81.js → loading-Dx4SCvZY.js} +1 -1
- package/dist/{lodash-Mri5RxId.js → lodash-Dq8OKCKK.js} +1 -1
- package/dist/{member-import-Ds0mHQDO.js → member-import-DX-jn2uk.js} +1 -1
- package/dist/{membership-Dl9I9gta.js → membership-CltAa-gH.js} +3 -3
- package/dist/{money-DJf18iEv.js → money-DsaAjJTI.js} +1 -1
- package/dist/{number-CDlVA7gg.js → number-DmhHKYgY.js} +1 -1
- package/dist/{objectid-C7Jmt3kj.js → objectid-BdNv-dZX.js} +10 -10
- package/dist/{plugins-BB3qsUY2.js → plugins-BFKVM3uC.js} +3 -3
- package/dist/{reward-BDoWlsUZ.js → reward--SjvIeyy.js} +1 -1
- package/dist/{rule-DZQUn3H0.js → rule-CAKdNobZ.js} +8 -8
- package/dist/{template-DIsdAHue.js → template-Cfxc5eM8.js} +6 -6
- package/dist/{timezone-DINP7HO_.js → timezone-D2b-V5XD.js} +1 -1
- package/dist/transaction.fn-B5mLY7bz.js +71 -0
- package/dist/{trigger-BAhUCSbv.js → trigger-DvYcjRBZ.js} +5 -5
- package/dist/{useMarketingMaterialActions-waypQ70p.js → useMarketingMaterialActions-DtqnjMSt.js} +3 -3
- package/dist/{usePagination-BLZ_9QGR.js → usePagination-DKX24g31.js} +1 -1
- package/dist/{user-PO61yniX.js → user-fWb1NxGO.js} +1 -1
- package/dist/{vue-i18n-CfOCSTEg.js → vue-i18n-wJReAVJw.js} +190 -190
- package/dist/{xlsx-Cu-uiqcb.js → xlsx-Mthhu4JR.js} +224 -224
- package/dist/{zod-BM3CuDZq.js → zod-CVpVUgBZ.js} +1 -1
- package/package.json +1 -1
- package/dist/transaction.fn-CorgPho4.js +0 -64
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { ref as E, defineComponent as re, computed as
|
|
1
|
+
import { ref as E, defineComponent as re, computed as U, h as l, resolveComponent as K, openBlock as k, createBlock as ce, unref as i, isRef as fe, withCtx as ae, createElementVNode as _, createVNode as D, createElementBlock as O, Fragment as X, renderList as ne, toDisplayString as G, createTextVNode as Re, resolveDynamicComponent as Ie, watch as ge, onBeforeMount as Fe, onMounted as De } from "vue";
|
|
2
2
|
import { components as T } from "@feedmepos/ui-library";
|
|
3
|
-
import { B as ue } from "./index-
|
|
4
|
-
import "./index-
|
|
5
|
-
import { T as
|
|
6
|
-
import { h as
|
|
3
|
+
import { B as ue } from "./index-B9ZMIUMa.js";
|
|
4
|
+
import "./index-BxU--5J5.js";
|
|
5
|
+
import { T as z } from "./transaction.fn-B5mLY7bz.js";
|
|
6
|
+
import { h as A } from "./moment-D7p2TMB-.js";
|
|
7
7
|
import { _ as le } from "./FilterChip.vue_vue_type_script_setup_true_lang-3bH-tZAm.js";
|
|
8
|
-
import { _ as
|
|
8
|
+
import { _ as ye } from "./DateRangeChip.vue_vue_type_script_setup_true_lang-DeNn_k19.js";
|
|
9
9
|
import { s as te } from "./index-CuvNtC_M.js";
|
|
10
|
-
import { f as W, F as
|
|
11
|
-
import { u as
|
|
12
|
-
import { _ as
|
|
13
|
-
import { c as de, p as
|
|
14
|
-
import { g as
|
|
15
|
-
import { B as
|
|
16
|
-
import { u as
|
|
17
|
-
import "./index-
|
|
18
|
-
import "./index-
|
|
19
|
-
import "./index-
|
|
20
|
-
import "./index-
|
|
21
|
-
import "./index-
|
|
22
|
-
import { u as se } from "./vue-i18n-
|
|
10
|
+
import { f as W, F as Ae } from "./number-DmhHKYgY.js";
|
|
11
|
+
import { u as ve } from "./business-DjAiT8tR.js";
|
|
12
|
+
import { _ as he, u as Ne } from "./usePagination-DKX24g31.js";
|
|
13
|
+
import { c as de, p as Pe } from "./plugins-BFKVM3uC.js";
|
|
14
|
+
import { g as be } from "./user-fWb1NxGO.js";
|
|
15
|
+
import { B as xe, e as ke } from "./base.export-BmUK8hMh.js";
|
|
16
|
+
import { u as Se } from "./campaign-tAmQNoq7.js";
|
|
17
|
+
import "./index-D8rGhchh.js";
|
|
18
|
+
import "./index-DJdTDF9C.js";
|
|
19
|
+
import "./index-BBsK7TUw.js";
|
|
20
|
+
import "./index-Bd4clHfr.js";
|
|
21
|
+
import "./index-DhtKt4OL.js";
|
|
22
|
+
import { u as se } from "./vue-i18n-wJReAVJw.js";
|
|
23
23
|
import { o as j } from "./objectId-dwaoBfJX.js";
|
|
24
|
-
import { u as
|
|
25
|
-
import { w as
|
|
26
|
-
import { useRouter as
|
|
27
|
-
import { t as H } from "./index-
|
|
28
|
-
import { R as ee } from "./app-
|
|
29
|
-
import { F as ie } from "./collectible.enum-
|
|
30
|
-
import { useCoreStore as
|
|
24
|
+
import { u as _e } from "./loading-Dx4SCvZY.js";
|
|
25
|
+
import { w as Me } from "./xlsx-Mthhu4JR.js";
|
|
26
|
+
import { useRouter as Ee } from "vue-router";
|
|
27
|
+
import { t as H } from "./index-CRvUvCMA.js";
|
|
28
|
+
import { R as ee } from "./app-BxTElIm-.js";
|
|
29
|
+
import { F as ie } from "./collectible.enum-BrtXpT9S.js";
|
|
30
|
+
import { useCoreStore as Ve } from "@feedmepos/mf-common";
|
|
31
31
|
import { c as Q } from "./string-Gcy5IM_H.js";
|
|
32
|
-
import { f as
|
|
33
|
-
import { m as
|
|
34
|
-
const
|
|
32
|
+
import { f as $e } from "./currency-10nX5QnT.js";
|
|
33
|
+
import { m as Oe } from "./index-DeQKLilv.js";
|
|
34
|
+
const Be = (f) => {
|
|
35
35
|
if (f.startsWith("_") || f.includes("."))
|
|
36
36
|
return f;
|
|
37
37
|
for (const v of ["pf_user_", "pf_collectible_"])
|
|
@@ -39,7 +39,7 @@ const ze = (f) => {
|
|
|
39
39
|
return `${v.slice(0, -1)}.${f.slice(v.length).replace(new RegExp("_", "g"), ".")}`;
|
|
40
40
|
return f.replace(new RegExp("_", "g"), ".");
|
|
41
41
|
};
|
|
42
|
-
function
|
|
42
|
+
function ze(f, v = { key: "_id", descending: !0 }) {
|
|
43
43
|
const u = E({
|
|
44
44
|
pageCount: 1,
|
|
45
45
|
searchValue: "",
|
|
@@ -49,13 +49,13 @@ function Ue(f, v = { key: "_id", descending: !0 }) {
|
|
|
49
49
|
pageSize: 10,
|
|
50
50
|
hasNext: !1
|
|
51
51
|
}), m = E(v), C = E([]), w = E([void 0]);
|
|
52
|
-
function
|
|
52
|
+
function N() {
|
|
53
53
|
w.value = [void 0], u.value.pageIndex = 0, u.value.pageCount = 1, u.value.hasNext = !1;
|
|
54
54
|
}
|
|
55
|
-
const V = async (
|
|
56
|
-
const p =
|
|
57
|
-
a &&
|
|
58
|
-
const t = a ? 0 : Math.max(
|
|
55
|
+
const V = async (b = {}) => {
|
|
56
|
+
const p = b.pageSize ?? u.value.pageSize, a = p !== u.value.pageSize;
|
|
57
|
+
a && N();
|
|
58
|
+
const t = a ? 0 : Math.max(b.pageIndex ?? u.value.pageIndex, 0), e = t === 0 || !!w.value[t] ? t : u.value.pageIndex, n = w.value[e];
|
|
59
59
|
u.value.isLoading = !0, u.value.pageSize = p, C.value = [];
|
|
60
60
|
try {
|
|
61
61
|
const c = await f({
|
|
@@ -63,7 +63,7 @@ function Ue(f, v = { key: "_id", descending: !0 }) {
|
|
|
63
63
|
sortBy: m.value.key,
|
|
64
64
|
descending: m.value.descending,
|
|
65
65
|
search: u.value.searchValue,
|
|
66
|
-
...
|
|
66
|
+
...n ? { cursor: n } : {}
|
|
67
67
|
});
|
|
68
68
|
C.value = c.resources, u.value.pageIndex = e, u.value.totalRows = c.resources.length, u.value.hasNext = c.meta.hasNext, u.value.pageCount = e + (c.meta.hasNext ? 2 : 1), c.meta.nextCursor ? w.value[e + 1] = c.meta.nextCursor : w.value.splice(e + 1);
|
|
69
69
|
} catch (c) {
|
|
@@ -72,10 +72,10 @@ function Ue(f, v = { key: "_id", descending: !0 }) {
|
|
|
72
72
|
u.value.isLoading = !1;
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
|
-
let
|
|
76
|
-
const h = (
|
|
77
|
-
g = p,
|
|
78
|
-
|
|
75
|
+
let R, g;
|
|
76
|
+
const h = (b) => (R && clearTimeout(R), g && g(), new Promise((p) => {
|
|
77
|
+
g = p, R = setTimeout(async () => {
|
|
78
|
+
R = void 0, g = void 0, await V(b), p();
|
|
79
79
|
}, 200);
|
|
80
80
|
}));
|
|
81
81
|
return {
|
|
@@ -83,45 +83,45 @@ function Ue(f, v = { key: "_id", descending: !0 }) {
|
|
|
83
83
|
rowData: C,
|
|
84
84
|
sortBy: m,
|
|
85
85
|
pageCursors: w,
|
|
86
|
-
resetCursorState:
|
|
86
|
+
resetCursorState: N,
|
|
87
87
|
fetchData: V,
|
|
88
88
|
debouncedFetchData: h,
|
|
89
|
-
onSort: async (
|
|
90
|
-
|
|
91
|
-
key:
|
|
92
|
-
descending:
|
|
93
|
-
} : m.value = v,
|
|
89
|
+
onSort: async (b) => {
|
|
90
|
+
b.length ? m.value = {
|
|
91
|
+
key: Be(b[0].id),
|
|
92
|
+
descending: b[0].desc
|
|
93
|
+
} : m.value = v, N(), await h({
|
|
94
94
|
pageIndex: 0,
|
|
95
95
|
pageSize: u.value.pageSize
|
|
96
96
|
});
|
|
97
97
|
},
|
|
98
|
-
onSearch: () => (
|
|
98
|
+
onSearch: () => (N(), h({
|
|
99
99
|
pageIndex: 0,
|
|
100
100
|
pageSize: u.value.pageSize
|
|
101
101
|
}))
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
|
-
class
|
|
104
|
+
class Ue extends xe {
|
|
105
105
|
}
|
|
106
|
-
const
|
|
106
|
+
const Ye = { class: "space-y-24 pr-12" }, Le = { class: "w-full space-y-16" }, Ge = { class: "fm-typo-en-body-lg-600" }, Ke = ["onClick"], je = { class: "fm-typo-en-body-lg-600" }, We = ["onClick"], qe = { class: "flex items-center gap-8" }, He = /* @__PURE__ */ re({
|
|
107
107
|
__name: "TransactionDetailSheet",
|
|
108
108
|
setup(f, { expose: v }) {
|
|
109
109
|
se();
|
|
110
|
-
const u = E(!1), m = E(), C =
|
|
111
|
-
function
|
|
112
|
-
u.value = h, m.value =
|
|
110
|
+
const u = E(!1), m = E(), C = Se(), w = ve();
|
|
111
|
+
function N(h, s) {
|
|
112
|
+
u.value = h, m.value = s ?? null;
|
|
113
113
|
}
|
|
114
|
-
const V =
|
|
115
|
-
var h,
|
|
114
|
+
const V = U(() => {
|
|
115
|
+
var h, s;
|
|
116
116
|
return W(
|
|
117
|
-
((
|
|
118
|
-
(
|
|
117
|
+
((s = m.value) == null ? void 0 : s.expiryAmount.reduce(
|
|
118
|
+
(S, b) => S + b.amount,
|
|
119
119
|
((h = m.value) == null ? void 0 : h.amount) ?? 0
|
|
120
120
|
)) ?? 0,
|
|
121
121
|
2
|
|
122
122
|
);
|
|
123
|
-
}),
|
|
124
|
-
var h,
|
|
123
|
+
}), R = U(() => {
|
|
124
|
+
var h, s, S, b, p;
|
|
125
125
|
return m.value ? [
|
|
126
126
|
{
|
|
127
127
|
label: "Transaction ID",
|
|
@@ -129,7 +129,7 @@ const Le = { class: "space-y-24 pr-12" }, Ge = { class: "w-full space-y-16" }, K
|
|
|
129
129
|
},
|
|
130
130
|
{
|
|
131
131
|
label: "Date/Time",
|
|
132
|
-
value:
|
|
132
|
+
value: A(j(m.value._id.toString())).format(
|
|
133
133
|
"D MMM YYYY, hh:mmA"
|
|
134
134
|
)
|
|
135
135
|
},
|
|
@@ -148,110 +148,110 @@ const Le = { class: "space-y-24 pr-12" }, Ge = { class: "w-full space-y-16" }, K
|
|
|
148
148
|
},
|
|
149
149
|
{
|
|
150
150
|
label: "Type",
|
|
151
|
-
value:
|
|
151
|
+
value: z.formattedType(m.value)
|
|
152
152
|
},
|
|
153
153
|
{
|
|
154
154
|
label: "Source",
|
|
155
|
-
value: te(
|
|
155
|
+
value: te(z.getReason(m.value.source))
|
|
156
156
|
},
|
|
157
157
|
{
|
|
158
158
|
label: "User",
|
|
159
|
-
value: (
|
|
159
|
+
value: (S = (s = m.value) == null ? void 0 : s.pf_user) == null ? void 0 : S.name
|
|
160
160
|
},
|
|
161
161
|
{
|
|
162
162
|
label: "Phone Number",
|
|
163
|
-
value: (p = (
|
|
163
|
+
value: (p = (b = m.value) == null ? void 0 : b.pf_user) == null ? void 0 : p.phoneNumber
|
|
164
164
|
}
|
|
165
165
|
] : [];
|
|
166
|
-
}), g =
|
|
167
|
-
var
|
|
166
|
+
}), g = U(() => {
|
|
167
|
+
var p, a, t, x;
|
|
168
168
|
if (!m.value) return [];
|
|
169
|
-
const h = [],
|
|
170
|
-
if (
|
|
171
|
-
const
|
|
172
|
-
(
|
|
169
|
+
const h = [], s = (p = m.value) == null ? void 0 : p.metadata, S = m.value;
|
|
170
|
+
if (s != null && s.campaign) {
|
|
171
|
+
const e = C.campaigns.all.find(
|
|
172
|
+
(n) => n._id === (s == null ? void 0 : s.campaign)
|
|
173
173
|
);
|
|
174
|
-
|
|
175
|
-
h.push({
|
|
174
|
+
e && h.push({
|
|
176
175
|
label: "Campaign",
|
|
177
|
-
value:
|
|
176
|
+
value: e.name
|
|
178
177
|
});
|
|
179
178
|
}
|
|
180
|
-
|
|
179
|
+
const b = z.formattedRemark(S);
|
|
180
|
+
return b && h.push({
|
|
181
181
|
label: "Remark",
|
|
182
|
-
value:
|
|
183
|
-
}), (
|
|
182
|
+
value: b
|
|
183
|
+
}), (a = m.value) != null && a.ref.startsWith("bill_") && h.push({
|
|
184
184
|
label: "Bill Number",
|
|
185
|
-
value: (
|
|
185
|
+
value: (t = m.value) == null ? void 0 : t.ref,
|
|
186
186
|
copy: () => {
|
|
187
|
-
var
|
|
188
|
-
return de((
|
|
187
|
+
var e;
|
|
188
|
+
return de((e = m.value) == null ? void 0 : e.ref);
|
|
189
189
|
}
|
|
190
|
-
}),
|
|
190
|
+
}), s != null && s.location && h.push({
|
|
191
191
|
label: "Location",
|
|
192
|
-
value: (
|
|
193
|
-
(
|
|
194
|
-
)) == null ? void 0 :
|
|
195
|
-
}),
|
|
192
|
+
value: (x = w.locations.find(
|
|
193
|
+
(e) => e._id.toString() === (s == null ? void 0 : s.location)
|
|
194
|
+
)) == null ? void 0 : x.name
|
|
195
|
+
}), S.source === ue.enum.STORE && h.push({
|
|
196
196
|
label: "Store Transaction",
|
|
197
|
-
value:
|
|
198
|
-
}),
|
|
197
|
+
value: S.ref
|
|
198
|
+
}), s != null && s.originTransaction && h.push({
|
|
199
199
|
label: "Parent Transaction",
|
|
200
|
-
value:
|
|
201
|
-
}),
|
|
200
|
+
value: s.originTransaction
|
|
201
|
+
}), s != null && s.referral_count && h.push({
|
|
202
202
|
label: "Referral Count",
|
|
203
|
-
value:
|
|
204
|
-
}),
|
|
203
|
+
value: s.referral_count
|
|
204
|
+
}), S.refundedFrom && h.push({
|
|
205
205
|
label: "Refunded From",
|
|
206
|
-
value:
|
|
206
|
+
value: S.refundedFrom
|
|
207
207
|
}), h;
|
|
208
208
|
});
|
|
209
209
|
return v({
|
|
210
|
-
showSheet:
|
|
211
|
-
}), (h,
|
|
212
|
-
const
|
|
213
|
-
return k(), ce(
|
|
210
|
+
showSheet: N
|
|
211
|
+
}), (h, s) => {
|
|
212
|
+
const S = K("FmButton"), b = K("FmSideSheet");
|
|
213
|
+
return k(), ce(b, {
|
|
214
214
|
"max-width": 560,
|
|
215
215
|
modelValue: i(u),
|
|
216
|
-
"onUpdate:modelValue":
|
|
216
|
+
"onUpdate:modelValue": s[1] || (s[1] = (p) => fe(u) ? u.value = p : null),
|
|
217
217
|
header: "Transaction Details"
|
|
218
218
|
}, {
|
|
219
219
|
"side-sheet-footer": ae(() => [
|
|
220
|
-
|
|
221
|
-
|
|
220
|
+
_("div", qe, [
|
|
221
|
+
D(S, {
|
|
222
222
|
label: "Close",
|
|
223
|
-
onClick:
|
|
223
|
+
onClick: s[0] || (s[0] = (p) => N(!1)),
|
|
224
224
|
variant: "tertiary"
|
|
225
225
|
})
|
|
226
226
|
])
|
|
227
227
|
]),
|
|
228
228
|
default: ae(() => [
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
(k(!0), O(X, null, ne(i(
|
|
229
|
+
_("div", Ye, [
|
|
230
|
+
_("div", Le, [
|
|
231
|
+
(k(!0), O(X, null, ne(i(R), (p) => (k(), O("div", {
|
|
232
232
|
key: p.label,
|
|
233
233
|
class: "flex flex-col gap-4"
|
|
234
234
|
}, [
|
|
235
|
-
|
|
236
|
-
|
|
235
|
+
_("div", Ge, G(p.label), 1),
|
|
236
|
+
_("div", {
|
|
237
237
|
class: "text-fm-color-typo-secondary fm-typo-en-body-md-400 hover:underline",
|
|
238
238
|
onClick: p.copy
|
|
239
239
|
}, [
|
|
240
|
-
|
|
241
|
-
(k(), ce(
|
|
242
|
-
], 8,
|
|
243
|
-
|
|
240
|
+
Re(G(p.accessorFn ? p.accessorFn() : p.value) + " ", 1),
|
|
241
|
+
(k(), ce(Ie(p.component)))
|
|
242
|
+
], 8, Ke),
|
|
243
|
+
s[2] || (s[2] = _("hr", { class: "mt-3" }, null, -1))
|
|
244
244
|
]))), 128)),
|
|
245
245
|
(k(!0), O(X, null, ne(i(g), (p) => (k(), O("div", {
|
|
246
246
|
key: p.label,
|
|
247
247
|
class: "flex flex-col gap-4"
|
|
248
248
|
}, [
|
|
249
|
-
|
|
250
|
-
|
|
249
|
+
_("div", je, G(p.label), 1),
|
|
250
|
+
_("div", {
|
|
251
251
|
class: "text-fm-color-typo-secondary fm-typo-en-body-md-400 hover:underline",
|
|
252
252
|
onClick: p.copy
|
|
253
|
-
}, G(p.accessorFn ? p.accessorFn() : p.value), 9,
|
|
254
|
-
|
|
253
|
+
}, G(p.accessorFn ? p.accessorFn() : p.value), 9, We),
|
|
254
|
+
s[3] || (s[3] = _("hr", { class: "mt-3" }, null, -1))
|
|
255
255
|
]))), 128))
|
|
256
256
|
])
|
|
257
257
|
])
|
|
@@ -260,7 +260,7 @@ const Le = { class: "space-y-24 pr-12" }, Ge = { class: "w-full space-y-16" }, K
|
|
|
260
260
|
}, 8, ["modelValue"]);
|
|
261
261
|
};
|
|
262
262
|
}
|
|
263
|
-
}),
|
|
263
|
+
}), Qe = { class: "hidden xs:!flex items-center justify-end" }, Xe = { class: "flex items-center justify-between" }, Je = { class: "flex gap-8 items-center w-full overflow-x-scroll" }, Ze = { class: "xs:hidden" }, jt = /* @__PURE__ */ re({
|
|
264
264
|
__name: "CollectionTransactions",
|
|
265
265
|
props: {
|
|
266
266
|
user: {
|
|
@@ -268,28 +268,28 @@ const Le = { class: "space-y-24 pr-12" }, Ge = { class: "w-full space-y-16" }, K
|
|
|
268
268
|
}
|
|
269
269
|
},
|
|
270
270
|
setup(f) {
|
|
271
|
-
const { t: v } = se(), u =
|
|
271
|
+
const { t: v } = se(), u = ve(), m = Se(), C = Ee(), w = f, N = E(!1), { minor: V } = _e, R = [
|
|
272
272
|
{
|
|
273
273
|
header: "Transaction ID",
|
|
274
274
|
accessorKey: "_id",
|
|
275
275
|
meta: {
|
|
276
276
|
maxWidth: "100px"
|
|
277
277
|
},
|
|
278
|
-
cell(
|
|
278
|
+
cell(o) {
|
|
279
279
|
return l("div", { class: "flex items-center" }, [
|
|
280
280
|
l(T.FmIcon, {
|
|
281
281
|
name: "content_copy",
|
|
282
282
|
outline: !0,
|
|
283
283
|
size: "sm",
|
|
284
284
|
class: "cursor-pointer mr-4",
|
|
285
|
-
onClick: (
|
|
286
|
-
|
|
285
|
+
onClick: (r) => {
|
|
286
|
+
r.preventDefault(), r.stopPropagation(), de(o.row.original._id.toString());
|
|
287
287
|
}
|
|
288
288
|
}),
|
|
289
289
|
l(
|
|
290
290
|
"div",
|
|
291
291
|
{ class: "pr-2 text-ellipsis overflow-hidden" },
|
|
292
|
-
|
|
292
|
+
o.row.original._id.toString()
|
|
293
293
|
)
|
|
294
294
|
]);
|
|
295
295
|
},
|
|
@@ -298,8 +298,8 @@ const Le = { class: "space-y-24 pr-12" }, Ge = { class: "w-full space-y-16" }, K
|
|
|
298
298
|
{
|
|
299
299
|
header: "Created at",
|
|
300
300
|
accessorKey: "_id",
|
|
301
|
-
accessorFn: (
|
|
302
|
-
cell: (
|
|
301
|
+
accessorFn: (o) => A(j(o._id.toString())),
|
|
302
|
+
cell: (o) => A(j(o.row.original._id.toString())).format(
|
|
303
303
|
"D MMM YYYY, hh:mmA"
|
|
304
304
|
),
|
|
305
305
|
enableSorting: !0
|
|
@@ -308,15 +308,15 @@ const Le = { class: "space-y-24 pr-12" }, Ge = { class: "w-full space-y-16" }, K
|
|
|
308
308
|
header: "Amount",
|
|
309
309
|
// accessorKey: 'totalAmount',
|
|
310
310
|
enableSorting: !1,
|
|
311
|
-
cell(
|
|
311
|
+
cell(o) {
|
|
312
312
|
var y, d, M, B;
|
|
313
|
-
const
|
|
314
|
-
|
|
315
|
-
(q,
|
|
316
|
-
|
|
313
|
+
const r = W(
|
|
314
|
+
o.row.original.expiryAmount.reduce(
|
|
315
|
+
(q, Y) => q + Y.amount,
|
|
316
|
+
o.row.original.amount ?? 0
|
|
317
317
|
),
|
|
318
318
|
2
|
|
319
|
-
),
|
|
319
|
+
), P = (d = (y = o.row.original.expiryAmount) == null ? void 0 : y[0]) != null && d.expiredAt ? A((B = (M = o.row.original.expiryAmount) == null ? void 0 : M[0]) == null ? void 0 : B.expiredAt).format(
|
|
320
320
|
"D MMM YYYY"
|
|
321
321
|
) : "";
|
|
322
322
|
return l("div", { class: "flex items-center" }, [
|
|
@@ -325,16 +325,16 @@ const Le = { class: "space-y-24 pr-12" }, Ge = { class: "w-full space-y-16" }, K
|
|
|
325
325
|
{
|
|
326
326
|
class: [
|
|
327
327
|
"pr-2",
|
|
328
|
-
+
|
|
328
|
+
+r > 0 ? "text-fm-color-system-success-300" : "text-fm-color-system-error-300"
|
|
329
329
|
]
|
|
330
330
|
},
|
|
331
|
-
|
|
331
|
+
r
|
|
332
332
|
),
|
|
333
333
|
l("div", { class: "flex items-center" }, [
|
|
334
|
-
|
|
334
|
+
o.row.original.expiryAmount.length > 0 ? l(
|
|
335
335
|
T.FmTooltip,
|
|
336
336
|
{
|
|
337
|
-
content: `Expired on ${
|
|
337
|
+
content: `Expired on ${P}`
|
|
338
338
|
},
|
|
339
339
|
[
|
|
340
340
|
l(T.FmIcon, {
|
|
@@ -351,18 +351,18 @@ const Le = { class: "space-y-24 pr-12" }, Ge = { class: "w-full space-y-16" }, K
|
|
|
351
351
|
{
|
|
352
352
|
header: "Type",
|
|
353
353
|
accessorKey: "pf_collectible.type",
|
|
354
|
-
accessorFn: (
|
|
354
|
+
accessorFn: (o) => z.formattedType(o),
|
|
355
355
|
meta: {
|
|
356
356
|
maxWidth: "200px"
|
|
357
357
|
},
|
|
358
|
-
cell(
|
|
359
|
-
const
|
|
358
|
+
cell(o) {
|
|
359
|
+
const r = z.formattedType(o.row.original);
|
|
360
360
|
return l("div", { class: "flex items-center" }, [
|
|
361
|
-
l("div", { class: "truncate text-ellipsis" },
|
|
362
|
-
|
|
361
|
+
l("div", { class: "truncate text-ellipsis" }, r),
|
|
362
|
+
r.length > 20 ? l(
|
|
363
363
|
T.FmTooltip,
|
|
364
364
|
{
|
|
365
|
-
content:
|
|
365
|
+
content: r
|
|
366
366
|
},
|
|
367
367
|
[
|
|
368
368
|
l(T.FmIcon, {
|
|
@@ -379,26 +379,26 @@ const Le = { class: "space-y-24 pr-12" }, Ge = { class: "w-full space-y-16" }, K
|
|
|
379
379
|
{
|
|
380
380
|
header: "Source",
|
|
381
381
|
accessorKey: "source",
|
|
382
|
-
cell(
|
|
383
|
-
var
|
|
382
|
+
cell(o) {
|
|
383
|
+
var r;
|
|
384
384
|
return l("div", { class: "flex items-center gap-4" }, [
|
|
385
385
|
l(
|
|
386
386
|
"div",
|
|
387
387
|
{ class: "truncate text-ellipsis" },
|
|
388
|
-
te(
|
|
388
|
+
te(z.getReason(o.row.original.source))
|
|
389
389
|
),
|
|
390
|
-
...(
|
|
390
|
+
...(r = o.row.original.metadata) != null && r.campaign ? [
|
|
391
391
|
l(
|
|
392
392
|
T.FmTooltip,
|
|
393
393
|
{
|
|
394
394
|
get content() {
|
|
395
|
-
var
|
|
396
|
-
return (
|
|
395
|
+
var P;
|
|
396
|
+
return (P = m.campaigns.all.find(
|
|
397
397
|
(y) => {
|
|
398
398
|
var d;
|
|
399
|
-
return y._id === ((d =
|
|
399
|
+
return y._id === ((d = o.row.original.metadata) == null ? void 0 : d.campaign);
|
|
400
400
|
}
|
|
401
|
-
)) == null ? void 0 :
|
|
401
|
+
)) == null ? void 0 : P.name;
|
|
402
402
|
}
|
|
403
403
|
},
|
|
404
404
|
[
|
|
@@ -406,12 +406,12 @@ const Le = { class: "space-y-24 pr-12" }, Ge = { class: "w-full space-y-16" }, K
|
|
|
406
406
|
name: "info",
|
|
407
407
|
color: "primary",
|
|
408
408
|
size: "sm",
|
|
409
|
-
onClick: async (
|
|
410
|
-
|
|
409
|
+
onClick: async (P) => {
|
|
410
|
+
P.preventDefault(), P.stopPropagation();
|
|
411
411
|
const y = m.campaigns.all.find(
|
|
412
412
|
(d) => {
|
|
413
413
|
var M;
|
|
414
|
-
return d._id === ((M =
|
|
414
|
+
return d._id === ((M = o.row.original.metadata) == null ? void 0 : M.campaign);
|
|
415
415
|
}
|
|
416
416
|
);
|
|
417
417
|
if (y)
|
|
@@ -452,43 +452,43 @@ const Le = { class: "space-y-24 pr-12" }, Ge = { class: "w-full space-y-16" }, K
|
|
|
452
452
|
{
|
|
453
453
|
header: "User",
|
|
454
454
|
accessorKey: "pf_user.name",
|
|
455
|
-
cell(
|
|
456
|
-
return
|
|
455
|
+
cell(o) {
|
|
456
|
+
return be(o.row.original.pf_user);
|
|
457
457
|
}
|
|
458
458
|
},
|
|
459
459
|
{
|
|
460
460
|
header: "Phone No.",
|
|
461
461
|
accessorKey: "pf_user.phoneNumber",
|
|
462
|
-
accessorFn: (
|
|
463
|
-
var
|
|
464
|
-
return ((
|
|
462
|
+
accessorFn: (o) => {
|
|
463
|
+
var r;
|
|
464
|
+
return ((r = o == null ? void 0 : o.pf_user) == null ? void 0 : r.phoneNumber) || "";
|
|
465
465
|
}
|
|
466
466
|
},
|
|
467
467
|
{
|
|
468
468
|
header: "Status",
|
|
469
469
|
id: "status",
|
|
470
470
|
enableSorting: !1,
|
|
471
|
-
cell(
|
|
472
|
-
const
|
|
471
|
+
cell(o) {
|
|
472
|
+
const r = !!o.row.original.refunded;
|
|
473
473
|
return l(T.FmChip, {
|
|
474
|
-
label: v(
|
|
474
|
+
label: v(r ? "connect.transaction.refunded" : "connect.transaction.completed"),
|
|
475
475
|
variant: "plain",
|
|
476
|
-
class:
|
|
476
|
+
class: r ? "text-fm-color-typo-warning bg-fm-color-system-warning-100" : "text-fm-color-typo-success bg-fm-color-system-success-100"
|
|
477
477
|
});
|
|
478
478
|
}
|
|
479
479
|
},
|
|
480
480
|
{
|
|
481
|
-
accessorFn: (
|
|
481
|
+
accessorFn: (o) => o.ref,
|
|
482
482
|
header: "References",
|
|
483
483
|
accessorKey: "ref",
|
|
484
|
-
cell(
|
|
485
|
-
|
|
484
|
+
cell(o) {
|
|
485
|
+
const r = z.formattedRemark(o.row.original);
|
|
486
486
|
return l("div", { class: "flex items-center justify-between gap-4" }, [
|
|
487
487
|
l("div", { class: "flex items-center" }, [
|
|
488
|
-
|
|
488
|
+
r ? l(
|
|
489
489
|
T.FmTooltip,
|
|
490
490
|
{
|
|
491
|
-
content:
|
|
491
|
+
content: r
|
|
492
492
|
},
|
|
493
493
|
[
|
|
494
494
|
l(T.FmIcon, {
|
|
@@ -500,14 +500,14 @@ const Le = { class: "space-y-24 pr-12" }, Ge = { class: "w-full space-y-16" }, K
|
|
|
500
500
|
]
|
|
501
501
|
) : l("div")
|
|
502
502
|
]),
|
|
503
|
-
l("div", { class: "flex-1" },
|
|
503
|
+
l("div", { class: "flex-1" }, o.row.original.ref)
|
|
504
504
|
]);
|
|
505
505
|
}
|
|
506
506
|
},
|
|
507
507
|
{
|
|
508
508
|
header: "Actions",
|
|
509
|
-
cell(
|
|
510
|
-
const
|
|
509
|
+
cell(o) {
|
|
510
|
+
const r = o.row.original;
|
|
511
511
|
return l(
|
|
512
512
|
T.FmTooltip,
|
|
513
513
|
{
|
|
@@ -520,9 +520,9 @@ const Le = { class: "space-y-24 pr-12" }, Ge = { class: "w-full space-y-16" }, K
|
|
|
520
520
|
variant: "tertiary",
|
|
521
521
|
icon: "amend",
|
|
522
522
|
iconColor: "neutral-gray-400",
|
|
523
|
-
disabled: !
|
|
524
|
-
onClick: (
|
|
525
|
-
|
|
523
|
+
disabled: !r.isRevertable,
|
|
524
|
+
onClick: (P) => {
|
|
525
|
+
P.stopPropagation(), n(r);
|
|
526
526
|
}
|
|
527
527
|
})
|
|
528
528
|
]
|
|
@@ -534,8 +534,8 @@ const Le = { class: "space-y-24 pr-12" }, Ge = { class: "w-full space-y-16" }, K
|
|
|
534
534
|
"pf_collectible.type": [],
|
|
535
535
|
"metadata.location": [],
|
|
536
536
|
dateRange: {
|
|
537
|
-
startDate:
|
|
538
|
-
endDate:
|
|
537
|
+
startDate: A().subtract(7, "day").toISOString(),
|
|
538
|
+
endDate: A().endOf("day").toISOString()
|
|
539
539
|
},
|
|
540
540
|
source: []
|
|
541
541
|
}), h = () => ({
|
|
@@ -545,22 +545,22 @@ const Le = { class: "space-y-24 pr-12" }, Ge = { class: "w-full space-y-16" }, K
|
|
|
545
545
|
start: new Date(g.value.dateRange.startDate).toISOString(),
|
|
546
546
|
end: new Date(g.value.dateRange.endDate).toISOString()
|
|
547
547
|
}
|
|
548
|
-
}), { tableMeta:
|
|
549
|
-
const
|
|
550
|
-
|
|
548
|
+
}), { tableMeta: s, rowData: S, onSort: b, debouncedFetchData: p, resetCursorState: a } = ze(async (o) => {
|
|
549
|
+
const r = await H.readAllCursor(
|
|
550
|
+
o,
|
|
551
551
|
h()
|
|
552
|
-
),
|
|
553
|
-
|
|
552
|
+
), P = await Promise.all(
|
|
553
|
+
r.resources.map(async (y) => {
|
|
554
554
|
let d;
|
|
555
555
|
if (y.source !== ue.enum.BILL)
|
|
556
556
|
d = !1;
|
|
557
557
|
else {
|
|
558
558
|
const B = y.refunded || !!y.refundedFrom;
|
|
559
559
|
if (y.expiryAmount.reduce(
|
|
560
|
-
(
|
|
560
|
+
(Y, L) => Y + L.amount,
|
|
561
561
|
y.amount ?? 0
|
|
562
562
|
) > 0) {
|
|
563
|
-
let
|
|
563
|
+
let Y = [];
|
|
564
564
|
[
|
|
565
565
|
ie.enum.STAMP,
|
|
566
566
|
ie.enum.POINT
|
|
@@ -569,7 +569,7 @@ const Le = { class: "space-y-24 pr-12" }, Ge = { class: "w-full space-y-16" }, K
|
|
|
569
569
|
switch (y.pf_collectible.type) {
|
|
570
570
|
case ie.enum.VOUCHER:
|
|
571
571
|
d = y.expiryAmount.some(
|
|
572
|
-
(
|
|
572
|
+
(L) => !L.expiredAt || A(L.expiredAt).isAfter(A())
|
|
573
573
|
) && !B;
|
|
574
574
|
break;
|
|
575
575
|
default:
|
|
@@ -586,27 +586,27 @@ const Le = { class: "space-y-24 pr-12" }, Ge = { class: "w-full space-y-16" }, K
|
|
|
586
586
|
})
|
|
587
587
|
);
|
|
588
588
|
return {
|
|
589
|
-
resources:
|
|
589
|
+
resources: r.resources.map((y) => {
|
|
590
590
|
const d = t.value.find((M) => M._id === y.ref);
|
|
591
591
|
return { ...y, ref: (d == null ? void 0 : d.seqNumber) || y.ref };
|
|
592
592
|
}),
|
|
593
|
-
meta:
|
|
593
|
+
meta: r.meta
|
|
594
594
|
};
|
|
595
|
-
}), t = E([]),
|
|
596
|
-
() => u.locations.map((
|
|
595
|
+
}), t = E([]), x = ue.options.map((o) => ({ label: te(z.getReason(o)), value: o })), e = U(
|
|
596
|
+
() => u.locations.map((o) => ({ label: o.name, value: o._id }))
|
|
597
597
|
);
|
|
598
|
-
|
|
598
|
+
ge(
|
|
599
599
|
g,
|
|
600
600
|
() => {
|
|
601
601
|
a(), p({ pageIndex: 0 });
|
|
602
602
|
},
|
|
603
603
|
{ deep: !0 }
|
|
604
604
|
);
|
|
605
|
-
async function o
|
|
605
|
+
async function n(o) {
|
|
606
606
|
V(
|
|
607
607
|
async () => {
|
|
608
608
|
await H.revertTransaction({
|
|
609
|
-
id:
|
|
609
|
+
id: o._id.toString()
|
|
610
610
|
}), await p();
|
|
611
611
|
},
|
|
612
612
|
{
|
|
@@ -617,49 +617,49 @@ const Le = { class: "space-y-24 pr-12" }, Ge = { class: "w-full space-y-16" }, K
|
|
|
617
617
|
}
|
|
618
618
|
async function c() {
|
|
619
619
|
try {
|
|
620
|
-
|
|
621
|
-
const
|
|
620
|
+
N.value = !0;
|
|
621
|
+
const o = new Ue(), r = h(), P = 1e3;
|
|
622
622
|
await V(
|
|
623
623
|
async () => {
|
|
624
|
-
var M, B, q,
|
|
624
|
+
var M, B, q, Y, L, pe;
|
|
625
625
|
let y, d = !0;
|
|
626
626
|
for (; d; ) {
|
|
627
627
|
const Z = await H.readAllCursor(
|
|
628
628
|
{
|
|
629
|
-
limit:
|
|
629
|
+
limit: P,
|
|
630
630
|
sortBy: "_id",
|
|
631
631
|
descending: !1,
|
|
632
632
|
...y ? { cursor: y } : {}
|
|
633
633
|
},
|
|
634
|
-
|
|
634
|
+
r
|
|
635
635
|
);
|
|
636
636
|
if (!Z.resources.length)
|
|
637
637
|
break;
|
|
638
638
|
for (const $ of Z.resources)
|
|
639
|
-
|
|
639
|
+
o.addRecord({
|
|
640
640
|
TransactionID: $._id,
|
|
641
|
-
CreatedAt:
|
|
641
|
+
CreatedAt: A(j($._id.toString())).format(
|
|
642
642
|
"D MMM YYYY, hh:mmA"
|
|
643
643
|
),
|
|
644
644
|
Amount: W(
|
|
645
645
|
$.expiryAmount.reduce(
|
|
646
|
-
(
|
|
646
|
+
(we, Ce) => we + Ce.amount,
|
|
647
647
|
$.amount ?? 0
|
|
648
648
|
),
|
|
649
649
|
2
|
|
650
650
|
),
|
|
651
|
-
ExpiredAt: (B = (M = $.expiryAmount) == null ? void 0 : M[0]) != null && B.expiredAt ?
|
|
652
|
-
Type:
|
|
653
|
-
Source: te(
|
|
654
|
-
User: ((
|
|
651
|
+
ExpiredAt: (B = (M = $.expiryAmount) == null ? void 0 : M[0]) != null && B.expiredAt ? A((Y = (q = $.expiryAmount) == null ? void 0 : q[0]) == null ? void 0 : Y.expiredAt).format("D MMM YYYY") : "",
|
|
652
|
+
Type: z.formattedType($),
|
|
653
|
+
Source: te(z.getReason($.source)),
|
|
654
|
+
User: ((L = $.pf_user) == null ? void 0 : L.name) || "",
|
|
655
655
|
"Phone No.": ((pe = $.pf_user) == null ? void 0 : pe.phoneNumber) || "",
|
|
656
656
|
References: $.ref,
|
|
657
|
-
Remark: (
|
|
657
|
+
Remark: z.formattedRemark($)
|
|
658
658
|
});
|
|
659
659
|
y = Z.meta.nextCursor ?? void 0, d = Z.meta.hasNext && !!y;
|
|
660
660
|
}
|
|
661
|
-
await
|
|
662
|
-
|
|
661
|
+
await Me(
|
|
662
|
+
o.buildExcel(),
|
|
663
663
|
`transactions-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
|
|
664
664
|
{
|
|
665
665
|
bookType: "xlsx",
|
|
@@ -673,53 +673,53 @@ const Le = { class: "space-y-24 pr-12" }, Ge = { class: "w-full space-y-16" }, K
|
|
|
673
673
|
successMessage: "transactions exported successfully"
|
|
674
674
|
}
|
|
675
675
|
);
|
|
676
|
-
} catch (
|
|
677
|
-
console.error(
|
|
676
|
+
} catch (o) {
|
|
677
|
+
console.error(o);
|
|
678
678
|
} finally {
|
|
679
|
-
|
|
679
|
+
N.value = !1;
|
|
680
680
|
}
|
|
681
681
|
}
|
|
682
|
-
const
|
|
683
|
-
function
|
|
684
|
-
var
|
|
685
|
-
console.log(
|
|
682
|
+
const I = E(null);
|
|
683
|
+
function F(o) {
|
|
684
|
+
var r;
|
|
685
|
+
console.log(o), (r = I.value) == null || r.showSheet(!0, o.original);
|
|
686
686
|
}
|
|
687
|
-
return
|
|
687
|
+
return Fe(async () => {
|
|
688
688
|
await u.readLocations(), await m.read(), await p();
|
|
689
|
-
}), (
|
|
690
|
-
const
|
|
689
|
+
}), (o, r) => {
|
|
690
|
+
const P = K("FmSearch"), y = K("FmButton");
|
|
691
691
|
return k(), O(X, null, [
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
692
|
+
_("div", null, [
|
|
693
|
+
_("div", Qe, [
|
|
694
|
+
D(P, {
|
|
695
695
|
class: "hidden xs:!flex border-b border-fm-color-neutral-gray-100",
|
|
696
696
|
modelValue: i(g).search,
|
|
697
|
-
"onUpdate:modelValue":
|
|
697
|
+
"onUpdate:modelValue": r[0] || (r[0] = (d) => i(g).search = d),
|
|
698
698
|
placeholder: "Search",
|
|
699
699
|
collapsible: ""
|
|
700
700
|
}, null, 8, ["modelValue"]),
|
|
701
|
-
|
|
701
|
+
D(y, {
|
|
702
702
|
icon: "ios_share",
|
|
703
703
|
variant: "tertiary",
|
|
704
704
|
onClick: c
|
|
705
705
|
})
|
|
706
706
|
]),
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
707
|
+
_("div", Xe, [
|
|
708
|
+
_("div", Je, [
|
|
709
|
+
D(le, {
|
|
710
710
|
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
711
711
|
"right-icon": "keyboard_arrow_down",
|
|
712
712
|
modelValue: i(g)["metadata.location"],
|
|
713
|
-
"onUpdate:modelValue":
|
|
713
|
+
"onUpdate:modelValue": r[1] || (r[1] = (d) => i(g)["metadata.location"] = d),
|
|
714
714
|
icon: "storefront",
|
|
715
715
|
"show-item-label": !0,
|
|
716
716
|
items: i(e)
|
|
717
717
|
}, null, 8, ["modelValue", "items"]),
|
|
718
|
-
|
|
718
|
+
D(le, {
|
|
719
719
|
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
720
720
|
"right-icon": "keyboard_arrow_down",
|
|
721
721
|
modelValue: i(g)["pf_collectible.type"],
|
|
722
|
-
"onUpdate:modelValue":
|
|
722
|
+
"onUpdate:modelValue": r[2] || (r[2] = (d) => i(g)["pf_collectible.type"] = d),
|
|
723
723
|
label: "Type: ",
|
|
724
724
|
"show-item-label": !0,
|
|
725
725
|
items: [
|
|
@@ -733,76 +733,76 @@ const Le = { class: "space-y-24 pr-12" }, Ge = { class: "w-full space-y-16" }, K
|
|
|
733
733
|
{ label: "Stamp", value: "STAMP" }
|
|
734
734
|
]
|
|
735
735
|
}, null, 8, ["modelValue"]),
|
|
736
|
-
|
|
736
|
+
D(le, {
|
|
737
737
|
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
738
738
|
"right-icon": "keyboard_arrow_down",
|
|
739
739
|
modelValue: i(g).source,
|
|
740
|
-
"onUpdate:modelValue":
|
|
740
|
+
"onUpdate:modelValue": r[3] || (r[3] = (d) => i(g).source = d),
|
|
741
741
|
label: "Source: ",
|
|
742
742
|
"show-item-label": !0,
|
|
743
|
-
items: i(
|
|
743
|
+
items: i(x)
|
|
744
744
|
}, null, 8, ["modelValue", "items"]),
|
|
745
|
-
|
|
745
|
+
D(ye, {
|
|
746
746
|
"model-value": {
|
|
747
747
|
startDate: i(g).dateRange.startDate,
|
|
748
748
|
endDate: i(g).dateRange.endDate
|
|
749
749
|
},
|
|
750
|
-
"onUpdate:modelValue":
|
|
751
|
-
startDate: i(
|
|
752
|
-
endDate: i(
|
|
750
|
+
"onUpdate:modelValue": r[4] || (r[4] = (d) => i(g).dateRange = {
|
|
751
|
+
startDate: i(A)(d.startDate).startOf("d").toISOString(),
|
|
752
|
+
endDate: i(A)(d.endDate).endOf("d").toISOString()
|
|
753
753
|
})
|
|
754
754
|
}, null, 8, ["model-value"])
|
|
755
755
|
]),
|
|
756
|
-
|
|
756
|
+
D(P, {
|
|
757
757
|
class: "xs:hidden",
|
|
758
758
|
modelValue: i(g).search,
|
|
759
|
-
"onUpdate:modelValue":
|
|
759
|
+
"onUpdate:modelValue": r[5] || (r[5] = (d) => i(g).search = d),
|
|
760
760
|
placeholder: "Search",
|
|
761
761
|
collapsible: ""
|
|
762
762
|
}, null, 8, ["modelValue"]),
|
|
763
|
-
|
|
764
|
-
|
|
763
|
+
_("div", Ze, [
|
|
764
|
+
D(y, {
|
|
765
765
|
icon: "ios_share",
|
|
766
766
|
variant: "tertiary",
|
|
767
767
|
onClick: c
|
|
768
768
|
})
|
|
769
769
|
])
|
|
770
770
|
]),
|
|
771
|
-
|
|
772
|
-
loading: i(
|
|
773
|
-
"row-data": i(
|
|
774
|
-
"row-count": i(
|
|
775
|
-
"column-defs":
|
|
771
|
+
D(he, {
|
|
772
|
+
loading: i(s).isLoading,
|
|
773
|
+
"row-data": i(S),
|
|
774
|
+
"row-count": i(s).totalRows,
|
|
775
|
+
"column-defs": R.filter(
|
|
776
776
|
(d) => !w.user || d.header !== "User" && d.header !== "Phone No."
|
|
777
777
|
),
|
|
778
|
-
"page-count": i(
|
|
779
|
-
"page-index": i(
|
|
780
|
-
"page-size": i(
|
|
778
|
+
"page-count": i(s).pageCount,
|
|
779
|
+
"page-index": i(s).pageIndex,
|
|
780
|
+
"page-size": i(s).pageSize,
|
|
781
781
|
"shrink-at": !1,
|
|
782
782
|
"pagination-mode": "cursor",
|
|
783
|
-
"has-next": i(
|
|
784
|
-
onSortChange: i(
|
|
785
|
-
onPageChange:
|
|
783
|
+
"has-next": i(s).hasNext,
|
|
784
|
+
onSortChange: i(b),
|
|
785
|
+
onPageChange: r[6] || (r[6] = (d) => i(p)({
|
|
786
786
|
pageSize: d.pageSize,
|
|
787
787
|
pageIndex: d.pageIndex
|
|
788
788
|
})),
|
|
789
|
-
onRowClick:
|
|
789
|
+
onRowClick: F
|
|
790
790
|
}, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "has-next", "onSortChange"])
|
|
791
791
|
]),
|
|
792
|
-
|
|
792
|
+
D(He, {
|
|
793
793
|
ref_key: "transactionDetailSheet",
|
|
794
|
-
ref:
|
|
794
|
+
ref: I
|
|
795
795
|
}, null, 512)
|
|
796
796
|
], 64);
|
|
797
797
|
};
|
|
798
798
|
}
|
|
799
799
|
});
|
|
800
|
-
class
|
|
800
|
+
class et extends xe {
|
|
801
801
|
}
|
|
802
802
|
function oe(f) {
|
|
803
803
|
return f.quantity ?? 1;
|
|
804
804
|
}
|
|
805
|
-
function
|
|
805
|
+
function Te(f, v) {
|
|
806
806
|
var u, m;
|
|
807
807
|
switch ((u = f.paymentType) == null ? void 0 : u.type) {
|
|
808
808
|
case "COIN":
|
|
@@ -814,7 +814,7 @@ function we(f, v) {
|
|
|
814
814
|
}
|
|
815
815
|
}
|
|
816
816
|
function J(f, v) {
|
|
817
|
-
return
|
|
817
|
+
return $e({
|
|
818
818
|
...v,
|
|
819
819
|
amount: v.amount * oe(f)
|
|
820
820
|
});
|
|
@@ -831,13 +831,13 @@ function me(f) {
|
|
|
831
831
|
f.bundle.priceWithTaxes ?? f.bundle.price
|
|
832
832
|
);
|
|
833
833
|
}
|
|
834
|
-
function
|
|
834
|
+
function tt(f) {
|
|
835
835
|
return J(
|
|
836
836
|
f,
|
|
837
837
|
f.bundle.originalPrice ?? f.bundle.price
|
|
838
838
|
);
|
|
839
839
|
}
|
|
840
|
-
function
|
|
840
|
+
function at(f) {
|
|
841
841
|
const [v, ...u] = f.bundle.taxTotals ?? [];
|
|
842
842
|
if (!v) return null;
|
|
843
843
|
const m = u.reduce(
|
|
@@ -849,20 +849,20 @@ function nt(f) {
|
|
|
849
849
|
amount: m
|
|
850
850
|
});
|
|
851
851
|
}
|
|
852
|
-
const
|
|
852
|
+
const nt = { class: "space-y-24 pr-12" }, ot = { class: "fm-typo-en-title-sm-800 mb-16" }, rt = {
|
|
853
853
|
key: 0,
|
|
854
854
|
class: "space-y-16"
|
|
855
|
-
},
|
|
855
|
+
}, st = { class: "fm-typo-en-body-lg-600" }, lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary break-words" }, it = {
|
|
856
856
|
key: 1,
|
|
857
857
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
858
|
-
},
|
|
858
|
+
}, ct = /* @__PURE__ */ re({
|
|
859
859
|
__name: "StoreTransactionDetailSheet",
|
|
860
860
|
setup(f, { expose: v }) {
|
|
861
861
|
const u = E(!1), m = E(null), { t: C } = se();
|
|
862
862
|
function w(a, t) {
|
|
863
863
|
u.value = a, m.value = t ?? null;
|
|
864
864
|
}
|
|
865
|
-
function
|
|
865
|
+
function N(a) {
|
|
866
866
|
if (!a.location) return "Online Store";
|
|
867
867
|
const t = Array.isArray(a.pf_location) ? a.pf_location[0] : a.pf_location;
|
|
868
868
|
return (t == null ? void 0 : t.name) ?? a.location.toString();
|
|
@@ -870,22 +870,22 @@ const ot = { class: "space-y-24 pr-12" }, rt = { class: "fm-typo-en-title-sm-800
|
|
|
870
870
|
function V(a) {
|
|
871
871
|
return Array.isArray(a) ? a.flatMap((t) => typeof t != "object" || t === null || !("name" in t) || typeof t.name != "string" ? [] : [t.name]) : [];
|
|
872
872
|
}
|
|
873
|
-
function
|
|
873
|
+
function R(a, t, x, e) {
|
|
874
874
|
if (a.length === t)
|
|
875
|
-
return a.map((c) =>
|
|
876
|
-
const
|
|
877
|
-
return `${
|
|
875
|
+
return a.map((c) => x > 1 ? `${c} × ${x}` : c).join(", ");
|
|
876
|
+
const n = t * x;
|
|
877
|
+
return `${n} ${e}${n === 1 ? "" : "s"}`;
|
|
878
878
|
}
|
|
879
|
-
const g =
|
|
880
|
-
var e,
|
|
879
|
+
const g = U(() => {
|
|
880
|
+
var e, n, c;
|
|
881
881
|
const a = m.value;
|
|
882
882
|
if (!a) return [];
|
|
883
|
-
const t = a.pf_member,
|
|
883
|
+
const t = a.pf_member, x = Te(a, C);
|
|
884
884
|
return [
|
|
885
885
|
{ label: "Transaction ID", value: a._id.toString() },
|
|
886
886
|
{
|
|
887
887
|
label: "Date/Time",
|
|
888
|
-
value:
|
|
888
|
+
value: A(j(a._id.toString())).format(
|
|
889
889
|
"D MMM YYYY, hh:mmA"
|
|
890
890
|
)
|
|
891
891
|
},
|
|
@@ -897,10 +897,10 @@ const ot = { class: "space-y-24 pr-12" }, rt = { class: "fm-typo-en-title-sm-800
|
|
|
897
897
|
label: "Customer",
|
|
898
898
|
value: (t == null ? void 0 : t.name) ?? (t == null ? void 0 : t.email) ?? (t == null ? void 0 : t.phoneNumber) ?? "Unknown"
|
|
899
899
|
},
|
|
900
|
-
{ label: "Location", value:
|
|
900
|
+
{ label: "Location", value: N(a) },
|
|
901
901
|
{
|
|
902
902
|
label: "Payment Type",
|
|
903
|
-
value: ((e = a.paymentType) == null ? void 0 : e.type) === "COIN" || ((
|
|
903
|
+
value: ((e = a.paymentType) == null ? void 0 : e.type) === "COIN" || ((n = a.paymentType) == null ? void 0 : n.type) === "CARD" || !((c = a.paymentType) != null && c.type) ? x : Q.title(x)
|
|
904
904
|
},
|
|
905
905
|
{ label: "Reference", value: a.ref || "N/A" },
|
|
906
906
|
...a.paymentRef ? [{ label: "Payment Reference", value: a.paymentRef }] : [],
|
|
@@ -909,13 +909,13 @@ const ot = { class: "space-y-24 pr-12" }, rt = { class: "fm-typo-en-title-sm-800
|
|
|
909
909
|
value: oe(a).toString()
|
|
910
910
|
}
|
|
911
911
|
];
|
|
912
|
-
}), h =
|
|
912
|
+
}), h = U(() => {
|
|
913
913
|
const a = m.value;
|
|
914
914
|
return a ? [
|
|
915
915
|
{ label: "Bundle Name", value: a.bundle.name },
|
|
916
916
|
{
|
|
917
917
|
label: "Bundle Value",
|
|
918
|
-
value:
|
|
918
|
+
value: tt(a)
|
|
919
919
|
},
|
|
920
920
|
{
|
|
921
921
|
label: "Base Subtotal",
|
|
@@ -926,24 +926,24 @@ const ot = { class: "space-y-24 pr-12" }, rt = { class: "fm-typo-en-title-sm-800
|
|
|
926
926
|
value: me(a)
|
|
927
927
|
}
|
|
928
928
|
] : [];
|
|
929
|
-
}),
|
|
930
|
-
var
|
|
929
|
+
}), s = U(() => {
|
|
930
|
+
var n;
|
|
931
931
|
const a = m.value;
|
|
932
932
|
if (!a) return [];
|
|
933
|
-
const { bundle: t } = a,
|
|
933
|
+
const { bundle: t } = a, x = oe(a), e = [];
|
|
934
934
|
if (t.credit.normal > 0 && e.push({
|
|
935
935
|
label: "Credit",
|
|
936
936
|
value: `${W(
|
|
937
|
-
t.credit.normal *
|
|
937
|
+
t.credit.normal * x,
|
|
938
938
|
2,
|
|
939
939
|
!0
|
|
940
940
|
)} credits`
|
|
941
|
-
}), (
|
|
941
|
+
}), (n = t.credit.free) != null && n.amount) {
|
|
942
942
|
const c = `${t.credit.free.day} day${t.credit.free.day === 1 ? "" : "s"}`;
|
|
943
943
|
e.push({
|
|
944
944
|
label: "Free Credit",
|
|
945
945
|
value: `${W(
|
|
946
|
-
t.credit.free.amount *
|
|
946
|
+
t.credit.free.amount * x,
|
|
947
947
|
2,
|
|
948
948
|
!0
|
|
949
949
|
)} credits (${c})`
|
|
@@ -951,36 +951,36 @@ const ot = { class: "space-y-24 pr-12" }, rt = { class: "fm-typo-en-title-sm-800
|
|
|
951
951
|
}
|
|
952
952
|
return t.vouchers.length > 0 && e.push({
|
|
953
953
|
label: "Vouchers",
|
|
954
|
-
value:
|
|
954
|
+
value: R(
|
|
955
955
|
V(t.pf_vouchers),
|
|
956
956
|
t.vouchers.length,
|
|
957
|
-
|
|
957
|
+
x,
|
|
958
958
|
"voucher"
|
|
959
959
|
)
|
|
960
960
|
}), t.titles.length > 0 && e.push({
|
|
961
961
|
label: "Titles",
|
|
962
|
-
value:
|
|
962
|
+
value: R(
|
|
963
963
|
V(t.pf_titles),
|
|
964
964
|
t.titles.length,
|
|
965
|
-
|
|
965
|
+
x,
|
|
966
966
|
"title"
|
|
967
967
|
)
|
|
968
968
|
}), e;
|
|
969
|
-
}),
|
|
969
|
+
}), S = U(() => {
|
|
970
970
|
const a = m.value;
|
|
971
971
|
if (!a) return [];
|
|
972
972
|
const t = (a.bundle.taxTotals ?? []).map((e) => {
|
|
973
973
|
var c;
|
|
974
|
-
const
|
|
975
|
-
(
|
|
974
|
+
const n = (c = a.bundle._inclusiveTaxes) == null ? void 0 : c.some(
|
|
975
|
+
(I) => I.systemCode === e.systemCode && I.inclusive
|
|
976
976
|
);
|
|
977
977
|
return {
|
|
978
|
-
label: `${e.name} (${
|
|
978
|
+
label: `${e.name} (${Ae(e.rate)}%, ${n ? "Inclusive" : "Exclusive"})`,
|
|
979
979
|
value: J(a, e.total)
|
|
980
980
|
};
|
|
981
|
-
}),
|
|
982
|
-
return
|
|
983
|
-
}),
|
|
981
|
+
}), x = at(a);
|
|
982
|
+
return x ? [...t, { label: "Tax Total", value: x }] : t;
|
|
983
|
+
}), b = U(() => {
|
|
984
984
|
var t;
|
|
985
985
|
const a = (t = m.value) == null ? void 0 : t.giftCard;
|
|
986
986
|
return a ? [
|
|
@@ -990,44 +990,44 @@ const ot = { class: "space-y-24 pr-12" }, rt = { class: "fm-typo-en-title-sm-800
|
|
|
990
990
|
value: a.serialNumber ?? (a.movement === "PURCHASE" ? "Pending card issuance" : "Not available")
|
|
991
991
|
}
|
|
992
992
|
] : [];
|
|
993
|
-
}), p =
|
|
993
|
+
}), p = U(() => [
|
|
994
994
|
{ title: "Transaction", items: g.value },
|
|
995
995
|
{ title: "Bundle & Pricing", items: h.value },
|
|
996
|
-
{ title: "Rewards", items:
|
|
997
|
-
{ title: "Taxes", items:
|
|
998
|
-
...
|
|
996
|
+
{ title: "Rewards", items: s.value, emptyText: "No rewards" },
|
|
997
|
+
{ title: "Taxes", items: S.value, emptyText: "No taxes" },
|
|
998
|
+
...b.value.length ? [{ title: "Gift Card", items: b.value }] : []
|
|
999
999
|
]);
|
|
1000
1000
|
return v({ showSheet: w }), (a, t) => {
|
|
1001
|
-
const
|
|
1001
|
+
const x = K("FmButton"), e = K("FmSideSheet");
|
|
1002
1002
|
return k(), ce(e, {
|
|
1003
1003
|
modelValue: i(u),
|
|
1004
|
-
"onUpdate:modelValue": t[1] || (t[1] = (
|
|
1004
|
+
"onUpdate:modelValue": t[1] || (t[1] = (n) => fe(u) ? u.value = n : null),
|
|
1005
1005
|
"max-width": 560,
|
|
1006
1006
|
header: "Store Transaction Details"
|
|
1007
1007
|
}, {
|
|
1008
1008
|
"side-sheet-footer": ae(() => [
|
|
1009
|
-
|
|
1009
|
+
D(x, {
|
|
1010
1010
|
label: "Close",
|
|
1011
1011
|
variant: "tertiary",
|
|
1012
|
-
onClick: t[0] || (t[0] = (
|
|
1012
|
+
onClick: t[0] || (t[0] = (n) => w(!1))
|
|
1013
1013
|
})
|
|
1014
1014
|
]),
|
|
1015
1015
|
default: ae(() => [
|
|
1016
|
-
|
|
1017
|
-
(k(!0), O(X, null, ne(i(p), (
|
|
1018
|
-
key:
|
|
1016
|
+
_("div", nt, [
|
|
1017
|
+
(k(!0), O(X, null, ne(i(p), (n) => (k(), O("section", {
|
|
1018
|
+
key: n.title
|
|
1019
1019
|
}, [
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
(k(!0), O(X, null, ne(
|
|
1020
|
+
_("h3", ot, G(n.title), 1),
|
|
1021
|
+
n.items.length ? (k(), O("div", rt, [
|
|
1022
|
+
(k(!0), O(X, null, ne(n.items, (c) => (k(), O("div", {
|
|
1023
1023
|
key: c.label,
|
|
1024
1024
|
class: "flex flex-col gap-4"
|
|
1025
1025
|
}, [
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
t[2] || (t[2] =
|
|
1026
|
+
_("div", st, G(c.label), 1),
|
|
1027
|
+
_("div", lt, G(c.value), 1),
|
|
1028
|
+
t[2] || (t[2] = _("hr", { class: "mt-3 border-fm-color-neutral-gray-100" }, null, -1))
|
|
1029
1029
|
]))), 128))
|
|
1030
|
-
])) : (k(), O("div",
|
|
1030
|
+
])) : (k(), O("div", it, G(n.emptyText), 1))
|
|
1031
1031
|
]))), 128))
|
|
1032
1032
|
])
|
|
1033
1033
|
]),
|
|
@@ -1035,7 +1035,7 @@ const ot = { class: "space-y-24 pr-12" }, rt = { class: "fm-typo-en-title-sm-800
|
|
|
1035
1035
|
}, 8, ["modelValue"]);
|
|
1036
1036
|
};
|
|
1037
1037
|
}
|
|
1038
|
-
}),
|
|
1038
|
+
}), ut = { class: "flex items-center justify-between" }, mt = { class: "flex gap-8 items-center" }, dt = { class: "flex gap-8 items-center xs:hidden" }, Wt = /* @__PURE__ */ re({
|
|
1039
1039
|
__name: "StoreTransactions",
|
|
1040
1040
|
props: {
|
|
1041
1041
|
user: {
|
|
@@ -1043,18 +1043,18 @@ const ot = { class: "space-y-24 pr-12" }, rt = { class: "fm-typo-en-title-sm-800
|
|
|
1043
1043
|
}
|
|
1044
1044
|
},
|
|
1045
1045
|
setup(f) {
|
|
1046
|
-
const v = f, { minor: u } =
|
|
1046
|
+
const v = f, { minor: u } = _e, { t: m } = se();
|
|
1047
1047
|
function C(e) {
|
|
1048
|
-
return
|
|
1048
|
+
return Te(e, m);
|
|
1049
1049
|
}
|
|
1050
1050
|
function w(e) {
|
|
1051
|
-
return
|
|
1051
|
+
return A(j(e._id.toString())).format(
|
|
1052
1052
|
"D MMM YYYY, hh:mmA"
|
|
1053
1053
|
);
|
|
1054
1054
|
}
|
|
1055
|
-
function
|
|
1056
|
-
var
|
|
1057
|
-
return e.location ? ((c = (
|
|
1055
|
+
function N(e) {
|
|
1056
|
+
var n, c;
|
|
1057
|
+
return e.location ? ((c = (n = e.pf_location) == null ? void 0 : n[0]) == null ? void 0 : c.name) ?? e.location.toString() : "Online Store";
|
|
1058
1058
|
}
|
|
1059
1059
|
const V = [
|
|
1060
1060
|
{
|
|
@@ -1069,8 +1069,8 @@ const ot = { class: "space-y-24 pr-12" }, rt = { class: "fm-typo-en-title-sm-800
|
|
|
1069
1069
|
outline: !0,
|
|
1070
1070
|
size: "sm",
|
|
1071
1071
|
class: "cursor-pointer mr-4 shrink-0",
|
|
1072
|
-
onClick: (
|
|
1073
|
-
|
|
1072
|
+
onClick: (n) => {
|
|
1073
|
+
n.preventDefault(), n.stopPropagation(), de(e.row.original._id.toString());
|
|
1074
1074
|
}
|
|
1075
1075
|
}),
|
|
1076
1076
|
l("div", { class: "truncate" }, e.row.original._id.toString())
|
|
@@ -1092,16 +1092,16 @@ const ot = { class: "space-y-24 pr-12" }, rt = { class: "fm-typo-en-title-sm-800
|
|
|
1092
1092
|
},
|
|
1093
1093
|
{
|
|
1094
1094
|
header: "Location",
|
|
1095
|
-
accessorFn:
|
|
1095
|
+
accessorFn: N
|
|
1096
1096
|
},
|
|
1097
1097
|
{
|
|
1098
1098
|
header: "Payment Type",
|
|
1099
1099
|
accessorFn: C,
|
|
1100
1100
|
cell(e) {
|
|
1101
|
-
var
|
|
1101
|
+
var n;
|
|
1102
1102
|
return l("div", { class: "flex items-center gap-4" }, [
|
|
1103
1103
|
l("div", { class: "flex items-center" }, [
|
|
1104
|
-
((
|
|
1104
|
+
((n = e.row.original.paymentType) == null ? void 0 : n.type) == "ONLINE" && e.row.original.paymentType.extra ? l(
|
|
1105
1105
|
T.FmTooltip,
|
|
1106
1106
|
{
|
|
1107
1107
|
content: e.row.original.paymentType.extra
|
|
@@ -1121,7 +1121,7 @@ const ot = { class: "space-y-24 pr-12" }, rt = { class: "fm-typo-en-title-sm-800
|
|
|
1121
1121
|
},
|
|
1122
1122
|
{
|
|
1123
1123
|
header: "User",
|
|
1124
|
-
cell: (e) =>
|
|
1124
|
+
cell: (e) => be(e.row.original.pf_member)
|
|
1125
1125
|
},
|
|
1126
1126
|
{
|
|
1127
1127
|
header: "Phone No.",
|
|
@@ -1131,21 +1131,21 @@ const ot = { class: "space-y-24 pr-12" }, rt = { class: "fm-typo-en-title-sm-800
|
|
|
1131
1131
|
header: "Status",
|
|
1132
1132
|
// accessorFn: (u) => u.status,
|
|
1133
1133
|
cell(e) {
|
|
1134
|
-
var
|
|
1135
|
-
const
|
|
1134
|
+
var I, F, o, r;
|
|
1135
|
+
const n = e.row.original.status, c = {
|
|
1136
1136
|
COMPLETED: "text-fm-color-typo-success bg-fm-color-system-success-100",
|
|
1137
1137
|
REFUNDED: "text-fm-color-typo-warning bg-fm-color-system-warning-100"
|
|
1138
1138
|
};
|
|
1139
1139
|
return l("div", { class: "flex items-center gap-4" }, [
|
|
1140
1140
|
l(T.FmChip, {
|
|
1141
|
-
label: Q.title(
|
|
1141
|
+
label: Q.title(n),
|
|
1142
1142
|
variant: "plain",
|
|
1143
|
-
class: c[
|
|
1143
|
+
class: c[n] ?? ""
|
|
1144
1144
|
}),
|
|
1145
|
-
(
|
|
1145
|
+
(F = (I = e.row.original) == null ? void 0 : I.refund) != null && F.reason ? l(
|
|
1146
1146
|
T.FmTooltip,
|
|
1147
1147
|
{
|
|
1148
|
-
content: (
|
|
1148
|
+
content: (r = (o = e.row.original) == null ? void 0 : o.refund) == null ? void 0 : r.reason
|
|
1149
1149
|
},
|
|
1150
1150
|
[
|
|
1151
1151
|
l(T.FmIcon, {
|
|
@@ -1170,13 +1170,13 @@ const ot = { class: "space-y-24 pr-12" }, rt = { class: "fm-typo-en-title-sm-800
|
|
|
1170
1170
|
{
|
|
1171
1171
|
id: "action",
|
|
1172
1172
|
cell(e) {
|
|
1173
|
-
const
|
|
1173
|
+
const n = e.row.original, c = n.status === "COMPLETED" && !n.refund && n.source == "ADMIN";
|
|
1174
1174
|
return c ? l(
|
|
1175
1175
|
T.FmMenu,
|
|
1176
1176
|
{
|
|
1177
1177
|
placement: "bottom-end",
|
|
1178
|
-
onClick: (
|
|
1179
|
-
|
|
1178
|
+
onClick: (I) => {
|
|
1179
|
+
I.stopPropagation();
|
|
1180
1180
|
}
|
|
1181
1181
|
},
|
|
1182
1182
|
{
|
|
@@ -1189,8 +1189,8 @@ const ot = { class: "space-y-24 pr-12" }, rt = { class: "fm-typo-en-title-sm-800
|
|
|
1189
1189
|
l(T.FmMenuItem, {
|
|
1190
1190
|
label: "Refund",
|
|
1191
1191
|
sublabel: "Refund this transaction",
|
|
1192
|
-
onClick: async (
|
|
1193
|
-
|
|
1192
|
+
onClick: async (I) => {
|
|
1193
|
+
I.stopPropagation(), await p(n);
|
|
1194
1194
|
}
|
|
1195
1195
|
})
|
|
1196
1196
|
]
|
|
@@ -1198,21 +1198,21 @@ const ot = { class: "space-y-24 pr-12" }, rt = { class: "fm-typo-en-title-sm-800
|
|
|
1198
1198
|
) : l("div");
|
|
1199
1199
|
}
|
|
1200
1200
|
}
|
|
1201
|
-
],
|
|
1201
|
+
], R = E({
|
|
1202
1202
|
searchValue: "",
|
|
1203
1203
|
dateRange: {
|
|
1204
|
-
startDate:
|
|
1205
|
-
endDate:
|
|
1204
|
+
startDate: A().subtract(7, "day").toISOString(),
|
|
1205
|
+
endDate: A().toISOString()
|
|
1206
1206
|
}
|
|
1207
|
-
}), { tableMeta: g, rowData: h, onSort:
|
|
1208
|
-
const
|
|
1209
|
-
...
|
|
1207
|
+
}), { tableMeta: g, rowData: h, onSort: s, debouncedFetchData: S, onSearch: b } = Ne(async (e) => {
|
|
1208
|
+
const n = {
|
|
1209
|
+
...R.value.dateRange,
|
|
1210
1210
|
user: v.user
|
|
1211
1211
|
};
|
|
1212
|
-
return await H.readStoreTransactions(e,
|
|
1212
|
+
return await H.readStoreTransactions(e, n);
|
|
1213
1213
|
});
|
|
1214
1214
|
async function p(e) {
|
|
1215
|
-
await
|
|
1215
|
+
await Pe.confirm(
|
|
1216
1216
|
"Are you sure you want to refund this transaction?",
|
|
1217
1217
|
"Refund Store Transaction",
|
|
1218
1218
|
"Confirm",
|
|
@@ -1220,10 +1220,10 @@ const ot = { class: "space-y-24 pr-12" }, rt = { class: "fm-typo-en-title-sm-800
|
|
|
1220
1220
|
) && await u(
|
|
1221
1221
|
async () => {
|
|
1222
1222
|
var c;
|
|
1223
|
-
await
|
|
1223
|
+
await Oe.refundStoreTransaction({
|
|
1224
1224
|
id: e._id,
|
|
1225
|
-
reason: `ADMIN:${(c =
|
|
1226
|
-
}), await
|
|
1225
|
+
reason: `ADMIN:${(c = Ve().sessionUser) == null ? void 0 : c.name}`
|
|
1226
|
+
}), await S();
|
|
1227
1227
|
},
|
|
1228
1228
|
{
|
|
1229
1229
|
message: "Refunding transaction...",
|
|
@@ -1231,91 +1231,91 @@ const ot = { class: "space-y-24 pr-12" }, rt = { class: "fm-typo-en-title-sm-800
|
|
|
1231
1231
|
}
|
|
1232
1232
|
);
|
|
1233
1233
|
}
|
|
1234
|
-
|
|
1235
|
-
|
|
1234
|
+
ge(
|
|
1235
|
+
R,
|
|
1236
1236
|
() => {
|
|
1237
|
-
|
|
1237
|
+
S();
|
|
1238
1238
|
},
|
|
1239
1239
|
{ deep: !0 }
|
|
1240
|
-
),
|
|
1241
|
-
await
|
|
1240
|
+
), De(async () => {
|
|
1241
|
+
await S();
|
|
1242
1242
|
});
|
|
1243
|
-
const a = async () =>
|
|
1244
|
-
exporter: new
|
|
1243
|
+
const a = async () => ke({
|
|
1244
|
+
exporter: new et(),
|
|
1245
1245
|
readFunction: (e) => H.readStoreTransactions(e, {
|
|
1246
|
-
...
|
|
1246
|
+
...R.value.dateRange,
|
|
1247
1247
|
user: v.user
|
|
1248
1248
|
}),
|
|
1249
1249
|
transformRecord: (e) => {
|
|
1250
|
-
var
|
|
1250
|
+
var n, c, I, F;
|
|
1251
1251
|
return {
|
|
1252
1252
|
"Transaction ID": e._id.toString(),
|
|
1253
1253
|
"Created at": w(e),
|
|
1254
1254
|
Bundle: e.bundle.name || "",
|
|
1255
1255
|
"Selling Price": me(e),
|
|
1256
|
-
Location:
|
|
1256
|
+
Location: N(e),
|
|
1257
1257
|
"Payment Type": C(e),
|
|
1258
|
-
"Payment Extra": ((
|
|
1258
|
+
"Payment Extra": ((n = e.paymentType) == null ? void 0 : n.extra) || "",
|
|
1259
1259
|
User: ((c = e.pf_member) == null ? void 0 : c.name) || "",
|
|
1260
|
-
"Phone No.": ((
|
|
1260
|
+
"Phone No.": ((I = e.pf_member) == null ? void 0 : I.phoneNumber) || "",
|
|
1261
1261
|
Status: Q.title(e.status),
|
|
1262
|
-
"Refund Reason": ((
|
|
1262
|
+
"Refund Reason": ((F = e.refund) == null ? void 0 : F.reason) || "",
|
|
1263
1263
|
Source: e.source,
|
|
1264
1264
|
Ref: (e == null ? void 0 : e.ref) || ""
|
|
1265
1265
|
};
|
|
1266
1266
|
},
|
|
1267
1267
|
filename: "store-transactions"
|
|
1268
1268
|
}), t = E(null);
|
|
1269
|
-
function
|
|
1270
|
-
var
|
|
1271
|
-
(
|
|
1269
|
+
function x(e) {
|
|
1270
|
+
var n;
|
|
1271
|
+
(n = t.value) == null || n.showSheet(!0, e.original);
|
|
1272
1272
|
}
|
|
1273
|
-
return (e,
|
|
1274
|
-
const c = K("FmSearch"),
|
|
1273
|
+
return (e, n) => {
|
|
1274
|
+
const c = K("FmSearch"), I = K("FmButton");
|
|
1275
1275
|
return k(), O("div", null, [
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
modelValue: i(
|
|
1280
|
-
"onUpdate:modelValue":
|
|
1276
|
+
_("div", ut, [
|
|
1277
|
+
_("div", mt, [
|
|
1278
|
+
D(ye, {
|
|
1279
|
+
modelValue: i(R).dateRange,
|
|
1280
|
+
"onUpdate:modelValue": n[0] || (n[0] = (F) => i(R).dateRange = F)
|
|
1281
1281
|
}, null, 8, ["modelValue"])
|
|
1282
1282
|
]),
|
|
1283
|
-
|
|
1284
|
-
|
|
1283
|
+
_("div", dt, [
|
|
1284
|
+
D(c, {
|
|
1285
1285
|
modelValue: i(g).searchValue,
|
|
1286
1286
|
"onUpdate:modelValue": [
|
|
1287
|
-
|
|
1288
|
-
i(
|
|
1287
|
+
n[1] || (n[1] = (F) => i(g).searchValue = F),
|
|
1288
|
+
i(b)
|
|
1289
1289
|
],
|
|
1290
1290
|
placeholder: "Search",
|
|
1291
1291
|
collapsible: ""
|
|
1292
1292
|
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
1293
|
-
|
|
1293
|
+
D(I, {
|
|
1294
1294
|
icon: "ios_share",
|
|
1295
1295
|
variant: "tertiary",
|
|
1296
1296
|
onClick: a
|
|
1297
1297
|
})
|
|
1298
1298
|
])
|
|
1299
1299
|
]),
|
|
1300
|
-
|
|
1300
|
+
D(he, {
|
|
1301
1301
|
loading: i(g).isLoading,
|
|
1302
1302
|
"row-data": i(h),
|
|
1303
1303
|
"row-count": i(g).totalRows,
|
|
1304
1304
|
"column-defs": V.filter(
|
|
1305
|
-
(
|
|
1305
|
+
(F) => !v.user || F.header !== "User" && F.header !== "Phone No."
|
|
1306
1306
|
),
|
|
1307
1307
|
"page-count": i(g).pageCount,
|
|
1308
1308
|
"page-index": i(g).pageIndex,
|
|
1309
1309
|
"page-size": i(g).pageSize,
|
|
1310
1310
|
"shrink-at": !1,
|
|
1311
|
-
onSortChange: i(
|
|
1312
|
-
onRowClick:
|
|
1313
|
-
onPageChange:
|
|
1314
|
-
pageSize:
|
|
1315
|
-
pageIndex:
|
|
1311
|
+
onSortChange: i(s),
|
|
1312
|
+
onRowClick: x,
|
|
1313
|
+
onPageChange: n[2] || (n[2] = (F) => i(S)({
|
|
1314
|
+
pageSize: F.pageSize,
|
|
1315
|
+
pageIndex: F.pageIndex
|
|
1316
1316
|
}))
|
|
1317
1317
|
}, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"]),
|
|
1318
|
-
|
|
1318
|
+
D(ct, {
|
|
1319
1319
|
ref_key: "transactionDetailSheet",
|
|
1320
1320
|
ref: t
|
|
1321
1321
|
}, null, 512)
|
|
@@ -1324,6 +1324,6 @@ const ot = { class: "space-y-24 pr-12" }, rt = { class: "fm-typo-en-title-sm-800
|
|
|
1324
1324
|
}
|
|
1325
1325
|
});
|
|
1326
1326
|
export {
|
|
1327
|
-
|
|
1328
|
-
|
|
1327
|
+
jt as _,
|
|
1328
|
+
Wt as a
|
|
1329
1329
|
};
|