The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
feat: merged billing & invoices / billing tab in new org nav (#35008)
Kevin Grüneberg679714fa75e0
diff --git a/apps/docs/content/guides/platform/billing-faq.mdx b/apps/docs/content/guides/platform/billing-faq.mdxindex 0f6e77226fb..f860c0cacff 100644--- a/apps/docs/content/guides/platform/billing-faq.mdx+++ b/apps/docs/content/guides/platform/billing-faq.mdx@@ -135,7 +135,7 @@ Restrictions due to usage limits are lifted with the next billing cycle as your#### Where do I find my invoices?-You can find all invoices from your organization on your [organization’s invoices page](https://supabase.com/dashboard/org/_/invoices).+You can find all invoices from your organization on your [organization’s invoices page](https://supabase.com/dashboard/org/_/billing#invoices).#### Where can I see a breakdown of usage?diff --git a/apps/docs/content/guides/platform/credits.mdx b/apps/docs/content/guides/platform/credits.mdxindex f4da68717fd..8597c8cb097 100644--- a/apps/docs/content/guides/platform/credits.mdx+++ b/apps/docs/content/guides/platform/credits.mdx@@ -61,7 +61,7 @@ If you are interested in larger (> $1,000) credit packages, [reach out](https://### Will I get an invoice for the credits purchase?-Yes, once the payment is confirmed, you will get a matching invoice that can be accessed through your [organization's invoices page](/dashboard/org/_/invoices).+Yes, once the payment is confirmed, you will get a matching invoice that can be accessed through your [organization's invoices page](/dashboard/org/_/billing#invoices).### Can I transfer credits to another organization?diff --git a/apps/docs/content/guides/platform/your-monthly-invoice.mdx b/apps/docs/content/guides/platform/your-monthly-invoice.mdxindex 22fd102ed15..3bcb16be420 100644--- a/apps/docs/content/guides/platform/your-monthly-invoice.mdx+++ b/apps/docs/content/guides/platform/your-monthly-invoice.mdx@@ -66,8 +66,8 @@ Monthly invoices are auto-collected by charging the payment method marked as "acIf your payment fails, Supabase retries the charge several times. We send you a Payment Failure email with the reason for the failure. Follow the steps outlined in this email. You can manually trigger a charge at any time via- the link in the Payment Failure email-- the "Pay Now" button on the [organization's invoices page](https://supabase.com/dashboard/org/_/invoices)+- the "Pay Now" button on the [organization's invoices page](https://supabase.com/dashboard/org/_/billing#invoices)## Where to find your invoices-Your invoice is sent to you via email. You can also find your invoices on the [organization's invoices page](https://supabase.com/dashboard/org/_/invoices).+Your invoice is sent to you via email. You can also find your invoices on the [organization's invoices page](https://supabase.com/dashboard/org/_/billing#invoices).diff --git a/apps/studio/components/interfaces/Home/ProjectList/ProjectList.tsx b/apps/studio/components/interfaces/Home/ProjectList/ProjectList.tsxindex fb343f02dc8..e29c408c00f 100644--- a/apps/studio/components/interfaces/Home/ProjectList/ProjectList.tsx+++ b/apps/studio/components/interfaces/Home/ProjectList/ProjectList.tsx@@ -243,7 +243,9 @@ const OrganizationProjects = ({{!!overdueInvoices.length && (<div><Button asChild type="danger">- <Link href={`/org/${organization.slug}/invoices`}>Outstanding Invoices</Link>+ <Link href={`/org/${organization.slug}/billing#invoices`}>+ Outstanding Invoices+ </Link></Button></div>)}diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/BillingBreakdown.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/BillingBreakdown.tsxindex 89db61d64a1..28b5d774ba8 100644--- a/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/BillingBreakdown.tsx+++ b/apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/BillingBreakdown.tsx@@ -43,7 +43,7 @@ const BillingBreakdown = () => {return (<ScaffoldSection><ScaffoldSectionDetail>- <div className="sticky space-y-2 top-12 pr-3">+ <div className="sticky space-y-2 top-12 pr-6"><p className="text-foreground text-base m-0">Upcoming Invoice</p><div className="py-2"><SparkBardiff --git a/apps/studio/components/interfaces/Organization/BillingSettings/BillingSettings.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/BillingSettings.tsxindex f306c24d7be..5e9dadca321 100644--- a/apps/studio/components/interfaces/Organization/BillingSettings/BillingSettings.tsx+++ b/apps/studio/components/interfaces/Organization/BillingSettings/BillingSettings.tsx@@ -1,6 +1,15 @@-import { ScaffoldContainer, ScaffoldDivider } from 'components/layouts/Scaffold'+import { useNewLayout } from 'components/interfaces/App/FeaturePreview/FeaturePreviewContext'+import {+ ScaffoldContainer,+ ScaffoldContainerLegacy,+ ScaffoldDivider,+ ScaffoldTitle,+} from 'components/layouts/Scaffold'import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'+import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'+import { cn } from 'ui'import { useOrgSubscriptionQuery } from '../../../../data/subscriptions/org-subscription-query'+import InvoicesSection from '../InvoicesSettings/InvoicesSection'import BillingAddress from './BillingAddress/BillingAddress'import BillingBreakdown from './BillingBreakdown/BillingBreakdown'import BillingEmail from './BillingEmail'@@ -9,14 +18,21 @@ import CreditBalance from './CreditBalance'import PaymentMethods from './PaymentMethods/PaymentMethods'import Subscription from './Subscription/Subscription'import TaxID from './TaxID/TaxID'-import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'const BillingSettings = () => {const {billingAccountData: isBillingAccountDataEnabledOnProfileLevel,billingPaymentMethods: isBillingPaymentMethodsEnabledOnProfileLevel,billingCredits: isBillingCreditsEnabledOnProfileLevel,- } = useIsFeatureEnabled(['billing:account_data', 'billing:payment_methods', 'billing:credits'])+ billingInvoices: isBillingInvoicesEnabledOnProfileLevel,+ } = useIsFeatureEnabled([+ 'billing:account_data',+ 'billing:payment_methods',+ 'billing:credits',+ 'billing:invoices',+ ])++ const newLayoutPreview = useNewLayout()const org = useSelectedOrganization()const { data: subscription } = useOrgSubscriptionQuery({ orgSlug: org?.slug })@@ -29,7 +45,13 @@ const BillingSettings = () => {return (<>- <ScaffoldContainer id="subscription">+ {newLayoutPreview && (+ <ScaffoldContainerLegacy>+ <ScaffoldTitle>Billing</ScaffoldTitle>+ </ScaffoldContainerLegacy>+ )}++ <ScaffoldContainer id="subscription" className={cn(newLayoutPreview && '[&>div]:!pt-0')}><Subscription /></ScaffoldContainer>@@ -47,12 +69,11 @@ const BillingSettings = () => {</ScaffoldContainer>)}- {isBillingCreditsEnabledOnProfileLevel && (+ {isBillingInvoicesEnabledOnProfileLevel && (<><ScaffoldDivider />-- <ScaffoldContainer id="credits-balance">- <CreditBalance />+ <ScaffoldContainer id="invoices">+ <InvoicesSection /></ScaffoldContainer></>)}@@ -67,6 +88,16 @@ const BillingSettings = () => {</>)}+ {isBillingCreditsEnabledOnProfileLevel && (+ <>+ <ScaffoldDivider />++ <ScaffoldContainer id="credits-balance">+ <CreditBalance />+ </ScaffoldContainer>+ </>+ )}+{billingAccountDataEnabled && (<><ScaffoldDivider />diff --git a/apps/studio/components/interfaces/Organization/InvoicesSettings/InvoicesSection.tsx b/apps/studio/components/interfaces/Organization/InvoicesSettings/InvoicesSection.tsxnew file mode 100644index 00000000000..35d8c06199f--- /dev/null+++ b/apps/studio/components/interfaces/Organization/InvoicesSettings/InvoicesSection.tsx@@ -0,0 +1,37 @@+import { PermissionAction } from '@supabase/shared-types/out/constants'+import {+ ScaffoldSection,+ ScaffoldSectionContent,+ ScaffoldSectionDetail,+} from 'components/layouts/Scaffold'+import NoPermission from 'components/ui/NoPermission'+import { useCheckPermissions } from 'hooks/misc/useCheckPermissions'+import InvoicesSettings from './InvoicesSettings'++const InvoicesSection = () => {+ const canReadInvoices = useCheckPermissions(PermissionAction.BILLING_READ, 'stripe.subscriptions')++ return (+ <ScaffoldSection>+ <ScaffoldSectionDetail>+ <div className="sticky space-y-2 top-12 pr-6">+ <p className="text-foreground text-base m-0">Past Invoices</p>++ <p className="prose text-sm">+ You get an invoice every time you change your plan or when your monthly billing cycle+ resets.+ </p>+ </div>+ </ScaffoldSectionDetail>+ <ScaffoldSectionContent>+ {!canReadInvoices ? (+ <NoPermission resourceText="view this organization's upcoming invoice" />+ ) : (+ <InvoicesSettings />+ )}+ </ScaffoldSectionContent>+ </ScaffoldSection>+ )+}++export default InvoicesSectiondiff --git a/apps/studio/components/interfaces/Organization/InvoicesSettings/InvoicesSettings.tsx b/apps/studio/components/interfaces/Organization/InvoicesSettings/InvoicesSettings.tsxindex 4de9e365ee5..5c4d1dceb50 100644--- a/apps/studio/components/interfaces/Organization/InvoicesSettings/InvoicesSettings.tsx+++ b/apps/studio/components/interfaces/Organization/InvoicesSettings/InvoicesSettings.tsx@@ -1,29 +1,24 @@-import { PermissionAction } from '@supabase/shared-types/out/constants'import dayjs from 'dayjs'-import Link from 'next/link'import { useEffect, useState } from 'react'import { toast } from 'sonner'import InvoiceStatusBadge from 'components/interfaces/Billing/InvoiceStatusBadge'import { InvoiceStatus } from 'components/interfaces/Billing/Invoices.types'-import { ScaffoldContainerLegacy } from 'components/layouts/Scaffold'import Table from 'components/to-be-cleaned/Table'import AlertError from 'components/ui/AlertError'-import NoPermission from 'components/ui/NoPermission'+import { ButtonTooltip } from 'components/ui/ButtonTooltip'import PartnerManagedResource from 'components/ui/PartnerManagedResource'-import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader'import { getInvoice } from 'data/invoices/invoice-query'import { useInvoicesCountQuery } from 'data/invoices/invoices-count-query'import { useInvoicesQuery } from 'data/invoices/invoices-query'-import { useCheckPermissions } from 'hooks/misc/useCheckPermissions'import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'import { formatCurrency } from 'lib/helpers'+import { ChevronLeft, ChevronRight, Download, FileText } from 'lucide-react'import { Button } from 'ui'-import CurrentPaymentMethod from '../BillingSettings/PaymentMethods/CurrentPaymentMethod'-import { FileText, Download, ChevronLeft, ChevronRight } from 'lucide-react'+import ShimmeringLoader from 'ui-patterns/ShimmeringLoader'import InvoicePayButton from './InvoicePayButton'-const PAGE_LIMIT = 10+const PAGE_LIMIT = 5const InvoicesSettings = () => {const [page, setPage] = useState(1)@@ -32,8 +27,6 @@ const InvoicesSettings = () => {const { slug } = selectedOrganization ?? {}const offset = (page - 1) * PAGE_LIMIT- const canReadInvoices = useCheckPermissions(PermissionAction.READ, 'invoices')-const { data: count, isError: isErrorCount } = useInvoicesCountQuery({slug,@@ -63,147 +56,144 @@ const InvoicesSettings = () => {}}- if (!canReadInvoices) {- return (- <ScaffoldContainerLegacy>- <NoPermission resourceText="view invoices" />- </ScaffoldContainerLegacy>- )- }-if (selectedOrganization?.managed_by !== undefined &&selectedOrganization?.managed_by !== 'supabase') {return (- <ScaffoldContainerLegacy>- <PartnerManagedResource- partner={selectedOrganization?.managed_by}- resource="Invoices"- cta={{- installationId: selectedOrganization?.partner_id,- path: '/invoices',- }}- // TODO: support AWS marketplace here: `https://us-east-1.console.aws.amazon.com/billing/home#/bills`- />- </ScaffoldContainerLegacy>+ <PartnerManagedResource+ partner={selectedOrganization?.managed_by}+ resource="Invoices"+ cta={{+ installationId: selectedOrganization?.partner_id,+ path: '/invoices',+ }}+ // TODO: support AWS marketplace here: `https://us-east-1.console.aws.amazon.com/billing/home#/bills`+ />)}return (- <ScaffoldContainerLegacy>- {isLoading && <GenericSkeletonLoader />}-- {isError && <AlertError error={error} subject="Failed to retrieve invoices" />}-- {isSuccess && (- <>- <CurrentPaymentMethod />-- <div className="overflow-hidden md:overflow-auto overflow-x-scroll">- <Table- head={[- <Table.th key="header-icon"></Table.th>,- <Table.th key="header-date">Date</Table.th>,- <Table.th key="header-amount">Amount</Table.th>,- <Table.th key="header-invoice">Invoice number</Table.th>,- <Table.th key="header-status" className="flex items-center">- Status- </Table.th>,- <Table.th key="header-download" className="text-right"></Table.th>,- ]}- body={- invoices.length === 0 ? (- <Table.tr>- <Table.td colSpan={6} className="p-3 py-12 text-center">- <p className="text-foreground-light">- {isLoading- ? 'Checking for invoices'- : 'No invoices for this organization yet'}- </p>+ <div className="overflow-hidden md:overflow-auto overflow-x-scroll">+ <Table+ head={[+ <Table.th key="header-icon" />,+ <Table.th key="header-date">Date</Table.th>,+ <Table.th key="header-amount">Amount</Table.th>,+ <Table.th key="header-invoice">Invoice number</Table.th>,+ <Table.th key="header-status" className="flex items-center">+ Status+ </Table.th>,+ <Table.th key="header-download" className="text-right"></Table.th>,+ ]}+ body={+ isLoading ? (+ new Array(6).fill(0).map((_, idx) => (+ <Table.tr key={`loading-${idx}`}>+ <Table.td>{idx !== 5 && <FileText size="24" />}</Table.td>+ <Table.td colSpan={5}>+ <ShimmeringLoader />+ </Table.td>+ </Table.tr>+ ))+ ) : isError ? (+ <Table.tr className="rounded-b">+ <Table.td colSpan={6} className="!p-0 !rounded-b overflow-hidden">+ <AlertError+ className="border-0 rounded-none"+ error={error}+ subject="Failed to retrieve invoices"+ />+ </Table.td>+ </Table.tr>+ ) : invoices.length === 0 ? (+ <Table.tr>+ <Table.td colSpan={6} className="p-3 py-12 text-center">+ <p className="text-foreground-light">+ {isLoading ? 'Checking for invoices' : 'No invoices for this organization yet'}+ </p>+ </Table.td>+ </Table.tr>+ ) : (+ <>+ {invoices.map((x) => {+ return (+ <Table.tr key={x.id}>+ <Table.td>+ <FileText size="24" />+ </Table.td>+ <Table.td>+ <p>{dayjs(x.period_end * 1000).format('MMM DD, YYYY')}</p>+ </Table.td>+ <Table.td>+ <p>{formatCurrency(x.amount_due / 100)}</p>+ </Table.td>+ <Table.td>+ <p>{x.number}</p>+ </Table.td>+ <Table.td>+ <InvoiceStatusBadge+ status={x.status as InvoiceStatus}+ paymentAttempted={x.payment_attempted}+ />+ </Table.td>+ <Table.td className="align-right">+ <div className="flex items-center justify-end space-x-2">+ {x.amount_due > 0 &&+ [+ InvoiceStatus.UNCOLLECTIBLE,+ InvoiceStatus.OPEN,+ InvoiceStatus.ISSUED,+ ].includes(x.status as InvoiceStatus) && (+ <InvoicePayButton slug={slug} invoiceId={x.id} />+ )}++ <ButtonTooltip+ type="outline"+ className="w-7"+ icon={<Download size={16} strokeWidth={1.5} />}+ onClick={() => fetchInvoice(x.id)}+ tooltip={{ content: { side: 'bottom', text: 'Download invoice' } }}+ />+ </div></Table.td></Table.tr>- ) : (- <>- {invoices.map((x) => {- return (- <Table.tr key={x.id}>- <Table.td>- <FileText size="24" />- </Table.td>- <Table.td>- <p>{dayjs(x.period_end * 1000).format('MMM DD, YYYY')}</p>- </Table.td>- <Table.td>- <p>{formatCurrency(x.amount_due / 100)}</p>- </Table.td>- <Table.td>- <p>{x.number}</p>- </Table.td>- <Table.td>- <InvoiceStatusBadge- status={x.status as InvoiceStatus}- paymentAttempted={x.payment_attempted}- />- </Table.td>- <Table.td className="align-right">- <div className="flex items-center justify-end space-x-2">- {x.amount_due > 0 &&- [- InvoiceStatus.UNCOLLECTIBLE,- InvoiceStatus.OPEN,- InvoiceStatus.ISSUED,- ].includes(x.status as InvoiceStatus) && (- <InvoicePayButton slug={slug} invoiceId={x.id} />- )}-- <Button- type="outline"- icon={<Download size={16} strokeWidth={1.5} />}- onClick={() => fetchInvoice(x.id)}- />- </div>- </Table.td>- </Table.tr>- )- })}- <Table.tr key="navigation">- <Table.td colSpan={6}>- <div className="flex items-center justify-between">- <p className="text-sm opacity-50">- {isErrorCount- ? 'Failed to retrieve total number of invoices'- : `Showing ${offset + 1} to ${- offset + invoices.length- } out of ${count} invoices`}- </p>- <div className="flex items-center space-x-2">- <Button- icon={<ChevronLeft />}- type="default"- size="tiny"- disabled={page === 1}- onClick={async () => setPage(page - 1)}- />- <Button- icon={<ChevronRight />}- type="default"- size="tiny"- disabled={page * PAGE_LIMIT >= (count ?? 0)}- onClick={async () => setPage(page + 1)}- />- </div>- </div>- </Table.td>- </Table.tr>- </>)- }- />- </div>- </>- )}- </ScaffoldContainerLegacy>+ })}+ <Table.tr key="navigation">+ <Table.td colSpan={6}>+ <div className="flex items-center justify-between">+ <p className="text-sm opacity-50">+ {isErrorCount+ ? 'Failed to retrieve total number of invoices'+ : `Showing ${offset + 1} to ${+ offset + invoices.length+ } out of ${count} invoices`}+ </p>+ <div className="flex items-center space-x-2">+ <Button+ icon={<ChevronLeft />}+ type="default"+ size="tiny"+ disabled={page === 1}+ onClick={async () => setPage(page - 1)}+ />+ <Button+ icon={<ChevronRight />}+ type="default"+ size="tiny"+ disabled={page * PAGE_LIMIT >= (count ?? 0)}+ onClick={async () => setPage(page + 1)}+ />+ </div>+ </div>+ </Table.td>+ </Table.tr>+ </>+ )+ }+ />+ </div>)}diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DeployNewReplicaPanel.tsx b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DeployNewReplicaPanel.tsxindex 5f957915332..cdb19a8e7d7 100644--- a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DeployNewReplicaPanel.tsx+++ b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DeployNewReplicaPanel.tsx@@ -236,7 +236,7 @@ const DeployNewReplicaPanel = ({</span><div className="mt-3"><Button asChild type="default">- <Link href={`/org/${org?.slug}/invoices`}>View invoices</Link>+ <Link href={`/org/${org?.slug}/billing#invoices`}>View invoices</Link></Button></div></AlertDescription_Shadcn_>diff --git a/apps/studio/components/interfaces/Sidebar.tsx b/apps/studio/components/interfaces/Sidebar.tsxindex 522ad536a2d..03a3a0d2c24 100644--- a/apps/studio/components/interfaces/Sidebar.tsx+++ b/apps/studio/components/interfaces/Sidebar.tsx@@ -6,6 +6,7 @@ import {Boxes,ChartArea,PanelLeftDashed,+ Receipt,Settings,Users,} from 'lucide-react'@@ -485,6 +486,12 @@ const OrganizationLinks = () => {key: 'usage',icon: <ChartArea size={ICON_SIZE} strokeWidth={ICON_STROKE_WIDTH} />,},+ {+ label: 'Billing',+ href: `/org/${slug}/billing`,+ key: 'billing',+ icon: <Receipt size={ICON_SIZE} strokeWidth={ICON_STROKE_WIDTH} />,+ },{label: 'Organization settings',href: `/org/${slug}/general`,@@ -504,8 +511,6 @@ const OrganizationLinks = () => {? activeRoute === undefined: item.key === 'settings'? router.pathname.includes('/general') ||- router.pathname.includes('/billing') ||- router.pathname.includes('/invoices') ||router.pathname.includes('/apps') ||router.pathname.includes('/audit') ||router.pathname.includes('/documents')diff --git a/apps/studio/components/layouts/ProjectLayout/OrganizationSettingsLayout.tsx b/apps/studio/components/layouts/ProjectLayout/OrganizationSettingsLayout.tsxindex ce3dfa86791..56db448226c 100644--- a/apps/studio/components/layouts/ProjectLayout/OrganizationSettingsLayout.tsx+++ b/apps/studio/components/layouts/ProjectLayout/OrganizationSettingsLayout.tsx@@ -11,7 +11,9 @@ function OrganizationSettingsLayout({ children }: PropsWithChildren) {const newLayoutPreview = useNewLayout()const { slug } = useParams()- const currentPath = useCurrentPath()+ const fullCurrentPath = useCurrentPath()+ // Get the path without any hash values+ const [currentPath] = fullCurrentPath.split('#')// hide these settings in the new layout// when path equals `/org/${slug}/team`@@ -23,7 +25,8 @@ function OrganizationSettingsLayout({ children }: PropsWithChildren) {newLayoutPreview &&(path === `/org/${slug}/team` ||path === `/org/${slug}/integrations` ||- path === `/org/${slug}/usage`)+ path === `/org/${slug}/usage` ||+ path === `/org/${slug}/billing`))}@@ -44,7 +47,7 @@ function OrganizationSettingsLayout({ children }: PropsWithChildren) {label: 'Integrations',href: `/org/${slug}/integrations`,},- {+ !newLayoutPreview && {label: 'Billing',href: `/org/${slug}/billing`,},@@ -52,10 +55,6 @@ function OrganizationSettingsLayout({ children }: PropsWithChildren) {label: 'Usage',href: `/org/${slug}/usage`,},- {- label: 'Invoices',- href: `/org/${slug}/invoices`,- },{label: 'OAuth Apps',href: `/org/${slug}/apps`,diff --git a/apps/studio/hooks/misc/useOrganizationRestrictions.ts b/apps/studio/hooks/misc/useOrganizationRestrictions.tsindex 4b6e6967dd4..f2958a336a7 100644--- a/apps/studio/hooks/misc/useOrganizationRestrictions.ts+++ b/apps/studio/hooks/misc/useOrganizationRestrictions.ts@@ -34,7 +34,7 @@ export function useOrganizationRestrictions() {type: 'danger',title: RESTRICTION_MESSAGES.OVERDUE_INVOICES.title,message: RESTRICTION_MESSAGES.OVERDUE_INVOICES.message,- link: `/org/${org?.slug}/invoices`,+ link: `/org/${org?.slug}/billing#invoices`,})}@@ -43,7 +43,7 @@ export function useOrganizationRestrictions() {type: 'danger',title: RESTRICTION_MESSAGES.OVERDUE_INVOICES_FROM_OTHER_ORGS.title,message: RESTRICTION_MESSAGES.OVERDUE_INVOICES_FROM_OTHER_ORGS.message,- link: `/org/${organizations ? organizations?.find((org) => org.id === overdueInvoicesFromOtherOrgs[0].organization_id)?.slug : org?.slug}/invoices`,+ link: `/org/${organizations ? organizations?.find((org) => org.id === overdueInvoicesFromOtherOrgs[0].organization_id)?.slug : org?.slug}/billing#invoices`,})}diff --git a/apps/studio/next.config.js b/apps/studio/next.config.jsindex 6ee5f671c8c..adc90c7eb26 100644--- a/apps/studio/next.config.js+++ b/apps/studio/next.config.js@@ -460,6 +460,12 @@ const nextConfig = {source: '/project/:ref/settings/functions',destination: '/project/:ref/functions/secrets',},+ {+ source: '/org/:slug/invoices',+ destination: '/org/:slug/billing#invoices',+ permanent: true,+ },+...(process.env.NEXT_PUBLIC_BASE_PATH?.length? [{diff --git a/apps/studio/pages/new/[slug].tsx b/apps/studio/pages/new/[slug].tsxindex f673fa86262..b12e1324ce2 100644--- a/apps/studio/pages/new/[slug].tsx+++ b/apps/studio/pages/new/[slug].tsx@@ -922,7 +922,7 @@ const Wizard: NextPageWithLayout = () => {<div><Button asChild type="default">- <Link href={`/org/${slug}/invoices`}>View invoices</Link>+ <Link href={`/org/${slug}/billing#invoices`}>View invoices</Link></Button></div></div>diff --git a/apps/studio/pages/org/[slug]/invoices.tsx b/apps/studio/pages/org/[slug]/invoices.tsxdeleted file mode 100644index 87e13f3c536..00000000000--- a/apps/studio/pages/org/[slug]/invoices.tsx+++ /dev/null@@ -1,33 +0,0 @@-import { InvoicesSettings } from 'components/interfaces/Organization'-import AppLayout from 'components/layouts/AppLayout/AppLayout'-import DefaultLayout from 'components/layouts/DefaultLayout'-import OrganizationLayout from 'components/layouts/OrganizationLayout'-import OrganizationSettingsLayout from 'components/layouts/ProjectLayout/OrganizationSettingsLayout'-import { Loading } from 'components/ui/Loading'-import { usePermissionsQuery } from 'data/permissions/permissions-query'-import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'-import type { NextPageWithLayout } from 'types'--const OrgInvoices: NextPageWithLayout = () => {- const { isLoading: isLoadingPermissions } = usePermissionsQuery()- const selectedOrganization = useSelectedOrganization()-- return (- <>- {selectedOrganization === undefined && isLoadingPermissions ? (- <Loading />- ) : (- <InvoicesSettings />- )}- </>- )-}--OrgInvoices.getLayout = (page) => (- <DefaultLayout>- <OrganizationLayout>- <OrganizationSettingsLayout>{page}</OrganizationSettingsLayout>- </OrganizationLayout>- </DefaultLayout>-)-export default OrgInvoices