@burdenoff/microfe-billing 2026.516.1 → 2026.517.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 +1 -1
- package/dist/billing/BillingUserRoutes.js.map +1 -1
- package/dist/billing/modules/billing/hooks/useInvoices.d.ts +0 -1
- package/dist/billing/modules/billing/hooks/useInvoices.d.ts.map +1 -1
- package/dist/billing/modules/billing/hooks/useInvoices.js +20 -26
- package/dist/billing/modules/billing/hooks/useInvoices.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.d.ts.map +1 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.js +176 -170
- package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/RefundsPage.js +1 -1
- package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
- package/dist/billing/modules/checkout/components/OrderSummary.js +4 -4
- package/dist/billing/modules/checkout/components/OrderSummary.js.map +1 -1
- package/dist/billing/modules/checkout/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/billing/modules/checkout/pages/CheckoutPage.js +2 -2
- package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.d.ts.map +1 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +178 -209
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
- package/dist/billing/modules/dashboard/pages/OverviewPage.js +2 -2
- package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js +2 -2
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
- package/dist/billing/modules/earnings/api.d.ts +0 -4
- package/dist/billing/modules/earnings/api.d.ts.map +1 -1
- package/dist/billing/modules/earnings/api.js +10 -14
- package/dist/billing/modules/earnings/api.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.d.ts.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +233 -523
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaPage.js +1 -1
- package/dist/billing/modules/quota/pages/QuotaPage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.d.ts.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +44 -101
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.d.ts.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +46 -105
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.d.ts +1 -1
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.d.ts.map +1 -1
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js +15 -16
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.d.ts.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +165 -158
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -1
- package/dist/billing/modules/usage/pages/UsagePage.d.ts.map +1 -1
- package/dist/billing/modules/usage/pages/UsagePage.js +3 -3
- package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
- package/dist/billing/shared/types/graphql.d.ts +0 -2
- package/dist/billing/shared/types/graphql.d.ts.map +1 -1
- package/dist/billing/shared/types/graphql.js.map +1 -1
- package/dist/generated/global-operations.d.ts +0 -48
- package/dist/generated/global-operations.d.ts.map +1 -1
- package/dist/generated/global-operations.js +293 -310
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.d.ts +0 -9
- package/dist/generated/global-types.d.ts.map +1 -1
- package/dist/generated/global-types.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,36 +4,63 @@ import { useBillingPermissions as o } from "../../../hooks/useBillingPermissions
|
|
|
4
4
|
import { useGetBillingAccountsByOrgQuery as s } from "../../../../generated/global-operations.js";
|
|
5
5
|
import { useBillingNavigate as c } from "../../../hooks/useBillingNavigate.js";
|
|
6
6
|
import { withBillingAccountId as l } from "../../../shared/utils/navigation.js";
|
|
7
|
-
import {
|
|
8
|
-
import { useEffect as d, useMemo as f,
|
|
9
|
-
import { useSearchParams as
|
|
10
|
-
import {
|
|
11
|
-
import { useI18n as
|
|
7
|
+
import { useInvoices as u } from "../hooks/useInvoices.js";
|
|
8
|
+
import { useEffect as d, useMemo as f, useState as p } from "react";
|
|
9
|
+
import { useSearchParams as m } from "react-router-dom";
|
|
10
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
11
|
+
import { useI18n as _ } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
12
12
|
//#region src/billing/modules/billing/pages/InvoicesListPage.tsx
|
|
13
|
-
var
|
|
14
|
-
let { t
|
|
15
|
-
let r = e
|
|
16
|
-
return r ===
|
|
17
|
-
},
|
|
13
|
+
var v = () => {
|
|
14
|
+
let { t } = _(), n = (e, n) => {
|
|
15
|
+
let r = t(e);
|
|
16
|
+
return r === e ? n : r;
|
|
17
|
+
}, i = c(), a = o(), [v] = m(), b = v.get("billingAccountId") ?? void 0, { data: x } = s({ fetchPolicy: "cache-first" }), S = x?.getBillingAccountsByOrg ?? [], [C, w] = p(b);
|
|
18
18
|
d(() => {
|
|
19
|
-
|
|
19
|
+
w(b);
|
|
20
20
|
}, [b]);
|
|
21
|
-
let
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
let T = f(() => (S.find((e) => e.isDefault) ?? S[0])?.id ?? void 0, [S]), E = C === void 0 ? T ?? null : C, { invoices: D, isLoading: O, error: k, refetch: A } = u({ billingAccountId: E ?? void 0 }), [j, M] = p("all"), [N, P] = p("");
|
|
22
|
+
if (!a.canViewInvoices) return /* @__PURE__ */ h("div", {
|
|
23
|
+
className: "flex items-center justify-center h-full min-h-[400px]",
|
|
24
|
+
children: /* @__PURE__ */ g("div", {
|
|
25
|
+
className: "text-center space-y-2",
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ h("div", {
|
|
28
|
+
className: "w-12 h-12 mx-auto rounded-full bg-muted flex items-center justify-center",
|
|
29
|
+
children: /* @__PURE__ */ h("svg", {
|
|
30
|
+
className: "w-6 h-6 text-muted-foreground",
|
|
31
|
+
fill: "none",
|
|
32
|
+
viewBox: "0 0 24 24",
|
|
33
|
+
stroke: "currentColor",
|
|
34
|
+
children: /* @__PURE__ */ h("path", {
|
|
35
|
+
strokeLinecap: "round",
|
|
36
|
+
strokeLinejoin: "round",
|
|
37
|
+
strokeWidth: 2,
|
|
38
|
+
d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"
|
|
39
|
+
})
|
|
40
|
+
})
|
|
41
|
+
}),
|
|
42
|
+
/* @__PURE__ */ h("h2", {
|
|
43
|
+
className: "text-lg font-semibold text-foreground",
|
|
44
|
+
children: n("billing.accessDenied.title", "Access Denied")
|
|
45
|
+
}),
|
|
46
|
+
/* @__PURE__ */ h("p", {
|
|
47
|
+
className: "text-sm text-muted-foreground max-w-sm",
|
|
48
|
+
children: n("billing.invoices.noViewPermission", "You don't have permission to view invoices.")
|
|
49
|
+
})
|
|
50
|
+
]
|
|
51
|
+
})
|
|
33
52
|
});
|
|
34
|
-
|
|
53
|
+
let F = D.filter((e) => {
|
|
54
|
+
if (j !== "all" && e.status !== j) return !1;
|
|
55
|
+
if (N) {
|
|
56
|
+
let t = N.toLowerCase();
|
|
57
|
+
return e.invoiceNumber.toLowerCase().includes(t) || e.id.toLowerCase().includes(t);
|
|
58
|
+
}
|
|
59
|
+
return !0;
|
|
60
|
+
}), I = F.reduce((e, t) => e + t.total, 0), L = F.filter((e) => e.status === "PAID").reduce((e, t) => e + t.total, 0), R = F.filter((e) => e.status === "OPEN").reduce((e, t) => e + t.total, 0);
|
|
61
|
+
return O && D.length === 0 ? /* @__PURE__ */ g("div", {
|
|
35
62
|
className: "space-y-6 p-6",
|
|
36
|
-
children: [/* @__PURE__ */
|
|
63
|
+
children: [/* @__PURE__ */ h("div", { className: "h-8 w-48 bg-muted animate-pulse rounded" }), /* @__PURE__ */ h("div", {
|
|
37
64
|
className: "space-y-3",
|
|
38
65
|
children: [
|
|
39
66
|
1,
|
|
@@ -41,30 +68,30 @@ var b = () => {
|
|
|
41
68
|
3,
|
|
42
69
|
4,
|
|
43
70
|
5
|
|
44
|
-
].map((e) => /* @__PURE__ */
|
|
71
|
+
].map((e) => /* @__PURE__ */ h("div", {
|
|
45
72
|
className: "border border-border rounded-lg p-4",
|
|
46
|
-
children: /* @__PURE__ */
|
|
73
|
+
children: /* @__PURE__ */ g("div", {
|
|
47
74
|
className: "flex items-center gap-4",
|
|
48
|
-
children: [/* @__PURE__ */
|
|
75
|
+
children: [/* @__PURE__ */ h("div", { className: "h-10 w-10 bg-muted animate-pulse rounded" }), /* @__PURE__ */ g("div", {
|
|
49
76
|
className: "flex-1 space-y-2",
|
|
50
|
-
children: [/* @__PURE__ */
|
|
77
|
+
children: [/* @__PURE__ */ h("div", { className: "h-4 w-32 bg-muted animate-pulse rounded" }), /* @__PURE__ */ h("div", { className: "h-3 w-48 bg-muted animate-pulse rounded" })]
|
|
51
78
|
})]
|
|
52
79
|
})
|
|
53
80
|
}, e))
|
|
54
81
|
})]
|
|
55
|
-
}) :
|
|
82
|
+
}) : k ? /* @__PURE__ */ h("div", {
|
|
56
83
|
className: "flex items-center justify-center h-full min-h-[400px]",
|
|
57
|
-
children: /* @__PURE__ */
|
|
84
|
+
children: /* @__PURE__ */ g("div", {
|
|
58
85
|
className: "text-center space-y-4",
|
|
59
86
|
children: [
|
|
60
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ h("div", {
|
|
61
88
|
className: "w-12 h-12 mx-auto rounded-full bg-destructive/10 flex items-center justify-center",
|
|
62
|
-
children: /* @__PURE__ */
|
|
89
|
+
children: /* @__PURE__ */ h("svg", {
|
|
63
90
|
className: "w-6 h-6 text-destructive",
|
|
64
91
|
fill: "none",
|
|
65
92
|
viewBox: "0 0 24 24",
|
|
66
93
|
stroke: "currentColor",
|
|
67
|
-
children: /* @__PURE__ */
|
|
94
|
+
children: /* @__PURE__ */ h("path", {
|
|
68
95
|
strokeLinecap: "round",
|
|
69
96
|
strokeLinejoin: "round",
|
|
70
97
|
strokeWidth: 2,
|
|
@@ -72,54 +99,89 @@ var b = () => {
|
|
|
72
99
|
})
|
|
73
100
|
})
|
|
74
101
|
}),
|
|
75
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ h("h2", {
|
|
76
103
|
className: "text-lg font-semibold text-foreground",
|
|
77
|
-
children:
|
|
104
|
+
children: n("billing.invoices.failedToLoad", "Failed to load invoices")
|
|
78
105
|
}),
|
|
79
|
-
/* @__PURE__ */
|
|
106
|
+
/* @__PURE__ */ h("p", {
|
|
80
107
|
className: "text-sm text-muted-foreground",
|
|
81
|
-
children:
|
|
108
|
+
children: k.message
|
|
82
109
|
}),
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
onClick: () =>
|
|
110
|
+
/* @__PURE__ */ h("button", {
|
|
111
|
+
onClick: () => A(),
|
|
85
112
|
className: "px-4 py-2 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",
|
|
86
113
|
children: "Try Again"
|
|
87
114
|
})
|
|
88
115
|
]
|
|
89
116
|
})
|
|
90
|
-
}) : /* @__PURE__ */
|
|
117
|
+
}) : /* @__PURE__ */ g("div", {
|
|
91
118
|
className: "space-y-6 p-6",
|
|
92
119
|
children: [
|
|
93
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ g("div", {
|
|
94
121
|
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
95
|
-
children: [/* @__PURE__ */
|
|
122
|
+
children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("h1", {
|
|
96
123
|
className: "text-2xl font-bold text-foreground",
|
|
97
|
-
children:
|
|
98
|
-
}), /* @__PURE__ */
|
|
124
|
+
children: n("billing.invoices.title", "Invoices")
|
|
125
|
+
}), /* @__PURE__ */ h("p", {
|
|
99
126
|
className: "text-sm text-muted-foreground mt-1",
|
|
100
|
-
children:
|
|
101
|
-
})] }),
|
|
127
|
+
children: n("billing.invoices.subtitle", "View and manage your billing invoices")
|
|
128
|
+
})] }), S.length > 1 && /* @__PURE__ */ g("div", {
|
|
102
129
|
className: "flex items-center gap-2",
|
|
103
|
-
children: [/* @__PURE__ */
|
|
130
|
+
children: [/* @__PURE__ */ h("label", {
|
|
104
131
|
className: "text-sm text-muted-foreground whitespace-nowrap",
|
|
105
132
|
children: "Billing Account"
|
|
106
|
-
}), /* @__PURE__ */
|
|
107
|
-
value:
|
|
108
|
-
onChange: (e) =>
|
|
133
|
+
}), /* @__PURE__ */ g("select", {
|
|
134
|
+
value: E ?? "",
|
|
135
|
+
onChange: (e) => w(e.target.value || null),
|
|
109
136
|
className: "text-sm border border-border rounded-md bg-background text-foreground px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary",
|
|
110
|
-
children: [/* @__PURE__ */
|
|
137
|
+
children: [/* @__PURE__ */ h("option", {
|
|
111
138
|
value: "",
|
|
112
139
|
children: "All Accounts"
|
|
113
|
-
}),
|
|
140
|
+
}), S.map((e) => /* @__PURE__ */ g("option", {
|
|
114
141
|
value: e.id ?? "",
|
|
115
142
|
children: [e.name ?? e.email ?? e.id, e.isDefault ? " (Default)" : ""]
|
|
116
143
|
}, e.id ?? ""))]
|
|
117
144
|
})]
|
|
118
145
|
})]
|
|
119
146
|
}),
|
|
120
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ g("div", {
|
|
148
|
+
className: "grid grid-cols-1 sm:grid-cols-3 gap-4",
|
|
149
|
+
children: [
|
|
150
|
+
/* @__PURE__ */ g("div", {
|
|
151
|
+
className: "border border-border rounded-lg bg-card p-4",
|
|
152
|
+
children: [/* @__PURE__ */ h("p", {
|
|
153
|
+
className: "text-sm text-muted-foreground",
|
|
154
|
+
children: n("billing.invoices.totalInvoiced", "Total Invoiced")
|
|
155
|
+
}), /* @__PURE__ */ h("p", {
|
|
156
|
+
className: "text-xl font-semibold text-foreground mt-1",
|
|
157
|
+
children: e(I)
|
|
158
|
+
})]
|
|
159
|
+
}),
|
|
160
|
+
/* @__PURE__ */ g("div", {
|
|
161
|
+
className: "border border-border rounded-lg bg-card p-4",
|
|
162
|
+
children: [/* @__PURE__ */ h("p", {
|
|
163
|
+
className: "text-sm text-muted-foreground",
|
|
164
|
+
children: n("billing.invoices.paid", "Paid")
|
|
165
|
+
}), /* @__PURE__ */ h("p", {
|
|
166
|
+
className: "text-xl font-semibold text-status-success-text mt-1",
|
|
167
|
+
children: e(L)
|
|
168
|
+
})]
|
|
169
|
+
}),
|
|
170
|
+
/* @__PURE__ */ g("div", {
|
|
171
|
+
className: "border border-border rounded-lg bg-card p-4",
|
|
172
|
+
children: [/* @__PURE__ */ h("p", {
|
|
173
|
+
className: "text-sm text-muted-foreground",
|
|
174
|
+
children: n("billing.invoices.outstanding", "Outstanding")
|
|
175
|
+
}), /* @__PURE__ */ h("p", {
|
|
176
|
+
className: "text-xl font-semibold text-status-warning-text mt-1",
|
|
177
|
+
children: e(R)
|
|
178
|
+
})]
|
|
179
|
+
})
|
|
180
|
+
]
|
|
181
|
+
}),
|
|
182
|
+
/* @__PURE__ */ g("div", {
|
|
121
183
|
className: "flex flex-wrap items-center gap-4 pb-4 border-b border-border",
|
|
122
|
-
children: [/* @__PURE__ */
|
|
184
|
+
children: [/* @__PURE__ */ h("div", {
|
|
123
185
|
className: "inline-flex rounded-lg border border-border p-1 bg-muted/50 flex-wrap",
|
|
124
186
|
children: [
|
|
125
187
|
"all",
|
|
@@ -127,46 +189,44 @@ var b = () => {
|
|
|
127
189
|
"PAID",
|
|
128
190
|
"DRAFT",
|
|
129
191
|
"VOID"
|
|
130
|
-
].map((e) => /* @__PURE__ */
|
|
131
|
-
onClick: () =>
|
|
132
|
-
|
|
133
|
-
},
|
|
134
|
-
className: `px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${O === e ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
|
|
192
|
+
].map((e) => /* @__PURE__ */ h("button", {
|
|
193
|
+
onClick: () => M(e),
|
|
194
|
+
className: `px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${j === e ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
|
|
135
195
|
children: e === "all" ? "All" : r(e)
|
|
136
196
|
}, e))
|
|
137
|
-
}), /* @__PURE__ */
|
|
138
|
-
className: "relative flex-1 min-w-
|
|
139
|
-
children: [/* @__PURE__ */
|
|
197
|
+
}), /* @__PURE__ */ g("div", {
|
|
198
|
+
className: "relative flex-1 min-w-[200px] max-w-md",
|
|
199
|
+
children: [/* @__PURE__ */ h("svg", {
|
|
140
200
|
className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground",
|
|
141
201
|
fill: "none",
|
|
142
202
|
viewBox: "0 0 24 24",
|
|
143
203
|
stroke: "currentColor",
|
|
144
|
-
children: /* @__PURE__ */
|
|
204
|
+
children: /* @__PURE__ */ h("path", {
|
|
145
205
|
strokeLinecap: "round",
|
|
146
206
|
strokeLinejoin: "round",
|
|
147
207
|
strokeWidth: 2,
|
|
148
208
|
d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
|
|
149
209
|
})
|
|
150
|
-
}), /* @__PURE__ */
|
|
210
|
+
}), /* @__PURE__ */ h("input", {
|
|
151
211
|
type: "text",
|
|
152
|
-
placeholder:
|
|
153
|
-
value:
|
|
154
|
-
onChange: (e) =>
|
|
212
|
+
placeholder: n("billing.invoices.searchPlaceholder", "Search by invoice number..."),
|
|
213
|
+
value: N,
|
|
214
|
+
onChange: (e) => P(e.target.value),
|
|
155
215
|
className: "w-full pl-[3.25rem] pr-4 py-2 text-sm border border-border rounded-md bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent"
|
|
156
216
|
})]
|
|
157
217
|
})]
|
|
158
218
|
}),
|
|
159
|
-
|
|
219
|
+
F.length === 0 ? /* @__PURE__ */ g("div", {
|
|
160
220
|
className: "flex flex-col items-center justify-center py-12 border border-dashed border-border rounded-lg",
|
|
161
221
|
children: [
|
|
162
|
-
/* @__PURE__ */
|
|
222
|
+
/* @__PURE__ */ h("div", {
|
|
163
223
|
className: "w-12 h-12 rounded-full bg-muted flex items-center justify-center mb-4",
|
|
164
|
-
children: /* @__PURE__ */
|
|
224
|
+
children: /* @__PURE__ */ h("svg", {
|
|
165
225
|
className: "w-6 h-6 text-muted-foreground",
|
|
166
226
|
fill: "none",
|
|
167
227
|
viewBox: "0 0 24 24",
|
|
168
228
|
stroke: "currentColor",
|
|
169
|
-
children: /* @__PURE__ */
|
|
229
|
+
children: /* @__PURE__ */ h("path", {
|
|
170
230
|
strokeLinecap: "round",
|
|
171
231
|
strokeLinejoin: "round",
|
|
172
232
|
strokeWidth: 2,
|
|
@@ -174,193 +234,139 @@ var b = () => {
|
|
|
174
234
|
})
|
|
175
235
|
})
|
|
176
236
|
}),
|
|
177
|
-
/* @__PURE__ */
|
|
237
|
+
/* @__PURE__ */ h("h3", {
|
|
178
238
|
className: "text-lg font-medium text-foreground",
|
|
179
|
-
children:
|
|
239
|
+
children: n("billing.invoices.noInvoicesFound", "No invoices found")
|
|
180
240
|
}),
|
|
181
|
-
/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ h("p", {
|
|
182
242
|
className: "text-sm text-muted-foreground mt-1",
|
|
183
|
-
children:
|
|
243
|
+
children: j !== "all" || N ? n("billing.invoices.noInvoicesFiltered", "No invoices match your filters.") : n("billing.invoices.noInvoicesYet", "You don't have any invoices yet.")
|
|
184
244
|
})
|
|
185
245
|
]
|
|
186
|
-
}) : /* @__PURE__ */
|
|
246
|
+
}) : /* @__PURE__ */ h("div", {
|
|
187
247
|
className: "border border-border rounded-lg overflow-hidden",
|
|
188
|
-
children: /* @__PURE__ */
|
|
248
|
+
children: /* @__PURE__ */ g("table", {
|
|
189
249
|
className: "w-full",
|
|
190
|
-
children: [/* @__PURE__ */
|
|
250
|
+
children: [/* @__PURE__ */ h("thead", {
|
|
191
251
|
className: "bg-muted/50",
|
|
192
|
-
children: /* @__PURE__ */
|
|
193
|
-
/* @__PURE__ */
|
|
252
|
+
children: /* @__PURE__ */ g("tr", { children: [
|
|
253
|
+
/* @__PURE__ */ h("th", {
|
|
194
254
|
className: "text-left px-4 py-3 text-sm font-medium text-muted-foreground",
|
|
195
255
|
children: "Invoice"
|
|
196
256
|
}),
|
|
197
|
-
/* @__PURE__ */
|
|
257
|
+
/* @__PURE__ */ h("th", {
|
|
198
258
|
className: "text-left px-4 py-3 text-sm font-medium text-muted-foreground",
|
|
199
259
|
children: "Status"
|
|
200
260
|
}),
|
|
201
|
-
!
|
|
261
|
+
!E && S.length > 1 && /* @__PURE__ */ h("th", {
|
|
202
262
|
className: "text-left px-4 py-3 text-sm font-medium text-muted-foreground hidden lg:table-cell",
|
|
203
263
|
children: "Account"
|
|
204
264
|
}),
|
|
205
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ h("th", {
|
|
206
266
|
className: "text-left px-4 py-3 text-sm font-medium text-muted-foreground hidden sm:table-cell",
|
|
207
267
|
children: "Date"
|
|
208
268
|
}),
|
|
209
|
-
/* @__PURE__ */
|
|
269
|
+
/* @__PURE__ */ h("th", {
|
|
210
270
|
className: "text-left px-4 py-3 text-sm font-medium text-muted-foreground hidden md:table-cell",
|
|
211
271
|
children: "Due Date"
|
|
212
272
|
}),
|
|
213
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ h("th", {
|
|
214
274
|
className: "text-right px-4 py-3 text-sm font-medium text-muted-foreground",
|
|
215
275
|
children: "Amount"
|
|
216
276
|
}),
|
|
217
|
-
/* @__PURE__ */
|
|
277
|
+
/* @__PURE__ */ h("th", {
|
|
218
278
|
className: "text-right px-4 py-3 text-sm font-medium text-muted-foreground",
|
|
219
279
|
children: "Actions"
|
|
220
280
|
})
|
|
221
281
|
] })
|
|
222
|
-
}), /* @__PURE__ */
|
|
282
|
+
}), /* @__PURE__ */ h("tbody", {
|
|
223
283
|
className: "divide-y divide-border",
|
|
224
|
-
children:
|
|
284
|
+
children: F.map((e) => /* @__PURE__ */ h(y, {
|
|
225
285
|
invoice: e,
|
|
226
|
-
onView: () =>
|
|
227
|
-
canPay:
|
|
228
|
-
canVoid:
|
|
229
|
-
showAccount: !
|
|
230
|
-
accountName:
|
|
286
|
+
onView: () => i(l(`/invoices/${e.id}`, e.billingAccountId)),
|
|
287
|
+
canPay: a.canPayInvoice,
|
|
288
|
+
canVoid: a.canVoidInvoice,
|
|
289
|
+
showAccount: !E && S.length > 1,
|
|
290
|
+
accountName: S.find((t) => t.id === e.billingAccountId)?.name ?? null
|
|
231
291
|
}, e.id))
|
|
232
292
|
})]
|
|
233
293
|
})
|
|
234
|
-
})
|
|
235
|
-
className: "flex items-center justify-between pt-2",
|
|
236
|
-
children: [/* @__PURE__ */ v("p", {
|
|
237
|
-
className: "text-sm text-muted-foreground",
|
|
238
|
-
children: [
|
|
239
|
-
"Page ",
|
|
240
|
-
P,
|
|
241
|
-
" of ",
|
|
242
|
-
R
|
|
243
|
-
]
|
|
244
|
-
}), /* @__PURE__ */ v("div", {
|
|
245
|
-
className: "flex items-center gap-2",
|
|
246
|
-
children: [/* @__PURE__ */ _("button", {
|
|
247
|
-
onClick: () => F((e) => Math.max(1, e - 1)),
|
|
248
|
-
disabled: P <= 1,
|
|
249
|
-
className: "px-3 py-1.5 text-sm font-medium border border-border rounded-md bg-background text-foreground hover:bg-muted disabled:opacity-40 disabled:cursor-not-allowed transition-colors",
|
|
250
|
-
children: "Previous"
|
|
251
|
-
}), /* @__PURE__ */ _("button", {
|
|
252
|
-
onClick: () => F((e) => Math.min(R, e + 1)),
|
|
253
|
-
disabled: P >= R,
|
|
254
|
-
className: "px-3 py-1.5 text-sm font-medium border border-border rounded-md bg-background text-foreground hover:bg-muted disabled:opacity-40 disabled:cursor-not-allowed transition-colors",
|
|
255
|
-
children: "Next"
|
|
256
|
-
})]
|
|
257
|
-
})]
|
|
258
|
-
})] })
|
|
294
|
+
})
|
|
259
295
|
]
|
|
260
|
-
}) : /* @__PURE__ */ _("div", {
|
|
261
|
-
className: "flex items-center justify-center h-full min-h-[400px]",
|
|
262
|
-
children: /* @__PURE__ */ v("div", {
|
|
263
|
-
className: "text-center space-y-2",
|
|
264
|
-
children: [
|
|
265
|
-
/* @__PURE__ */ _("div", {
|
|
266
|
-
className: "w-12 h-12 mx-auto rounded-full bg-muted flex items-center justify-center",
|
|
267
|
-
children: /* @__PURE__ */ _("svg", {
|
|
268
|
-
className: "w-6 h-6 text-muted-foreground",
|
|
269
|
-
fill: "none",
|
|
270
|
-
viewBox: "0 0 24 24",
|
|
271
|
-
stroke: "currentColor",
|
|
272
|
-
children: /* @__PURE__ */ _("path", {
|
|
273
|
-
strokeLinecap: "round",
|
|
274
|
-
strokeLinejoin: "round",
|
|
275
|
-
strokeWidth: 2,
|
|
276
|
-
d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"
|
|
277
|
-
})
|
|
278
|
-
})
|
|
279
|
-
}),
|
|
280
|
-
/* @__PURE__ */ _("h2", {
|
|
281
|
-
className: "text-lg font-semibold text-foreground",
|
|
282
|
-
children: t("billing.accessDenied.title", "Access Denied")
|
|
283
|
-
}),
|
|
284
|
-
/* @__PURE__ */ _("p", {
|
|
285
|
-
className: "text-sm text-muted-foreground max-w-sm",
|
|
286
|
-
children: t("billing.invoices.noViewPermission", "You don't have permission to view invoices.")
|
|
287
|
-
})
|
|
288
|
-
]
|
|
289
|
-
})
|
|
290
296
|
});
|
|
291
|
-
},
|
|
297
|
+
}, y = ({ invoice: o, onView: s, canPay: c, canVoid: l, showAccount: u = !1, accountName: d }) => {
|
|
292
298
|
let f = i(o.status), p = o.status === "OPEN", m = o.status === "DRAFT";
|
|
293
|
-
return /* @__PURE__ */
|
|
299
|
+
return /* @__PURE__ */ g("tr", {
|
|
294
300
|
className: "hover:bg-muted/30 transition-colors",
|
|
295
301
|
children: [
|
|
296
|
-
/* @__PURE__ */
|
|
302
|
+
/* @__PURE__ */ g("td", {
|
|
297
303
|
className: "px-4 py-4",
|
|
298
|
-
children: [/* @__PURE__ */
|
|
304
|
+
children: [/* @__PURE__ */ h("button", {
|
|
299
305
|
onClick: s,
|
|
300
306
|
className: "font-medium text-foreground hover:text-primary transition-colors",
|
|
301
307
|
children: n(o.invoiceNumber)
|
|
302
|
-
}), (o.itemDescription ?? o.subscription?.plan?.name) && /* @__PURE__ */
|
|
308
|
+
}), (o.itemDescription ?? o.subscription?.plan?.name) && /* @__PURE__ */ h("p", {
|
|
303
309
|
className: "text-sm text-muted-foreground mt-0.5",
|
|
304
310
|
children: o.itemDescription ?? o.subscription?.plan?.name
|
|
305
311
|
})]
|
|
306
312
|
}),
|
|
307
|
-
/* @__PURE__ */
|
|
313
|
+
/* @__PURE__ */ h("td", {
|
|
308
314
|
className: "px-4 py-4",
|
|
309
|
-
children: /* @__PURE__ */
|
|
315
|
+
children: /* @__PURE__ */ h("span", {
|
|
310
316
|
className: `inline-flex px-2 py-1 text-xs font-medium rounded ${a(f)}`,
|
|
311
317
|
children: r(o.status)
|
|
312
318
|
})
|
|
313
319
|
}),
|
|
314
|
-
u && /* @__PURE__ */
|
|
320
|
+
u && /* @__PURE__ */ h("td", {
|
|
315
321
|
className: "px-4 py-4 hidden lg:table-cell",
|
|
316
|
-
children: d ? /* @__PURE__ */
|
|
322
|
+
children: d ? /* @__PURE__ */ h("span", {
|
|
317
323
|
className: "inline-flex items-center px-2 py-0.5 text-xs font-medium rounded-full bg-muted text-muted-foreground border border-border",
|
|
318
324
|
children: d
|
|
319
|
-
}) : /* @__PURE__ */
|
|
325
|
+
}) : /* @__PURE__ */ h("span", {
|
|
320
326
|
className: "text-sm text-muted-foreground",
|
|
321
327
|
children: "—"
|
|
322
328
|
})
|
|
323
329
|
}),
|
|
324
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ h("td", {
|
|
325
331
|
className: "px-4 py-4 text-sm text-muted-foreground hidden sm:table-cell",
|
|
326
332
|
children: t(o.createdAt, "short")
|
|
327
333
|
}),
|
|
328
|
-
/* @__PURE__ */
|
|
334
|
+
/* @__PURE__ */ h("td", {
|
|
329
335
|
className: "px-4 py-4 text-sm text-muted-foreground hidden md:table-cell",
|
|
330
336
|
children: o.dueDate ? t(o.dueDate, "short") : "—"
|
|
331
337
|
}),
|
|
332
|
-
/* @__PURE__ */
|
|
338
|
+
/* @__PURE__ */ h("td", {
|
|
333
339
|
className: "px-4 py-4 text-right font-medium text-foreground",
|
|
334
340
|
children: e(o.total, o.currency)
|
|
335
341
|
}),
|
|
336
|
-
/* @__PURE__ */
|
|
342
|
+
/* @__PURE__ */ h("td", {
|
|
337
343
|
className: "px-4 py-4 text-right",
|
|
338
|
-
children: /* @__PURE__ */
|
|
344
|
+
children: /* @__PURE__ */ g("div", {
|
|
339
345
|
className: "flex items-center justify-end gap-2",
|
|
340
346
|
children: [
|
|
341
|
-
o.invoiceUrl ? /* @__PURE__ */
|
|
347
|
+
o.invoiceUrl ? /* @__PURE__ */ h("a", {
|
|
342
348
|
href: o.invoiceUrl,
|
|
343
349
|
target: "_blank",
|
|
344
350
|
rel: "noopener noreferrer",
|
|
345
351
|
className: "px-3 py-1.5 text-sm font-medium text-foreground hover:bg-muted rounded-md transition-colors",
|
|
346
352
|
children: "View"
|
|
347
|
-
}) : /* @__PURE__ */
|
|
353
|
+
}) : /* @__PURE__ */ h("button", {
|
|
348
354
|
onClick: s,
|
|
349
355
|
className: "px-3 py-1.5 text-sm font-medium text-foreground hover:bg-muted rounded-md transition-colors",
|
|
350
356
|
children: "View"
|
|
351
357
|
}),
|
|
352
|
-
o.pdfUrl && /* @__PURE__ */
|
|
358
|
+
o.pdfUrl && /* @__PURE__ */ h("a", {
|
|
353
359
|
href: o.pdfUrl,
|
|
354
360
|
target: "_blank",
|
|
355
361
|
rel: "noopener noreferrer",
|
|
356
362
|
className: "px-3 py-1.5 text-sm font-medium text-primary hover:bg-primary/10 rounded-md transition-colors",
|
|
357
363
|
children: "PDF"
|
|
358
364
|
}),
|
|
359
|
-
p && c && /* @__PURE__ */
|
|
365
|
+
p && c && /* @__PURE__ */ h("button", {
|
|
360
366
|
className: "px-3 py-1.5 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",
|
|
361
367
|
children: "Pay"
|
|
362
368
|
}),
|
|
363
|
-
(p || m) && l && /* @__PURE__ */
|
|
369
|
+
(p || m) && l && /* @__PURE__ */ h("button", {
|
|
364
370
|
className: "px-3 py-1.5 text-sm font-medium text-destructive hover:bg-destructive/10 rounded-md transition-colors",
|
|
365
371
|
children: "Void"
|
|
366
372
|
})
|
|
@@ -371,6 +377,6 @@ var b = () => {
|
|
|
371
377
|
});
|
|
372
378
|
};
|
|
373
379
|
//#endregion
|
|
374
|
-
export {
|
|
380
|
+
export { v as InvoicesListPage };
|
|
375
381
|
|
|
376
382
|
//# sourceMappingURL=InvoicesListPage.js.map
|