- -{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}
+
+ {/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}