From aac3112274e8277aa6ffb81b291387b68d41e0d3 Mon Sep 17 00:00:00 2001 From: Leo Hemsted Date: Wed, 6 Jul 2016 16:03:00 +0100 Subject: [PATCH] mmg rates set to 1.65p also moved a default parameter to a plain ol' local variable to reduce ambiguity about whether it is overriden by any callers (it's not) --- app/main/views/dashboard.py | 5 ++++- app/templates/views/pricing.html | 2 +- app/templates/views/usage.html | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/main/views/dashboard.py b/app/main/views/dashboard.py index 60c24e2f4..126b174bb 100644 --- a/app/main/views/dashboard.py +++ b/app/main/views/dashboard.py @@ -178,7 +178,10 @@ def get_dashboard_partials(service_id): } -def calculate_usage(usage, sms_free_allowance=250000, sms_rate=0.018): +def calculate_usage(usage): + # TODO: Don't hardcode these - get em from the API + sms_free_allowance = 250000 + sms_rate = 0.0165 sms_sent = usage.get('sms_count', 0) emails_sent = usage.get('email_count', 0) diff --git a/app/templates/views/pricing.html b/app/templates/views/pricing.html index 34f47e3f5..367e4687e 100644 --- a/app/templates/views/pricing.html +++ b/app/templates/views/pricing.html @@ -26,7 +26,7 @@
  • Up to 306 characters = 2 text messages
  • Up to 459 characters = 3 text messages
  • -
  • Standard text message rate: 1.8p + VAT
  • +
  • Standard text message rate: 1.65p + VAT
  • diff --git a/app/templates/views/usage.html b/app/templates/views/usage.html index 9280d3a60..1f97fcd50 100644 --- a/app/templates/views/usage.html +++ b/app/templates/views/usage.html @@ -34,7 +34,7 @@ {% if sms_chargeable %} {{ big_number( sms_chargeable, - 'at {:.1f}p per message'.format(sms_rate * 100), + 'at {:.2f}p per message'.format(sms_rate * 100), smaller=True ) }} {% endif %}