-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Enable commas for float thousands separation * Add new invoice dashboard template * Add new view controller for finance dashboard * Add finance dashboard to dropdown * Update finance URLs to put dashboard at index route * Add payment methods to generated sample data * Flip 'outstanding' and 'waiting' cards on dashboard to match order in dropdown Also made them link to their respective lists and fixed low text contrast --------- Co-authored-by: FreneticScribbler <[email protected]>
- Loading branch information
1 parent
e5c7e24
commit c2ef469
Showing
6 changed files
with
181 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
{% extends 'base_rigs.html' %} | ||
|
||
{% block content %} | ||
|
||
<form method="GET" action="{% url 'invoice_dashboard' %}"> | ||
<div class="form-row"> | ||
<div class="form-group col-md-4"> | ||
<label for="time_filter">Time Filter</label> | ||
<select id="time_filter" name="time_filter" class="form-control"> | ||
<option value="week" {% if time_filter == 'week' %}selected{% endif %}>Last Week (7 days)</option> | ||
<option value="month" {% if time_filter == 'month' %}selected{% endif %}>Last Month (30 days)</option> | ||
<option value="year" {% if time_filter == 'year' %}selected{% endif %}>Last Year</option> | ||
<option value="all" {% if time_filter == 'all' %}selected{% endif %}>All Time</option> | ||
</select> | ||
</div> | ||
</div> | ||
</form> | ||
|
||
<script> | ||
$('#time_filter').change(function () { | ||
$(this).closest('form').submit(); | ||
}); | ||
</script> | ||
|
||
<h3>Overview</h3> | ||
|
||
<!-- big cards in 2x2 grid with total_outstanding, total_events, total_invoices and total_payments, different backgrounds --> | ||
|
||
<div class="card-deck"> | ||
<div class="card"> | ||
<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> | ||
</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> | ||
</div> | ||
</a> | ||
</div> | ||
<div class="card"> | ||
<div class="card-body bg-danger"> | ||
<h5 class="card-title text-center">Total Events</h5> | ||
<p class="card-text text-center h3"><strong>{{ total_events }}</strong></p> | ||
</div> | ||
</div> | ||
<div class="card"> | ||
<div class="card-body bg-success"> | ||
<h5 class="card-title text-center">Total Invoices</h5> | ||
<p class="card-text text-center h3"><strong>{{ total_invoices }}</strong></p> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<br /> | ||
|
||
<h3>Payments</h3> | ||
|
||
<br/> | ||
|
||
<h4>Sources</h4> | ||
|
||
<br/> | ||
|
||
{% for source in payment_methods %} | ||
<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> | ||
</div> | ||
</div> | ||
{% endfor %} | ||
|
||
<br/> | ||
|
||
<h4>Total</h4> | ||
|
||
<br/> | ||
|
||
<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> | ||
</div> | ||
</div> | ||
|
||
<br/> | ||
|
||
<h4>Invoice Payment Time</h4> | ||
|
||
<br/> | ||
|
||
<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> | ||
</div> | ||
</div> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters