@burdenoff/microfe-billing 2026.1108.2 → 2026.1112.1
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/BillingUserRoutes.js +202 -188
- package/dist/billing/BillingUserRoutes.js.map +1 -1
- package/dist/billing/hooks/useBillingVariant.d.ts +6 -0
- package/dist/billing/hooks/useBillingVariant.js +8 -0
- package/dist/billing/hooks/useBillingVariant.js.map +1 -0
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +169 -140
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.js +191 -156
- package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/UserRefundsPage.js +160 -157
- package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +4 -1
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
- package/dist/billing/providers/BillingProvider.js +16 -15
- package/dist/billing/providers/BillingProvider.js.map +1 -1
- package/dist/billing/shared/components/MoneyActionDialog.d.ts +27 -0
- package/dist/billing/shared/components/MoneyActionDialog.js +53 -0
- package/dist/billing/shared/components/MoneyActionDialog.js.map +1 -0
- package/dist/billing/shared/components/index.d.ts +1 -0
- package/dist/billing/shared/components/index.js +2 -1
- package/dist/billing/shared/utils/accessRules.d.ts +16 -0
- package/dist/billing/shared/utils/accessRules.js +10 -0
- package/dist/billing/shared/utils/accessRules.js.map +1 -0
- package/dist/billing/shared/utils/directActivityGraphql.d.ts +2 -0
- package/dist/billing/shared/utils/directActivityGraphql.js +1 -1
- package/dist/billing/shared/utils/directBillingGraphql.d.ts +2 -0
- package/dist/billing/shared/utils/directBillingGraphql.js +2 -1
- package/dist/billing/shared/utils/directBillingGraphql.js.map +1 -1
- package/dist/billing/shared/utils/gatewayGraphql.d.ts +2 -0
- package/dist/billing/shared/utils/gatewayGraphql.js +2 -1
- package/dist/billing/shared/utils/gatewayGraphql.js.map +1 -1
- package/dist/billing/shared/utils/pinnedRequest.d.ts +48 -0
- package/dist/billing/shared/utils/pinnedRequest.js +63 -0
- package/dist/billing/shared/utils/pinnedRequest.js.map +1 -0
- package/dist/billing/types/index.d.ts +6 -0
- package/package.json +2 -2
|
@@ -1,53 +1,56 @@
|
|
|
1
1
|
import { useBillingNavigate as e } from "../../../hooks/useBillingNavigate.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
2
|
+
import { MoneyActionDialog as t } from "../../../shared/components/MoneyActionDialog.js";
|
|
3
|
+
import { useBilling as n } from "../../../providers/BillingProvider.js";
|
|
4
|
+
import { useBillingAccountSelection as r } from "../../../hooks/useBillingAccountSelection.js";
|
|
5
|
+
import { useInvoice as i, useInvoiceMutations as a } from "../hooks/useInvoices.js";
|
|
6
|
+
import { useBillingPermissions as ee } from "../../../hooks/useBillingPermissions.js";
|
|
7
|
+
import { useIsFluidgridsVariant as o } from "../../../hooks/useBillingVariant.js";
|
|
8
|
+
import "../../../shared/components/index.js";
|
|
9
|
+
import { useGetDefaultBillingAccountDashboardQuery as s } from "../../../../generated/global-operations.js";
|
|
10
|
+
import { formatCurrency as c, formatDate as l, formatInvoiceNumber as u, formatInvoiceStatus as d } from "../../../shared/utils/format.js";
|
|
11
|
+
import { withBillingAccountId as f } from "../../../shared/utils/navigation.js";
|
|
12
|
+
import { getInvoiceStatusColor as te, getStatusBadgeClasses as p } from "../../../shared/utils/status.js";
|
|
10
13
|
import { useState as m } from "react";
|
|
11
14
|
import { useParams as h } from "react-router";
|
|
12
15
|
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
13
16
|
import { useI18n as v } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
14
|
-
import { EmphasisPanel as y, NextSteps as b, PagePurpose as x, ResponsiveTable as
|
|
17
|
+
import { EmphasisPanel as y, NextSteps as b, PagePurpose as x, ResponsiveTable as ne } from "@burdenoff/fe-libs/ui";
|
|
15
18
|
// src/billing/modules/billing/pages/InvoiceDetailPage.tsx
|
|
16
|
-
var
|
|
17
|
-
let { t:
|
|
18
|
-
let n =
|
|
19
|
+
var S = () => {
|
|
20
|
+
let { t: S } = v(), C = (e, t) => {
|
|
21
|
+
let n = S(e);
|
|
19
22
|
return n === e ? t : n;
|
|
20
|
-
}, { invoiceId:
|
|
21
|
-
orgId:
|
|
23
|
+
}, { invoiceId: w } = h(), T = e(), { orgId: E } = n(), D = ee(), { selectedAccountId: O } = r({
|
|
24
|
+
orgId: E,
|
|
22
25
|
syncFromUrl: !0,
|
|
23
26
|
urlParamName: "billingAccountId"
|
|
24
|
-
}), { data:
|
|
25
|
-
if (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
H(e instanceof Error ? e.message : "Failed to pay invoice");
|
|
34
|
-
}
|
|
35
|
-
}
|
|
27
|
+
}), { data: k } = s({ fetchPolicy: "cache-first" }), A = O ?? k?.getDefaultBillingAccount?.id ?? void 0, { invoice: j, isLoading: re, error: M, refetch: N } = i(w, A), { payInvoice: P, voidInvoice: F, isPaying: I, isVoiding: L } = a(), R = k?.getDefaultBillingAccount?.defaultPaymentMethod, [z, B] = m(null), V = o(), [H, U] = m(null), W = async () => {
|
|
28
|
+
if (!j) return !1;
|
|
29
|
+
if (!R) return B("Add and set a default payment method before paying this invoice."), !1;
|
|
30
|
+
if (!A) return B("No billing account context"), !1;
|
|
31
|
+
B(null);
|
|
32
|
+
try {
|
|
33
|
+
return await P(j.id, R, A), await N(), !0;
|
|
34
|
+
} catch (e) {
|
|
35
|
+
return B(e instanceof Error ? e.message : "Failed to pay invoice"), !1;
|
|
36
36
|
}
|
|
37
|
-
},
|
|
38
|
-
if (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
H(e instanceof Error ? e.message : "Failed to void invoice");
|
|
46
|
-
}
|
|
47
|
-
}
|
|
37
|
+
}, G = async () => {
|
|
38
|
+
if (!j) return !1;
|
|
39
|
+
if (!A) return B("No billing account context"), !1;
|
|
40
|
+
B(null);
|
|
41
|
+
try {
|
|
42
|
+
return await F(j.id, A), await N(), !0;
|
|
43
|
+
} catch (e) {
|
|
44
|
+
return B(e instanceof Error ? e.message : "Failed to void invoice"), !1;
|
|
48
45
|
}
|
|
46
|
+
}, K = () => {
|
|
47
|
+
B(null), V ? U("pay") : W();
|
|
48
|
+
}, q = () => {
|
|
49
|
+
B(null), U("void");
|
|
50
|
+
}, J = async () => {
|
|
51
|
+
(H === "pay" ? await W() : await G()) && U(null);
|
|
49
52
|
};
|
|
50
|
-
if (!
|
|
53
|
+
if (!D.canViewInvoices) return /* @__PURE__ */ g("div", {
|
|
51
54
|
className: "flex items-center justify-center h-full min-h-[400px]",
|
|
52
55
|
children: /* @__PURE__ */ _("div", {
|
|
53
56
|
className: "text-center space-y-2",
|
|
@@ -69,16 +72,16 @@ var C = () => {
|
|
|
69
72
|
}),
|
|
70
73
|
/* @__PURE__ */ g("h2", {
|
|
71
74
|
className: "text-lg font-semibold text-text-primary",
|
|
72
|
-
children:
|
|
75
|
+
children: C("billing.accessDenied.title", "Access Denied")
|
|
73
76
|
}),
|
|
74
77
|
/* @__PURE__ */ g("p", {
|
|
75
78
|
className: "text-sm text-text-secondary max-w-sm",
|
|
76
|
-
children:
|
|
79
|
+
children: C("billing.invoices.noViewPermission", "You don't have permission to view invoices.")
|
|
77
80
|
})
|
|
78
81
|
]
|
|
79
82
|
})
|
|
80
83
|
});
|
|
81
|
-
if (
|
|
84
|
+
if (re) return /* @__PURE__ */ _("div", {
|
|
82
85
|
className: "space-y-6 px-6 lg:px-8 py-6",
|
|
83
86
|
children: [/* @__PURE__ */ _("div", {
|
|
84
87
|
className: "flex items-center gap-4",
|
|
@@ -130,7 +133,7 @@ var C = () => {
|
|
|
130
133
|
})]
|
|
131
134
|
})]
|
|
132
135
|
});
|
|
133
|
-
if (
|
|
136
|
+
if (M || !j) return /* @__PURE__ */ g("div", {
|
|
134
137
|
className: "flex items-center justify-center h-full min-h-[400px]",
|
|
135
138
|
children: /* @__PURE__ */ _("div", {
|
|
136
139
|
className: "text-center space-y-4",
|
|
@@ -152,22 +155,22 @@ var C = () => {
|
|
|
152
155
|
}),
|
|
153
156
|
/* @__PURE__ */ g("h2", {
|
|
154
157
|
className: "text-lg font-semibold text-text-primary",
|
|
155
|
-
children:
|
|
158
|
+
children: C("billing.invoices.invoiceNotFound", "Invoice not found")
|
|
156
159
|
}),
|
|
157
160
|
/* @__PURE__ */ g("p", {
|
|
158
161
|
className: "text-sm text-text-secondary",
|
|
159
|
-
children:
|
|
162
|
+
children: M?.message || C("billing.invoices.invoiceNotFoundMessage", "The invoice you are looking for does not exist.")
|
|
160
163
|
}),
|
|
161
164
|
/* @__PURE__ */ _("div", {
|
|
162
165
|
className: "flex items-center justify-center gap-3",
|
|
163
166
|
children: [/* @__PURE__ */ g("button", {
|
|
164
167
|
type: "button",
|
|
165
|
-
onClick: () =>
|
|
168
|
+
onClick: () => N(),
|
|
166
169
|
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",
|
|
167
170
|
children: "Try Again"
|
|
168
171
|
}), /* @__PURE__ */ g("button", {
|
|
169
172
|
type: "button",
|
|
170
|
-
onClick: () =>
|
|
173
|
+
onClick: () => T(f("/invoices", A)),
|
|
171
174
|
className: "px-4 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
|
|
172
175
|
children: "Back to Invoices"
|
|
173
176
|
})]
|
|
@@ -175,7 +178,7 @@ var C = () => {
|
|
|
175
178
|
]
|
|
176
179
|
})
|
|
177
180
|
});
|
|
178
|
-
let
|
|
181
|
+
let Y = te(j.status), X = j.status === "OPEN", ie = j.status === "DRAFT", Z = j.items || [], Q = j.total - j.amountPaid, $ = j.metadata?.invoicePdfBackupUrl, ae = [
|
|
179
182
|
{
|
|
180
183
|
key: "description",
|
|
181
184
|
header: "Description",
|
|
@@ -199,7 +202,7 @@ var C = () => {
|
|
|
199
202
|
cellClassName: "text-right",
|
|
200
203
|
cell: (e) => /* @__PURE__ */ g("span", {
|
|
201
204
|
className: "tabular-nums",
|
|
202
|
-
children:
|
|
205
|
+
children: c(e.unitPrice, j.currency)
|
|
203
206
|
})
|
|
204
207
|
},
|
|
205
208
|
{
|
|
@@ -209,39 +212,39 @@ var C = () => {
|
|
|
209
212
|
cellClassName: "text-right font-medium",
|
|
210
213
|
cell: (e) => /* @__PURE__ */ g("span", {
|
|
211
214
|
className: "tabular-nums",
|
|
212
|
-
children:
|
|
215
|
+
children: c(e.amount, j.currency)
|
|
213
216
|
})
|
|
214
217
|
}
|
|
215
|
-
],
|
|
216
|
-
...
|
|
218
|
+
], oe = [
|
|
219
|
+
...X && D.canPayInvoice ? [{
|
|
217
220
|
id: "pay",
|
|
218
221
|
label: "Pay this invoice",
|
|
219
|
-
description:
|
|
220
|
-
onClick:
|
|
222
|
+
description: R ? "Settle the outstanding amount with your default payment method." : "Add a default payment method first, then pay.",
|
|
223
|
+
onClick: K
|
|
221
224
|
}] : [],
|
|
222
|
-
...
|
|
225
|
+
...j.pdfUrl ? [{
|
|
223
226
|
id: "download",
|
|
224
227
|
label: "Download the PDF",
|
|
225
228
|
description: "Save a copy of this invoice for your records.",
|
|
226
|
-
href:
|
|
229
|
+
href: j.pdfUrl
|
|
227
230
|
}] : [],
|
|
228
|
-
|
|
231
|
+
...$ ? [{
|
|
229
232
|
id: "download-backup",
|
|
230
233
|
label: "Download the PDF (backup copy)",
|
|
231
234
|
description: "Our own stored copy — works even if the link above ever breaks.",
|
|
232
|
-
href:
|
|
235
|
+
href: $
|
|
233
236
|
}] : [],
|
|
234
|
-
...
|
|
237
|
+
...j.subscription ? [{
|
|
235
238
|
id: "view-subscription",
|
|
236
239
|
label: "View the related subscription",
|
|
237
240
|
description: "See the plan and quotas this invoice billed for.",
|
|
238
|
-
onClick: () =>
|
|
241
|
+
onClick: () => T(f(`/subscriptions/${j.subscription.id}`, A))
|
|
239
242
|
}] : [],
|
|
240
243
|
{
|
|
241
244
|
id: "request-refund",
|
|
242
245
|
label: "Have an issue? Request a refund",
|
|
243
246
|
description: "Raise a refund request for a charge on this account.",
|
|
244
|
-
onClick: () =>
|
|
247
|
+
onClick: () => T(f("/refunds", A))
|
|
245
248
|
}
|
|
246
249
|
];
|
|
247
250
|
return /* @__PURE__ */ _("div", {
|
|
@@ -253,7 +256,7 @@ var C = () => {
|
|
|
253
256
|
className: "flex items-start gap-4",
|
|
254
257
|
children: [/* @__PURE__ */ g("button", {
|
|
255
258
|
type: "button",
|
|
256
|
-
onClick: () =>
|
|
259
|
+
onClick: () => T(f("/invoices", A)),
|
|
257
260
|
className: "p-2 -ml-2 text-text-secondary hover:text-text-primary hover:bg-bg-sunken rounded-button transition-colors",
|
|
258
261
|
children: /* @__PURE__ */ g("svg", {
|
|
259
262
|
className: "size-5",
|
|
@@ -272,71 +275,97 @@ var C = () => {
|
|
|
272
275
|
className: "flex items-center gap-3",
|
|
273
276
|
children: [/* @__PURE__ */ _("h1", {
|
|
274
277
|
className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary",
|
|
275
|
-
children: ["Invoice ",
|
|
278
|
+
children: ["Invoice ", u(j.invoiceNumber)]
|
|
276
279
|
}), /* @__PURE__ */ g("span", {
|
|
277
|
-
className: `px-2 py-1 text-xs font-medium rounded ${p(
|
|
278
|
-
children:
|
|
280
|
+
className: `px-2 py-1 text-xs font-medium rounded ${p(Y)}`,
|
|
281
|
+
children: d(j.status)
|
|
279
282
|
})]
|
|
280
283
|
}),
|
|
281
284
|
/* @__PURE__ */ _("p", {
|
|
282
285
|
className: "text-sm text-text-secondary mt-1",
|
|
283
286
|
children: [
|
|
284
287
|
"Created ",
|
|
285
|
-
|
|
286
|
-
|
|
288
|
+
l(j.createdAt, "short"),
|
|
289
|
+
j.dueDate && ` · Due ${l(j.dueDate, "short")}`
|
|
287
290
|
]
|
|
288
291
|
}),
|
|
289
292
|
/* @__PURE__ */ g(x, {
|
|
290
293
|
className: "mt-3",
|
|
291
|
-
children:
|
|
294
|
+
children: C("billing.invoices.detailPurpose", "The full breakdown of a single invoice — its line items, taxes, what has been paid and what is still due. Use it to download the PDF, pay an outstanding balance, jump to the subscription it covers, or raise a refund.")
|
|
292
295
|
})
|
|
293
296
|
] })]
|
|
294
297
|
}), /* @__PURE__ */ _("div", {
|
|
295
298
|
className: "flex items-center gap-2 flex-wrap",
|
|
296
299
|
children: [
|
|
297
|
-
|
|
298
|
-
href:
|
|
300
|
+
j.pdfUrl && /* @__PURE__ */ g("a", {
|
|
301
|
+
href: j.pdfUrl,
|
|
299
302
|
target: "_blank",
|
|
300
303
|
rel: "noopener noreferrer",
|
|
301
304
|
className: "px-4 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
|
|
302
305
|
children: "Download PDF"
|
|
303
306
|
}),
|
|
304
|
-
|
|
305
|
-
href:
|
|
307
|
+
$ && /* @__PURE__ */ g("a", {
|
|
308
|
+
href: $,
|
|
306
309
|
target: "_blank",
|
|
307
310
|
rel: "noopener noreferrer",
|
|
308
311
|
className: "px-4 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
|
|
309
312
|
children: "Download PDF (backup)"
|
|
310
313
|
}),
|
|
311
|
-
|
|
312
|
-
href:
|
|
314
|
+
j.invoiceUrl && /* @__PURE__ */ g("a", {
|
|
315
|
+
href: j.invoiceUrl,
|
|
313
316
|
target: "_blank",
|
|
314
317
|
rel: "noopener noreferrer",
|
|
315
318
|
className: "px-4 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
|
|
316
319
|
children: "View on Portal"
|
|
317
320
|
}),
|
|
318
|
-
|
|
321
|
+
X && D.canPayInvoice && /* @__PURE__ */ g("button", {
|
|
319
322
|
type: "button",
|
|
320
|
-
onClick:
|
|
321
|
-
disabled:
|
|
323
|
+
onClick: K,
|
|
324
|
+
disabled: I || !R,
|
|
322
325
|
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 disabled:opacity-50",
|
|
323
|
-
children:
|
|
326
|
+
children: R ? I ? "Processing..." : "Pay Invoice" : "Default Payment Method Required"
|
|
324
327
|
}),
|
|
325
|
-
(
|
|
328
|
+
(X || ie) && D.canVoidInvoice && /* @__PURE__ */ g("button", {
|
|
326
329
|
type: "button",
|
|
327
|
-
onClick:
|
|
328
|
-
disabled:
|
|
330
|
+
onClick: q,
|
|
331
|
+
disabled: L,
|
|
329
332
|
className: "px-4 py-2 text-sm font-medium border border-border-subtle text-status-error-text rounded-button hover:bg-status-error-bg-subtle transition-colors disabled:opacity-50",
|
|
330
|
-
children:
|
|
333
|
+
children: L ? C("billing.invoices.voiding", "Voiding...") : C("billing.invoices.voidInvoice", "Void Invoice")
|
|
331
334
|
})
|
|
332
335
|
]
|
|
333
336
|
})]
|
|
334
337
|
}),
|
|
335
|
-
|
|
338
|
+
/* @__PURE__ */ g(t, {
|
|
339
|
+
open: H !== null,
|
|
340
|
+
tone: H === "void" ? "danger" : "primary",
|
|
341
|
+
title: H === "void" ? C("billing.invoices.voidReview.title", "Void this invoice?") : C("billing.invoices.payReview.title", "Review and pay"),
|
|
342
|
+
description: H === "void" ? C("billing.invoices.voidReview.description", "The invoice is cancelled and can no longer be paid. This cannot be undone.") : C("billing.invoices.payReview.description", "Your default card is charged as soon as you confirm."),
|
|
343
|
+
details: [
|
|
344
|
+
{
|
|
345
|
+
label: C("billing.invoices.payReview.invoice", "Invoice"),
|
|
346
|
+
value: u(j.invoiceNumber)
|
|
347
|
+
},
|
|
348
|
+
...H === "pay" ? [{
|
|
349
|
+
label: C("billing.invoices.payReview.card", "Paid with"),
|
|
350
|
+
value: C("billing.invoices.payReview.defaultCard", "Your default card")
|
|
351
|
+
}] : [],
|
|
352
|
+
{
|
|
353
|
+
label: C("billing.invoices.payReview.amount", "Amount"),
|
|
354
|
+
value: c(j.total, j.currency)
|
|
355
|
+
}
|
|
356
|
+
],
|
|
357
|
+
confirmLabel: H === "void" ? C("billing.invoices.voidReview.confirm", "Void invoice") : C("billing.invoices.payReview.confirm", "Pay {{amount}}").replace("{{amount}}", c(j.total, j.currency)),
|
|
358
|
+
busyLabel: H === "void" ? C("billing.invoices.voiding", "Voiding...") : C("billing.common.paying", "Paying…"),
|
|
359
|
+
isBusy: H === "void" ? L : I,
|
|
360
|
+
error: z,
|
|
361
|
+
onConfirm: () => void J(),
|
|
362
|
+
onCancel: () => U(null)
|
|
363
|
+
}),
|
|
364
|
+
z && H === null && /* @__PURE__ */ g("div", {
|
|
336
365
|
className: "p-3 bg-status-error-bg-subtle border border-status-error-border rounded-button",
|
|
337
366
|
children: /* @__PURE__ */ g("p", {
|
|
338
367
|
className: "text-sm text-status-error-text",
|
|
339
|
-
children:
|
|
368
|
+
children: z
|
|
340
369
|
})
|
|
341
370
|
}),
|
|
342
371
|
/* @__PURE__ */ _("div", {
|
|
@@ -352,23 +381,23 @@ var C = () => {
|
|
|
352
381
|
children: /* @__PURE__ */ _("h2", {
|
|
353
382
|
className: "text-lg font-semibold text-text-primary",
|
|
354
383
|
children: [
|
|
355
|
-
|
|
384
|
+
C("billing.invoices.lineItems", "Line Items"),
|
|
356
385
|
" (",
|
|
357
|
-
|
|
386
|
+
Z.length,
|
|
358
387
|
")"
|
|
359
388
|
]
|
|
360
389
|
})
|
|
361
390
|
}),
|
|
362
|
-
|
|
391
|
+
Z.length === 0 ? /* @__PURE__ */ g("div", {
|
|
363
392
|
className: "p-6",
|
|
364
393
|
children: /* @__PURE__ */ g("p", {
|
|
365
394
|
className: "text-sm text-text-secondary",
|
|
366
|
-
children:
|
|
395
|
+
children: C("billing.invoices.noLineItems", "No line items on this invoice.")
|
|
367
396
|
})
|
|
368
|
-
}) : /* @__PURE__ */ g(
|
|
369
|
-
data:
|
|
397
|
+
}) : /* @__PURE__ */ g(ne, {
|
|
398
|
+
data: Z,
|
|
370
399
|
rowKey: (e) => e.id,
|
|
371
|
-
columns:
|
|
400
|
+
columns: ae
|
|
372
401
|
}),
|
|
373
402
|
/* @__PURE__ */ g("div", {
|
|
374
403
|
className: "border-t border-border-subtle p-4",
|
|
@@ -379,50 +408,50 @@ var C = () => {
|
|
|
379
408
|
className: "flex items-center justify-between text-sm",
|
|
380
409
|
children: [/* @__PURE__ */ g("span", {
|
|
381
410
|
className: "text-text-secondary",
|
|
382
|
-
children:
|
|
411
|
+
children: C("billing.invoices.subtotal", "Subtotal")
|
|
383
412
|
}), /* @__PURE__ */ g("span", {
|
|
384
413
|
className: "text-text-primary",
|
|
385
|
-
children:
|
|
414
|
+
children: c(j.subtotal, j.currency)
|
|
386
415
|
})]
|
|
387
416
|
}),
|
|
388
417
|
/* @__PURE__ */ _("div", {
|
|
389
418
|
className: "flex items-center justify-between text-sm",
|
|
390
419
|
children: [/* @__PURE__ */ g("span", {
|
|
391
420
|
className: "text-text-secondary",
|
|
392
|
-
children:
|
|
421
|
+
children: C("billing.invoices.tax", "Tax")
|
|
393
422
|
}), /* @__PURE__ */ g("span", {
|
|
394
423
|
className: "text-text-primary",
|
|
395
|
-
children:
|
|
424
|
+
children: c(j.tax, j.currency)
|
|
396
425
|
})]
|
|
397
426
|
}),
|
|
398
427
|
/* @__PURE__ */ _("div", {
|
|
399
428
|
className: "flex items-center justify-between text-sm font-semibold border-t border-border-subtle pt-2",
|
|
400
429
|
children: [/* @__PURE__ */ g("span", {
|
|
401
430
|
className: "text-text-primary",
|
|
402
|
-
children:
|
|
431
|
+
children: C("billing.invoices.total", "Total")
|
|
403
432
|
}), /* @__PURE__ */ g("span", {
|
|
404
433
|
className: "text-text-primary",
|
|
405
|
-
children:
|
|
434
|
+
children: c(j.total, j.currency)
|
|
406
435
|
})]
|
|
407
436
|
}),
|
|
408
|
-
|
|
437
|
+
j.amountPaid > 0 && /* @__PURE__ */ _("div", {
|
|
409
438
|
className: "flex items-center justify-between text-sm",
|
|
410
439
|
children: [/* @__PURE__ */ g("span", {
|
|
411
440
|
className: "text-text-secondary",
|
|
412
|
-
children:
|
|
441
|
+
children: C("billing.invoices.amountPaid", "Amount Paid")
|
|
413
442
|
}), /* @__PURE__ */ _("span", {
|
|
414
443
|
className: "text-status-success-text",
|
|
415
|
-
children: ["-",
|
|
444
|
+
children: ["-", c(j.amountPaid, j.currency)]
|
|
416
445
|
})]
|
|
417
446
|
}),
|
|
418
|
-
|
|
447
|
+
Q > 0 && /* @__PURE__ */ _("div", {
|
|
419
448
|
className: "flex items-center justify-between text-sm font-semibold border-t border-border-subtle pt-2",
|
|
420
449
|
children: [/* @__PURE__ */ g("span", {
|
|
421
450
|
className: "text-text-primary",
|
|
422
|
-
children:
|
|
451
|
+
children: C("billing.invoices.amountDue", "Amount Due")
|
|
423
452
|
}), /* @__PURE__ */ g("span", {
|
|
424
453
|
className: "text-status-warning-text",
|
|
425
|
-
children:
|
|
454
|
+
children: c(Q, j.currency)
|
|
426
455
|
})]
|
|
427
456
|
})
|
|
428
457
|
]
|
|
@@ -430,13 +459,13 @@ var C = () => {
|
|
|
430
459
|
})
|
|
431
460
|
]
|
|
432
461
|
}),
|
|
433
|
-
|
|
462
|
+
j.subscription && /* @__PURE__ */ _("div", {
|
|
434
463
|
className: "border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 overflow-hidden",
|
|
435
464
|
children: [/* @__PURE__ */ g("div", {
|
|
436
465
|
className: "p-6 border-b border-border-subtle bg-bg-sunken",
|
|
437
466
|
children: /* @__PURE__ */ g("h2", {
|
|
438
467
|
className: "text-lg font-semibold text-text-primary",
|
|
439
|
-
children:
|
|
468
|
+
children: C("billing.invoices.subscription", "Subscription")
|
|
440
469
|
})
|
|
441
470
|
}), /* @__PURE__ */ g("div", {
|
|
442
471
|
className: "p-6 space-y-4",
|
|
@@ -444,7 +473,7 @@ var C = () => {
|
|
|
444
473
|
className: "flex items-center justify-between",
|
|
445
474
|
children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
|
|
446
475
|
className: "font-medium text-text-primary",
|
|
447
|
-
children:
|
|
476
|
+
children: j.subscription.plan?.name || "Unknown Plan"
|
|
448
477
|
}), /* @__PURE__ */ _("p", {
|
|
449
478
|
className: "text-sm text-text-secondary mt-0.5",
|
|
450
479
|
children: [
|
|
@@ -452,25 +481,25 @@ var C = () => {
|
|
|
452
481
|
" ",
|
|
453
482
|
/* @__PURE__ */ g("span", {
|
|
454
483
|
className: "font-mono text-xs",
|
|
455
|
-
children:
|
|
484
|
+
children: j.subscription.id
|
|
456
485
|
})
|
|
457
486
|
]
|
|
458
487
|
})] }), /* @__PURE__ */ g("button", {
|
|
459
488
|
type: "button",
|
|
460
|
-
onClick: () =>
|
|
489
|
+
onClick: () => T(f(`/subscriptions/${j.subscription.id}`, A)),
|
|
461
490
|
className: "px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-bg-sunken rounded-button transition-colors",
|
|
462
491
|
children: "View"
|
|
463
492
|
})]
|
|
464
493
|
})
|
|
465
494
|
})]
|
|
466
495
|
}),
|
|
467
|
-
|
|
496
|
+
j.payment && /* @__PURE__ */ _("div", {
|
|
468
497
|
className: "border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 overflow-hidden",
|
|
469
498
|
children: [/* @__PURE__ */ g("div", {
|
|
470
499
|
className: "p-6 border-b border-border-subtle bg-bg-sunken",
|
|
471
500
|
children: /* @__PURE__ */ g("h2", {
|
|
472
501
|
className: "text-lg font-semibold text-text-primary",
|
|
473
|
-
children:
|
|
502
|
+
children: C("billing.invoices.payment", "Payment")
|
|
474
503
|
})
|
|
475
504
|
}), /* @__PURE__ */ g("div", {
|
|
476
505
|
className: "p-6",
|
|
@@ -482,42 +511,42 @@ var C = () => {
|
|
|
482
511
|
children: "Payment ID"
|
|
483
512
|
}), /* @__PURE__ */ g("p", {
|
|
484
513
|
className: "font-mono text-sm text-text-primary mt-0.5 break-all",
|
|
485
|
-
children:
|
|
514
|
+
children: j.payment.id
|
|
486
515
|
})] }),
|
|
487
516
|
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
|
|
488
517
|
className: "text-sm text-text-secondary",
|
|
489
518
|
children: "Amount"
|
|
490
519
|
}), /* @__PURE__ */ g("p", {
|
|
491
520
|
className: "text-sm text-text-primary mt-0.5",
|
|
492
|
-
children:
|
|
521
|
+
children: c(j.payment.amount, j.payment.currency)
|
|
493
522
|
})] }),
|
|
494
523
|
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
|
|
495
524
|
className: "text-sm text-text-secondary",
|
|
496
525
|
children: "Status"
|
|
497
526
|
}), /* @__PURE__ */ g("p", {
|
|
498
527
|
className: "text-sm text-text-primary mt-0.5 capitalize",
|
|
499
|
-
children:
|
|
528
|
+
children: j.payment.status.toLowerCase()
|
|
500
529
|
})] }),
|
|
501
530
|
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
|
|
502
531
|
className: "text-sm text-text-secondary",
|
|
503
532
|
children: "Method"
|
|
504
533
|
}), /* @__PURE__ */ g("p", {
|
|
505
534
|
className: "text-sm text-text-primary mt-0.5 capitalize",
|
|
506
|
-
children:
|
|
535
|
+
children: j.payment.method.toLowerCase().replace(/_/g, " ")
|
|
507
536
|
})] }),
|
|
508
|
-
|
|
537
|
+
j.payment.provider && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
|
|
509
538
|
className: "text-sm text-text-secondary",
|
|
510
539
|
children: "Provider"
|
|
511
540
|
}), /* @__PURE__ */ g("p", {
|
|
512
541
|
className: "text-sm text-text-primary mt-0.5 capitalize",
|
|
513
|
-
children:
|
|
542
|
+
children: j.payment.provider
|
|
514
543
|
})] }),
|
|
515
|
-
|
|
544
|
+
j.payment.paidAt && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
|
|
516
545
|
className: "text-sm text-text-secondary",
|
|
517
546
|
children: "Paid At"
|
|
518
547
|
}), /* @__PURE__ */ g("p", {
|
|
519
548
|
className: "text-sm text-text-primary mt-0.5",
|
|
520
|
-
children:
|
|
549
|
+
children: l(j.payment.paidAt, "short")
|
|
521
550
|
})] })
|
|
522
551
|
]
|
|
523
552
|
})
|
|
@@ -529,7 +558,7 @@ var C = () => {
|
|
|
529
558
|
children: [
|
|
530
559
|
/* @__PURE__ */ g(b, {
|
|
531
560
|
storageKey: "billing-invoice-detail",
|
|
532
|
-
steps:
|
|
561
|
+
steps: oe
|
|
533
562
|
}),
|
|
534
563
|
/* @__PURE__ */ _("div", {
|
|
535
564
|
className: "border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 overflow-hidden",
|
|
@@ -537,7 +566,7 @@ var C = () => {
|
|
|
537
566
|
className: "p-6 border-b border-border-subtle bg-bg-sunken",
|
|
538
567
|
children: /* @__PURE__ */ g("h2", {
|
|
539
568
|
className: "text-lg font-semibold text-text-primary",
|
|
540
|
-
children:
|
|
569
|
+
children: C("billing.invoices.details", "Details")
|
|
541
570
|
})
|
|
542
571
|
}), /* @__PURE__ */ _("div", {
|
|
543
572
|
className: "p-6 space-y-4",
|
|
@@ -547,56 +576,56 @@ var C = () => {
|
|
|
547
576
|
children: "Invoice ID"
|
|
548
577
|
}), /* @__PURE__ */ g("p", {
|
|
549
578
|
className: "font-mono text-sm text-text-primary mt-0.5 break-all",
|
|
550
|
-
children:
|
|
579
|
+
children: j.id
|
|
551
580
|
})] }),
|
|
552
581
|
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
|
|
553
582
|
className: "text-sm text-text-secondary",
|
|
554
583
|
children: "Invoice Number"
|
|
555
584
|
}), /* @__PURE__ */ g("p", {
|
|
556
585
|
className: "text-sm text-text-primary mt-0.5",
|
|
557
|
-
children:
|
|
586
|
+
children: u(j.invoiceNumber)
|
|
558
587
|
})] }),
|
|
559
|
-
|
|
588
|
+
j.itemDescription && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
|
|
560
589
|
className: "text-sm text-text-secondary",
|
|
561
590
|
children: "Description"
|
|
562
591
|
}), /* @__PURE__ */ g("p", {
|
|
563
592
|
className: "text-sm text-text-primary mt-0.5",
|
|
564
|
-
children:
|
|
593
|
+
children: j.itemDescription
|
|
565
594
|
})] }),
|
|
566
595
|
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
|
|
567
596
|
className: "text-sm text-text-secondary",
|
|
568
597
|
children: "Status"
|
|
569
598
|
}), /* @__PURE__ */ g("span", {
|
|
570
|
-
className: `inline-flex mt-0.5 px-2 py-1 text-xs font-medium rounded ${p(
|
|
571
|
-
children:
|
|
599
|
+
className: `inline-flex mt-0.5 px-2 py-1 text-xs font-medium rounded ${p(Y)}`,
|
|
600
|
+
children: d(j.status)
|
|
572
601
|
})] }),
|
|
573
602
|
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
|
|
574
603
|
className: "text-sm text-text-secondary",
|
|
575
604
|
children: "Currency"
|
|
576
605
|
}), /* @__PURE__ */ g("p", {
|
|
577
606
|
className: "text-sm text-text-primary mt-0.5",
|
|
578
|
-
children:
|
|
607
|
+
children: j.currency
|
|
579
608
|
})] }),
|
|
580
609
|
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
|
|
581
610
|
className: "text-sm text-text-secondary",
|
|
582
611
|
children: "Total"
|
|
583
612
|
}), /* @__PURE__ */ g("p", {
|
|
584
613
|
className: "text-sm font-semibold text-text-primary mt-0.5",
|
|
585
|
-
children:
|
|
614
|
+
children: c(j.total, j.currency)
|
|
586
615
|
})] }),
|
|
587
616
|
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
|
|
588
617
|
className: "text-sm text-text-secondary",
|
|
589
618
|
children: "Amount Paid"
|
|
590
619
|
}), /* @__PURE__ */ g("p", {
|
|
591
620
|
className: "text-sm text-status-success-text mt-0.5",
|
|
592
|
-
children:
|
|
621
|
+
children: c(j.amountPaid, j.currency)
|
|
593
622
|
})] }),
|
|
594
|
-
|
|
623
|
+
Q > 0 && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
|
|
595
624
|
className: "text-sm text-text-secondary",
|
|
596
625
|
children: "Amount Due"
|
|
597
626
|
}), /* @__PURE__ */ g("p", {
|
|
598
627
|
className: "text-sm font-semibold text-status-warning-text mt-0.5",
|
|
599
|
-
children:
|
|
628
|
+
children: c(Q, j.currency)
|
|
600
629
|
})] })
|
|
601
630
|
]
|
|
602
631
|
})]
|
|
@@ -607,7 +636,7 @@ var C = () => {
|
|
|
607
636
|
className: "p-6 border-b border-border-subtle bg-bg-sunken",
|
|
608
637
|
children: /* @__PURE__ */ g("h2", {
|
|
609
638
|
className: "text-lg font-semibold text-text-primary",
|
|
610
|
-
children:
|
|
639
|
+
children: C("billing.invoices.dates", "Dates")
|
|
611
640
|
})
|
|
612
641
|
}), /* @__PURE__ */ _("div", {
|
|
613
642
|
className: "p-6 space-y-4",
|
|
@@ -617,28 +646,28 @@ var C = () => {
|
|
|
617
646
|
children: "Created"
|
|
618
647
|
}), /* @__PURE__ */ g("p", {
|
|
619
648
|
className: "text-sm text-text-primary mt-0.5",
|
|
620
|
-
children:
|
|
649
|
+
children: l(j.createdAt)
|
|
621
650
|
})] }),
|
|
622
|
-
|
|
651
|
+
j.dueDate && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
|
|
623
652
|
className: "text-sm text-text-secondary",
|
|
624
653
|
children: "Due Date"
|
|
625
654
|
}), /* @__PURE__ */ g("p", {
|
|
626
655
|
className: "text-sm text-text-primary mt-0.5",
|
|
627
|
-
children:
|
|
656
|
+
children: l(j.dueDate)
|
|
628
657
|
})] }),
|
|
629
|
-
|
|
658
|
+
j.paidAt && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
|
|
630
659
|
className: "text-sm text-text-secondary",
|
|
631
660
|
children: "Paid At"
|
|
632
661
|
}), /* @__PURE__ */ g("p", {
|
|
633
662
|
className: "text-sm text-text-primary mt-0.5",
|
|
634
|
-
children:
|
|
663
|
+
children: l(j.paidAt)
|
|
635
664
|
})] }),
|
|
636
665
|
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
|
|
637
666
|
className: "text-sm text-text-secondary",
|
|
638
667
|
children: "Last Updated"
|
|
639
668
|
}), /* @__PURE__ */ g("p", {
|
|
640
669
|
className: "text-sm text-text-primary mt-0.5",
|
|
641
|
-
children:
|
|
670
|
+
children: l(j.updatedAt)
|
|
642
671
|
})] })
|
|
643
672
|
]
|
|
644
673
|
})]
|
|
@@ -649,7 +678,7 @@ var C = () => {
|
|
|
649
678
|
className: "p-6 border-b border-border-subtle bg-bg-sunken",
|
|
650
679
|
children: /* @__PURE__ */ g("h2", {
|
|
651
680
|
className: "text-lg font-semibold text-text-primary",
|
|
652
|
-
children:
|
|
681
|
+
children: C("billing.invoices.organization", "Organization")
|
|
653
682
|
})
|
|
654
683
|
}), /* @__PURE__ */ g("div", {
|
|
655
684
|
className: "p-6 space-y-4",
|
|
@@ -658,7 +687,7 @@ var C = () => {
|
|
|
658
687
|
children: "Organization ID"
|
|
659
688
|
}), /* @__PURE__ */ g("p", {
|
|
660
689
|
className: "font-mono text-sm text-text-primary mt-0.5 break-all",
|
|
661
|
-
children:
|
|
690
|
+
children: j.orgId
|
|
662
691
|
})] })
|
|
663
692
|
})]
|
|
664
693
|
})
|
|
@@ -668,6 +697,6 @@ var C = () => {
|
|
|
668
697
|
]
|
|
669
698
|
});
|
|
670
699
|
};
|
|
671
|
-
export {
|
|
700
|
+
export { S as InvoiceDetailPage };
|
|
672
701
|
|
|
673
702
|
//# sourceMappingURL=InvoiceDetailPage.js.map
|