service level specific base fees

This commit is contained in:
Tobias Brunner 2025-06-20 15:39:26 +02:00
parent 150250bfb1
commit 033eea92cd
No known key found for this signature in database
9 changed files with 716 additions and 58 deletions

View file

@ -289,7 +289,7 @@ class VSHNAppCatBaseFeeInline(admin.TabularInline):
model = VSHNAppCatBaseFee
extra = 1
fields = ("currency", "amount")
fields = ("currency", "service_level", "amount")
class VSHNAppCatUnitRateInline(admin.TabularInline):
@ -350,7 +350,7 @@ class VSHNAppCatPriceAdmin(admin.ModelAdmin):
if not fees:
return "No base fees"
return format_html(
"<br>".join([f"{fee.amount} {fee.currency}" for fee in fees])
"<br>".join([f"{fee.amount} {fee.currency} ({fee.get_service_level_display()})" for fee in fees])
)
admin_display_base_fees.short_description = "Base Fees"
@ -561,7 +561,7 @@ class VSHNAppCatAddonBaseFeeInline(admin.TabularInline):
model = VSHNAppCatAddonBaseFee
extra = 1
fields = ("currency", "amount")
fields = ("currency", "service_level", "amount")
class VSHNAppCatAddonUnitRateInline(admin.TabularInline):
@ -618,7 +618,7 @@ class VSHNAppCatAddonAdmin(admin.ModelAdmin):
if not fees:
return "No base fees set"
return format_html(
"<br>".join([f"{fee.amount} {fee.currency}" for fee in fees])
"<br>".join([f"{fee.amount} {fee.currency} ({fee.get_service_level_display()})" for fee in fees])
)
elif obj.addon_type == "UR": # Unit Rate
rates = obj.unit_rates.all()