discount_details URL parameter for pricelist
This commit is contained in:
parent
19b36b9a2c
commit
5b4392f838
2 changed files with 11 additions and 1 deletions
|
@ -50,8 +50,10 @@
|
|||
<th>SLA Base</th>
|
||||
<th>SLA Per Unit</th>
|
||||
<th>SLA Price</th>
|
||||
{% if show_discount_details %}
|
||||
<th>Discount Model</th>
|
||||
<th>Discount Details</th>
|
||||
{% endif %}
|
||||
<th class="table-warning">Final Price</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
@ -73,6 +75,7 @@
|
|||
<td>{{ row.sla_base|floatformat:2 }}</td>
|
||||
<td>{{ row.sla_per_unit|floatformat:4 }}</td>
|
||||
<td>{{ row.sla_price|floatformat:2 }}</td>
|
||||
{% if show_discount_details %}
|
||||
<td>
|
||||
{% if row.has_discount %}
|
||||
{{ row.discount_model }}
|
||||
|
@ -98,6 +101,7 @@
|
|||
<small class="text-muted">No discount applied</small>
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endif %}
|
||||
<td class="table-warning fw-bold">{{ row.final_price|floatformat:2 }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
|
|
@ -12,6 +12,9 @@ def natural_sort_key(name):
|
|||
|
||||
def pricelist(request):
|
||||
"""Generate comprehensive price list grouped by compute plan groups and service levels"""
|
||||
# Check if discount details should be shown
|
||||
show_discount_details = request.GET.get("discount_details", "").lower() == "true"
|
||||
|
||||
# Fetch all active compute plans with related data
|
||||
compute_plans = (
|
||||
ComputePlan.objects.filter(active=True)
|
||||
|
@ -223,5 +226,8 @@ def pricelist(request):
|
|||
for sl_key, plans_list in service_levels_dict.items()
|
||||
}
|
||||
|
||||
context = {"pricing_data_by_group_and_service_level": final_context_data}
|
||||
context = {
|
||||
"pricing_data_by_group_and_service_level": final_context_data,
|
||||
"show_discount_details": show_discount_details,
|
||||
}
|
||||
return render(request, "services/pricelist.html", context)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue