stripe: Don't invoice fixed-price plans for additional licenses.

Earlier, the code block to calculate additional licenses charge
raised assertion error when processing a fixed-price plan.

The code block shouldn't be executed for fixed-price plans as
we don't charge customers on fixed-price plans for additional
licenses.
This commit is contained in:
Prakhar Pratyush 2024-03-07 16:52:57 +05:30 committed by Tim Abbott
parent 5085d58bc7
commit bd969de208

View File

@ -2792,7 +2792,11 @@ class BillingSession(ABC):
"quantity": ledger_entry.licenses,
}
description = f"{plan.name} - renewal"
elif licenses_base is not None and ledger_entry.licenses != licenses_base:
elif (
plan.fixed_price is None
and licenses_base is not None
and ledger_entry.licenses != licenses_base
):
assert plan.price_per_license is not None
last_ledger_entry_renewal = (
LicenseLedger.objects.filter(