From 0fdb88b8aa5659dafdd709f81edffb95bb7c4e80 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Mon, 7 May 2018 07:50:32 +0530 Subject: [PATCH] invoice discount amount fix --- datacenterlight/migrations/0022_auto_20180506_1950.py | 5 +++-- datacenterlight/templates/datacenterlight/order_detail.html | 4 ++-- hosting/templates/hosting/order_detail.html | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/datacenterlight/migrations/0022_auto_20180506_1950.py b/datacenterlight/migrations/0022_auto_20180506_1950.py index dd79b825..a5554a58 100644 --- a/datacenterlight/migrations/0022_auto_20180506_1950.py +++ b/datacenterlight/migrations/0022_auto_20180506_1950.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Generated by Django 1.9.4 on 2018-05-06 14:20 +# Generated by Django 1.9.4 on 2018-05-07 02:19 from __future__ import unicode_literals from django.db import migrations, models @@ -15,7 +15,8 @@ class Migration(migrations.Migration): migrations.AddField( model_name='vmpricing', name='discount_amount', - field=models.DecimalField(decimal_places=2, default=0, max_digits=4), + field=models.DecimalField( + decimal_places=2, default=0, max_digits=6), ), migrations.AddField( model_name='vmpricing', diff --git a/datacenterlight/templates/datacenterlight/order_detail.html b/datacenterlight/templates/datacenterlight/order_detail.html index 1bedbb44..fbe7ff0f 100644 --- a/datacenterlight/templates/datacenterlight/order_detail.html +++ b/datacenterlight/templates/datacenterlight/order_detail.html @@ -76,11 +76,11 @@ {{vm.vat|floatformat:2|intcomma}} CHF

{% endif %} - {% if vm.discount > 0 %} + {% if vm.discount.amount > 0 %}

{%trans "Discount" as discount_name %} {{ vm.discount.name|default:discount_name }}: - - {{ discount.amount }} CHF + - {{ vm.discount.amount }} CHF

{% endif %}

diff --git a/hosting/templates/hosting/order_detail.html b/hosting/templates/hosting/order_detail.html index 1ed75bd9..11aa3474 100644 --- a/hosting/templates/hosting/order_detail.html +++ b/hosting/templates/hosting/order_detail.html @@ -138,11 +138,11 @@ {{vm.vat|floatformat:2|intcomma}} CHF

{% endif %} - {% if vm.discount > 0 %} + {% if vm.discount.amount > 0 %}

{%trans "Discount" as discount_name %} {{ vm.discount.name|default:discount_name }}: - - {{ discount.amount }} CHF + - {{ vm.discount.amount }} CHF

{% endif %}