From 4560be158a58907cd5097cfbc99ad7360ece7825 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Thu, 23 Apr 2015 23:58:54 +0100 Subject: [PATCH] Added PO field to event form --- RIGS/forms.py | 2 +- RIGS/models.py | 2 +- RIGS/templates/RIGS/event_detail.html | 5 +++++ RIGS/templates/RIGS/event_form.html | 8 ++++++++ RIGS/templates/RIGS/invoice_detail.html | 2 +- 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/RIGS/forms.py b/RIGS/forms.py index 640a2a15..3f38f9d5 100644 --- a/RIGS/forms.py +++ b/RIGS/forms.py @@ -116,4 +116,4 @@ class EventForm(forms.ModelForm): fields = ['is_rig', 'name', 'venue', 'start_time', 'end_date', 'start_date', 'end_time', 'meet_at', 'access_at', 'description', 'notes', 'mic', 'person', 'organisation', 'dry_hire', 'checked_in_by', 'status', - 'collector',] + 'collector','purchase_order'] diff --git a/RIGS/models.py b/RIGS/models.py index 641aeab9..524cc338 100644 --- a/RIGS/models.py +++ b/RIGS/models.py @@ -255,7 +255,7 @@ class Event(models.Model, RevisionMixin): # Monies payment_method = models.CharField(max_length=255, blank=True, null=True) payment_received = models.CharField(max_length=255, blank=True, null=True) - purchase_order = models.CharField(max_length=255, blank=True, null=True) + purchase_order = models.CharField(max_length=255, blank=True, null=True, verbose_name='Purchase Order') collector = models.CharField(max_length=255, blank=True, null=True, verbose_name='Collected By') # Calculated values diff --git a/RIGS/templates/RIGS/event_detail.html b/RIGS/templates/RIGS/event_detail.html index d2e57352..fe5a70fa 100644 --- a/RIGS/templates/RIGS/event_detail.html +++ b/RIGS/templates/RIGS/event_detail.html @@ -157,6 +157,11 @@
Collected By
{{ object.collector }}
{% endif %} + + {% if event.is_rig %} +
Purchase Order
+
{{ object.purchase_order }}
+ {% endif %} diff --git a/RIGS/templates/RIGS/event_form.html b/RIGS/templates/RIGS/event_form.html index 8a691b91..6eb8dc41 100644 --- a/RIGS/templates/RIGS/event_form.html +++ b/RIGS/templates/RIGS/event_form.html @@ -363,6 +363,14 @@ {% render_field form.collector class+="form-control" %} +
+ + +
+ {% render_field form.purchase_order class+="form-control" %} +
+
diff --git a/RIGS/templates/RIGS/invoice_detail.html b/RIGS/templates/RIGS/invoice_detail.html index 38dd4c97..a36b08b1 100644 --- a/RIGS/templates/RIGS/invoice_detail.html +++ b/RIGS/templates/RIGS/invoice_detail.html @@ -57,7 +57,7 @@
{{ object.checked_in_by.name }}
{% endif %} -
PO
+
Purchase Order
{{ object.event.purchase_order }}