diff --git a/src/lib/components/collapsibleItem.svelte b/src/lib/components/collapsibleItem.svelte index a16b63460..f98c8845e 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 d3d6b7fd1..23802e081 100644 --- a/src/routes/(console)/organization-[organization]/billing/+page.svelte +++ b/src/routes/(console)/organization-[organization]/billing/+page.svelte @@ -130,9 +130,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 b0a1efd7f..6efbb5434 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 ? 'Credit' : '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 a75439aac..9c391398b 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} - -
  • - The scheduled payment has failed. . -
  • -
    - - {:else} - - {status === 'requires_authentication' ? 'failed' : status} - - {/if} - - - {formatCurrency(invoice.grossAmount)} - - - - - - (showDropdown[i] = !showDropdown[i])} - event="view_invoice"> - View invoice - - + + {formatCurrency(invoice.grossAmount)} + + + + + + + (showDropdown[i] = !showDropdown[i])} + event="view_invoice"> + View invoice + + { - 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} -
    - + }} + 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} + + +{/if} diff --git a/src/routes/(console)/organization-[organization]/billing/paymentMethods.svelte b/src/routes/(console)/organization-[organization]/billing/paymentMethods.svelte index 4e7bdbcdc..1a7938d24 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,112 +195,115 @@ {/if}
    -
    -

    Backup

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

    Backup

    + {#if $organization?.backupPaymentMethodId} + + + + + {#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 - )} -
    -
    -
    - - - - {#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 - -
    -
    + 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 + +
    -
    - Add a backup 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 c84356b75..f356741ad 100644 --- a/src/routes/(console)/organization-[organization]/billing/planSummary.svelte +++ b/src/routes/(console)/organization-[organization]/billing/planSummary.svelte @@ -1,6 +1,6 @@