diff options
| author | Mitch Riedstra <Mitch@riedstra.us> | 2017-11-09 15:57:46 -0500 |
|---|---|---|
| committer | Mitch Riedstra <Mitch@riedstra.us> | 2017-11-09 15:57:46 -0500 |
| commit | 33a6e5cb02189b7621a279c32c12b5c3d83ba680 (patch) | |
| tree | 6d9776af90222f8062921b62fc7f6f4b5fa01dc7 /app/dispatch/templates | |
| parent | c055260bb88fd407c81ad0d40dd288a5aae4fb17 (diff) | |
| download | dispatch-tracker-33a6e5cb02189b7621a279c32c12b5c3d83ba680.tar.gz dispatch-tracker-33a6e5cb02189b7621a279c32c12b5c3d83ba680.tar.xz | |
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"
Diffstat (limited to 'app/dispatch/templates')
7 files changed, 110 insertions, 22 deletions
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 @@ <div class="col s6"> <div class="right-align"> {% if request.user.is_superuser %} - <a class="btn orange" href="{% url 'identity_default' object.pk ident.pk %}">Make Default Bill To</a> + <a class="btn orange" href="{% url 'identity_default' object.pk ident.pk %}">Make Default Bill To</a> + {% else %} {% endif %} <a class="btn green" href="{% url 'identity_edit' object.pk ident.pk %}"> Edit @@ -60,6 +61,17 @@ </div> </div> +{% if request.user.is_superuser %} +<div class="row"> + <div class="col s12"> + <p class=""> + "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. + </p> + </div> +</div> +{% endif %} + <div class="row"> <div class="col s12"> <table> 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 @@ <div class="row"> <div class="col s12"> <div class="right-align"> + {% if can_invoice %} <a class="btn orange" href="{% url 'invoice_generate' object.pk%}?date={{week_dates.start_date|date:"m/d/Y"}}">Generate Invoice For Listing</a> + {% else %} + <a class="btn orange disabled">Generate Invoice For Listing</a> + {% endif %} </div> </div> </div> +{% else %} {% endif %} {% if not request.user.is_superuser %} @@ -30,6 +35,7 @@ <td>Date</td> <td>Description</td> <td>Total</td> + <td>Attachments</td> <td></td> </tr> </thead> @@ -38,7 +44,17 @@ <tr> <td>{{load.date}}</td> <td>{{load.description}}</td> - <td>{{load.amount}}</td> + {% if load.amount == 0 %} + <td><b><span class="red-text">{{load.amount}}</span></b></td> + {% else %} + <td>{{load.amount}}</td> + {% endif %} + {% if load.paperwork_set.all %} + <td>{{load.paperwork_set.all|length}}</td> + {% else %} + <td><b><span class="red-text">0</span></b></td> + {% endif %} + <td></td> <td class="right-align"> <a href="{% url 'load_detail' load.id %}" class="btn green"> View @@ -52,6 +68,7 @@ </div> {% endif %} + <div class="row"> <div class="col s12"> <table> @@ -71,6 +88,18 @@ </div> </div> +{% if not can_invoice %} +<div class="row"> + <div class="col s12"> + <h5>Note:</h5> + <p class="flow-text"> + Cannot generate an invoice at this time, one or more Loads has an improper + Amount or is missing attachments. + </p> + </div> +</div> +{% endif %} + @@ -84,23 +113,9 @@ </div> </div> -{% if stats.incomplete_loads > 0 %} -<div class="row"> - <div class="col s12 m8 offset-m2"> - <div class="card red z-depth-3"> - <div class="card-content black-text"> - <span class="card-title"> - Note: One or more loads has a 0 amount that needs attention - </span> - </div> - </div> - </div> -</div> -{% 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 @@ </thead> <tbody> {% for load in loads|keyvalue:date %} - <tr class="green lighten-4"> + {% if load.amount <= 2 %} + <tr class="red lighten-4"> + {% elif load.paperwork_set.all|length <= 0 %} + <tr class="orange lighten-4"> + {% else %} + <tr class="green lighten-4"> + {% endif %} {% if "Customer" in load_headers %} {% if request.user.is_superuser %} <td><a href="{% url 'customer_detail' load.customer.id %}">{{ load.customer.name }}</a></td> @@ -42,7 +48,7 @@ {% if "Amount" in load_headers %} {% if load.amount == 0 %} - <td><span class="red-text">{{ load.amount }}</span></td> + <td><b><span class="red-text">{{ load.amount }}</span></b></td> {% else %} <td>{{ load.amount }}</td> {% endif %} @@ -52,6 +58,14 @@ <td>{{ load.description }}</td> {% endif %} + {% if "Attachments" in load_headers %} + {% if load.paperwork_set.all %} + <td>{{load.paperwork_set.all|length}}</td> + {% else %} + <td><b><span class="red-text">0</span></b></td> + {% endif %} + {% endif %} + <td class="right-align"> <!-- <a href="{% url 'load_edit' load.id %}" class="btn orange">Edit</a> --> <a href="{% url 'load_detail' load.id %}" class="btn blue">View</a> 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}} </h4> </div> + <div class="col s6 right-align"> + <h4>PAID</h4> + </div> </div> <div class="row"> <div class="col s6"> @@ -67,9 +70,28 @@ <td>{{object.total}}</td> </tr> <tr> + <td><b>Amount Paid:</b></td> + + {% if object.paid %} + <td>{{object.payment_identifier}}</td> + {% else %} + <td></td> + {% endif %} + + {% if object.paid %} + <td>({{object.total}})</td> + {% else %} + <td>0</td> + {% endif %} + </tr> + <tr> <td><b>Amount Due:</b></td> <td></td> + {% if object.paid %} + <td><b>0</b></td> + {% else %} <td><b>{{object.total}}</b></td> + {% endif %} </tr> </tbody> </table> 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 @@ <!-- <input type="submit" class="btn red" value="Delete" /> --> {% csrf_token %} <a class="btn red" href="#" onClick="warn_submit('Are you sure?', '#invoice_delete')">Delete</a> - <a class="btn green" href="#" onClick="window.print()">Print</a> + <a class="btn orange darken-3" href="{% url 'invoice_edit' object.pk %}">Edit</a> + <a class="btn green" href="#" onClick="window.print()">Print</a> </form> </div> </div> @@ -21,6 +22,8 @@ <div style="padding-top:30px;" class="hide-print"></div> +<div style="padding-top:30px;" class="hide-print"></div> + <div class="z-depth-3 padding-30"> {% include "dispatch/invoice/detail-table.html" %} </div> @@ -33,7 +36,8 @@ <!-- <input type="submit" class="btn red" value="Delete" /> --> {% csrf_token %} <a class="btn red" href="#" onClick="warn_submit('Are you sure?', '#invoice_delete')">Delete</a> - <a class="btn green" href="#" onClick="window.print()">Print</a> + <a class="btn orange darken-3" href="{% url 'invoice_edit' object.pk %}">Edit</a> + <a class="btn green" href="#" onClick="window.print()">Print</a> </form> </div> </div> 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 %} +<div class="row"> + <div class="col s12 m6"> + <h1>{{object.name}}</h1> + </div> +</div> + +<form action="" method="post">{% csrf_token %} + {% for field in form %} + <p> + {{field.label_tag}} {{field}} + </p> + {% endfor %} + <input type="submit" class="btn blue" value="Update" /> +</form> + +{% 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 @@ </div> {% 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" %} <div class="row"> |
