From 6c32db39982d4c4f4a9f5fcc5b704f2db8891fa0 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Sun, 27 Oct 2024 15:09:04 +0000 Subject: [PATCH] Fix issues caused by thousands separator (#602) * Disable thousands separation in locale settings that caused issues updating rigs * Update invoice dashboard to use "g" suffixed floatformats for thousands separation --- PyRIGS/settings.py | 2 +- RIGS/templates/invoice_dashboard.html | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/PyRIGS/settings.py b/PyRIGS/settings.py index 5116440a..36a0b889 100644 --- a/PyRIGS/settings.py +++ b/PyRIGS/settings.py @@ -224,7 +224,7 @@ USE_L10N = True USE_TZ = True -USE_THOUSAND_SEPARATOR = True +USE_THOUSAND_SEPARATOR = False # Need to allow seconds as datetime-local input type spits out a time that has seconds DATETIME_INPUT_FORMATS = ('%Y-%m-%dT%H:%M', '%Y-%m-%dT%H:%M:%S') diff --git a/RIGS/templates/invoice_dashboard.html b/RIGS/templates/invoice_dashboard.html index 5086d555..eecbc415 100644 --- a/RIGS/templates/invoice_dashboard.html +++ b/RIGS/templates/invoice_dashboard.html @@ -1,5 +1,6 @@ {% extends 'base_rigs.html' %} +{% load humanize %} {% block content %}
@@ -31,7 +32,7 @@
Total Waiting
-

£{{ total_waiting|floatformat:2 }}

+

£{{ total_waiting|floatformat:"2g" }}

@@ -39,7 +40,7 @@
Total Outstanding
-

£{{ total_outstanding|floatformat:2 }}

+

£{{ total_outstanding|floatformat:"2g" }}

@@ -71,7 +72,7 @@
{{ source.method }}
-

£{{ source.total|floatformat:2 }}

+

£{{ source.total|floatformat:"2g" }}

{% endfor %} @@ -85,7 +86,7 @@
Total Income
-

£{{ total_income|floatformat:2 }}

+

£{{ total_income|floatformat:"2g" }}

@@ -98,7 +99,7 @@
Average Time to Pay
-

{{ mean_invoice_to_payment|floatformat:2 }} days

+

{{ mean_invoice_to_payment|floatformat:"2g" }} days