Change to just using online auth for internal clients.

This effectively reverts 067e03b.
This commit is contained in:
Tom Price
2017-05-23 18:19:02 +01:00
parent 4d316c7a4a
commit c6b7bbc219
16 changed files with 123 additions and 183 deletions

View File

@@ -71,7 +71,7 @@
</div>
{% endif %}
{% if event.is_rig %}
{% if event.is_rig and event.internal %}
<div class="panel panel-default">
<div class="panel-heading">Client Authorisation</div>
<div class="panel-body">
@@ -183,17 +183,23 @@
{% if event.is_rig %}
<dd>&nbsp;</dd>
<dt>Authorisation Request</dt>
<dd>{{ object.auth_request_to|yesno:"Yes,No" }}</dd>
{% if object.internal %}
<dt>Authorisation Request</dt>
<dd>{{ object.auth_request_to|yesno:"Yes,No" }}</dd>
<dt>By</dt>
<dd>{{ object.auth_request_by }}</dd>
<dt>By</dt>
<dd>{{ object.auth_request_by }}</dd>
<dt>At</dt>
<dd>{{ object.auth_request_at|date:"D d M Y H:i"|default:"" }}</dd>
<dt>At</dt>
<dd>{{ object.auth_request_at|date:"D d M Y H:i"|default:"" }}</dd>
<dt>To</dt>
<dd>{{ object.auth_request_to }}</dd>
<dt>To</dt>
<dd>{{ object.auth_request_to }}</dd>
{% else %}
<dt>PO</dt>
<dd>{{ object.purchase_order }}</dd>
{% endif %}
{% endif %}
</dl>
</div>

View File

@@ -11,29 +11,32 @@
class="glyphicon glyphicon-duplicate"></span> <span
class="hidden-xs">Duplicate</span></a>
{% if event.is_rig %}
<a class="btn btn-default item-add modal-href event-authorise-request
{% if event.authorised %}
btn-success
{% elif event.authorisation and event.authorisation.amount != event.total and event.authorisation.last_edited_at > event.auth_request_at %}
btn-warning
{% elif event.auth_request_to %}
btn-info
{% endif %}
"
href="{% url 'event_authorise_request' object.pk %}">
<span class="glyphicon glyphicon-send"></span>
<span class="hidden-xs">
{% if event.authorised %}
Authorised
{% elif event.authorisation and event.authorisation.amount != event.total and event.authorisation.last_edited_at > event.auth_request_at %}
Authorisation Issue
{% elif event.auth_request_to %}
Awaiting Authorisation
{% else %}
Request Authorisation
{% endif %}
</span>
</a>
{% if event.internal %}
<a class="btn btn-default item-add modal-href event-authorise-request
{% if event.authorised %}
btn-success
{% elif event.authorisation and event.authorisation.amount != event.total and event.authorisation.last_edited_at > event.auth_request_at %}
btn-warning
{% elif event.auth_request_to %}
btn-info
{% endif %}
"
href="{% url 'event_authorise_request' object.pk %}">
<span class="glyphicon glyphicon-send"></span>
<span class="hidden-xs">
{% if event.authorised %}
Authorised
{% elif event.authorisation and event.authorisation.amount != event.total and event.authorisation.last_edited_at > event.auth_request_at %}
Authorisation Issue
{% elif event.auth_request_to %}
Awaiting Authorisation
{% else %}
Request Authorisation
{% endif %}
</span>
</a>
{% endif %}
{% if perms.RIGS.add_invoice %}
<a id="invoiceDropdownLabel" href="{% url 'invoice_event' event.pk %}" class="btn
{% if event.invoice and event.invoice.is_closed %}

View File

@@ -398,6 +398,15 @@
{% render_field form.collector class+="form-control" %}
</div>
</div>
<div class="form-group" data-toggle="tooltip" title="The purchase order number (for external clients)">
<label for="{{ form.purchase_order.id_for_label }}"
class="col-sm-4 control-label">{{ form.purchase_order.label }}</label>
<div class="col-sm-8">
{% render_field form.purchase_order class+="form-control" %}
</div>
</div>
</div>
</div>
</div>

