diff --git a/src/routes/(console)/organization-[organization]/billing/planSummary.svelte b/src/routes/(console)/organization-[organization]/billing/planSummary.svelte index 3e973b260..d6a6855e1 100644 --- a/src/routes/(console)/organization-[organization]/billing/planSummary.svelte +++ b/src/routes/(console)/organization-[organization]/billing/planSummary.svelte @@ -65,148 +65,155 @@
{:else} - - - - {tierToPlan($organization?.billingPlan)?.name} plan -
- {isTrial || $organization?.billingPlan === BillingPlan.GITHUB_EDUCATION - ? formatCurrency(0) - : currentPlan - ? formatCurrency(currentPlan?.price) - : ''} -
-
- {#if $organization?.billingPlan !== BillingPlan.FREE && $organization?.billingPlan !== BillingPlan.GITHUB_EDUCATION && extraUsage > 0} - - - Add-ons{extraMembers ? extraAddons + 1 : extraAddons} -
- -
-
- -
- - {formatCurrency(extraUsage >= 0 ? extraUsage : 0)} - -
-
- - -
- {/if} - - {#if $organization?.billingPlan !== BillingPlan.FREE && availableCredit > 0} - - - - - Credits to be applied - -
- -{formatCurrency( - Math.min(availableCredit, currentInvoice?.amount ?? 0) - )} + + + + {tierToPlan($organization?.billingPlan)?.name} plan +
+ {isTrial || $organization?.billingPlan === BillingPlan.GITHUB_EDUCATION + ? formatCurrency(0) + : currentPlan + ? formatCurrency(currentPlan?.price) + : ''}
- {/if} + {#if $organization?.billingPlan !== BillingPlan.FREE && $organization?.billingPlan !== BillingPlan.GITHUB_EDUCATION && extraUsage > 0} + + + Add-ons{extraMembers ? extraAddons + 1 : extraAddons} +
+ +
+
+ +
+ + {formatCurrency(extraUsage >= 0 ? extraUsage : 0)} + +
+
- - Current total (USD) - - - -
- {$organization?.billingPlan === BillingPlan.FREE || - $organization?.billingPlan === BillingPlan.GITHUB_EDUCATION - ? formatCurrency(0) - : formatCurrency( - Math.max( - (currentInvoice?.amount ?? 0) - - Math.min(availableCredit, currentInvoice?.amount ?? 0), - 0 - ) - )} -
-
-
+
    + {#if extraMembers} +
  • +
    +
    + Additional members +
    +
    + {formatCurrency( + extraMembers * + (currentPlan?.addons?.member?.price ?? 0) + )} +
    +
    +
    +
    + {extraMembers} +
    +
    +
  • + {/if} + {#if currentInvoice?.usage} + {#each currentInvoice.usage as excess, i} +
  • 0 || extraMembers}> + {#if ['storage', 'bandwidth'].includes(excess.name)} + {@const excessValue = humanFileSize(excess.value)} +
    +
    + {excess.name} +
    + {formatCurrency(excess.amount)} +
    +
    + {excessValue.value ?? 0}{excessValue.unit} +
    + {/if} + {#if ['users', 'executions'].includes(excess.name)} +
    +
    + {excess.name} +
    + {formatCurrency(excess.amount)} +
    +
    + {abbreviateNumber(excess.value)} +
    + {/if} +
  • + {/each} + {/if} +
+ + {/if} + + {#if $organization?.billingPlan !== BillingPlan.FREE && availableCredit > 0} + + + + + Credits to be applied + +
+ -{formatCurrency( + Math.min(availableCredit, currentInvoice?.amount ?? 0) + )} +
+
+ {/if} + + + Current total (USD) + + + +
+ {$organization?.billingPlan === BillingPlan.FREE || + $organization?.billingPlan === BillingPlan.GITHUB_EDUCATION + ? formatCurrency(0) + : formatCurrency( + Math.max( + (currentInvoice?.amount ?? 0) - + Math.min( + availableCredit, + currentInvoice?.amount ?? 0 + ), + 0 + ) + )} +
+
+ {/if}