From 33a6e5cb02189b7621a279c32c12b5c3d83ba680 Mon Sep 17 00:00:00 2001 From: Mitch Riedstra Date: Thu, 9 Nov 2017 15:57:46 -0500 Subject: Show number of attachments, and color code issues with loads. Prevent invoice generation on zero amounts and no attachments. Add a way for superusers to edit invoices. Add a field to invoices for a payment identifier. E.g. "Check #1234" --- .../templates/dispatch/drivers/detail.html | 14 ++++++- .../templates/dispatch/drivers/summary.html | 47 ++++++++++++++-------- .../templates/dispatch/generic_load_listing.html | 18 ++++++++- .../templates/dispatch/invoice/detail-table.html | 22 ++++++++++ .../templates/dispatch/invoice/detail.html | 8 +++- app/dispatch/templates/dispatch/invoice/edit.html | 21 ++++++++++ app/dispatch/templates/dispatch/loads/list.html | 2 +- 7 files changed, 110 insertions(+), 22 deletions(-) create mode 100644 app/dispatch/templates/dispatch/invoice/edit.html (limited to 'app/dispatch/templates') diff --git a/app/dispatch/templates/dispatch/drivers/detail.html b/app/dispatch/templates/dispatch/drivers/detail.html index 99d9611..e8ffb99 100644 --- a/app/dispatch/templates/dispatch/drivers/detail.html +++ b/app/dispatch/templates/dispatch/drivers/detail.html @@ -51,7 +51,8 @@
{% if request.user.is_superuser %} - Make Default Bill To + Make Default Bill To + {% else %} {% endif %} Edit @@ -60,6 +61,17 @@
+{% if request.user.is_superuser %} +
+
+

+ "Default Bill To" is the Identity object to which all of the Invoices generated + by the system will have their Bill-To set. Be careful when changing this. +

+
+
+{% endif %} +
diff --git a/app/dispatch/templates/dispatch/drivers/summary.html b/app/dispatch/templates/dispatch/drivers/summary.html index 5da7d3c..362c1fa 100644 --- a/app/dispatch/templates/dispatch/drivers/summary.html +++ b/app/dispatch/templates/dispatch/drivers/summary.html @@ -15,10 +15,15 @@
+ {% if can_invoice %} Generate Invoice For Listing + {% else %} + Generate Invoice For Listing + {% endif %}
+{% else %} {% endif %} {% if not request.user.is_superuser %} @@ -30,6 +35,7 @@ + @@ -38,7 +44,17 @@ - + {% if load.amount == 0 %} + + {% else %} + + {% endif %} + {% if load.paperwork_set.all %} + + {% else %} + + {% endif %} +
Date Description TotalAttachments
{{load.date}} {{load.description}}{{load.amount}}{{load.amount}}{{load.amount}}{{load.paperwork_set.all|length}}0 View @@ -52,6 +68,7 @@ {% endif %} +
@@ -71,6 +88,18 @@ +{% if not can_invoice %} +
+
+
Note:
+

+ Cannot generate an invoice at this time, one or more Loads has an improper + Amount or is missing attachments. +

+
+
+{% endif %} + @@ -84,23 +113,9 @@ -{% if stats.incomplete_loads > 0 %} -
-
-
-
- - Note: One or more loads has a 0 amount that needs attention - -
-
-
-
-{% endif %} - {% if request.user.is_superuser %} {% load custom_tags %} - {% listForCommaString "Customer,Amount,Description" as load_headers %} + {% listForCommaString "Customer,Amount,Description,Attachments" as load_headers %} {% include "dispatch/generic_load_listing.html" %} {% endif %} diff --git a/app/dispatch/templates/dispatch/generic_load_listing.html b/app/dispatch/templates/dispatch/generic_load_listing.html index 5512184..3a78335 100644 --- a/app/dispatch/templates/dispatch/generic_load_listing.html +++ b/app/dispatch/templates/dispatch/generic_load_listing.html @@ -28,7 +28,13 @@ {% for load in loads|keyvalue:date %} - + {% if load.amount <= 2 %} + + {% elif load.paperwork_set.all|length <= 0 %} + + {% else %} + + {% endif %} {% if "Customer" in load_headers %} {% if request.user.is_superuser %} @@ -42,7 +48,7 @@ {% if "Amount" in load_headers %} {% if load.amount == 0 %} - + {% else %} {% endif %} @@ -52,6 +58,14 @@ {% endif %} + {% if "Attachments" in load_headers %} + {% if load.paperwork_set.all %} + + {% else %} + + {% endif %} + {% endif %} + + + + + {% if object.paid %} + + {% else %} + + {% endif %} + + {% if object.paid %} + + {% else %} + + {% endif %} + + {% if object.paid %} + + {% else %} + {% endif %}
{{ load.customer.name }}{{ load.amount }}{{ load.amount }}{{ load.amount }}{{ load.description }}{{load.paperwork_set.all|length}}0 View diff --git a/app/dispatch/templates/dispatch/invoice/detail-table.html b/app/dispatch/templates/dispatch/invoice/detail-table.html index 37fa2a5..508ab31 100644 --- a/app/dispatch/templates/dispatch/invoice/detail-table.html +++ b/app/dispatch/templates/dispatch/invoice/detail-table.html @@ -4,6 +4,9 @@ Invoice #{{object.invoice_id}} +
+

PAID

+
@@ -66,10 +69,29 @@
{{object.total}}
Amount Paid:{{object.payment_identifier}}({{object.total}})0
Amount Due: 0{{object.total}}
diff --git a/app/dispatch/templates/dispatch/invoice/detail.html b/app/dispatch/templates/dispatch/invoice/detail.html index 033747c..850c427 100644 --- a/app/dispatch/templates/dispatch/invoice/detail.html +++ b/app/dispatch/templates/dispatch/invoice/detail.html @@ -13,7 +13,8 @@ {% csrf_token %}
Delete - Print + Edit + Print
@@ -21,6 +22,8 @@
+
+
{% include "dispatch/invoice/detail-table.html" %}
@@ -33,7 +36,8 @@ {% csrf_token %} Delete - Print + Edit + Print diff --git a/app/dispatch/templates/dispatch/invoice/edit.html b/app/dispatch/templates/dispatch/invoice/edit.html new file mode 100644 index 0000000..c056ed9 --- /dev/null +++ b/app/dispatch/templates/dispatch/invoice/edit.html @@ -0,0 +1,21 @@ +{% extends 'dispatch/base.html' %} + +{% block title %}Edit - {{ object.description }}{% endblock %} + +{% block content %} +
+
+

{{object.name}}

+
+
+ +
{% csrf_token %} + {% for field in form %} +

+ {{field.label_tag}} {{field}} +

+ {% endfor %} + +
+ +{% endblock %} diff --git a/app/dispatch/templates/dispatch/loads/list.html b/app/dispatch/templates/dispatch/loads/list.html index 01dd47d..615c4e1 100644 --- a/app/dispatch/templates/dispatch/loads/list.html +++ b/app/dispatch/templates/dispatch/loads/list.html @@ -24,7 +24,7 @@ {% load custom_tags %} -{% listForCommaString "Customer,Driver,Amount,Description" as load_headers %} +{% listForCommaString "Customer,Driver,Amount,Description,Attachments" as load_headers %} {% include "dispatch/generic_load_listing.html" %}
-- cgit v1.2.3