From 137f4fccdefc55b4c172dbd790e45c957715b59c Mon Sep 17 00:00:00 2001 From: Lauryn Menard Date: Thu, 5 Sep 2024 18:42:53 +0200 Subject: [PATCH] billing: Highlight manual license management errors for admins. In the billing portal UI for manual license management, limit decreasing the number of licenses for the next billing period to be less than the currently used licenses. If the customer is exempt from license number checks, then this limit is not applied. Also, visually highlight manual license management errors so that the billing admin is aware of potential issues. As of these changes, current licenses can be under the seat count when a guest user is changed to a non-guest user. And next billing period licenses can be under the seat cout when a user joins with a currently available, purchased license after a billing admin has decreased the number of licenses set for the next billing period. --- corporate/lib/stripe.py | 1 + templates/corporate/billing/billing.html | 4 +- web/src/billing/billing.ts | 80 +++++++++++++++++++++--- 3 files changed, 73 insertions(+), 12 deletions(-) diff --git a/corporate/lib/stripe.py b/corporate/lib/stripe.py index 770f06236f..8cd14f76e1 100644 --- a/corporate/lib/stripe.py +++ b/corporate/lib/stripe.py @@ -2545,6 +2545,7 @@ class BillingSession(ABC): "licenses": licenses, "licenses_at_next_renewal": licenses_at_next_renewal, "seat_count": seat_count, + "exempt_from_license_number_check": customer.exempt_from_license_number_check, "renewal_date": renewal_date, "renewal_amount": cents_to_dollar_string(renewal_cents) if renewal_cents != 0 else None, "payment_method": payment_method, diff --git a/templates/corporate/billing/billing.html b/templates/corporate/billing/billing.html index 8fa819c28e..f1d2bd2127 100644 --- a/templates/corporate/billing/billing.html +++ b/templates/corporate/billing/billing.html @@ -143,7 +143,7 @@
- +
licenses ({{ seat_count }} in use)