Added the ability to invoice an event

This commit is contained in:
tomtom5152
2015-01-30 00:26:15 +00:00
parent bbce968478
commit af1396a168
7 changed files with 177 additions and 6 deletions

View File

@@ -15,6 +15,10 @@
class="glyphicon glyphicon-print"></span></a>
<a href="{% url 'event_duplicate' event.pk %}" class="btn btn-default" title="Duplicate Rig"><span
class="glyphicon glyphicon-duplicate"></span></a>
{% if perms.RIGS.add_invoice %}
<a href="{% url 'invoice_event' event.pk %}" class="btn btn-default" title="Duplicate Rig"><span
class="glyphicon glyphicon-gbp"></span></a>
{% endif %}
</div>
</div>
</div>
@@ -121,6 +125,10 @@
class="glyphicon glyphicon-print"></span></a>
<a href="{% url 'event_duplicate' event.pk %}" class="btn btn-default" title="Duplicate Rig"><span
class="glyphicon glyphicon-duplicate"></span></a>
{% if perms.RIGS.add_invoice %}
<a href="{% url 'invoice_event' event.pk %}" class="btn btn-default" title="Duplicate Rig"><span
class="glyphicon glyphicon-gbp"></span></a>
{% endif %}
</div>
</div>
<div class="col-sm-12">
@@ -145,6 +153,10 @@
class="glyphicon glyphicon-print"></span></a>
<a href="{% url 'event_duplicate' event.pk %}" class="btn btn-default" title="Duplicate Rig"><span
class="glyphicon glyphicon-duplicate"></span></a>
{% if perms.RIGS.add_invoice %}
<a href="{% url 'invoice_event' event.pk %}" class="btn btn-default" title="Duplicate Rig"><span
class="glyphicon glyphicon-gbp"></span></a>
{% endif %}
</div>
<div>Last edited at {{ object.last_edited_at|date:"SHORT_DATETIME_FORMAT" }}
by {{ object.last_edited_by.name }}.

View File

@@ -0,0 +1,70 @@
{% extends 'base.html' %}
{% load paginator from filters %}
{% block title %}Events for Invoice{% endblock %}
{% block content %}
<div class="col-sm-12">
<h2>Events for Invoice</h2>
{% if is_paginated %}
<div class="col-md-6 col-md-offset-6 col-sm-12 text-right">
{% paginator %}
</div>
{% endif %}
<table class="table table-responsive table-hover">
<thead>
<tr>
<th class="hiddenx-xs">#</th>
<th>Date</th>
<th>Event</th>
<th>Client</th>
<th>Cost</th>
<th class="hidden-xs">MIC</th>
<th></th>
</tr>
</thead>
<tbody>
{% for object in object_list %}
<tr class="
{% if event.cancelled %}
active
{% elif event.confirmed and event.mic or not event.is_rig %}
{# interpreated as (booked and mic) or is non rig #}
success
{% elif event.mic %}
warning
{% else %}
danger
{% endif %}
">
<td class="hidden-xs">N{{ object.pk|stringformat:"05d" }}</td>
<td>{{ object.end_date }}</td>
<td>{{ object.name }}</td>
<td>
{% if object.organisation %}
{{ object.organisation.name }}
{% else %}
{{ object.person.name }}
{% endif %}
</td>
<td>{{ object.sum_total|floatformat:2 }}</td>
<td class="text-center">
{{ object.mic.initials }}<br/>
<img src="{{ object.mic.profile_picture }}" class="event-mic-photo"/>
</td>
<td class="text-right">
<a href="{% url 'invoice_event' object.pk %}" class="btn btn-default">
<span class="glyphicon glyphicon-pencil"></span>
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% if is_paginated %}
<div class="col-md-6 col-md-offset-6 col-sm-12 text-right">
{% paginator %}
</div>
{% endif %}
</div>
{% endblock %}

View File

@@ -4,7 +4,17 @@
{% block content %}
<div class="col-sm-12">
<h2>Invoice {{ object.pk }}</h2>
<div class="row">
<div class="col-sm-8">
<h2>Invoice {{ object.pk }}</h2>
</div>
<div class="col-sm-4 text-right">
<a href="{% url 'invoice_void' object.pk %}" class="btn btn-default" title="Void Invoice">
<span class="glyphicon glyphicon-text-background"></span>
</a>
</div>
</div>
<div class="row">
<div class="col-sm-6">

View File

@@ -1,10 +1,16 @@
{% extends 'base.html' %}
{% load paginator from filters %}
{% block title %}Active Invoices{% endblock %}
{% block title %}Invoices{% endblock %}
{% block content %}
<div class="col-sm-12">
<h2>Active Invoices</h2>
<h2>Invoices</h2>
{% if is_paginated %}
<div class="col-md-6 col-md-offset-6 col-sm-12 text-right">
{% paginator %}
</div>
{% endif %}
<table class="table table-responsive table-hover">
<thead>
<tr>
@@ -17,8 +23,8 @@
</thead>
<tbody>
{% for object in object_list %}
<tr>
<td>{{ object.pk }}</td>
<tr class="{% if object.void %}danger{% elif object.balance == 0 %}success{% endif %}">
<td>{{ object.pk }}</td>
<td>{{ object.event }}</td>
<td>{{ object.invoice_date }}</td>
<td>{{ object.balance|floatformat:2 }}</td>
@@ -31,5 +37,10 @@
{% endfor %}
</tbody>
</table>
{% if is_paginated %}
<div class="col-md-6 col-md-offset-6 col-sm-12 text-right">
{% paginator %}
</div>
{% endif %}
</div>
{% endblock %}