aboutsummaryrefslogtreecommitdiff
path: root/app/dispatch
diff options
context:
space:
mode:
authorMitch Riedstra <mitch@riedstra.us>2018-03-25 22:41:03 -0400
committerMitch Riedstra <mitch@riedstra.us>2018-03-25 22:41:03 -0400
commit02e68c71dbae66e46703ca403c45378c6a0437aa (patch)
tree35a671b78de69c3c350ccdd1f758b07a40ea465c /app/dispatch
parent8f52ee7320051bce63254a70a524b407cc8105c1 (diff)
downloaddispatch-tracker-02e68c71dbae66e46703ca403c45378c6a0437aa.tar.gz
dispatch-tracker-02e68c71dbae66e46703ca403c45378c6a0437aa.tar.xz
Remove color coding entirely if the load is paid for.
Added audit log to the navigation bar as well. Removed commented out urls related to previous versions of the audit log.
Diffstat (limited to 'app/dispatch')
-rw-r--r--app/dispatch/models.py11
-rw-r--r--app/dispatch/templates/dispatch/generic_load_listing.html4
-rw-r--r--app/dispatch/templates/dispatch/nav.html1
-rw-r--r--app/dispatch/urls.py3
4 files changed, 16 insertions, 3 deletions
diff --git a/app/dispatch/models.py b/app/dispatch/models.py
index 1d2bae2..6dcd570 100644
--- a/app/dispatch/models.py
+++ b/app/dispatch/models.py
@@ -64,6 +64,17 @@ class Load(models.Model):
else:
return False
+ def has_related_paid_invoices(self):
+ wk = get_week_dates_datetime(self.date)
+ inv = Invoice.objects.filter(
+ invoice_date__range=(wk['start_date'],
+ wk['end_date']),
+ paid=True)
+ if len(inv) >= 1:
+ return True
+ else:
+ return False
+
class Paperwork(models.Model):
load = models.ForeignKey(Load, on_delete=models.CASCADE)
diff --git a/app/dispatch/templates/dispatch/generic_load_listing.html b/app/dispatch/templates/dispatch/generic_load_listing.html
index c7be455..152c7d9 100644
--- a/app/dispatch/templates/dispatch/generic_load_listing.html
+++ b/app/dispatch/templates/dispatch/generic_load_listing.html
@@ -11,6 +11,7 @@
{% for heading in load_headers %}
<th>{{heading}}</th>
{% endfor %}
+ {% if false %}
<!--
Order is specific here, you're goign going to want to define
the fields beforehand i.e.
@@ -25,6 +26,7 @@
<th>Load Number</th>
<th>Description</th>
-->
+ {% endif %}
</tr>
</thead>
<tbody>
@@ -33,6 +35,8 @@
<tr class="red lighten-4">
{% elif load.paperwork_set.all|length <= 0 %}
<tr class="orange lighten-4">
+ {% elif load.has_related_paid_invoices %}
+ <tr>{% if false %} No colors if they have a paid invoice {% endif %}
{% else %}
<tr class="green lighten-4">
{% endif %}
diff --git a/app/dispatch/templates/dispatch/nav.html b/app/dispatch/templates/dispatch/nav.html
index bc34d41..b9e02e8 100644
--- a/app/dispatch/templates/dispatch/nav.html
+++ b/app/dispatch/templates/dispatch/nav.html
@@ -6,6 +6,7 @@
<li><a href="{% url 'load_list' %}">Loads</a></li>
<li><a href="{% url 'invoice_list' %}">Invoices</a></li>
{% if request.user.is_superuser %}
+ <li><a href="{% url 'log_summary' %}">Audit Log</a></li>
<li><a href="{% url 'driver_list' %}">Vendors</a></li>
<li><a href="{% url 'customer_list' %}">Customers</a></li>
{% else %}
diff --git a/app/dispatch/urls.py b/app/dispatch/urls.py
index 1b7d71f..d78186b 100644
--- a/app/dispatch/urls.py
+++ b/app/dispatch/urls.py
@@ -49,9 +49,6 @@ urlpatterns = [
url(r'^invoices/delete/(?P<pk>\d+)$', views.InvoiceDelete.as_view(), name='invoice_delete'),
url(r'^drivers/view/(?P<pk>\d+)/generate/$', views.InvoiceGenerateForDates, name='invoice_generate'),
- # url(r'^audit_log/summary/(?P<pk>\d+)$', views.AuditLog.as_view(), name='driver_summary'),
url(r'^audit_log/summary/$', views.AuditLog.as_view(), name='log_summary'),
- # url(r'^audit_log/unusual/$', views.AuditLogUnusual.as_view(), name='log_unusual'),
- # url(r'^drivers/activity/summary$', views.DriverActivitySummary.as_view(), name='driver_activity_summary'),
]