diff options
Diffstat (limited to 'app/templates/modules/invoices.html')
-rw-r--r-- | app/templates/modules/invoices.html | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/app/templates/modules/invoices.html b/app/templates/modules/invoices.html new file mode 100644 index 0000000..9e8f765 --- /dev/null +++ b/app/templates/modules/invoices.html @@ -0,0 +1,80 @@ +{# -*- mode: web; -*- #} + +{% extends "base.html" %} +{% block title %} +Invoices +{% endblock %} + +{% block actions %} +<li><a href="{{ url_for('common.add_item', module='invoices', table='Invoice') }}" class="button">Add invoice</a></li> +<li></li> +{% endblock %} + +{% block content %} +<i>Track your invoices and create new ones here.</i><br/> + +{# Pagination Links #} +{# gotten from https://betterprogramming.pub/simple-flask-pagination-example-4190b12c2e2e #} +<center> + {# Loop through the number of pages to display a link for each #} + {% for page_num in invoices.iter_pages(left_edge=1, right_edge=1, left_current=1, right_current=2) %} + {% if page_num %} + {# Check for the active page and set the link to "Active" #} + {% if invoices.page == page_num %} + <a href="{{ url_for('invoices.view', page=page_num) }}" + class="button"> + {{ page_num }} + </a> + {% else %} + <a href="{{ url_for('invoices.view', page=page_num) }}" + class="button button-light"> + {{ page_num }} + </a> + {% endif %} + {% else %} + ... + {% endif %} + {% endfor %} +</center> +<table> + <thead> + <tr> + <th></th> + <th>ID</th> + <th>Created</th> + <th>Alternative Invoice ID</th> + <th>Customer Name</th> + <th>Customer Reference</th> + <th>Date Billed</th> + <th>Date Due</th> + <th>Amount (Net €)</th> + <th>Amount (Gross €)</th> + <th>Tax Amount (€)</th> + </tr> + </thead> + <tbody> + {% for invoice in invoices.items %} + <tr {% if invoice.archive == True %} style="color: dimgray" {% endif %}> + <td> + <form method="post" action="{{ url_for('common.edit_item', module='invoices', pk=invoice.primary_key, table='Invoice') }}"> + <button>archive</button> + </form> + <form method="get" action="{{ url_for('invoices.preview', pk=invoice.primary_key) }}"> + <button>preview</button> + </form> + </td> + <td>{{ invoice.primary_key }}</td> + <td>{{ invoice.date_time_created }}</td> + <td>{{ invoice.invoice_id_alt }}</td> + <td>{{ invoice.customer.name }}</td> + <td>{{ invoice.customer_reference }}</td> + <td>{{ invoice.date_billed }}</td> + <td>{{ invoice.date_due }}</td> + <td>{{ invoice.amount_net }}</td> + <td>{{ invoice.amount_gross }}</td> + <td>{{ invoice.amount_tax }}</td> + </tr> + {% endfor %} + </tbody> +</table> +{% endblock %} |