diff --git a/src/lib/components/billing/usageRates.svelte b/src/lib/components/billing/usageRates.svelte index c2d5c73ae0..d8f57849dd 100644 --- a/src/lib/components/billing/usageRates.svelte +++ b/src/lib/components/billing/usageRates.svelte @@ -67,7 +67,7 @@ following rates. Next billing period: {toLocaleDate(nextDate)}.

{/if} - +
Resource Limit diff --git a/src/lib/components/collapsibleItem.svelte b/src/lib/components/collapsibleItem.svelte index 92dd4e13da..47a414625d 100644 --- a/src/lib/components/collapsibleItem.svelte +++ b/src/lib/components/collapsibleItem.svelte @@ -7,12 +7,15 @@ export let noContent = false; export let isInfo = false; export let gap = 16; + + export let style = null; + export let wrapperStyle = null;
  • {#if noContent} -
    -
    +
    +
    diff --git a/src/routes/(console)/organization-[organization]/billing/+page.svelte b/src/routes/(console)/organization-[organization]/billing/+page.svelte index c31d1e8d06..017a1dec08 100644 --- a/src/routes/(console)/organization-[organization]/billing/+page.svelte +++ b/src/routes/(console)/organization-[organization]/billing/+page.svelte @@ -17,7 +17,6 @@ import { confirmPayment } from '$lib/stores/stripe'; import { sdk } from '$lib/stores/sdk'; import { toLocaleDate } from '$lib/helpers/date'; - import { BillingPlan } from '$lib/constants'; import RetryPaymentModal from './retryPaymentModal.svelte'; import { selectedInvoice, showRetryModal } from './store'; import { Button } from '$lib/elements/forms'; @@ -130,9 +129,7 @@ - {#if $organization?.billingPlan !== BillingPlan.FREE && !!$organization?.billingBudget} - - {/if} + diff --git a/src/routes/(console)/organization-[organization]/billing/availableCredit.svelte b/src/routes/(console)/organization-[organization]/billing/availableCredit.svelte index b0a1efd7fa..23275fe0f5 100644 --- a/src/routes/(console)/organization-[organization]/billing/availableCredit.svelte +++ b/src/routes/(console)/organization-[organization]/billing/availableCredit.svelte @@ -90,7 +90,9 @@ - Available credit + + {$organization?.billingPlan === BillingPlan.FREE ? 'Credits' : 'Available credit'} +

    Appwrite credit will automatically be applied to your next invoice.

    diff --git a/src/routes/(console)/organization-[organization]/billing/budgetAlert.svelte b/src/routes/(console)/organization-[organization]/billing/budgetAlert.svelte index a75439aac4..948eeab9e1 100644 --- a/src/routes/(console)/organization-[organization]/billing/budgetAlert.svelte +++ b/src/routes/(console)/organization-[organization]/billing/budgetAlert.svelte @@ -1,8 +1,9 @@ - - Payment history +{#if $organization?.billingPlan === BillingPlan.FREE && invoiceList.total > 0} + + Payment history -

    - Transaction history for this organization. Download invoices for more details about your - payments. -

    - - {#if invoiceList.total > 0} - - - Due Date - Status - Amount Due - - - - {#each invoiceList?.invoices as invoice, i} - {@const status = invoice.status} - - - {toLocaleDate(invoice.dueAt)} - - - {#if invoice?.lastError} - +

    + Transaction history for this organization. Download invoices for more details about your + payments. +

    + + {#if invoiceList.total > 0} + + + Due Date + Status + Amount Due + + + + {#each invoiceList?.invoices as invoice, i} + {@const status = invoice.status} + + + {toLocaleDate(invoice.dueAt)} + + + {#if invoice?.lastError} + + (showFailedError = true)} + button> + {status === 'requires_authentication' + ? 'failed' + : status} + + +
  • + The scheduled payment has failed. + + . +
  • + + + {:else} (showFailedError = true)} - button> + warning={status === 'pending'}> {status === 'requires_authentication' ? 'failed' : status} + {/if} + + + {formatCurrency(invoice.grossAmount)} + + + + -
  • - The scheduled payment has failed. . -
  • + showDropdown[i] = !showDropdown[i]; + trackEvent(`click_retry_payment`, { + from: 'button', + source: 'billing_invoice_menu' + }); + }}> + Retry payment + + {/if}
    - {:else} - - {status === 'requires_authentication' ? 'failed' : status} - - {/if} -
    - - {formatCurrency(invoice.grossAmount)} - - - - - - (showDropdown[i] = !showDropdown[i])} - event="view_invoice"> - View invoice - - { - showDropdown[i] = !showDropdown[i]; - }} - event="download_invoice"> - Download PDF - - {#if status === 'overdue' || status === 'failed'} - { - retryPayment(invoice); - showDropdown[i] = !showDropdown[i]; - trackEvent(`click_retry_payment`, { - from: 'button', - source: 'billing_invoice_menu' - }); - }}> - Retry payment - - {/if} - - - - - {/each} - - -
    -

    Total results: {invoiceList?.total ?? 0}

    - -
    - {:else} - -

    - You have no payment history. After you receive your first invoice, you'll see it - here. -

    -
    - {/if} - - + + + {/each} + + +
    +

    Total results: {invoiceList?.total ?? 0}

    + +
    + {:else} + +

    + You have no payment history. After you receive your first invoice, you'll + see it here. +

    +
    + {/if} + + +{/if} diff --git a/src/routes/(console)/organization-[organization]/billing/paymentMethods.svelte b/src/routes/(console)/organization-[organization]/billing/paymentMethods.svelte index 4e7bdbcdc8..ebffd54261 100644 --- a/src/routes/(console)/organization-[organization]/billing/paymentMethods.svelte +++ b/src/routes/(console)/organization-[organization]/billing/paymentMethods.svelte @@ -99,7 +99,6 @@

    View or update your organization payment methods here.

    -

    Default

    {#if $organization?.paymentMethodId} @@ -196,64 +195,65 @@ {/if}
    -
    -

    Backup

    - {#if $organization?.backupPaymentMethodId} - - - - - {#if backupPaymentMethod.userId === $user.$id} + {#if $organization?.billingPlan !== BillingPlan.FREE && $organization?.billingPlan !== BillingPlan.GITHUB_EDUCATION} +
    + {#if $organization?.backupPaymentMethodId} +

    Backup

    + + + + + {#if backupPaymentMethod.userId === $user.$id} + { + showEdit = true; + isSelectedBackup = true; + showDropdownBackup = false; + }}> + Edit + + {/if} { - showEdit = true; + showReplace = true; isSelectedBackup = true; showDropdownBackup = false; }}> - Edit + Replace - {/if} - { - showReplace = true; - isSelectedBackup = true; - showDropdownBackup = false; - }}> - Replace - - { - showDelete = true; - isSelectedBackup = true; - showDropdownBackup = false; - }}> - Delete - - - - - {:else} - {@const filteredPaymentMethods = $paymentMethods.paymentMethods.filter( - (o) => !!o.last4 && o.$id !== $organization?.paymentMethodId - )} -
    -
    -
    - + { + showDelete = true; + isSelectedBackup = true; + showDropdownBackup = false; + }}> + Delete + + + + + {:else} + {@const filteredPaymentMethods = $paymentMethods.paymentMethods.filter( + (o) => !!o.last4 && o.$id !== $organization?.paymentMethodId + )} +
    + +
    - - {#if $paymentMethods.total} - {#each filteredPaymentMethods as paymentMethod} - { - showDropdownBackup = true; - addBackupPaymentMethod(paymentMethod?.$id); - }}> - -

    - Card ending in {paymentMethod.last4} -

    - -
    -
    - {/each} - {/if} - (showPayment = true)}> - Add new payment method - -
    - -
    -
    - Add a backup payment method - -
    + +
    + + {#if $paymentMethods.total} + {#each filteredPaymentMethods as paymentMethod} + { + showDropdownBackup = true; + addBackupPaymentMethod(paymentMethod?.$id); + }}> + +

    + Card ending in {paymentMethod.last4} +

    + +
    +
    + {/each} + {/if} + (showPayment = true)}> + Add new payment method + +
    +
    -
    - {/if} -
    + {/if} +
    + {/if}
    diff --git a/src/routes/(console)/organization-[organization]/billing/planSummary.svelte b/src/routes/(console)/organization-[organization]/billing/planSummary.svelte index d75261d43f..ab9e3ae106 100644 --- a/src/routes/(console)/organization-[organization]/billing/planSummary.svelte +++ b/src/routes/(console)/organization-[organization]/billing/planSummary.svelte @@ -1,6 +1,6 @@