@burdenoff/microfe-billing 2026.1114.6 → 2026.1114.8
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 +35 -0
- package/dist/billing/shared/components/BillingHistoryTabs.js.map +1 -0
- package/dist/billing/shared/components/historyTabs.d.ts +16 -0
- package/dist/billing/shared/components/historyTabs.js +24 -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
|
@@ -4,28 +4,29 @@ import { useInvoiceMutations as n, usePaginatedInvoices as r } from "../hooks/us
|
|
|
4
4
|
import { MoneyActionDialog as i } from "../../../shared/components/MoneyActionDialog.js";
|
|
5
5
|
import { useBillingPermissions as a } from "../../../hooks/useBillingPermissions.js";
|
|
6
6
|
import { useGetBillingAccountsByOrgQuery as o } from "../../../../generated/global-operations.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { BillingHistoryTabs as s } from "../../../shared/components/BillingHistoryTabs.js";
|
|
8
|
+
import { formatCurrency as c, formatDate as l, formatInvoiceNumber as u, formatInvoiceStatus as d } from "../../../shared/utils/format.js";
|
|
9
|
+
import { withBillingAccountId as f } from "../../../shared/utils/navigation.js";
|
|
10
|
+
import { getInvoiceStatusColor as p } from "../../../shared/utils/status.js";
|
|
10
11
|
import "../../../shared/ui/index.js";
|
|
11
12
|
import "../../../shared/components/index.js";
|
|
12
|
-
import { useIsFluidgridsVariant as
|
|
13
|
-
import { useTr as
|
|
14
|
-
import { nativeConfirm as
|
|
15
|
-
import { useCallback as
|
|
16
|
-
import { IllustratedEmptyState as
|
|
17
|
-
import { RotateCcw as
|
|
18
|
-
import { useSearchParams as
|
|
19
|
-
import { Fragment as
|
|
13
|
+
import { useIsFluidgridsVariant as m } from "../../../hooks/useBillingVariant.js";
|
|
14
|
+
import { useTr as h } from "../../../shared/hooks/useTr.js";
|
|
15
|
+
import { nativeConfirm as g, nativeImpact as _, nativeNotify as v } from "../../../../utils/nativeBridge.js";
|
|
16
|
+
import { useCallback as y, useEffect as b, useMemo as x, useRef as S, useState as C } from "react";
|
|
17
|
+
import { IllustratedEmptyState as w, PagePurpose as T } from "@burdenoff/fe-libs/ui";
|
|
18
|
+
import { RotateCcw as E } from "lucide-react";
|
|
19
|
+
import { useSearchParams as D } from "react-router";
|
|
20
|
+
import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
20
21
|
// src/billing/modules/billing/pages/InvoicesListPage.tsx
|
|
21
|
-
var
|
|
22
|
-
let t =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}, [
|
|
26
|
-
let
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
var j = () => {
|
|
23
|
+
let t = h(), i = m(), c = e(), l = a(), [u] = D(), p = u.get("billingAccountId") ?? void 0, { data: g } = o({ fetchPolicy: "cache-first" }), _ = x(() => g?.getBillingAccountsByOrg ?? [], [g]), { payInvoice: j, voidInvoice: N } = n(), [P, F] = C(null), [I, L] = C(null), [R, z] = C(p);
|
|
24
|
+
b(() => {
|
|
25
|
+
z(p);
|
|
26
|
+
}, [p]);
|
|
27
|
+
let ee = x(() => (_.find((e) => e.isDefault) ?? _[0])?.id ?? void 0, [_]), B = R === void 0 ? ee ?? null : R, [V, H] = C("all"), [U, te] = C(""), [W, ne] = C(""), [G, K] = C(1), q = S(null);
|
|
28
|
+
b(() => (q.current && clearTimeout(q.current), q.current = setTimeout(() => {
|
|
29
|
+
ne(U), K(1);
|
|
29
30
|
}, 400), () => {
|
|
30
31
|
q.current && clearTimeout(q.current);
|
|
31
32
|
}), [U]);
|
|
@@ -35,57 +36,57 @@ var A = () => {
|
|
|
35
36
|
search: W || void 0,
|
|
36
37
|
page: G,
|
|
37
38
|
pageSize: 20
|
|
38
|
-
}),
|
|
39
|
-
let t = e.billingAccountId, n = t ?
|
|
40
|
-
if (!t)
|
|
41
|
-
else if (!n)
|
|
39
|
+
}), re = y(async (e) => {
|
|
40
|
+
let t = e.billingAccountId, n = t ? _.find((e) => e.id === t)?.defaultPaymentMethod : void 0;
|
|
41
|
+
if (!t) F("No billing account context");
|
|
42
|
+
else if (!n) F("Add and set a default payment method before paying this invoice.");
|
|
42
43
|
else {
|
|
43
|
-
|
|
44
|
+
F(null), L({
|
|
44
45
|
invoiceId: e.id,
|
|
45
46
|
action: "pay"
|
|
46
47
|
});
|
|
47
48
|
try {
|
|
48
|
-
await
|
|
49
|
+
await j(e.id, n, t), await Q(), v("success");
|
|
49
50
|
} catch (e) {
|
|
50
|
-
|
|
51
|
+
F(e instanceof Error ? e.message : "Failed to pay invoice"), v("error");
|
|
51
52
|
} finally {
|
|
52
|
-
|
|
53
|
+
L(null);
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
}, [
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
_,
|
|
58
|
+
j,
|
|
58
59
|
Q
|
|
59
|
-
]),
|
|
60
|
+
]), ie = y(async (e) => {
|
|
60
61
|
let t = e.billingAccountId;
|
|
61
|
-
if (!t)
|
|
62
|
+
if (!t) F("No billing account context");
|
|
62
63
|
else {
|
|
63
|
-
|
|
64
|
+
F(null), L({
|
|
64
65
|
invoiceId: e.id,
|
|
65
66
|
action: "void"
|
|
66
67
|
});
|
|
67
68
|
try {
|
|
68
|
-
await
|
|
69
|
+
await N(e.id, t), await Q(), v("success");
|
|
69
70
|
} catch (e) {
|
|
70
|
-
|
|
71
|
+
F(e instanceof Error ? e.message : "Failed to void invoice"), v("error");
|
|
71
72
|
} finally {
|
|
72
|
-
|
|
73
|
+
L(null);
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
|
-
}, [Q,
|
|
76
|
-
if (!
|
|
76
|
+
}, [Q, N]);
|
|
77
|
+
if (!l.canViewInvoices) return /* @__PURE__ */ k("div", {
|
|
77
78
|
className: "flex items-center justify-center h-full min-h-[400px]",
|
|
78
|
-
children: /* @__PURE__ */
|
|
79
|
+
children: /* @__PURE__ */ A("div", {
|
|
79
80
|
className: "text-center space-y-2",
|
|
80
81
|
children: [
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ k("div", {
|
|
82
83
|
className: "size-12 mx-auto rounded-full bg-bg-sunken flex items-center justify-center",
|
|
83
|
-
children: /* @__PURE__ */
|
|
84
|
+
children: /* @__PURE__ */ k("svg", {
|
|
84
85
|
className: "size-6 text-text-secondary",
|
|
85
86
|
fill: "none",
|
|
86
87
|
viewBox: "0 0 24 24",
|
|
87
88
|
stroke: "currentColor",
|
|
88
|
-
children: /* @__PURE__ */
|
|
89
|
+
children: /* @__PURE__ */ k("path", {
|
|
89
90
|
strokeLinecap: "round",
|
|
90
91
|
strokeLinejoin: "round",
|
|
91
92
|
strokeWidth: 2,
|
|
@@ -93,20 +94,20 @@ var A = () => {
|
|
|
93
94
|
})
|
|
94
95
|
})
|
|
95
96
|
}),
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ k("h2", {
|
|
97
98
|
className: "text-lg font-semibold text-text-primary",
|
|
98
99
|
children: t("billing.accessDenied.title", "Access Denied")
|
|
99
100
|
}),
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ k("p", {
|
|
101
102
|
className: "text-sm text-text-secondary max-w-sm",
|
|
102
103
|
children: t("billing.invoices.noViewPermission", "You don't have permission to view invoices.")
|
|
103
104
|
})
|
|
104
105
|
]
|
|
105
106
|
})
|
|
106
107
|
});
|
|
107
|
-
if (X && J.length === 0) return /* @__PURE__ */
|
|
108
|
+
if (X && J.length === 0) return /* @__PURE__ */ A("div", {
|
|
108
109
|
className: "space-y-6 p-6",
|
|
109
|
-
children: [/* @__PURE__ */
|
|
110
|
+
children: [/* @__PURE__ */ k("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ k("div", {
|
|
110
111
|
className: "space-y-3",
|
|
111
112
|
children: [
|
|
112
113
|
1,
|
|
@@ -114,31 +115,31 @@ var A = () => {
|
|
|
114
115
|
3,
|
|
115
116
|
4,
|
|
116
117
|
5
|
|
117
|
-
].map((e) => /* @__PURE__ */
|
|
118
|
+
].map((e) => /* @__PURE__ */ k("div", {
|
|
118
119
|
className: "border border-border-subtle rounded-lg p-4",
|
|
119
|
-
children: /* @__PURE__ */
|
|
120
|
+
children: /* @__PURE__ */ A("div", {
|
|
120
121
|
className: "flex items-center gap-4",
|
|
121
|
-
children: [/* @__PURE__ */
|
|
122
|
+
children: [/* @__PURE__ */ k("div", { className: "size-10 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ A("div", {
|
|
122
123
|
className: "flex-1 space-y-2",
|
|
123
|
-
children: [/* @__PURE__ */
|
|
124
|
+
children: [/* @__PURE__ */ k("div", { className: "h-4 w-32 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ k("div", { className: "h-3 w-48 bg-bg-sunken animate-pulse rounded" })]
|
|
124
125
|
})]
|
|
125
126
|
})
|
|
126
127
|
}, e))
|
|
127
128
|
})]
|
|
128
129
|
});
|
|
129
|
-
if (Z) return /* @__PURE__ */
|
|
130
|
+
if (Z) return /* @__PURE__ */ k("div", {
|
|
130
131
|
className: "flex items-center justify-center h-full min-h-[400px]",
|
|
131
|
-
children: /* @__PURE__ */
|
|
132
|
+
children: /* @__PURE__ */ A("div", {
|
|
132
133
|
className: "text-center space-y-4",
|
|
133
134
|
children: [
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
+
/* @__PURE__ */ k("div", {
|
|
135
136
|
className: "size-12 mx-auto rounded-full bg-status-error-bg-subtle flex items-center justify-center",
|
|
136
|
-
children: /* @__PURE__ */
|
|
137
|
+
children: /* @__PURE__ */ k("svg", {
|
|
137
138
|
className: "size-6 text-status-error-text",
|
|
138
139
|
fill: "none",
|
|
139
140
|
viewBox: "0 0 24 24",
|
|
140
141
|
stroke: "currentColor",
|
|
141
|
-
children: /* @__PURE__ */
|
|
142
|
+
children: /* @__PURE__ */ k("path", {
|
|
142
143
|
strokeLinecap: "round",
|
|
143
144
|
strokeLinejoin: "round",
|
|
144
145
|
strokeWidth: 2,
|
|
@@ -146,15 +147,15 @@ var A = () => {
|
|
|
146
147
|
})
|
|
147
148
|
})
|
|
148
149
|
}),
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
+
/* @__PURE__ */ k("h2", {
|
|
150
151
|
className: "text-lg font-semibold text-text-primary",
|
|
151
152
|
children: t("billing.invoices.failedToLoad", "Failed to load invoices")
|
|
152
153
|
}),
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ k("p", {
|
|
154
155
|
className: "text-sm text-text-secondary",
|
|
155
156
|
children: Z.message
|
|
156
157
|
}),
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ k("button", {
|
|
158
159
|
type: "button",
|
|
159
160
|
onClick: () => Q(),
|
|
160
161
|
className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors",
|
|
@@ -163,59 +164,66 @@ var A = () => {
|
|
|
163
164
|
]
|
|
164
165
|
})
|
|
165
166
|
});
|
|
166
|
-
let $ =
|
|
167
|
+
let $ = _.length > 1 ? /* @__PURE__ */ A("div", {
|
|
167
168
|
className: i ? "flex w-full min-w-0 items-center gap-2 sm:w-auto" : "flex items-center gap-2",
|
|
168
|
-
children: [/* @__PURE__ */
|
|
169
|
+
children: [/* @__PURE__ */ k("label", {
|
|
169
170
|
className: "text-sm text-text-secondary whitespace-nowrap",
|
|
170
171
|
children: t("billing.invoices.billingAccountLabel", "Billing Account")
|
|
171
|
-
}), /* @__PURE__ */
|
|
172
|
+
}), /* @__PURE__ */ A("select", {
|
|
172
173
|
value: B ?? "",
|
|
173
|
-
onChange: (e) =>
|
|
174
|
+
onChange: (e) => z(e.target.value || null),
|
|
174
175
|
className: `${i ? "min-w-0 flex-1 truncate sm:max-w-xs sm:flex-none " : ""}text-sm border border-border-subtle rounded-button bg-bg-surface text-text-primary px-3 py-2 focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary`,
|
|
175
|
-
children: [/* @__PURE__ */
|
|
176
|
+
children: [/* @__PURE__ */ k("option", {
|
|
176
177
|
value: "",
|
|
177
178
|
children: t("billing.invoices.allAccounts", "All Accounts")
|
|
178
|
-
}),
|
|
179
|
+
}), _.map((e) => /* @__PURE__ */ A("option", {
|
|
179
180
|
value: e.id ?? "",
|
|
180
181
|
children: [e.name ?? e.email ?? e.id, e.isDefault ? t("billing.invoices.defaultSuffix", " (Default)") : ""]
|
|
181
182
|
}, e.id ?? ""))]
|
|
182
183
|
})]
|
|
183
184
|
}) : null;
|
|
184
|
-
return /* @__PURE__ */
|
|
185
|
+
return /* @__PURE__ */ A("div", {
|
|
185
186
|
className: "space-y-6 px-6 lg:px-8 py-6",
|
|
186
187
|
children: [
|
|
187
|
-
/* @__PURE__ */
|
|
188
|
+
/* @__PURE__ */ A("div", {
|
|
188
189
|
className: i ? "flex flex-col gap-4 xl:flex-row xl:items-start xl:justify-between" : "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
189
|
-
children: [/* @__PURE__ */
|
|
190
|
+
children: [/* @__PURE__ */ A("div", {
|
|
190
191
|
className: i ? "min-w-0 xl:max-w-3xl" : void 0,
|
|
191
192
|
children: [
|
|
192
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ k("h1", {
|
|
193
194
|
className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary",
|
|
194
195
|
children: t("billing.invoices.title", "Invoices")
|
|
195
196
|
}),
|
|
196
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ k("p", {
|
|
197
198
|
className: "text-sm text-text-secondary mt-1",
|
|
198
199
|
children: t("billing.invoices.subtitle", "View and manage your billing invoices")
|
|
199
200
|
}),
|
|
200
|
-
/* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ k(T, {
|
|
201
202
|
className: "mt-3",
|
|
202
203
|
children: t("billing.invoices.purpose", "A record of everything you have been billed for — subscriptions, add-ons and one-off charges. Open an invoice to see line items, download the PDF, pay an outstanding amount, or request a refund.")
|
|
204
|
+
}),
|
|
205
|
+
i && /* @__PURE__ */ k("div", {
|
|
206
|
+
className: "mt-4",
|
|
207
|
+
children: /* @__PURE__ */ k(s, {
|
|
208
|
+
active: "invoices",
|
|
209
|
+
billingAccountId: B
|
|
210
|
+
})
|
|
203
211
|
})
|
|
204
212
|
]
|
|
205
|
-
}), /* @__PURE__ */
|
|
206
|
-
className:
|
|
207
|
-
children: [/* @__PURE__ */
|
|
213
|
+
}), !i && /* @__PURE__ */ A("div", {
|
|
214
|
+
className: "flex items-center gap-3",
|
|
215
|
+
children: [/* @__PURE__ */ A("button", {
|
|
208
216
|
type: "button",
|
|
209
|
-
onClick: () =>
|
|
217
|
+
onClick: () => c("/refunds"),
|
|
210
218
|
className: "inline-flex items-center gap-2 whitespace-nowrap px-3 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken hover:border-border-strong transition-all duration-200",
|
|
211
|
-
children: [/* @__PURE__ */
|
|
212
|
-
}),
|
|
219
|
+
children: [/* @__PURE__ */ k(E, { className: "size-4" }), t("billing.invoices.myRefunds", "My Refunds")]
|
|
220
|
+
}), $]
|
|
213
221
|
})]
|
|
214
222
|
}),
|
|
215
|
-
/* @__PURE__ */
|
|
223
|
+
/* @__PURE__ */ A("div", {
|
|
216
224
|
className: "flex flex-wrap items-center gap-4 pb-4 border-b border-border-subtle",
|
|
217
225
|
children: [
|
|
218
|
-
/* @__PURE__ */
|
|
226
|
+
/* @__PURE__ */ k("div", {
|
|
219
227
|
className: "inline-flex rounded-lg border border-border-subtle p-1 bg-bg-sunken flex-wrap",
|
|
220
228
|
children: [
|
|
221
229
|
"all",
|
|
@@ -223,122 +231,122 @@ var A = () => {
|
|
|
223
231
|
"PAID",
|
|
224
232
|
"DRAFT",
|
|
225
233
|
"VOID"
|
|
226
|
-
].map((e) => /* @__PURE__ */
|
|
234
|
+
].map((e) => /* @__PURE__ */ k("button", {
|
|
227
235
|
type: "button",
|
|
228
236
|
onClick: () => {
|
|
229
237
|
H(e), K(1);
|
|
230
238
|
},
|
|
231
239
|
className: `px-3 py-1.5 text-sm font-medium rounded-button transition-colors ${V === e ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-secondary hover:text-text-primary"}`,
|
|
232
|
-
children: e === "all" ? "All" :
|
|
240
|
+
children: e === "all" ? "All" : d(e)
|
|
233
241
|
}, e))
|
|
234
242
|
}),
|
|
235
|
-
/* @__PURE__ */
|
|
243
|
+
/* @__PURE__ */ A("div", {
|
|
236
244
|
className: "relative flex-1 min-w-0 w-full sm:max-w-md",
|
|
237
|
-
children: [/* @__PURE__ */
|
|
245
|
+
children: [/* @__PURE__ */ k("svg", {
|
|
238
246
|
className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-text-secondary",
|
|
239
247
|
fill: "none",
|
|
240
248
|
viewBox: "0 0 24 24",
|
|
241
249
|
stroke: "currentColor",
|
|
242
|
-
children: /* @__PURE__ */
|
|
250
|
+
children: /* @__PURE__ */ k("path", {
|
|
243
251
|
strokeLinecap: "round",
|
|
244
252
|
strokeLinejoin: "round",
|
|
245
253
|
strokeWidth: 2,
|
|
246
254
|
d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
|
|
247
255
|
})
|
|
248
|
-
}), /* @__PURE__ */
|
|
256
|
+
}), /* @__PURE__ */ k("input", {
|
|
249
257
|
type: "text",
|
|
250
258
|
placeholder: t("billing.invoices.searchPlaceholder", "Search by invoice number..."),
|
|
251
259
|
value: U,
|
|
252
|
-
onChange: (e) =>
|
|
260
|
+
onChange: (e) => te(e.target.value),
|
|
253
261
|
className: "w-full pl-[3.25rem] pr-4 py-2 text-sm border border-border-subtle rounded-button bg-bg-surface text-text-primary placeholder:text-text-placeholder focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] focus:border-transparent"
|
|
254
262
|
})]
|
|
255
263
|
}),
|
|
256
|
-
i && $ ? /* @__PURE__ */
|
|
264
|
+
i && $ ? /* @__PURE__ */ k("div", {
|
|
257
265
|
className: "w-full sm:ml-auto sm:w-auto",
|
|
258
266
|
children: $
|
|
259
267
|
}) : null
|
|
260
268
|
]
|
|
261
269
|
}),
|
|
262
|
-
|
|
270
|
+
P && /* @__PURE__ */ k("div", {
|
|
263
271
|
className: "rounded-button border border-status-error-border bg-status-error-bg-subtle p-3",
|
|
264
|
-
children: /* @__PURE__ */
|
|
272
|
+
children: /* @__PURE__ */ k("p", {
|
|
265
273
|
className: "text-sm text-status-error-text",
|
|
266
|
-
children:
|
|
274
|
+
children: P
|
|
267
275
|
})
|
|
268
276
|
}),
|
|
269
|
-
!X && J.length === 0 ? /* @__PURE__ */
|
|
277
|
+
!X && J.length === 0 ? /* @__PURE__ */ k(w, {
|
|
270
278
|
illustration: V !== "all" || W ? "empty-search" : "empty-files",
|
|
271
279
|
title: t("billing.invoices.noInvoicesFound", "No invoices found"),
|
|
272
280
|
description: V !== "all" || W ? t("billing.invoices.noInvoicesFiltered", "No invoices match your filters.") : t("billing.invoices.noInvoicesYet", "You don't have any invoices yet.")
|
|
273
|
-
}) : /* @__PURE__ */
|
|
281
|
+
}) : /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k("div", {
|
|
274
282
|
className: `border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 ${i ? "overflow-x-auto" : "overflow-hidden"}`,
|
|
275
|
-
children: /* @__PURE__ */
|
|
283
|
+
children: /* @__PURE__ */ A("table", {
|
|
276
284
|
className: "w-full",
|
|
277
|
-
children: [/* @__PURE__ */
|
|
285
|
+
children: [/* @__PURE__ */ k("thead", {
|
|
278
286
|
className: "bg-bg-sunken",
|
|
279
|
-
children: /* @__PURE__ */
|
|
280
|
-
/* @__PURE__ */
|
|
287
|
+
children: /* @__PURE__ */ A("tr", { children: [
|
|
288
|
+
/* @__PURE__ */ k("th", {
|
|
281
289
|
className: "text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted",
|
|
282
290
|
children: t("billing.invoices.invoice", "Invoice")
|
|
283
291
|
}),
|
|
284
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ k("th", {
|
|
285
293
|
className: "text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted",
|
|
286
294
|
children: t("billing.common.status", "Status")
|
|
287
295
|
}),
|
|
288
|
-
!B &&
|
|
296
|
+
!B && _.length > 1 && /* @__PURE__ */ k("th", {
|
|
289
297
|
className: "text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted hidden lg:table-cell",
|
|
290
298
|
children: t("billing.common.account", "Account")
|
|
291
299
|
}),
|
|
292
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ k("th", {
|
|
293
301
|
className: "text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted hidden sm:table-cell",
|
|
294
302
|
children: t("billing.common.date", "Date")
|
|
295
303
|
}),
|
|
296
|
-
/* @__PURE__ */
|
|
304
|
+
/* @__PURE__ */ k("th", {
|
|
297
305
|
className: "text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted hidden md:table-cell",
|
|
298
306
|
children: t("billing.common.dueDate", "Due Date")
|
|
299
307
|
}),
|
|
300
|
-
/* @__PURE__ */
|
|
308
|
+
/* @__PURE__ */ k("th", {
|
|
301
309
|
className: "text-right px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted",
|
|
302
310
|
children: t("billing.common.amount", "Amount")
|
|
303
311
|
}),
|
|
304
|
-
/* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ k("th", {
|
|
305
313
|
className: "text-right px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted",
|
|
306
314
|
children: t("billing.common.actions", "Actions")
|
|
307
315
|
})
|
|
308
316
|
] })
|
|
309
|
-
}), /* @__PURE__ */
|
|
317
|
+
}), /* @__PURE__ */ k("tbody", {
|
|
310
318
|
className: "divide-y divide-border-subtle",
|
|
311
|
-
children: J.map((e) => /* @__PURE__ */
|
|
319
|
+
children: J.map((e) => /* @__PURE__ */ k(M, {
|
|
312
320
|
invoice: e,
|
|
313
|
-
onView: () =>
|
|
314
|
-
canPay:
|
|
315
|
-
canVoid:
|
|
316
|
-
onPay:
|
|
317
|
-
onVoid:
|
|
318
|
-
isProcessing:
|
|
319
|
-
processingAction:
|
|
320
|
-
showAccount: !B &&
|
|
321
|
-
accountName:
|
|
321
|
+
onView: () => c(f(`/invoices/${e.id}`, e.billingAccountId)),
|
|
322
|
+
canPay: l.canPayInvoice,
|
|
323
|
+
canVoid: l.canVoidInvoice,
|
|
324
|
+
onPay: re,
|
|
325
|
+
onVoid: ie,
|
|
326
|
+
isProcessing: I?.invoiceId === e.id,
|
|
327
|
+
processingAction: I?.invoiceId === e.id ? I.action : void 0,
|
|
328
|
+
showAccount: !B && _.length > 1,
|
|
329
|
+
accountName: _.find((t) => t.id === e.billingAccountId)?.name ?? null
|
|
322
330
|
}, e.id))
|
|
323
331
|
})]
|
|
324
332
|
})
|
|
325
|
-
}), Y > 1 && /* @__PURE__ */
|
|
333
|
+
}), Y > 1 && /* @__PURE__ */ A("div", {
|
|
326
334
|
className: "flex items-center justify-between pt-2",
|
|
327
|
-
children: [/* @__PURE__ */
|
|
335
|
+
children: [/* @__PURE__ */ k("p", {
|
|
328
336
|
className: "text-sm text-text-secondary",
|
|
329
337
|
children: t("billing.common.pageOf", "Page {{page}} of {{totalPages}}", {
|
|
330
338
|
page: G,
|
|
331
339
|
totalPages: Y
|
|
332
340
|
})
|
|
333
|
-
}), /* @__PURE__ */
|
|
341
|
+
}), /* @__PURE__ */ A("div", {
|
|
334
342
|
className: "flex items-center gap-2",
|
|
335
|
-
children: [/* @__PURE__ */
|
|
343
|
+
children: [/* @__PURE__ */ k("button", {
|
|
336
344
|
type: "button",
|
|
337
345
|
onClick: () => K((e) => Math.max(1, e - 1)),
|
|
338
346
|
disabled: G <= 1,
|
|
339
347
|
className: "px-3 py-1.5 text-sm font-medium border border-border-subtle rounded-button bg-bg-surface text-text-primary hover:bg-bg-sunken disabled:opacity-40 disabled:cursor-not-allowed transition-colors",
|
|
340
348
|
children: t("billing.common.previous", "Previous")
|
|
341
|
-
}), /* @__PURE__ */
|
|
349
|
+
}), /* @__PURE__ */ k("button", {
|
|
342
350
|
type: "button",
|
|
343
351
|
onClick: () => K((e) => Math.min(Y, e + 1)),
|
|
344
352
|
disabled: G >= Y,
|
|
@@ -349,10 +357,10 @@ var A = () => {
|
|
|
349
357
|
})] })
|
|
350
358
|
]
|
|
351
359
|
});
|
|
352
|
-
},
|
|
353
|
-
let x =
|
|
354
|
-
|
|
355
|
-
let t = await
|
|
360
|
+
}, M = ({ invoice: e, onView: n, onPay: r, onVoid: a, canPay: o, canVoid: s, isProcessing: f, processingAction: v, showAccount: y = !1, accountName: b }) => {
|
|
361
|
+
let x = h(), S = m(), [w, T] = C(!1), [E, D] = C(!1), O = p(e.status), j = e.status === "OPEN", M = e.status === "DRAFT", N = async () => {
|
|
362
|
+
_("medium");
|
|
363
|
+
let t = await g({
|
|
356
364
|
title: "Void invoice",
|
|
357
365
|
message: "Are you sure you want to void this invoice?",
|
|
358
366
|
okButtonTitle: "Void",
|
|
@@ -360,109 +368,109 @@ var A = () => {
|
|
|
360
368
|
});
|
|
361
369
|
t === !0 ? await a(e) : t === null && T(!0);
|
|
362
370
|
}, P = () => {
|
|
363
|
-
|
|
371
|
+
S ? D(!0) : r(e);
|
|
364
372
|
}, F = async () => {
|
|
365
373
|
await r(e), D(!1);
|
|
366
374
|
}, I = async () => {
|
|
367
375
|
await a(e), T(!1);
|
|
368
376
|
}, L = e.metadata?.invoicePdfBackupUrl;
|
|
369
|
-
return /* @__PURE__ */
|
|
377
|
+
return /* @__PURE__ */ A("tr", {
|
|
370
378
|
className: "hover:bg-bg-sunken transition-colors",
|
|
371
379
|
children: [
|
|
372
|
-
/* @__PURE__ */
|
|
380
|
+
/* @__PURE__ */ A("td", {
|
|
373
381
|
className: "p-4",
|
|
374
|
-
children: [e.invoiceUrl ? /* @__PURE__ */
|
|
382
|
+
children: [e.invoiceUrl ? /* @__PURE__ */ k("a", {
|
|
375
383
|
href: e.invoiceUrl,
|
|
376
384
|
target: "_blank",
|
|
377
385
|
rel: "noopener noreferrer",
|
|
378
386
|
className: "font-medium text-text-primary hover:text-text-link transition-colors",
|
|
379
|
-
children:
|
|
380
|
-
}) : /* @__PURE__ */
|
|
387
|
+
children: u(e.invoiceNumber)
|
|
388
|
+
}) : /* @__PURE__ */ k("button", {
|
|
381
389
|
type: "button",
|
|
382
390
|
onClick: n,
|
|
383
391
|
className: "font-medium text-text-primary hover:text-text-link transition-colors",
|
|
384
|
-
children:
|
|
385
|
-
}), (e.itemDescription ?? e.subscription?.plan?.name) && /* @__PURE__ */
|
|
392
|
+
children: u(e.invoiceNumber)
|
|
393
|
+
}), (e.itemDescription ?? e.subscription?.plan?.name) && /* @__PURE__ */ k("p", {
|
|
386
394
|
className: "text-sm text-text-secondary mt-0.5",
|
|
387
395
|
children: e.itemDescription ?? e.subscription?.plan?.name
|
|
388
396
|
})]
|
|
389
397
|
}),
|
|
390
|
-
/* @__PURE__ */
|
|
398
|
+
/* @__PURE__ */ k("td", {
|
|
391
399
|
className: "p-4",
|
|
392
|
-
children: /* @__PURE__ */
|
|
393
|
-
status:
|
|
400
|
+
children: /* @__PURE__ */ k(t, {
|
|
401
|
+
status: O,
|
|
394
402
|
dot: !0,
|
|
395
|
-
children:
|
|
403
|
+
children: d(e.status)
|
|
396
404
|
})
|
|
397
405
|
}),
|
|
398
|
-
y && /* @__PURE__ */
|
|
406
|
+
y && /* @__PURE__ */ k("td", {
|
|
399
407
|
className: "p-4 hidden lg:table-cell",
|
|
400
|
-
children: b ? /* @__PURE__ */
|
|
408
|
+
children: b ? /* @__PURE__ */ k("span", {
|
|
401
409
|
className: "inline-flex items-center px-2 py-0.5 text-xs font-medium rounded-full bg-bg-sunken text-text-secondary border border-border-subtle",
|
|
402
410
|
children: b
|
|
403
|
-
}) : /* @__PURE__ */
|
|
411
|
+
}) : /* @__PURE__ */ k("span", {
|
|
404
412
|
className: "text-sm text-text-secondary",
|
|
405
413
|
children: ", "
|
|
406
414
|
})
|
|
407
415
|
}),
|
|
408
|
-
/* @__PURE__ */
|
|
416
|
+
/* @__PURE__ */ k("td", {
|
|
409
417
|
className: "p-4 text-sm text-text-secondary hidden sm:table-cell",
|
|
410
|
-
children:
|
|
418
|
+
children: l(e.createdAt, "short")
|
|
411
419
|
}),
|
|
412
|
-
/* @__PURE__ */
|
|
420
|
+
/* @__PURE__ */ k("td", {
|
|
413
421
|
className: "p-4 text-sm text-text-secondary hidden md:table-cell",
|
|
414
|
-
children: e.dueDate ?
|
|
422
|
+
children: e.dueDate ? l(e.dueDate, "short") : "—"
|
|
415
423
|
}),
|
|
416
|
-
/* @__PURE__ */
|
|
417
|
-
className: `p-4 text-right font-medium text-text-primary ${
|
|
418
|
-
children:
|
|
424
|
+
/* @__PURE__ */ k("td", {
|
|
425
|
+
className: `p-4 text-right font-medium text-text-primary ${S ? "whitespace-nowrap" : ""}`,
|
|
426
|
+
children: c(e.total, e.currency)
|
|
419
427
|
}),
|
|
420
|
-
/* @__PURE__ */
|
|
428
|
+
/* @__PURE__ */ k("td", {
|
|
421
429
|
className: "p-4 text-right",
|
|
422
|
-
children: /* @__PURE__ */
|
|
423
|
-
className: `relative flex items-center justify-end ${
|
|
430
|
+
children: /* @__PURE__ */ A("div", {
|
|
431
|
+
className: `relative flex items-center justify-end ${S ? "flex-wrap gap-1" : "gap-2"}`,
|
|
424
432
|
children: [
|
|
425
|
-
e.invoiceUrl ? /* @__PURE__ */
|
|
433
|
+
e.invoiceUrl ? /* @__PURE__ */ k("a", {
|
|
426
434
|
href: e.invoiceUrl,
|
|
427
435
|
target: "_blank",
|
|
428
436
|
rel: "noopener noreferrer",
|
|
429
437
|
className: "px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-bg-sunken rounded-button transition-colors duration-200",
|
|
430
438
|
children: x("billing.common.view", "View")
|
|
431
|
-
}) : /* @__PURE__ */
|
|
439
|
+
}) : /* @__PURE__ */ k("button", {
|
|
432
440
|
type: "button",
|
|
433
441
|
onClick: n,
|
|
434
442
|
className: "px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-bg-sunken rounded-button transition-colors duration-200",
|
|
435
443
|
children: x("billing.common.view", "View")
|
|
436
444
|
}),
|
|
437
|
-
e.pdfUrl && /* @__PURE__ */
|
|
445
|
+
e.pdfUrl && /* @__PURE__ */ k("a", {
|
|
438
446
|
href: e.pdfUrl,
|
|
439
447
|
target: "_blank",
|
|
440
448
|
rel: "noopener noreferrer",
|
|
441
449
|
className: "px-3 py-1.5 text-sm font-medium text-text-link hover:bg-[var(--color-accent-softHover)] rounded-button transition-colors duration-200",
|
|
442
450
|
children: x("billing.common.pdf", "PDF")
|
|
443
451
|
}),
|
|
444
|
-
L && /* @__PURE__ */
|
|
452
|
+
L && /* @__PURE__ */ k("a", {
|
|
445
453
|
href: L,
|
|
446
454
|
target: "_blank",
|
|
447
455
|
rel: "noopener noreferrer",
|
|
448
456
|
className: "px-3 py-1.5 text-sm font-medium text-text-link hover:bg-[var(--color-accent-softHover)] rounded-button transition-colors duration-200",
|
|
449
457
|
children: x("billing.common.pdfBackup", "PDF (backup)")
|
|
450
458
|
}),
|
|
451
|
-
j && o && /* @__PURE__ */
|
|
459
|
+
j && o && /* @__PURE__ */ k("button", {
|
|
452
460
|
type: "button",
|
|
453
461
|
onClick: P,
|
|
454
|
-
disabled:
|
|
462
|
+
disabled: f,
|
|
455
463
|
className: "px-3 py-1.5 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors duration-200 disabled:cursor-not-allowed disabled:opacity-50",
|
|
456
|
-
children:
|
|
464
|
+
children: f && v === "pay" ? x("billing.common.paying", "Paying…") : x("billing.common.pay", "Pay")
|
|
457
465
|
}),
|
|
458
|
-
|
|
466
|
+
S && /* @__PURE__ */ k(i, {
|
|
459
467
|
open: E,
|
|
460
468
|
title: x("billing.invoices.payReview.title", "Review and pay"),
|
|
461
469
|
description: x("billing.invoices.payReview.description", "Your default card is charged as soon as you confirm."),
|
|
462
470
|
details: [
|
|
463
471
|
{
|
|
464
472
|
label: x("billing.invoices.payReview.invoice", "Invoice"),
|
|
465
|
-
value:
|
|
473
|
+
value: u(e.invoiceNumber)
|
|
466
474
|
},
|
|
467
475
|
...b ? [{
|
|
468
476
|
label: x("billing.invoices.payReview.account", "Billing account"),
|
|
@@ -474,40 +482,40 @@ var A = () => {
|
|
|
474
482
|
},
|
|
475
483
|
{
|
|
476
484
|
label: x("billing.invoices.payReview.amount", "Amount"),
|
|
477
|
-
value:
|
|
485
|
+
value: c(e.total, e.currency)
|
|
478
486
|
}
|
|
479
487
|
],
|
|
480
|
-
confirmLabel: x("billing.invoices.payReview.confirm", "Pay {{amount}}", { amount:
|
|
488
|
+
confirmLabel: x("billing.invoices.payReview.confirm", "Pay {{amount}}", { amount: c(e.total, e.currency) }),
|
|
481
489
|
busyLabel: x("billing.common.paying", "Paying…"),
|
|
482
|
-
isBusy:
|
|
490
|
+
isBusy: f && v === "pay",
|
|
483
491
|
onConfirm: () => void F(),
|
|
484
492
|
onCancel: () => D(!1)
|
|
485
493
|
}),
|
|
486
|
-
(j || M) &&
|
|
494
|
+
(j || M) && s && /* @__PURE__ */ k("button", {
|
|
487
495
|
type: "button",
|
|
488
496
|
onClick: () => void N(),
|
|
489
|
-
disabled:
|
|
497
|
+
disabled: f,
|
|
490
498
|
className: "px-3 py-1.5 text-sm font-medium text-status-error-text hover:bg-status-error-bg-subtle rounded-button transition-colors duration-200 disabled:cursor-not-allowed disabled:opacity-50",
|
|
491
|
-
children:
|
|
499
|
+
children: f && v === "void" ? x("billing.common.voiding", "Voiding…") : x("billing.common.void", "Void")
|
|
492
500
|
}),
|
|
493
|
-
w && /* @__PURE__ */
|
|
501
|
+
w && /* @__PURE__ */ A("div", {
|
|
494
502
|
className: "absolute right-4 mt-12 z-10 w-64 rounded-card border border-status-error-border bg-bg-elevated p-3 text-left shadow-elevation-2",
|
|
495
|
-
children: [/* @__PURE__ */
|
|
503
|
+
children: [/* @__PURE__ */ k("p", {
|
|
496
504
|
className: "text-sm font-medium text-text-primary",
|
|
497
505
|
children: "Void this invoice?"
|
|
498
|
-
}), /* @__PURE__ */
|
|
506
|
+
}), /* @__PURE__ */ A("div", {
|
|
499
507
|
className: "mt-3 flex justify-end gap-2",
|
|
500
|
-
children: [/* @__PURE__ */
|
|
508
|
+
children: [/* @__PURE__ */ k("button", {
|
|
501
509
|
type: "button",
|
|
502
510
|
onClick: () => T(!1),
|
|
503
511
|
className: "rounded-button border border-border-subtle bg-bg-surface px-2.5 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
|
|
504
512
|
children: "Cancel"
|
|
505
|
-
}), /* @__PURE__ */
|
|
513
|
+
}), /* @__PURE__ */ k("button", {
|
|
506
514
|
type: "button",
|
|
507
515
|
onClick: () => void I(),
|
|
508
|
-
disabled:
|
|
516
|
+
disabled: f,
|
|
509
517
|
className: "rounded-button bg-action-danger-bg px-2.5 py-1.5 text-xs font-medium text-action-primary-text hover:bg-action-danger-bgHover disabled:cursor-not-allowed disabled:opacity-50",
|
|
510
|
-
children:
|
|
518
|
+
children: f ? "Voiding…" : "Confirm"
|
|
511
519
|
})]
|
|
512
520
|
})]
|
|
513
521
|
})
|
|
@@ -517,6 +525,6 @@ var A = () => {
|
|
|
517
525
|
]
|
|
518
526
|
});
|
|
519
527
|
};
|
|
520
|
-
export {
|
|
528
|
+
export { j as InvoicesListPage };
|
|
521
529
|
|
|
522
530
|
//# sourceMappingURL=InvoicesListPage.js.map
|