mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-24 17:02:18 +00:00
Basic working invoice system. Need to add a way to create invoices.
This commit is contained in:
108
RIGS/templates/RIGS/invoice_detail.html
Normal file
108
RIGS/templates/RIGS/invoice_detail.html
Normal file
@@ -0,0 +1,108 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block title %}Invoice {{ object.pk }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="col-sm-12">
|
||||
<h2>Invoice {{ object.pk }}</h2>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">Invoice Details</div>
|
||||
<div class="panel-body">
|
||||
{% if object.event.organisation %}
|
||||
{{ object.event.organisation.name }}<br/>
|
||||
{{ object.event.organisation.address|linebreaksbr }}
|
||||
{% else %}
|
||||
{{ object.event.person.name }}<br/>
|
||||
{{ object.event.person.address|linebreaksbr }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="panel panel-{% if object.void %}danger{% else %}info{% endif %}">
|
||||
<div class="panel-heading">Event Details</div>
|
||||
<div class="panel-body">
|
||||
<dl class="dl-horizontal">
|
||||
<dt>Event Number</dt>
|
||||
<dd>N{{ object.event.pk|stringformat:"05d" }}</dd>
|
||||
|
||||
<dt>Event</dt>
|
||||
<dd>{{ objet.event.pk }}</dd>
|
||||
|
||||
<dt>Event Venue</dt>
|
||||
<dd>{{ object.event.venue }}</dd>
|
||||
|
||||
<dt>Event MIC</dt>
|
||||
<dd>{{ object.event.mic.name }}</dd>
|
||||
|
||||
<dt>Status</dt>
|
||||
<dd>{{ object.event.get_status_display }}</dd>
|
||||
|
||||
{% if object.event.dry_hire %}
|
||||
<dd> </dd>
|
||||
<dt>Checked In By</dt>
|
||||
<dd>{{ object.checked_in_by.name }}</dd>
|
||||
{% endif %}
|
||||
|
||||
<dt>PO</dt>
|
||||
<dd>{{ object.event.purchase_order }}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="pull-right">
|
||||
<a href="{% url 'payment_create' %}?invoice={{ object.pk }}"
|
||||
class="btn btn-default modal-href"
|
||||
data-target="#{{ form.person.id_for_label }}">
|
||||
<span class="glyphicon glyphicon-plus"></span> Add
|
||||
</a>
|
||||
</div>
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Date</td>
|
||||
<td>Amount</td>
|
||||
<td>Method</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for payment in object.payment_set.all %}
|
||||
<tr>
|
||||
<td>{{ payment.date }}</td>
|
||||
<td>{{ payment.amount|floatformat:2 }}</td>
|
||||
<td>{{ payment.get_method_display }}</td>
|
||||
<td>
|
||||
<a href="{% url 'payment_delete' payment.pk %}"
|
||||
class="btn btn-small btn-danger"><span class="glyphicon glyphicon-remove"</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
{% with object.event as object %}
|
||||
{% include 'RIGS/item_table.html' %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
35
RIGS/templates/RIGS/invoice_list.html
Normal file
35
RIGS/templates/RIGS/invoice_list.html
Normal file
@@ -0,0 +1,35 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block title %}Active Invoices{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="col-sm-12">
|
||||
<h2>Active Invoices</h2>
|
||||
<table class="table table-responsive table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Event</th>
|
||||
<th>Invoice Date</th>
|
||||
<th>Balance</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for object in object_list %}
|
||||
<tr>
|
||||
<td>{{ object.pk }}</td>
|
||||
<td>{{ object.event }}</td>
|
||||
<td>{{ object.invoice_date }}</td>
|
||||
<td>{{ object.balance|floatformat:2 }}</td>
|
||||
<td class="text-right">
|
||||
<a href="{% url 'invoice_detail' object.pk %}" class="btn btn-default">
|
||||
<span class="glyphicon glyphicon-pencil"></span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endblock %}
|
||||
37
RIGS/templates/RIGS/payment_confirm_delete.html
Normal file
37
RIGS/templates/RIGS/payment_confirm_delete.html
Normal file
@@ -0,0 +1,37 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block title %}Delete payment on invoice {{ object.invoice.pk }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="col-sm-offset-2 col-sm-8">
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<h2>Delete payment on invoice {{ object.invoice.pk }}</h2>
|
||||
|
||||
<p>Are you sure you wish to delete a payment for £{{ object.amount|floatformat:2 }}
|
||||
({{ object.get_method_display }})
|
||||
from {{ object.date }} on invoice {{ object.invoice.pk }}.</p>
|
||||
|
||||
<p class="text-center"><strong>This action cannot be undone!</strong></p>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<form action="{{ action_link }}" method="post">{% csrf_token %}
|
||||
<input type="hidden" name="next" value="{% url 'invoice_detail' object.invoice.pk %}"/>
|
||||
<a href="{% url 'invoice_detail' object.invoice.pk %}" class="btn btn-default col-sm-1">No</a>
|
||||
<a href="{% url 'invoice_detail' object.invoice.pk %}" class="btn btn-default col-sm-1">No</a>
|
||||
<a href="{% url 'invoice_detail' object.invoice.pk %}" class="btn btn-default col-sm-1">No</a>
|
||||
<a href="{% url 'invoice_detail' object.invoice.pk %}" class="btn btn-default col-sm-1">No</a>
|
||||
<a href="{% url 'invoice_detail' object.invoice.pk %}" class="btn btn-default col-sm-1">No</a>
|
||||
<a href="{% url 'invoice_detail' object.invoice.pk %}" class="btn btn-default col-sm-1">No</a>
|
||||
<a href="{% url 'invoice_detail' object.invoice.pk %}" class="btn btn-default col-sm-1">No</a>
|
||||
<a href="{% url 'invoice_detail' object.invoice.pk %}" class="btn btn-default col-sm-1">No</a>
|
||||
<input type="submit" value="Yes" class="btn btn-danger col-sm-1"/>
|
||||
<a href="{% url 'invoice_detail' object.invoice.pk %}" class="btn btn-default col-sm-1">No</a>
|
||||
<a href="{% url 'invoice_detail' object.invoice.pk %}" class="btn btn-default col-sm-1">No</a>
|
||||
<a href="{% url 'invoice_detail' object.invoice.pk %}" class="btn btn-default col-sm-1">No</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
51
RIGS/templates/RIGS/payment_form.html
Normal file
51
RIGS/templates/RIGS/payment_form.html
Normal file
@@ -0,0 +1,51 @@
|
||||
{% extends 'base_ajax.html' %}
|
||||
{% load widget_tweaks %}
|
||||
|
||||
{% block title %}Add Payment{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-sm-offset-3 col-sm-6">
|
||||
<form action="{{ form.action|default:request.path }}" method="post" class="form-horizontal">{% csrf_token %}
|
||||
<input type="hidden" name="{{ form.invoice.name }}" value="{{ form.invoice.value }}"/>
|
||||
|
||||
<div class="row">
|
||||
{% include 'form_errors.html' %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label"
|
||||
for="{{ form.date.id_for_label }}">{{ form.date.label }}</label>
|
||||
|
||||
<div class="col-sm-10">
|
||||
{% render_field form.date type="date" class+="form-control" %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label"
|
||||
for="{{ form.amount.id_for_label }}">{{ form.amount.label }}</label>
|
||||
|
||||
<div class="col-sm-10">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">£</div>
|
||||
{% render_field form.amount class+="form-control" %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label"
|
||||
for="{{ form.method.id_for_label }}">{{ form.method.label }}</label>
|
||||
|
||||
<div class="col-sm-10">
|
||||
{% render_field form.method class+="form-control" %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-right col-sm-3 col-sm-offset-9">
|
||||
<div class="form-group">
|
||||
<input type="submit" class="form-control btn btn-primary"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user