discount option added to calculator

This commit is contained in:
Arvind Tiwari 2018-05-07 05:07:58 +05:30
commit f8dc2c6bbe
18 changed files with 554 additions and 476 deletions

View file

@ -8,6 +8,7 @@
window.ramUnitPrice = {{vm_pricing.ram_unit_price|default:0}};
window.ssdUnitPrice = {{vm_pricing.ssd_unit_price|default:0}};
window.hddUnitPrice = {{vm_pricing.hdd_unit_price|default:0}};
window.discountAmount = {{vm_pricing.discount_amount|default:0}};
</script>
{% endif %}
@ -19,11 +20,15 @@
<div class="price">
<span id="total"></span>
<span>CHF/{% trans "month" %}</span>
{% if vm_pricing.vat_inclusive %}
<div class="price-text">
<p>{% trans "VAT included" %}</p>
<p>
{% if vm_pricing.vat_inclusive %}{% trans "VAT included" %} <br>{% endif %}
{% if vm_pricing.discount_amount %}
{% trans "Discount" as discount_name %}
{{ vm_pricing.discount_amount }} CHF <strong>{{ vm_pricing.discount_name|default:discount_name }}</strong> included
{% endif %}
</p>
</div>
{% endif %}
</div>
<div class="descriptions">
<div class="description form-group">

View file

@ -78,7 +78,24 @@
<hr>
<p>{% trans "Configuration"%} <strong class="pull-right">{{request.session.template.name}}</strong></p>
<hr>
<p class="last-p"><strong>{%trans "Total" %}</strong>&nbsp;&nbsp;<small>({% if vm_pricing.vat_inclusive %}{%trans "including VAT" %}{% else %}{%trans "excluding VAT" %}{% endif %})</small> <strong class="pull-right">{{request.session.specs.price|intcomma}} CHF/{% trans "Month" %}</strong></p>
<p>
<strong>{%trans "Total" %}</strong>&nbsp;&nbsp;
<small>
({% if vm_pricing.vat_inclusive %}{%trans "including VAT" %}{% else %}{%trans "excluding VAT" %}{% endif %})
</small>
<strong class="pull-right">{{request.session.specs.price|intcomma}} CHF/{% trans "Month" %}</strong>
</p>
<hr>
{% if vm_pricing.discount_amount %}
<p class="mb-0">
{%trans "Discount" as discount_name %}
<strong>{{ vm_pricing.discount_name|default:discount_name }}</strong>&nbsp;&nbsp;
<strong class="pull-right text-primary">- {{ vm_pricing.discount_amount }} CHF/{% trans "Month" %}</strong>
</p>
<p>
({% trans "Will be applied at checkout" %})
</p>
{% endif %}
</div>
</div>
</div>

View file

@ -65,6 +65,7 @@
<span>{% trans "Disk space" %}: </span>
<span class="pull-right">{{vm.disk_size|intcomma}} GB</span>
</p>
<hr>
{% if vm.vat > 0 %}
<p>
<strong>{% trans "Subtotal" %}: </strong>
@ -75,6 +76,13 @@
<span class="pull-right">{{vm.vat|floatformat:2|intcomma}} CHF</span>
</p>
{% endif %}
{% if vm_pricing.discount_amount %}
<p class="text-primary">
{%trans "Discount" as discount_name %}
<span>{{ vm_pricing.discount_name|default:discount_name }}: </span>
<span class="pull-right">- {{ vm_pricing.discount_amount }} CHF</span>
</p>
{% endif %}
<p>
<strong>{% trans "Total" %}</strong>
<span class="pull-right">{{vm.total_price|floatformat:2|intcomma}} CHF</span>