View File

@@ -61,21 +61,14 @@
{% endif %}
</td>
<td>
{% if object.organisation %}
{{ object.organisation.name }}
<br>
<span class="text-muted">{{ object.organisation.union_account|yesno:'Internal,External' }}</span>
{% else %}
{{ object.person.name }}
<br>
<span class="text-muted">External</span>
{% endif %}
{{ object.organisation.name }}
<br>
<span class="text-muted">{{ object.internal|yesno:'Internal,External' }}</span>
</td>
<td>
{{ object.sum_total|floatformat:2 }}
<br />
<span class="text-muted">{{ object.authorisation.po }}</span>
<span class="text-muted">{% if not object.internal %}{{ object.purchase_order }}{% endif %}</span>
</td>
<td class="text-center">
{% if object.mic %}
@@ -86,7 +79,10 @@
{% endif %}
</td>
<td class="text-right">
<a href="{% url 'invoice_event' object.pk %}" class="btn btn-default" data-toggle="tooltip" title="'Invoice' this event - click this when paperwork has been sent to treasury">
<a href="{% url 'invoice_event' object.pk %}"
class="btn btn-default"
data-toggle="tooltip"
title="'Invoice' this event - click this when paperwork has been sent to treasury">
<span class="glyphicon glyphicon-gbp"></span>
</a>
</td>

View File

@@ -249,13 +249,12 @@
<tr>
<td>
{% if object.authorised %}
<para>
Event authorised online by {{ object.authorisation.name }} ({{ object.authorisation.email }}) at
{{ object.authorisation.last_edited_at }}.
</para>
{% if object.internal and object.authorised %}
<para>
Event authorised online by {{ object.authorisation.name }} ({{ object.authorisation.email }}) at
{{ object.authorisation.last_edited_at }}.
</para>
{% if object.organisation.union_account %}
<blockTable colWidths="165,165,165">
<tr>
<td><para><b>University ID</b></para></td>
@@ -268,19 +267,18 @@
<td>£ {{ object.authorisation.amount|floatformat:2 }}</td>
</tr>
</blockTable>
{% else %}
{% elif not object.internal and object.purchase_order %}
<blockTable colWidths="247,248">
<tr>
<td></td>
<td><para><b>Purchase Order</b></para></td>
<td><para><b>Authorised Amount</b></para></td>
</tr>
<tr>
<td>{{ object.authorisation.po }}</td>
<td>£ {{ object.authorisation.amount|floatformat:2 }}</td>
<td></td>
<td>{{ object.purchase_order }}</td>
</tr>
</blockTable>
{% endif %}
{% endif %}
</td>
</tr>
</blockTable>

View File

