diff --git a/RIGS/templates/RIGS/event_detail.html b/RIGS/templates/RIGS/event_detail.html index 92d97e46..22f8aa4a 100644 --- a/RIGS/templates/RIGS/event_detail.html +++ b/RIGS/templates/RIGS/event_detail.html @@ -13,7 +13,7 @@
{% include 'RIGS/event_detail_buttons.html' %}
- + {% endif %} {% if object.is_rig %} {# only need contact details for a rig #} @@ -148,8 +148,33 @@ {% endif %} {% if event.is_rig %} -
PO
-
{{ object.purchase_order }}
+ {% if object.purchase_order %} +
PO
+
{{ object.purchase_order }}
+ {% endif %} + +
 
+ +
Authorised
+
{{ object.authorised|yesno:"Yes,No" }}
+ +
Authorised by
+
+ {% if object.authorised %} + {{ object.authorisation.name }} + ({{ object.authorisation.email }}) + {% endif %} +
+ +
Authorised at
+
{{ object.authorisation.last_edited_at }}
+ +
Authorised amount
+
+ {% if object.authorised %} + £ {{ object.authorisation.amount|floatformat:"2" }} + {% endif %} +
{% endif %} diff --git a/RIGS/templates/RIGS/event_form.html b/RIGS/templates/RIGS/event_form.html index b2b4dcd7..71e91fe6 100644 --- a/RIGS/templates/RIGS/event_form.html +++ b/RIGS/templates/RIGS/event_form.html @@ -398,14 +398,6 @@ {% render_field form.collector class+="form-control" %} -
- - -
- {% render_field form.purchase_order class+="form-control" %} -
-
diff --git a/RIGS/templates/RIGS/event_invoice.html b/RIGS/templates/RIGS/event_invoice.html index fcbe5e87..71136b35 100644 --- a/RIGS/templates/RIGS/event_invoice.html +++ b/RIGS/templates/RIGS/event_invoice.html @@ -54,7 +54,12 @@ N{{ object.pk|stringformat:"05d" }}
{{ object.get_status_display }} {{ object.start_date }} - {{ object.name }} + + {{ object.name }} + {% if object.is_rig and perms.RIGS.view_event and object.authorised %} + + {% endif %} + {% if object.organisation %} {{ object.organisation.name }} @@ -67,7 +72,11 @@ {% endif %} - {{ object.sum_total|floatformat:2 }} + + {{ object.sum_total|floatformat:2 }} +
+ {{ object.authorisation.po }} + {% if object.mic %} {{ object.mic.initials }}
@@ -92,4 +101,4 @@ {% endif %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/RIGS/templates/RIGS/event_table.html b/RIGS/templates/RIGS/event_table.html index 949c710a..c84b6624 100644 --- a/RIGS/templates/RIGS/event_table.html +++ b/RIGS/templates/RIGS/event_table.html @@ -33,13 +33,18 @@

- {{ event.name }} + + {{ event.name }} + {% if event.venue %} at {{ event.venue }} {% endif %} {% if event.dry_hire %} Dry Hire {% endif %} + {% if event.is_rig and perms.RIGS.view_event and event.authorised %} + + {% endif %}

{% if event.is_rig and not event.cancelled %}
@@ -99,4 +104,4 @@ {% endfor %} - \ No newline at end of file + diff --git a/RIGS/templates/RIGS/invoice_detail.html b/RIGS/templates/RIGS/invoice_detail.html index cfcfcfe9..d45deeda 100644 --- a/RIGS/templates/RIGS/invoice_detail.html +++ b/RIGS/templates/RIGS/invoice_detail.html @@ -76,8 +76,45 @@
{{ object.checked_in_by.name }}
{% endif %} -
PO
-
{{ object.event.purchase_order }}
+ {% if object.event.purchase_order %} +
PO
+
{{ object.event.purchase_order }}
+ {% endif %} + +
 
+ +
Authorised
+
{{ object.event.authorised|yesno:"Yes,No" }}
+ +
Authorised by
+
+ {% if object.event.authorised %} + {{ object.event.authorisation.name }} + ({{ object.event.authorisation.email }}) + {% endif %} +
+ + {% if object.event.organisation.union_account %} + {# internal #} +
Uni ID
+
{{ object.event.authorisation.uni_id }}
+ +
Account code
+
{{ object.event.authorisation.account_code }}
+ {% else %} +
PO
+
{{ object.event.authorisation.po }}
+ {% endif %} + +
Authorised at
+
{{ object.event.authorisation.last_edited_at }}
+ +
Authorised amount
+
+ {% if object.event.authorised %} + £ {{ object.event.authorisation.amount|floatformat:"2" }} + {% endif %} +
@@ -139,4 +176,4 @@ -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/RIGS/templates/RIGS/invoice_list.html b/RIGS/templates/RIGS/invoice_list.html index 2f34b6c9..62012238 100644 --- a/RIGS/templates/RIGS/invoice_list.html +++ b/RIGS/templates/RIGS/invoice_list.html @@ -59,7 +59,11 @@ {{ object.event.start_date }} {{ object.invoice_date }} - {{ object.balance|floatformat:2 }} + + {{ object.balance|floatformat:2 }} +
+ {{ object.event.authorisation.po }} + @@ -76,4 +80,4 @@ {% endif %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/RIGS/urls.py b/RIGS/urls.py index 93a95e6d..2b4c716d 100644 --- a/RIGS/urls.py +++ b/RIGS/urls.py @@ -115,14 +115,6 @@ urlpatterns = patterns('', permission_required_with_403('RIGS.view_event')(versioning.VersionHistory.as_view()), name='event_history', kwargs={'model': models.Event}), - url(r'^event/(?P\d+)/auth/$', - permission_required_with_403('RIGS.change_event')( - rigboard.EventAuthorisationRequest.as_view() - ), - name='event_authorise_request'), - url(r'^event/(?P\d+)/(?P[-:\w]+)/$', rigboard.EventAuthorise.as_view(), - name='event_authorise'), - # Finance url(r'^invoice/$', permission_required_with_403('RIGS.view_invoice')(finance.InvoiceIndex.as_view()), @@ -157,6 +149,15 @@ urlpatterns = patterns('', permission_required_with_403('RIGS.add_payment')(finance.PaymentDelete.as_view()), name='payment_delete'), + # Client event authorisation + url(r'^event/(?P\d+)/auth/$', + permission_required_with_403('RIGS.change_event')( + rigboard.EventAuthorisationRequest.as_view() + ), + name='event_authorise_request'), + url(r'^event/(?P\d+)/(?P[-:\w]+)/$', rigboard.EventAuthorise.as_view(), + name='event_authorise'), + # User editing url(r'^user/$', login_required(views.ProfileDetail.as_view()), name='profile_detail'), url(r'^user/(?P\d+)/$',