Skip to content

Commit

Permalink
Fix issues caused by thousands separator (#602)
Browse files Browse the repository at this point in the history
* Disable thousands separation in locale settings that caused issues updating rigs

* Update invoice dashboard to use "g" suffixed floatformats for thousands separation
  • Loading branch information
jb3 authored Oct 27, 2024
1 parent c2ef469 commit 6c32db3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion PyRIGS/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@

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')
Expand Down
11 changes: 6 additions & 5 deletions RIGS/templates/invoice_dashboard.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends 'base_rigs.html' %}

{% load humanize %}
{% block content %}

<form method="GET" action="{% url 'invoice_dashboard' %}">
Expand Down Expand Up @@ -31,15 +32,15 @@ <h3>Overview</h3>
<a href="{% url 'invoice_waiting' %}" class="text-decoration-none text-white">
<div class="card-body bg-primary">
<h5 class="card-title text-center">Total Waiting</h5>
<p class="card-text text-center h3"><strong>£{{ total_waiting|floatformat:2 }}</strong></p>
<p class="card-text text-center h3"><strong>£{{ total_waiting|floatformat:"2g" }}</strong></p>
</div>
</a>
</div>
<div class="card">
<a href="{% url 'invoice_list' %}" class="text-decoration-none text-dark">
<div class="card-body bg-info">
<h5 class="card-title text-center">Total Outstanding</h5>
<p class="card-text text-center h3"><strong>£{{ total_outstanding|floatformat:2 }}</strong></p>
<p class="card-text text-center h3"><strong>£{{ total_outstanding|floatformat:"2g" }}</strong></p>
</div>
</a>
</div>
Expand Down Expand Up @@ -71,7 +72,7 @@ <h4>Sources</h4>
<div class="card">
<div class="card-body">
<h5 class="card-title"><strong>{{ source.method }}</strong></h5>
<p class="card-text h3">£{{ source.total|floatformat:2 }}</p>
<p class="card-text h3">£{{ source.total|floatformat:"2g" }}</p>
</div>
</div>
{% endfor %}
Expand All @@ -85,7 +86,7 @@ <h4>Total</h4>
<div class="card">
<div class="card-body">
<h5 class="card-title text-center">Total Income</h5>
<p class="card-text text-center h3"><strong>£{{ total_income|floatformat:2 }}</strong></p>
<p class="card-text text-center h3"><strong>£{{ total_income|floatformat:"2g" }}</strong></p>
</div>
</div>

Expand All @@ -98,7 +99,7 @@ <h4>Invoice Payment Time</h4>
<div class="card">
<div class="card-body">
<h5 class="card-title text-center">Average Time to Pay</h5>
<p class="card-text text-center h3"><strong>{{ mean_invoice_to_payment|floatformat:2 }} days</strong></p>
<p class="card-text text-center h3"><strong>{{ mean_invoice_to_payment|floatformat:"2g" }} days</strong></p>
</div>
</div>

Expand Down

0 comments on commit 6c32db3

Please sign in to comment.