diff --git a/RIGS/models.py b/RIGS/models.py index 4dd560c7..415bcd5d 100644 --- a/RIGS/models.py +++ b/RIGS/models.py @@ -943,6 +943,10 @@ class PowerTestRecord(ReviewableModel, RevisionMixin): def activity_feed_string(self): return str(self.event) + @property + def name(self): + return f"Power Test Record - {self.event}" + class EventCheckIn(models.Model): event = models.ForeignKey('Event', related_name='crew', on_delete=models.CASCADE) diff --git a/RIGS/templates/base_print.xml b/RIGS/templates/base_print.xml index 678c354f..27bc4a6f 100644 --- a/RIGS/templates/base_print.xml +++ b/RIGS/templates/base_print.xml @@ -22,6 +22,9 @@ + {% block extrastyles %} + {% endblock %} + @@ -137,6 +140,7 @@ {% block content %} {% endblock %} + diff --git a/RIGS/templates/hs/power_detail.html b/RIGS/templates/hs/power_detail.html index e6637bbd..f130ddad 100644 --- a/RIGS/templates/hs/power_detail.html +++ b/RIGS/templates/hs/power_detail.html @@ -165,6 +165,7 @@
+{% button 'print' 'pt_print' object.pk %} {% button 'edit' url='pt_edit' pk=object.pk %} {% button 'view' url='event_detail' pk=object.event.pk text="Event" %} {% include 'partials/review_status.html' with perm=perms.RIGS.review_power review='pt_review' %} diff --git a/RIGS/templates/hs/power_print.xml b/RIGS/templates/hs/power_print.xml new file mode 100644 index 00000000..1595f470 --- /dev/null +++ b/RIGS/templates/hs/power_print.xml @@ -0,0 +1,170 @@ +{% extends 'base_print.xml' %} +{% load filters %} + +{% block extrastyles %} + + + + + + + + + + +{% endblock %} + +{% block content %} + +

Power Test Record for {{ object.event }}

+ +

Client: {{ object.event.person|default:object.event.organisation }} | Venue: {{ object.event.venue }} | MIC: {{ object.event.mic }}

+ +
+ +{% if object.reviewed_by %} + Reviewed by: {{ object.reviewed_by }} at {{ object.reviewed_at|date:"D d/m/Y" }} +{% else %} + Power test results not yet reviewed +{% endif %} + +
+ + +

Power Plan Information

+ + + + + Power MIC: {{ object.power_mic }} + Venue: {{ object.event.venue }} + + + + Event Date: {{ object.event.start_date |date:"D d/m/Y" }} + Generators: {{ object.event.riskassessment.generators|yesno|capfirst }} + + + Power Test taken at: {{ object.date_created|date:"D d/m/Y H:i" }} + Other Companies Power: {{ object.event.riskassessment.other_companies_power|yesno|capfirst }} + + + + +
+ + + + +

Power Test Results

+ + +Source RCD protected? {{ object.source_rcd|yesno|capfirst }} +(If cable is more than 3 metres long) + + + +Appropriate and clear labelling on distribution and cabling? {{ object.labelling|yesno|capfirst }} + + + +Equipment appropriately earthed? {{ object.source_rcd|yesno|capfirst }} +(truss, stage, generators etc.) + + + +All equipment in PAT period? {{ object.pat|yesno|capfirst }} + + + +

Tests at first distro

+ + + + +Voltage
(cube meter) / V
+ + + + L1 - N + L2 - N + L3 - N + + + {{ object.fd_voltage_l1}} + {{ object.fd_voltage_l2}} + {{ object.fd_voltage_l3}} + + + + +
+ + + + + + Phase Rotation
(if required)
+ {{ object.fd_phase_rotation|yesno|capfirst }} + Earth Fault Loop Impedance (Zs) / Ω + {{ object.fd_earth_fault }} + +
+ + + +Prospective Short Circuit Current / A {{ object.fd_pssc }} + + + +

Tests 'Worst Case' points (at least 1 required)

+ + + + + Description + Polarity checked? + Voltage / V + Earth Fault Loop Impedance (Zs) / Ω + + {% if object.w1_description %} + + {{ object.w1_description }} + {{ object.w1_polarity|yesno|capfirst }} + {{ object.w1_voltage }} V + {{ object.w1_earth_fault }} + + {% endif %} + {% if object.w2_description %} + + {{ object.w2_description }} + {{ object.w2_polarity|yesno|capfirst }} + {{ object.w2_voltage }} V + {{ object.w2_earth_fault }} + + {% endif %} + {% if object.w3_description %} + + {{ object.w3_description }} + {{ object.w3_polarity|yesno|capfirst }} + {{ object.w3_voltage }} V + {{ object.w3_earth_fault }} + + {% endif %} + + + +

Generic Tests

+ + + + + All circuit RCDs tested?
(using test button)
+ {{ object.all_rcds_tested|yesno|capfirst }} + + + Public/performer accessible circuits tested?
(using socket tester)
+ {{ object.public_sockets_tested|yesno|capfirst }} + +
+{% endblock %} diff --git a/RIGS/urls.py b/RIGS/urls.py index 8793b741..5c263c48 100644 --- a/RIGS/urls.py +++ b/RIGS/urls.py @@ -100,6 +100,7 @@ urlpatterns = [ name='pt_edit'), path('event/power//review/', permission_required_with_403('RIGS.review_power')(views.MarkReviewed.as_view()), name='pt_review', kwargs={'model': 'PowerTestRecord'}), + path('event/power//print/', permission_required_with_403('RIGS.view_powertestrecord')(views.PowerPrint.as_view()), name='pt_print'), path('event//checkin/', login_required(views.EventCheckIn.as_view()), name='event_checkin'), diff --git a/RIGS/views/hs.py b/RIGS/views/hs.py index fd97dfd7..931bc708 100644 --- a/RIGS/views/hs.py +++ b/RIGS/views/hs.py @@ -232,6 +232,16 @@ class RAPrint(PrintView): return context +class PowerPrint(PrintView): + model = models.PowerTestRecord + template_name = 'hs/power_print.xml' + + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context['filename'] = f"PowerTestRecord_for_{context['object'].event.display_id}.pdf" + return context + + class EventCheckIn(generic.CreateView, ModalURLMixin): model = models.EventCheckIn template_name = 'hs/eventcheckin_form.html'