@burdenoff/microfe-billing 2026.1114.9 → 2026.1114.10

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.
@@ -4,8 +4,8 @@ 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 { 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";
7
+ import { formatCurrency as s, formatDate as c, formatInvoiceNumber as l, formatInvoiceStatus as u } from "../../../shared/utils/format.js";
8
+ import { BillingHistoryTabs as d } from "../../../shared/components/BillingHistoryTabs.js";
9
9
  import { withBillingAccountId as f } from "../../../shared/utils/navigation.js";
10
10
  import { getInvoiceStatusColor as p } from "../../../shared/utils/status.js";
11
11
  import "../../../shared/ui/index.js";
@@ -20,7 +20,7 @@ import { useSearchParams as D } from "react-router";
20
20
  import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
21
21
  // src/billing/modules/billing/pages/InvoicesListPage.tsx
22
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);
23
+ let t = h(), i = m(), s = e(), c = a(), [l] = D(), p = l.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
24
  b(() => {
25
25
  z(p);
26
26
  }, [p]);
@@ -74,7 +74,7 @@ var j = () => {
74
74
  }
75
75
  }
76
76
  }, [Q, N]);
77
- if (!l.canViewInvoices) return /* @__PURE__ */ k("div", {
77
+ if (!c.canViewInvoices) return /* @__PURE__ */ k("div", {
78
78
  className: "flex items-center justify-center h-full min-h-[400px]",
79
79
  children: /* @__PURE__ */ A("div", {
80
80
  className: "text-center space-y-2",
@@ -204,7 +204,7 @@ var j = () => {
204
204
  }),
205
205
  i && /* @__PURE__ */ k("div", {
206
206
  className: "mt-4",
207
- children: /* @__PURE__ */ k(s, {
207
+ children: /* @__PURE__ */ k(d, {
208
208
  active: "invoices",
209
209
  billingAccountId: B
210
210
  })
@@ -214,7 +214,7 @@ var j = () => {
214
214
  className: "flex items-center gap-3",
215
215
  children: [/* @__PURE__ */ A("button", {
216
216
  type: "button",
217
- onClick: () => c("/refunds"),
217
+ onClick: () => s("/refunds"),
218
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",
219
219
  children: [/* @__PURE__ */ k(E, { className: "size-4" }), t("billing.invoices.myRefunds", "My Refunds")]
220
220
  }), $]
@@ -237,7 +237,7 @@ var j = () => {
237
237
  H(e), K(1);
238
238
  },
239
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"}`,
240
- children: e === "all" ? "All" : d(e)
240
+ children: e === "all" ? "All" : u(e)
241
241
  }, e))
242
242
  }),
243
243
  /* @__PURE__ */ A("div", {
@@ -318,9 +318,9 @@ var j = () => {
318
318
  className: "divide-y divide-border-subtle",
319
319
  children: J.map((e) => /* @__PURE__ */ k(M, {
320
320
  invoice: e,
321
- onView: () => c(f(`/invoices/${e.id}`, e.billingAccountId)),
322
- canPay: l.canPayInvoice,
323
- canVoid: l.canVoidInvoice,
321
+ onView: () => s(f(`/invoices/${e.id}`, e.billingAccountId)),
322
+ canPay: c.canPayInvoice,
323
+ canVoid: c.canVoidInvoice,
324
324
  onPay: re,
325
325
  onVoid: ie,
326
326
  isProcessing: I?.invoiceId === e.id,
@@ -357,7 +357,7 @@ var j = () => {
357
357
  })] })
358
358
  ]
359
359
  });
360
- }, M = ({ invoice: e, onView: n, onPay: r, onVoid: a, canPay: o, canVoid: s, isProcessing: f, processingAction: v, showAccount: y = !1, accountName: b }) => {
360
+ }, M = ({ invoice: e, onView: n, onPay: r, onVoid: a, canPay: o, canVoid: d, isProcessing: f, processingAction: v, showAccount: y = !1, accountName: b }) => {
361
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
362
  _("medium");
363
363
  let t = await g({
@@ -384,12 +384,12 @@ var j = () => {
384
384
  target: "_blank",
385
385
  rel: "noopener noreferrer",
386
386
  className: "font-medium text-text-primary hover:text-text-link transition-colors",
387
- children: u(e.invoiceNumber)
387
+ children: l(e.invoiceNumber)
388
388
  }) : /* @__PURE__ */ k("button", {
389
389
  type: "button",
390
390
  onClick: n,
391
391
  className: "font-medium text-text-primary hover:text-text-link transition-colors",
392
- children: u(e.invoiceNumber)
392
+ children: l(e.invoiceNumber)
393
393
  }), (e.itemDescription ?? e.subscription?.plan?.name) && /* @__PURE__ */ k("p", {
394
394
  className: "text-sm text-text-secondary mt-0.5",
395
395
  children: e.itemDescription ?? e.subscription?.plan?.name
@@ -400,7 +400,7 @@ var j = () => {
400
400
  children: /* @__PURE__ */ k(t, {
401
401
  status: O,
402
402
  dot: !0,
403
- children: d(e.status)
403
+ children: u(e.status)
404
404
  })
405
405
  }),
406
406
  y && /* @__PURE__ */ k("td", {
@@ -415,15 +415,15 @@ var j = () => {
415
415
  }),
416
416
  /* @__PURE__ */ k("td", {
417
417
  className: "p-4 text-sm text-text-secondary hidden sm:table-cell",
418
- children: l(e.createdAt, "short")
418
+ children: c(e.createdAt, "short")
419
419
  }),
420
420
  /* @__PURE__ */ k("td", {
421
421
  className: "p-4 text-sm text-text-secondary hidden md:table-cell",
422
- children: e.dueDate ? l(e.dueDate, "short") : "—"
422
+ children: e.dueDate ? c(e.dueDate, "short") : "—"
423
423
  }),
424
424
  /* @__PURE__ */ k("td", {
425
425
  className: `p-4 text-right font-medium text-text-primary ${S ? "whitespace-nowrap" : ""}`,
426
- children: c(e.total, e.currency)
426
+ children: s(e.total, e.currency)
427
427
  }),
428
428
  /* @__PURE__ */ k("td", {
429
429
  className: "p-4 text-right",
@@ -470,7 +470,7 @@ var j = () => {
470
470
  details: [
471
471
  {
472
472
  label: x("billing.invoices.payReview.invoice", "Invoice"),
473
- value: u(e.invoiceNumber)
473
+ value: l(e.invoiceNumber)
474
474
  },
475
475
  ...b ? [{
476
476
  label: x("billing.invoices.payReview.account", "Billing account"),
@@ -482,16 +482,16 @@ var j = () => {
482
482
  },
483
483
  {
484
484
  label: x("billing.invoices.payReview.amount", "Amount"),
485
- value: c(e.total, e.currency)
485
+ value: s(e.total, e.currency)
486
486
  }
487
487
  ],
488
- confirmLabel: x("billing.invoices.payReview.confirm", "Pay {{amount}}", { amount: c(e.total, e.currency) }),
488
+ confirmLabel: x("billing.invoices.payReview.confirm", "Pay {{amount}}", { amount: s(e.total, e.currency) }),
489
489
  busyLabel: x("billing.common.paying", "Paying…"),
490
490
  isBusy: f && v === "pay",
491
491
  onConfirm: () => void F(),
492
492
  onCancel: () => D(!1)
493
493
  }),
494
- (j || M) && s && /* @__PURE__ */ k("button", {
494
+ (j || M) && d && /* @__PURE__ */ k("button", {
495
495
  type: "button",
496
496
  onClick: () => void N(),
497
497
  disabled: f,