still buggy price calculator

This commit is contained in:
Tobias Brunner 2025-06-19 17:05:49 +02:00
parent 22e527bcd9
commit 9d423ce61e
No known key found for this signature in database
3 changed files with 268 additions and 350 deletions

View file

@ -377,6 +377,7 @@ def generate_pricing_data(offering):
for addon in addons:
addon_price = None
addon_price_per_unit = None
if addon.addon_type == "BF": # Base Fee
addon_price = addon.get_price(currency)
@ -392,6 +393,7 @@ def generate_pricing_data(offering):
"commercial_description": addon.commercial_description,
"addon_type": addon.get_addon_type_display(),
"price": addon_price,
"price_per_unit": addon_price_per_unit, # Add per-unit price for frontend calculations
}
if addon.mandatory:
@ -428,6 +430,9 @@ def generate_pricing_data(offering):
"storage_price": storage_price_data.get(currency, 0),
"ha_replica_min": appcat_price.ha_replica_min,
"ha_replica_max": appcat_price.ha_replica_max,
"variable_unit": appcat_price.variable_unit,
"units": units,
"total_units": total_units,
"mandatory_addons": mandatory_addons,
"optional_addons": optional_addons,
}