@@ -9,11 +9,11 @@
$('[data-toggle="tooltip"]').tooltip();
});
$('form').on('submit', function() {
$('#loading-modal').modal({
backdrop: 'static',
show: true
});
$('form').on('submit', function () {
$('#loading-modal').modal({
backdrop: 'static',
show: true
});
});
</script>
{% endblock %}
@@ -54,17 +54,15 @@
{% csrf_token %}
{% include 'form_errors.html' %}
<div class="row">
{% if internal %}
<div class="col-sm-12">
<p>
I agree that I am authorised to approve this event. I agree that I am the
<strong>President/Treasurer or account holder</strong> of the hirer, or that I
have the written permission of the
<strong>President/Treasurer or account holder</strong> of the hirer stating that
I can authorise this event.
</p>
</div>
{% endif %}
<div class="col-sm-12">
<p>
I agree that I am authorised to approve this event. I agree that I am the
<strong>President/Treasurer or account holder</strong> of the hirer, or that I
have the written permission of the
<strong>President/Treasurer or account holder</strong> of the hirer stating that
I can authorise this event.
</p>
</div>
<div class="col-sm-12 col-md-6">
<div class="col-sm-12 form-group" data-toggle="tooltip"
@@ -77,38 +75,25 @@
</div>
</div>
{% if internal %}
<div class="col-sm-12 form-group" data-toggle="tooltip"
title="Your Student ID or Staff username as the person authorising the event.">
<label for="{{ form.uni_id.id_for_label }}"
class="col-sm-4 control-label">{{ form.uni_id.label }}</label>
<div class="col-sm-8">
{% render_field form.uni_id class+="form-control" %}
</div>
<div class="col-sm-12 form-group" data-toggle="tooltip"
title="Your Student ID or Staff username as the person authorising the event.">
<label for="{{ form.uni_id.id_for_label }}"
class="col-sm-4 control-label">{{ form.uni_id.label }}</label>
<div class="col-sm-8">
{% render_field form.uni_id class+="form-control" %}
</div>
{% endif %}
</div>
</div>
<div class="col-sm-12 col-md-6">
{% if internal %}
<div class="col-sm-12 form-group" data-toggle="tooltip"
title="The Students' Union account code you wish this event to be charged to.">
<label for="{{ form.account_code.id_for_label }}"
class="col-sm-4 control-label">{{ form.account_code.label }}</label>
<div class="col-sm-8">
{% render_field form.account_code class+="form-control" %}
</div>
<div class="col-sm-12 form-group" data-toggle="tooltip"
title="The Students' Union account code you wish this event to be charged to.">
<label for="{{ form.account_code.id_for_label }}"
class="col-sm-4 control-label">{{ form.account_code.label }}</label>
<div class="col-sm-8">
{% render_field form.account_code class+="form-control" %}
</div>
{% else %}
<div class="col-sm-12 form-group" data-toggle="tooltip"
title="Your Purchase Order reference for this event.">
<label for="{{ form.po.id_for_label }}"
class="col-sm-4 control-label">{{ form.po.label }}</label>
<div class="col-sm-8">
{% render_field form.po class+="form-control" %}
</div>
</div>
{% endif %}
</div>
<div class="col-sm-12 form-group" data-toggle="tooltip"
title="The full amount chargable for this event as displayed above, including VAT.">

View File

@@ -49,13 +49,8 @@
<div class="col-sm-12 col-md-6">
<dl class="dl-horizontal">
{% if internal %}
<dt>Account code</dt>
<dd>{{ object.account_code }}</dd>
{% else %}
<dt>PO</dt>
<dd>{{ object.po }}</dd>
{% endif %}
<dt>Account code</dt>
<dd>{{ object.account_code }}</dd>
<dt>Authorised amount</dt>
<dd>£ {{ object.amount|floatformat:2 }}</dd>

View File

@@ -89,7 +89,7 @@
{% endif %}
</dd>
{% if object.event.organisation.union_account %}
{% if object.event.internal %}
{# internal #}
<dt>Uni ID</dt>
<dd>{{ object.event.authorisation.uni_id }}</dd>
@@ -98,7 +98,7 @@
<dd>{{ object.event.authorisation.account_code }}</dd>
{% else %}
<dt>PO</dt>
<dd>{{ object.event.authorisation.po }}</dd>
<dd>{{ object.event.purchase_order }}</dd>
{% endif %}
<dt>Authorised at</dt>

View File

@@ -50,7 +50,7 @@
<td>{% if object.event.organisation %}
{{ object.event.organisation.name }}
<br>
<span class="text-muted">{{ object.event.organisation.union_account|yesno:'Internal,External' }}</span>
<span class="text-muted">{{ object.event.internal|yesno:'Internal,External' }}</span>
{% else %}
{{ object.event.person.name }}
<br>
@@ -62,7 +62,7 @@
<td>
{{ object.balance|floatformat:2 }}
<br />
<span class="text-muted">{{ object.event.authorisation.po }}</span>
<span class="text-muted">{{ object.event.purchase_order }}</span>
</td>
<td class="text-right">
<a href="{% url 'invoice_detail' object.pk %}" class="btn btn-default">