aboutsummaryrefslogtreecommitdiff
path: root/app/dispatch/templates
diff options
context:
space:
mode:
authorMitch Riedstra <mitch@riedstra.us>2018-02-03 21:17:02 -0500
committerMitch Riedstra <mitch@riedstra.us>2018-02-03 21:17:02 -0500
commit93a57dc5afb2962d675c51504ecdb3afa34a95a7 (patch)
tree97e0ffb39c777c2907f817c24a88b9696d0f6370 /app/dispatch/templates
parent9494ff9cb0e917fb11d2281fe0ffb04a8c40b6db (diff)
downloaddispatch-tracker-93a57dc5afb2962d675c51504ecdb3afa34a95a7.tar.gz
dispatch-tracker-93a57dc5afb2962d675c51504ecdb3afa34a95a7.tar.xz
Show whether or not there are any related invoices on the summary page
Also prevent the generation of duplicate invoices based on the date of invoice and the current user.
Diffstat (limited to 'app/dispatch/templates')
-rw-r--r--app/dispatch/templates/dispatch/drivers/summary.html29
1 files changed, 28 insertions, 1 deletions
diff --git a/app/dispatch/templates/dispatch/drivers/summary.html b/app/dispatch/templates/dispatch/drivers/summary.html
index 82df917..55d0854 100644
--- a/app/dispatch/templates/dispatch/drivers/summary.html
+++ b/app/dispatch/templates/dispatch/drivers/summary.html
@@ -91,7 +91,8 @@
</div>
</div>
-{% if not can_invoice %}
+
+{% if not can_invoice and related_invoices|length == 0 %}
<div class="row">
<div class="col s12">
<h5>Note:</h5>
@@ -101,6 +102,32 @@
</p>
</div>
</div>
+{% elif related_invoices|length >= 1 %}
+<div class="row">
+ <div class="col s12">
+ <h5>Note:</h5>
+ <p class="flow-text">
+ There are Invoices related to these loads
+ <table>
+ <thead>
+ <tr>
+ <td>Invoice Number</td>
+ <td>Invoice Amount</td>
+ <td>Invoice Paid</td>
+ <td></td>
+ </tr>
+ </thead>
+ <tr>
+ {% for r in related_invoices %}
+ <td>{{r.invoice_id}}</td>
+ <td>{{r.total}}</td>
+ <td>{{r.paid}}</td>
+ <td class="right-align"><a class="btn blue" href="{% url 'invoice_detail' r.id%}">View</a></td>
+ {% endfor %}
+ </tr>
+ </table>
+ </div>
+</div>
{% endif %}