@burdenoff/microfe-billing 2026.1114.6 → 2026.1114.7
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/billing/modules/addons/pages/AddonBrowseDetailPage.js +1 -1
- package/dist/billing/modules/addons/pages/AddonDetailPage.js +1 -1
- package/dist/billing/modules/addons/pages/AddonEditPage.js +1 -1
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +3 -3
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.js +176 -168
- package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.js +117 -111
- package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/UserRefundsPage.js +143 -138
- package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +132 -126
- package/dist/billing/modules/credits/pages/CreditTransactionsPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js +13 -13
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js +24 -24
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +1 -1
- package/dist/billing/modules/plans/pages/PlanEditPage.js +6 -6
- package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js +35 -35
- package/dist/billing/modules/plans/pages/PlansListPage.js +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +4 -4
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +4 -4
- package/dist/billing/shared/components/BillingHistoryTabs.d.ts +9 -0
- package/dist/billing/shared/components/BillingHistoryTabs.js +30 -0
- package/dist/billing/shared/components/BillingHistoryTabs.js.map +1 -0
- package/dist/billing/shared/components/historyTabs.d.ts +19 -0
- package/dist/billing/shared/components/historyTabs.js +32 -0
- package/dist/billing/shared/components/historyTabs.js.map +1 -0
- package/dist/billing/shared/components/index.d.ts +1 -0
- package/dist/billing/shared/components/index.js +2 -1
- package/package.json +1 -1
|
@@ -3,30 +3,32 @@ import { PageHeader as t } from "../../../shared/components/PageHeader.js";
|
|
|
3
3
|
import { EmptyState as n } from "../../../shared/components/EmptyState.js";
|
|
4
4
|
import { ServerError as r } from "../../../shared/components/ServerError.js";
|
|
5
5
|
import { useBillingPermissions as i } from "../../../hooks/useBillingPermissions.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { isServerError as c } from "../../../shared/utils/error.js";
|
|
6
|
+
import { useBillingNavigate as a } from "../../../hooks/useBillingNavigate.js";
|
|
7
|
+
import { BillingHistoryTabs as o } from "../../../shared/components/BillingHistoryTabs.js";
|
|
9
8
|
import "../hooks/index.js";
|
|
9
|
+
import { formatCurrency as s, formatDateTime as c } from "../../../shared/utils/format.js";
|
|
10
10
|
import { nativeImpact as l, nativeNotify as u, nativeOpenUrl as d } from "../../../../utils/nativeBridge.js";
|
|
11
|
+
import { isServerError as f } from "../../../shared/utils/error.js";
|
|
11
12
|
import "../../../shared/components/index.js";
|
|
13
|
+
import { useIsFluidgridsVariant as p } from "../../../hooks/useBillingVariant.js";
|
|
12
14
|
import "../../../shared/utils/index.js";
|
|
13
|
-
import { useInvoiceMutations as
|
|
14
|
-
import { useTransactions as
|
|
15
|
-
import { getStatusBadgeClasses as
|
|
16
|
-
import { useEffect as
|
|
17
|
-
import { Dialog as
|
|
18
|
-
import { ArrowLeft as
|
|
19
|
-
import { useParams as
|
|
15
|
+
import { useInvoiceMutations as m } from "../hooks/useInvoices.js";
|
|
16
|
+
import { useTransactions as h } from "../hooks/useTransactions.js";
|
|
17
|
+
import { getStatusBadgeClasses as g, getTransactionStatusColor as _ } from "../../../shared/utils/status.js";
|
|
18
|
+
import { useEffect as v, useRef as y, useState as b } from "react";
|
|
19
|
+
import { Dialog as x, DialogContent as S, DialogFooter as C, DialogHeader as w, DialogTitle as T, EmphasisPanel as E, IllustratedEmptyState as D, PagePurpose as O, ResponsiveTable as k } from "@burdenoff/fe-libs/ui";
|
|
20
|
+
import { ArrowLeft as A, Calendar as j, CheckCircle as M, ChevronLeft as N, ChevronRight as P, CreditCard as F, Eye as I, FileText as L, Mail as R, MoreHorizontal as z, Wallet as B, XCircle as ee } from "lucide-react";
|
|
21
|
+
import { useParams as te } from "react-router";
|
|
20
22
|
import { Fragment as V, jsx as H, jsxs as U } from "react/jsx-runtime";
|
|
21
|
-
import { useI18n as
|
|
23
|
+
import { useI18n as ne } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
22
24
|
// src/billing/modules/billing/pages/TransactionsPage.tsx
|
|
23
25
|
var W = {
|
|
24
26
|
payment: "Payment",
|
|
25
27
|
refund: "Refund",
|
|
26
28
|
adjustment: "Adjustment"
|
|
27
|
-
}, G = (e) => W[e.toLowerCase()] ?? e,
|
|
28
|
-
let [i, a] =
|
|
29
|
-
return
|
|
29
|
+
}, G = (e) => W[e.toLowerCase()] ?? e, re = ({ transaction: e, onViewDetails: t, onViewInvoice: n, hasInvoiceUrl: r }) => {
|
|
30
|
+
let [i, a] = b(!1), o = y(null);
|
|
31
|
+
return v(() => {
|
|
30
32
|
let e = (e) => {
|
|
31
33
|
o.current && !o.current.contains(e.target) && a(!1);
|
|
32
34
|
};
|
|
@@ -39,7 +41,7 @@ var W = {
|
|
|
39
41
|
onClick: () => a(!i),
|
|
40
42
|
className: "p-1.5 rounded-md hover:bg-bg-sunken/50 transition-colors",
|
|
41
43
|
"aria-label": "Transaction actions",
|
|
42
|
-
children: /* @__PURE__ */ H(
|
|
44
|
+
children: /* @__PURE__ */ H(z, { className: "size-4 text-text-secondary" })
|
|
43
45
|
}), i && /* @__PURE__ */ U("div", {
|
|
44
46
|
className: "absolute right-0 top-full mt-1 z-50 min-w-[160px] bg-popover border border-border-subtle rounded-md shadow-lg py-1",
|
|
45
47
|
children: [/* @__PURE__ */ U("button", {
|
|
@@ -48,29 +50,29 @@ var W = {
|
|
|
48
50
|
t(), a(!1);
|
|
49
51
|
},
|
|
50
52
|
className: "w-full flex items-center gap-2 px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken/50 transition-colors whitespace-nowrap",
|
|
51
|
-
children: [/* @__PURE__ */ H(
|
|
53
|
+
children: [/* @__PURE__ */ H(I, { className: "size-4" }), "View Details"]
|
|
52
54
|
}), e.type === "payment" && r && /* @__PURE__ */ U("button", {
|
|
53
55
|
type: "button",
|
|
54
56
|
onClick: () => {
|
|
55
57
|
n(), a(!1);
|
|
56
58
|
},
|
|
57
59
|
className: "w-full flex items-center gap-2 px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken/50 transition-colors whitespace-nowrap",
|
|
58
|
-
children: [/* @__PURE__ */ H(
|
|
60
|
+
children: [/* @__PURE__ */ H(L, { className: "size-4" }), "View Invoice"]
|
|
59
61
|
})]
|
|
60
62
|
})]
|
|
61
63
|
});
|
|
62
|
-
},
|
|
64
|
+
}, ie = ({ transaction: e, onClose: t, onViewInvoice: n, onRetryInvoice: r, isRetryingInvoice: i, retryInvoiceError: a, invoiceUrl: o, invoiceProvider: u }) => {
|
|
63
65
|
if (!e) return null;
|
|
64
|
-
let f = e.metadata, p = f?.subtotal,
|
|
65
|
-
return /* @__PURE__ */ H(
|
|
66
|
+
let f = e.metadata, p = f?.subtotal, m = f?.taxAmount, h = f?.taxRate, v = f?.taxType, y = f?.total, b = f?.invoiceNumber, E = f?.invoiceStatus, D = f?.invoiceCreationError, O = !b && e.type === "payment" && e.status === "success", k = e.type === "refund", A = f?.refundRecordId, j = f?.originalTransactionId, M = f?.creditNoteId, N = f?.creditNoteNumber, P = f?.creditNotePdfUrl, F = f?.reason, I = f?.purchaseType, R = f?.purchaseDetail, z = y && m !== void 0 && m > 0;
|
|
67
|
+
return /* @__PURE__ */ H(x, {
|
|
66
68
|
open: !!e,
|
|
67
69
|
onOpenChange: (e) => !e && t(),
|
|
68
|
-
children: /* @__PURE__ */ U(
|
|
70
|
+
children: /* @__PURE__ */ U(S, {
|
|
69
71
|
className: "max-w-md max-h-[90vh] overflow-auto p-0",
|
|
70
72
|
children: [
|
|
71
|
-
/* @__PURE__ */ H(
|
|
73
|
+
/* @__PURE__ */ H(w, {
|
|
72
74
|
className: "p-4 border-b border-border-subtle",
|
|
73
|
-
children: /* @__PURE__ */ H(
|
|
75
|
+
children: /* @__PURE__ */ H(T, {
|
|
74
76
|
className: "text-lg font-semibold",
|
|
75
77
|
children: "Transaction Details"
|
|
76
78
|
})
|
|
@@ -102,24 +104,24 @@ var W = {
|
|
|
102
104
|
children: [/* @__PURE__ */ H("span", {
|
|
103
105
|
className: "text-text-secondary",
|
|
104
106
|
children: "Subtotal"
|
|
105
|
-
}), /* @__PURE__ */ H("span", { children:
|
|
107
|
+
}), /* @__PURE__ */ H("span", { children: s(p || e.amount, e.currency) })]
|
|
106
108
|
}),
|
|
107
|
-
|
|
109
|
+
m > 0 && /* @__PURE__ */ U("div", {
|
|
108
110
|
className: "flex justify-between text-sm",
|
|
109
111
|
children: [/* @__PURE__ */ U("span", {
|
|
110
112
|
className: "text-text-secondary",
|
|
111
113
|
children: [
|
|
112
114
|
v || "Tax",
|
|
113
115
|
" ",
|
|
114
|
-
|
|
116
|
+
h ? `(${(h * 100).toFixed(0)}%)` : ""
|
|
115
117
|
]
|
|
116
|
-
}), /* @__PURE__ */ H("span", { children:
|
|
118
|
+
}), /* @__PURE__ */ H("span", { children: s(m, e.currency) })]
|
|
117
119
|
}),
|
|
118
120
|
/* @__PURE__ */ U("div", {
|
|
119
121
|
className: "flex justify-between text-sm font-semibold border-t border-border-subtle pt-2",
|
|
120
122
|
children: [/* @__PURE__ */ H("span", { children: "Total" }), /* @__PURE__ */ U("span", {
|
|
121
123
|
className: e.type === "refund" ? "text-status-error-text" : "",
|
|
122
|
-
children: [e.type === "refund" ? "-" : "",
|
|
124
|
+
children: [e.type === "refund" ? "-" : "", s(y, e.currency)]
|
|
123
125
|
})]
|
|
124
126
|
})
|
|
125
127
|
] }) : /* @__PURE__ */ U("div", {
|
|
@@ -129,12 +131,12 @@ var W = {
|
|
|
129
131
|
children: "Amount"
|
|
130
132
|
}), /* @__PURE__ */ U("p", {
|
|
131
133
|
className: `text-sm font-medium ${e.type === "refund" ? "text-status-error-text" : ""}`,
|
|
132
|
-
children: [e.type === "refund" ? "-" : "",
|
|
134
|
+
children: [e.type === "refund" ? "-" : "", s(y || e.amount, e.currency)]
|
|
133
135
|
})] }), /* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("p", {
|
|
134
136
|
className: "text-xs text-text-secondary mb-1",
|
|
135
137
|
children: "Status"
|
|
136
138
|
}), /* @__PURE__ */ H("span", {
|
|
137
|
-
className: `px-2 py-0.5 text-xs font-medium rounded ${
|
|
139
|
+
className: `px-2 py-0.5 text-xs font-medium rounded ${g(_(e.status))}`,
|
|
138
140
|
children: e.status
|
|
139
141
|
})] })]
|
|
140
142
|
})
|
|
@@ -143,7 +145,7 @@ var W = {
|
|
|
143
145
|
className: "text-xs text-text-secondary mb-1",
|
|
144
146
|
children: "Status"
|
|
145
147
|
}), /* @__PURE__ */ H("span", {
|
|
146
|
-
className: `px-2 py-0.5 text-xs font-medium rounded ${
|
|
148
|
+
className: `px-2 py-0.5 text-xs font-medium rounded ${g(_(e.status))}`,
|
|
147
149
|
children: e.status
|
|
148
150
|
})] }),
|
|
149
151
|
/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("p", {
|
|
@@ -151,7 +153,7 @@ var W = {
|
|
|
151
153
|
children: "Date & Time"
|
|
152
154
|
}), /* @__PURE__ */ H("p", {
|
|
153
155
|
className: "text-sm",
|
|
154
|
-
children:
|
|
156
|
+
children: c(e.createdAt)
|
|
155
157
|
})] }),
|
|
156
158
|
e.description && /* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("p", {
|
|
157
159
|
className: "text-xs text-text-secondary mb-1",
|
|
@@ -160,7 +162,7 @@ var W = {
|
|
|
160
162
|
className: "text-sm",
|
|
161
163
|
children: e.description
|
|
162
164
|
})] }),
|
|
163
|
-
|
|
165
|
+
b && /* @__PURE__ */ U("div", {
|
|
164
166
|
className: "p-3 bg-bg-sunken/50 rounded-lg space-y-2",
|
|
165
167
|
children: [
|
|
166
168
|
/* @__PURE__ */ U("div", {
|
|
@@ -170,7 +172,7 @@ var W = {
|
|
|
170
172
|
children: "Invoice"
|
|
171
173
|
}), /* @__PURE__ */ H("p", {
|
|
172
174
|
className: "text-sm font-mono",
|
|
173
|
-
children:
|
|
175
|
+
children: b
|
|
174
176
|
})] }), E && /* @__PURE__ */ H("span", {
|
|
175
177
|
className: `px-2 py-0.5 text-xs font-medium rounded ${E === "PAID" ? "bg-status-success-bg-subtle text-status-success-text" : "bg-status-warning-bg-subtle text-status-warning-text"}`,
|
|
176
178
|
children: E
|
|
@@ -180,28 +182,28 @@ var W = {
|
|
|
180
182
|
className: "text-xs text-text-secondary",
|
|
181
183
|
children: ["Provider: ", u]
|
|
182
184
|
}),
|
|
183
|
-
|
|
185
|
+
o && n && /* @__PURE__ */ U("button", {
|
|
184
186
|
type: "button",
|
|
185
187
|
onClick: () => n(e),
|
|
186
188
|
className: "flex items-center gap-2 text-sm text-primary hover:underline",
|
|
187
|
-
children: [/* @__PURE__ */ H(
|
|
189
|
+
children: [/* @__PURE__ */ H(L, { className: "size-4" }), "View Invoice"]
|
|
188
190
|
})
|
|
189
191
|
]
|
|
190
192
|
}),
|
|
191
|
-
!
|
|
193
|
+
!b && o && n && /* @__PURE__ */ H("div", {
|
|
192
194
|
className: "p-3 bg-bg-sunken/50 rounded-lg",
|
|
193
195
|
children: /* @__PURE__ */ U("button", {
|
|
194
196
|
type: "button",
|
|
195
197
|
onClick: () => n(e),
|
|
196
198
|
className: "flex items-center gap-2 text-sm text-primary hover:underline",
|
|
197
199
|
children: [
|
|
198
|
-
/* @__PURE__ */ H(
|
|
200
|
+
/* @__PURE__ */ H(L, { className: "size-4" }),
|
|
199
201
|
"View Invoice ",
|
|
200
202
|
u && `(${u})`
|
|
201
203
|
]
|
|
202
204
|
})
|
|
203
205
|
}),
|
|
204
|
-
O && !
|
|
206
|
+
O && !o && r && /* @__PURE__ */ U("div", {
|
|
205
207
|
className: "p-3 bg-status-warning-bg-subtle border border-status-warning-border rounded-lg space-y-2",
|
|
206
208
|
children: [
|
|
207
209
|
/* @__PURE__ */ H("p", {
|
|
@@ -213,15 +215,15 @@ var W = {
|
|
|
213
215
|
onClick: () => r(e),
|
|
214
216
|
disabled: i,
|
|
215
217
|
className: "flex items-center gap-2 text-sm font-medium text-primary hover:underline disabled:cursor-not-allowed disabled:opacity-50",
|
|
216
|
-
children: [/* @__PURE__ */ H(
|
|
218
|
+
children: [/* @__PURE__ */ H(L, { className: "size-4" }), i ? "Generating…" : "Generate Invoice"]
|
|
217
219
|
}),
|
|
218
|
-
|
|
220
|
+
a && /* @__PURE__ */ H("p", {
|
|
219
221
|
className: "text-sm text-status-error-text",
|
|
220
|
-
children:
|
|
222
|
+
children: a
|
|
221
223
|
})
|
|
222
224
|
]
|
|
223
225
|
}),
|
|
224
|
-
k && (M ||
|
|
226
|
+
k && (M || F || I) && /* @__PURE__ */ U("div", {
|
|
225
227
|
className: "p-3 bg-status-error-bg-subtle/20 border border-border-subtle rounded-lg space-y-3",
|
|
226
228
|
children: [
|
|
227
229
|
/* @__PURE__ */ U("div", {
|
|
@@ -245,22 +247,22 @@ var W = {
|
|
|
245
247
|
l("light"), d(P);
|
|
246
248
|
},
|
|
247
249
|
className: "flex items-center gap-2 text-sm text-status-error-text hover:underline",
|
|
248
|
-
children: [/* @__PURE__ */ H(
|
|
250
|
+
children: [/* @__PURE__ */ H(L, { className: "size-4" }), "Download Credit Note PDF"]
|
|
249
251
|
})]
|
|
250
252
|
}),
|
|
251
|
-
|
|
253
|
+
I && /* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("p", {
|
|
252
254
|
className: "text-xs text-status-error-text mb-1",
|
|
253
255
|
children: "Purchase Type"
|
|
254
256
|
}), /* @__PURE__ */ U("p", {
|
|
255
257
|
className: "text-sm text-status-error-text",
|
|
256
|
-
children: [
|
|
258
|
+
children: [I, R && ` - ${R}`]
|
|
257
259
|
})] }),
|
|
258
|
-
|
|
260
|
+
F && /* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("p", {
|
|
259
261
|
className: "text-xs text-status-error-text mb-1",
|
|
260
262
|
children: "Reason"
|
|
261
263
|
}), /* @__PURE__ */ H("p", {
|
|
262
264
|
className: "text-sm text-status-error-text",
|
|
263
|
-
children:
|
|
265
|
+
children: F
|
|
264
266
|
})] }),
|
|
265
267
|
j && /* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("p", {
|
|
266
268
|
className: "text-xs text-status-error-text mb-1",
|
|
@@ -294,7 +296,7 @@ var W = {
|
|
|
294
296
|
})] })
|
|
295
297
|
]
|
|
296
298
|
}),
|
|
297
|
-
/* @__PURE__ */ H(
|
|
299
|
+
/* @__PURE__ */ H(C, {
|
|
298
300
|
className: "p-4 border-t border-border-subtle",
|
|
299
301
|
children: /* @__PURE__ */ H("button", {
|
|
300
302
|
type: "button",
|
|
@@ -307,30 +309,30 @@ var W = {
|
|
|
307
309
|
})
|
|
308
310
|
});
|
|
309
311
|
}, K = () => {
|
|
310
|
-
let { t:
|
|
311
|
-
let n =
|
|
312
|
+
let { t: v } = ne(), y = (e, t) => {
|
|
313
|
+
let n = v(e);
|
|
312
314
|
return n === e ? t : n;
|
|
313
|
-
}, { billingAccountId:
|
|
314
|
-
if (
|
|
315
|
+
}, { billingAccountId: x } = te(), S = i(), C = a(), w = p(), { billingAccount: T, transactions: I, pagination: z, isLoading: V, error: K, refetch: ae, goToNextPage: oe, goToPreviousPage: se } = h(x), [q, ce] = b("all"), [le, J] = b(null), Y = I.find((e) => e.id === le) ?? null, { retryInvoiceGeneration: ue, isRetrying: de } = m(), [fe, X] = b(null), pe = async (e) => {
|
|
316
|
+
if (x) {
|
|
315
317
|
X(null);
|
|
316
318
|
try {
|
|
317
|
-
await
|
|
319
|
+
await ue(e.id, x), u("success");
|
|
318
320
|
} catch (e) {
|
|
319
321
|
X(e instanceof Error ? e.message : "Failed to generate invoice"), u("error");
|
|
320
322
|
}
|
|
321
323
|
}
|
|
322
|
-
}, Z = (e) => e.metadata?.invoiceUrl ?? null,
|
|
324
|
+
}, Z = (e) => e.metadata?.invoiceUrl ?? null, me = (e) => {
|
|
323
325
|
let t = e.metadata;
|
|
324
326
|
return t?.total && typeof t.total == "number" ? t.total : e.amount;
|
|
325
|
-
},
|
|
327
|
+
}, he = (e) => {
|
|
326
328
|
let t = e.metadata?.invoiceProvider;
|
|
327
329
|
return t === "ZOHO_BOOKS" ? "Zoho Books" : t === "STRIPE" ? "Stripe" : null;
|
|
328
330
|
}, Q = (e) => {
|
|
329
331
|
let t = Z(e);
|
|
330
332
|
t && (l("light"), d(t));
|
|
331
333
|
};
|
|
332
|
-
if (!
|
|
333
|
-
if (!
|
|
334
|
+
if (!S.canViewPayments) return /* @__PURE__ */ H(e, { message: y("billing.transactions.noPermission", "You don't have permission to view transaction history.") });
|
|
335
|
+
if (!x) return /* @__PURE__ */ H("div", {
|
|
334
336
|
className: "p-6",
|
|
335
337
|
children: /* @__PURE__ */ H(n, {
|
|
336
338
|
icon: /* @__PURE__ */ H("svg", {
|
|
@@ -345,21 +347,21 @@ var W = {
|
|
|
345
347
|
d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
|
|
346
348
|
})
|
|
347
349
|
}),
|
|
348
|
-
title:
|
|
349
|
-
description:
|
|
350
|
+
title: y("billing.transactions.noAccountSelected", "No billing account selected"),
|
|
351
|
+
description: y("billing.transactions.noAccountSelectedDesc", "Please select a billing account from the overview page to view transactions.")
|
|
350
352
|
})
|
|
351
353
|
});
|
|
352
|
-
if (
|
|
354
|
+
if (K && f(K)) return /* @__PURE__ */ H("div", {
|
|
353
355
|
className: "p-6",
|
|
354
356
|
children: /* @__PURE__ */ H(r, {
|
|
355
|
-
title:
|
|
356
|
-
message:
|
|
357
|
-
onRetry: () =>
|
|
357
|
+
title: y("billing.transactions.serverUnavailable", "Server Unavailable"),
|
|
358
|
+
message: y("billing.transactions.serverUnavailableMessage", "Unable to load transactions. The server might be down or experiencing issues."),
|
|
359
|
+
onRetry: () => ae(),
|
|
358
360
|
showRetry: !0
|
|
359
361
|
})
|
|
360
362
|
});
|
|
361
|
-
let $ = q === "all" ?
|
|
362
|
-
return
|
|
363
|
+
let $ = q === "all" ? I : I.filter((e) => e.type === q);
|
|
364
|
+
return V ? /* @__PURE__ */ U("div", {
|
|
363
365
|
className: "space-y-6 p-6",
|
|
364
366
|
children: [/* @__PURE__ */ H("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ H("div", {
|
|
365
367
|
className: "space-y-2",
|
|
@@ -376,78 +378,82 @@ var W = {
|
|
|
376
378
|
children: [
|
|
377
379
|
/* @__PURE__ */ U("button", {
|
|
378
380
|
type: "button",
|
|
379
|
-
onClick: () =>
|
|
381
|
+
onClick: () => C("/overview"),
|
|
380
382
|
className: "inline-flex items-center gap-2 text-sm text-text-secondary hover:text-text-primary transition-colors",
|
|
381
|
-
children: [/* @__PURE__ */ H(
|
|
383
|
+
children: [/* @__PURE__ */ H(A, { className: "size-4" }), "Back to Overview"]
|
|
382
384
|
}),
|
|
383
385
|
/* @__PURE__ */ H(t, {
|
|
384
|
-
title:
|
|
385
|
-
description:
|
|
386
|
+
title: y("billing.transactions.title", "Transaction History"),
|
|
387
|
+
description: T ? `Transactions for ${T.name}` : "View all your billing transactions"
|
|
388
|
+
}),
|
|
389
|
+
/* @__PURE__ */ H(O, { children: y("billing.transactions.purpose", "A complete, time-ordered ledger of money movements on this billing account — payments, refunds and adjustments. Use it to reconcile what you were charged, open the linked invoice or credit note, and see tax breakdowns for each transaction.") }),
|
|
390
|
+
w && /* @__PURE__ */ H(o, {
|
|
391
|
+
active: "payments",
|
|
392
|
+
billingAccountId: x
|
|
386
393
|
}),
|
|
387
|
-
/* @__PURE__ */ H(E, {
|
|
388
|
-
S && /* @__PURE__ */ H(w, {
|
|
394
|
+
T && /* @__PURE__ */ H(E, {
|
|
389
395
|
className: "p-4",
|
|
390
396
|
children: /* @__PURE__ */ U("div", {
|
|
391
397
|
className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-4",
|
|
392
398
|
children: [
|
|
393
399
|
/* @__PURE__ */ U("div", {
|
|
394
400
|
className: "flex items-start gap-2",
|
|
395
|
-
children: [/* @__PURE__ */ H(
|
|
401
|
+
children: [/* @__PURE__ */ H(F, { className: "size-4 text-text-secondary mt-0.5" }), /* @__PURE__ */ U("div", { children: [
|
|
396
402
|
/* @__PURE__ */ H("p", {
|
|
397
403
|
className: "text-xs text-text-secondary mb-0.5",
|
|
398
404
|
children: "Account"
|
|
399
405
|
}),
|
|
400
406
|
/* @__PURE__ */ H("p", {
|
|
401
407
|
className: "text-sm font-medium",
|
|
402
|
-
children:
|
|
408
|
+
children: T.name
|
|
403
409
|
}),
|
|
404
|
-
|
|
410
|
+
T.isActive ? /* @__PURE__ */ U("span", {
|
|
405
411
|
className: "inline-flex items-center gap-1 mt-1 px-1.5 py-0.5 text-xs font-medium rounded bg-status-success-bg-subtle text-status-success-text",
|
|
406
|
-
children: [/* @__PURE__ */ H(
|
|
412
|
+
children: [/* @__PURE__ */ H(M, { className: "size-3" }), "Active"]
|
|
407
413
|
}) : /* @__PURE__ */ U("span", {
|
|
408
414
|
className: "inline-flex items-center gap-1 mt-1 px-1.5 py-0.5 text-xs font-medium rounded bg-status-error-bg-subtle text-status-error-text",
|
|
409
|
-
children: [/* @__PURE__ */ H(
|
|
415
|
+
children: [/* @__PURE__ */ H(ee, { className: "size-3" }), "Inactive"]
|
|
410
416
|
})
|
|
411
417
|
] })]
|
|
412
418
|
}),
|
|
413
419
|
/* @__PURE__ */ U("div", {
|
|
414
420
|
className: "flex items-start gap-2",
|
|
415
|
-
children: [/* @__PURE__ */ H(
|
|
421
|
+
children: [/* @__PURE__ */ H(R, { className: "size-4 text-text-secondary mt-0.5" }), /* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("p", {
|
|
416
422
|
className: "text-xs text-text-secondary mb-0.5",
|
|
417
423
|
children: "Email"
|
|
418
424
|
}), /* @__PURE__ */ H("p", {
|
|
419
425
|
className: "text-sm font-medium break-all",
|
|
420
|
-
children:
|
|
426
|
+
children: T.billingEmail || T.email
|
|
421
427
|
})] })]
|
|
422
428
|
}),
|
|
423
429
|
/* @__PURE__ */ U("div", {
|
|
424
430
|
className: "flex items-start gap-2",
|
|
425
|
-
children: [/* @__PURE__ */ H(
|
|
431
|
+
children: [/* @__PURE__ */ H(B, { className: "size-4 text-text-secondary mt-0.5" }), /* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("p", {
|
|
426
432
|
className: "text-xs text-text-secondary mb-0.5",
|
|
427
433
|
children: "Credits Balance"
|
|
428
434
|
}), /* @__PURE__ */ U("p", {
|
|
429
435
|
className: "text-sm font-semibold text-text-primary",
|
|
430
|
-
children: [(
|
|
436
|
+
children: [(T.creditAmount || 0).toLocaleString(), " Credits"]
|
|
431
437
|
})] })]
|
|
432
438
|
}),
|
|
433
439
|
/* @__PURE__ */ U("div", {
|
|
434
440
|
className: "flex items-start gap-2",
|
|
435
|
-
children: [/* @__PURE__ */ H(
|
|
441
|
+
children: [/* @__PURE__ */ H(L, { className: "size-4 text-text-secondary mt-0.5" }), /* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("p", {
|
|
436
442
|
className: "text-xs text-text-secondary mb-0.5",
|
|
437
443
|
children: "Tax ID"
|
|
438
444
|
}), /* @__PURE__ */ H("p", {
|
|
439
445
|
className: "text-sm font-medium",
|
|
440
|
-
children:
|
|
446
|
+
children: T.taxId || "-"
|
|
441
447
|
})] })]
|
|
442
448
|
}),
|
|
443
449
|
/* @__PURE__ */ U("div", {
|
|
444
450
|
className: "flex items-start gap-2",
|
|
445
|
-
children: [/* @__PURE__ */ H(
|
|
451
|
+
children: [/* @__PURE__ */ H(j, { className: "size-4 text-text-secondary mt-0.5" }), /* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("p", {
|
|
446
452
|
className: "text-xs text-text-secondary mb-0.5",
|
|
447
453
|
children: "Member Since"
|
|
448
454
|
}), /* @__PURE__ */ H("p", {
|
|
449
455
|
className: "text-sm font-medium",
|
|
450
|
-
children:
|
|
456
|
+
children: T.createdAt ? c(T.createdAt) : "-"
|
|
451
457
|
})] })]
|
|
452
458
|
})
|
|
453
459
|
]
|
|
@@ -464,19 +470,19 @@ var W = {
|
|
|
464
470
|
"adjustment"
|
|
465
471
|
].map((e) => /* @__PURE__ */ H("button", {
|
|
466
472
|
type: "button",
|
|
467
|
-
onClick: () =>
|
|
473
|
+
onClick: () => ce(e),
|
|
468
474
|
className: `px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${q === e ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-secondary hover:text-text-primary"}`,
|
|
469
475
|
children: e === "all" ? "All" : W[e]
|
|
470
476
|
}, e))
|
|
471
477
|
})
|
|
472
478
|
}),
|
|
473
|
-
$.length === 0 ? /* @__PURE__ */ H(
|
|
479
|
+
$.length === 0 ? /* @__PURE__ */ H(D, {
|
|
474
480
|
illustration: q === "all" ? "empty-data" : "empty-search",
|
|
475
|
-
title:
|
|
476
|
-
description: q === "all" ?
|
|
481
|
+
title: y("billing.transactions.noTransactionsFound", "No transactions found"),
|
|
482
|
+
description: q === "all" ? y("billing.transactions.noTransactionsYet", "Your transaction history will appear here.") : y("billing.transactions.noTransactionsFiltered", "No transactions match your filter.")
|
|
477
483
|
}) : /* @__PURE__ */ H("div", {
|
|
478
484
|
className: "border border-border-subtle rounded-lg overflow-visible",
|
|
479
|
-
children: /* @__PURE__ */ H(
|
|
485
|
+
children: /* @__PURE__ */ H(k, {
|
|
480
486
|
columns: [
|
|
481
487
|
{
|
|
482
488
|
key: "date",
|
|
@@ -485,7 +491,7 @@ var W = {
|
|
|
485
491
|
cellClassName: "whitespace-nowrap",
|
|
486
492
|
cell: (e) => /* @__PURE__ */ H("span", {
|
|
487
493
|
className: "text-sm text-text-primary",
|
|
488
|
-
children:
|
|
494
|
+
children: c(e.createdAt)
|
|
489
495
|
})
|
|
490
496
|
},
|
|
491
497
|
{
|
|
@@ -512,7 +518,7 @@ var W = {
|
|
|
512
518
|
cellClassName: "text-right whitespace-nowrap",
|
|
513
519
|
cell: (e) => /* @__PURE__ */ U("span", {
|
|
514
520
|
className: `text-sm font-medium tabular-nums ${e.type === "refund" ? "text-status-error-text" : "text-text-primary"}`,
|
|
515
|
-
children: [e.type === "refund" ? "-" : "",
|
|
521
|
+
children: [e.type === "refund" ? "-" : "", s(me(e), e.currency)]
|
|
516
522
|
})
|
|
517
523
|
},
|
|
518
524
|
{
|
|
@@ -521,14 +527,14 @@ var W = {
|
|
|
521
527
|
headerClassName: "text-center",
|
|
522
528
|
cellClassName: "text-center whitespace-nowrap",
|
|
523
529
|
cell: (e) => /* @__PURE__ */ H("span", {
|
|
524
|
-
className: `px-1.5 py-0.5 text-xs font-medium rounded ${
|
|
530
|
+
className: `px-1.5 py-0.5 text-xs font-medium rounded ${g(_(e.status))}`,
|
|
525
531
|
children: e.status
|
|
526
532
|
})
|
|
527
533
|
}
|
|
528
534
|
],
|
|
529
535
|
data: $,
|
|
530
536
|
rowKey: (e) => e.id,
|
|
531
|
-
rowActions: (e) => /* @__PURE__ */ H(
|
|
537
|
+
rowActions: (e) => /* @__PURE__ */ H(re, {
|
|
532
538
|
transaction: e,
|
|
533
539
|
onViewDetails: () => J(e.id),
|
|
534
540
|
onViewInvoice: () => Q(e),
|
|
@@ -536,19 +542,19 @@ var W = {
|
|
|
536
542
|
})
|
|
537
543
|
})
|
|
538
544
|
}),
|
|
539
|
-
|
|
545
|
+
z.totalCount > 0 && /* @__PURE__ */ U("div", {
|
|
540
546
|
className: "flex items-center justify-between border-t border-border-subtle pt-4",
|
|
541
547
|
children: [/* @__PURE__ */ U("p", {
|
|
542
548
|
className: "text-sm text-text-secondary",
|
|
543
549
|
children: [
|
|
544
550
|
"Showing ",
|
|
545
|
-
|
|
551
|
+
z.page * z.pageSize + 1,
|
|
546
552
|
" to",
|
|
547
553
|
" ",
|
|
548
|
-
Math.min((
|
|
554
|
+
Math.min((z.page + 1) * z.pageSize, z.totalCount),
|
|
549
555
|
" of",
|
|
550
556
|
" ",
|
|
551
|
-
|
|
557
|
+
z.totalCount,
|
|
552
558
|
" transactions"
|
|
553
559
|
]
|
|
554
560
|
}), /* @__PURE__ */ U("div", {
|
|
@@ -556,41 +562,41 @@ var W = {
|
|
|
556
562
|
children: [
|
|
557
563
|
/* @__PURE__ */ U("button", {
|
|
558
564
|
type: "button",
|
|
559
|
-
onClick:
|
|
560
|
-
disabled: !
|
|
565
|
+
onClick: se,
|
|
566
|
+
disabled: !z.hasPrevious,
|
|
561
567
|
className: "inline-flex items-center gap-1 px-3 py-1.5 text-sm font-medium rounded-md border border-border-subtle bg-bg-surface hover:bg-bg-sunken/50 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
562
|
-
children: [/* @__PURE__ */ H(
|
|
568
|
+
children: [/* @__PURE__ */ H(N, { className: "size-4" }), "Previous"]
|
|
563
569
|
}),
|
|
564
570
|
/* @__PURE__ */ U("span", {
|
|
565
571
|
className: "text-sm text-text-secondary px-2",
|
|
566
572
|
children: [
|
|
567
573
|
"Page ",
|
|
568
|
-
|
|
574
|
+
z.page + 1,
|
|
569
575
|
" of ",
|
|
570
|
-
Math.ceil(
|
|
576
|
+
Math.ceil(z.totalCount / z.pageSize)
|
|
571
577
|
]
|
|
572
578
|
}),
|
|
573
579
|
/* @__PURE__ */ U("button", {
|
|
574
580
|
type: "button",
|
|
575
|
-
onClick:
|
|
576
|
-
disabled: !
|
|
581
|
+
onClick: oe,
|
|
582
|
+
disabled: !z.hasMore,
|
|
577
583
|
className: "inline-flex items-center gap-1 px-3 py-1.5 text-sm font-medium rounded-md border border-border-subtle bg-bg-surface hover:bg-bg-sunken/50 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
578
|
-
children: ["Next", /* @__PURE__ */ H(
|
|
584
|
+
children: ["Next", /* @__PURE__ */ H(P, { className: "size-4" })]
|
|
579
585
|
})
|
|
580
586
|
]
|
|
581
587
|
})]
|
|
582
588
|
}),
|
|
583
|
-
/* @__PURE__ */ H(
|
|
589
|
+
/* @__PURE__ */ H(ie, {
|
|
584
590
|
transaction: Y,
|
|
585
591
|
onClose: () => {
|
|
586
592
|
J(null), X(null);
|
|
587
593
|
},
|
|
588
594
|
onViewInvoice: Q,
|
|
589
|
-
onRetryInvoice:
|
|
590
|
-
isRetryingInvoice:
|
|
591
|
-
retryInvoiceError:
|
|
595
|
+
onRetryInvoice: pe,
|
|
596
|
+
isRetryingInvoice: de,
|
|
597
|
+
retryInvoiceError: fe,
|
|
592
598
|
invoiceUrl: Y ? Z(Y) : null,
|
|
593
|
-
invoiceProvider: Y ?
|
|
599
|
+
invoiceProvider: Y ? he(Y) : null
|
|
594
600
|
})
|
|
595
601
|
]
|
|
596
602
|
});
|