diff --git a/hub/services/templates/services/pricelist.html b/hub/services/templates/services/pricelist.html index 4901cae..bc90f6d 100644 --- a/hub/services/templates/services/pricelist.html +++ b/hub/services/templates/services/pricelist.html @@ -1,5 +1,6 @@ {% extends 'base.html' %} {% load static %} +{% load math_tags %} {% block title %}Complete Price List{% endblock %} @@ -51,6 +52,69 @@ .servala-row { border-bottom: 2px solid #007bff; } + + /* Price calculation breakdown styling */ + .price-breakdown-header { + background: linear-gradient(135deg, #28a745, #20b2aa); + } + + .compute-plan-col { + background-color: rgba(13, 110, 253, 0.1); + border-right: 2px solid #0d6efd; + } + + .sla-base-col { + background-color: rgba(111, 66, 193, 0.1); + border-right: 2px solid #6f42c1; + } + + .sla-units-col { + background-color: rgba(253, 126, 20, 0.1); + border-right: 2px solid #fd7e14; + } + + .mandatory-addons-col { + background-color: rgba(220, 53, 69, 0.1); + border-right: 2px solid #dc3545; + } + + .total-sla-col { + background-color: rgba(25, 135, 84, 0.2); + border-right: 3px solid #198754; + } + + /* Mathematical operator styling */ + .math-operator { + font-size: 1.2em; + font-weight: bold; + color: #666; + padding: 0 5px; + } + + /* Price calculation formula helper */ + .price-formula { + background-color: #f8f9fa; + border: 1px solid #dee2e6; + border-radius: 0.25rem; + padding: 10px; + margin-bottom: 20px; + font-family: monospace; + text-align: center; + } + + .price-formula .formula-part { + display: inline-block; + padding: 2px 8px; + margin: 0 5px; + border-radius: 3px; + font-weight: bold; + } + + .price-formula .compute-part { background-color: rgba(13, 110, 253, 0.2); color: #0d6efd; } + .price-formula .sla-base-part { background-color: rgba(111, 66, 193, 0.2); color: #6f42c1; } + .price-formula .sla-units-part { background-color: rgba(253, 126, 20, 0.2); color: #fd7e14; } + .price-formula .addons-part { background-color: rgba(220, 53, 69, 0.2); color: #dc3545; } + .price-formula .equals-part { background-color: rgba(25, 135, 84, 0.2); color: #198754; } {% endblock %} @@ -60,6 +124,61 @@
+ Compute Plan Price +
+ SLA Base +
+ (Units × SLA Per Unit) +
+ Mandatory Add-ons =
+ Final Price
+
+ + + This transparent pricing model ensures you understand exactly what you're paying for. + The table below breaks down each component for every service variant we offer. + +
+Compute Plan | -Cloud Provider | -vCPUs | -RAM (GB) | -Term | -Currency | -Compute Plan Price | -Units | -SLA Base | -SLA Per Unit | -SLA Price | +Compute Plan | +Cloud Provider | +vCPUs | +RAM (GB) | +Term | +Currency | +Price Calculation Breakdown | {% if show_addon_details %} -Add-ons | +Add-ons | {% endif %} {% if show_discount_details %} -Discount Model | -Discount Details | +Discount Model | +Discount Details | {% endif %} {% if show_price_comparison %} -External Comparisons | +External Comparisons | {% endif %} -Final Price | +Final Price | +||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Compute Plan Price | +SLA Base | +Units × SLA Per Unit | +Mandatory Add-ons | += Total SLA Price | {{ row.ram }} | {{ row.term }} | {{ row.currency }} | -{{ row.compute_plan_price|floatformat:2 }} | -{{ row.units }} | -{{ row.sla_base|floatformat:2 }} | -{{ row.sla_per_unit|floatformat:4 }} | -{{ row.sla_price|floatformat:2 }} | + ++ {{ row.compute_plan_price|floatformat:2 }} + | ++ {{ row.sla_base|floatformat:2 }} + | +
+ {{ row.units|floatformat:0 }} × {{ row.sla_per_unit|floatformat:4 }} + = {{ row.units|multiply:row.sla_per_unit|floatformat:2 }} + |
+
+ {% if row.mandatory_addons %}
+ {% for addon in row.mandatory_addons %}
+
+ {% if addon.addon_type == "Unit Rate" %}
+ {{ addon.name }}
+ {% if not forloop.last %}+ {{ row.units|floatformat:0 }} × {{ addon.price|floatformat:4 }} + = {{ row.units|multiply:addon.price|floatformat:2 }} + {% elif addon.addon_type == "Base Fee" %} + {{ addon.name }} + {{ addon.price|floatformat:2 }} + {% else %} + {{ addon.name }} + {{ addon.price|floatformat:2 }} + {% endif %} + {% endif %} + {% endfor %} + {% else %} + n/a + {% endif %} + |
+ + {% with addon_total=row.mandatory_addons|calculate_addon_total:row.units %} + {{ row.sla_price|add_float:addon_total|floatformat:2 }} + {% endwith %} + | {% if show_addon_details %}{% if row.mandatory_addons or row.optional_addons %} @@ -415,6 +584,7 @@ | {{ row.term }} | {{ comparison.currency }} | +- | - | - | @@ -462,7 +632,7 @@ {# Price Chart #}