New paperwork design

This commit is contained in:
David Taylor
2015-04-21 19:24:49 +01:00
parent 3884519bb1
commit 4d31f445be
2 changed files with 153 additions and 144 deletions

View File

@@ -1,48 +1,54 @@
<?xml version="1.0" encoding="UTF-8" ?>
{% load multiply from filters %}
{% load static %}
<!DOCTYPE document SYSTEM "rml.dtd">
<document filename="Event {{ object.id }} - {{ object.name }} - {{ object.start_date }}.pdf">
<docinit>
<registerTTFont faceName="OpenSans" fileName="{{ fonts.opensans.regular }}"/>
<registerTTFont faceName="OpenSans-Bold" fileName="{{ fonts.opensans.bold }}"/>
<registerFontFamily name="OpenSans" bold="OpenSans-Bold" boldItalic="OpenSans-BoldItalic"/>
<registerFontFamily name="OpenSans" bold="OpenSans-Bold" boldItalic="OpenSans-Bold"/>
</docinit>
<stylesheet>
<initialize>
<color id="LightGray" RGB="#D3D3D3"/>
<color id="DarkGray" RGB="#707070"/>
</initialize>
<paraStyle name="style.para" fontName="OpenSans"/>
<paraStyle name="style.para" fontName="OpenSans" />
<paraStyle name="blockPara" spaceAfter="5" spaceBefore="5"/>
<paraStyle name="style.Heading1" fontName="OpenSans" fontSize="14" leading="10" spaceAfter="10"/>
<paraStyle name="style.Heading2" fontName="OpenSans-Bold" fontSize="12" spaceAfter="5"/>
<paraStyle name="style.Heading3" fontName="OpenSans" fontSize="11" spaceAfter="5"/>
<paraStyle name="style.Heading1" fontName="OpenSans" fontSize="16" leading="18" spaceAfter="0"/>
<paraStyle name="style.Heading2" fontName="OpenSans-Bold" fontSize="10" spaceAfter="2"/>
<paraStyle name="style.Heading3" fontName="OpenSans" fontSize="10" spaceAfter="0"/>
<paraStyle name="center" alignment="center"/>
<blockTableStyle id="headerTable">
<blockFont name="OpenSans-Bold"/>
<blockAlignment value="left"/>
<blockLeftPadding start="0,0" stop="0,0" length="0"/>
<blockBackground start="1,0" stop="1,0" colorName="LightGray"/>
<blockBackground start="3,0" stop="3,0" colorName="LightGray"/>
<lineStyle kind="box" start="1,0" stop="1,0" colorName="black"/>
<lineStyle kind="box" start="3,0" stop="3,0" colorName="black"/>
<paraStyle name="style.event_description" fontName="OpenSans" textColor="DarkGray" />
<paraStyle name="style.item_description" fontName="OpenSans" textColor="DarkGray" leftIndent="10" />
<paraStyle name="style.specific_description" fontName="OpenSans" textColor="DarkGray" fontSize="10" />
<paraStyle name="style.times" fontName="OpenSans" fontSize="10" />
<blockTableStyle id="eventSpecifics">
<blockValign value="top"/>
<lineStyle kind="LINEAFTER" colorName="LightGrey" start="0,0" stop="1,0" thickness="1"/>
</blockTableStyle>
<blockTableStyle id="eventDetails">
<blockValign value="top"/>
<blockTopPadding start="0,0" stop="-1,0" length="0"/>
<blockLeftPadding start="0,0" stop="0,-1" length="0"/>
</blockTableStyle>
<blockTableStyle id="itemTable">
<blockValign value="top"/>
<lineStyle kind="grid" colorName="black" thickness="1" start="0,0" stop="-1,-1"/>
<lineStyle kind="LINEBELOW" colorName="LightGrey" start="0,0" stop="-1,-1" thickness="1"/>
{#<lineStyle kind="box" colorName="black" thickness="1" start="0,0" stop="-1,-1"/>#}
</blockTableStyle>
<blockTableStyle id="totalTable">
<blockLeftPadding start="0,0" stop="0,-1" length="0"/>
<lineStyle cap="default" kind="grid" colorName="black" thickness="1" start="1,0" stop="-1,-1"/>
<lineStyle kind="LINEBELOW" colorName="LightGrey" start="-2,0" stop="-1,-1" thickness="1"/>
{# <lineStyle cap="default" kind="grid" colorName="black" thickness="1" start="1,0" stop="-1,-1"/> #}
</blockTableStyle>
<blockTableStyle id="infoTable" keepWithNext="true">
@@ -65,8 +71,8 @@
</blockTableStyle>
</stylesheet>
<template> {# Note: page is 595x842 points (1 point=1/72in) #}
<pageTemplate id="Headed">
<template > {# Note: page is 595x842 points (1 point=1/72in) #}
<pageTemplate id="Headed" >
<pageGraphics>
<image file="RIGS/static/imgs/paperwork/corner.jpg" x="395" y="642" height="200" width="200"/>
@@ -84,23 +90,19 @@
<setFont name="OpenSans" size="10"/>
<setFont name="OpenSans" size="10" />
<drawCenteredString x="302.5" y="50">[{{ copy }} Copy]</drawCenteredString>
<drawCenteredString x="302.5" y="38">[Page <pageNumber/> of <getName id="lastPage" default="0" />]</drawCenteredString>
</pageGraphics>
<frame id="jobDetails" x1="50" y1="682" width="495" height="20"/>
<frame id="client" x1="50" y1="560" width="150" height="120" topPadding="5"
rightPadding="5" bottomPadding="5" leftPadding="5"/>
<frame id="venue" x1="221" y1="560" width="150" height="120" topPadding="5"
rightPadding="5" bottomPadding="5" leftPadding="5"/>
<frame id="event" x1="395" y1="560" width="150" height="120" topPadding="5"
rightPadding="5" bottomPadding="5" leftPadding="5"/>
<frame id="main" x1="50" y1="65" width="495" height="502"/>
<frame id="main" x1="50" y1="65" width="495" height="645"/>
</pageTemplate>
<pageTemplate id="Main">
<pageGraphics>
<setFont name="OpenSans" size="10"/>
<drawCenteredString x="302.5" y="50">[{{ copy }} Copy]</drawCenteredString>
<drawCenteredString x="302.5" y="38">[Page <pageNumber/> of <getName id="lastPage" default="0" />]</drawCenteredString>
</pageGraphics>
<frame id="main" x1="50" y1="65" width="495" height="727"/>
</pageTemplate>

View File

@@ -1,85 +1,93 @@
<setNextFrame name="jobDetails"/>
<nextFrame/>
<blockTable style="headerTable" colWidths="123,124,123,123">
<tr>
<td>Event Date:</td>
<td>{{ object.start_date }}</td>
<td>JOB NUMBER:</td>
<td>N{{ object.pk|stringformat:"05d" }}</td>
</tr>
</blockTable>
<setNextFrame name="client"/>
<nextFrame/>
<keepInFrame>
<h2>Hirer</h2>
<h3>{{ object.person.name }}</h3>
<h3>{{ object.organisation.name|default_if_none:"" }}</h3>
{% if object.person.phone %}
<para>Tel: {{ object.person.phone }}</para>
{% elif object.organisation.phone %}
<para>Tel: {{ object.organisation.phone }}</para>
{% endif %}
{% if object.person.email %}
<para>Email: {{ object.person.email }}</para>
{% elif object.organisation.email %}
<para>Email: {{ object.organisation.email }}</para>
{% endif %}
</keepInFrame>
<setNextFrame name="venue"/>
<nextFrame/>
<keepInFrame>
<h2>Venue</h2>
<h3>{{ object.venue.name }}</h3>
<para>{{ object.venue.address|default_if_none:""|linebreaks }}</para>
</keepInFrame>
<setNextFrame name="event"/>
<nextFrame/>
<h2>Event Details</h2>
<blockTable style="eventDetails" colWidths="75,75">
<tr>
<td>Start Time</td>
<td>
<para>{{ object.start_time|time:"H:i" }}
<br/>
{{ object.start_date|date:"(d/m/Y)" }}
</para>
</td>
</tr>
<tr>
<td>End Time</td>
<td>
<para>{{ object.end_time|time:"H:i" }}
<br/>
{{ object.end_date|date:"(d/m/Y)" }}
</para>
</td>
</tr>
<tr>
<td>Earliest Access</td>
<td>
<para>{{ object.access_at|time:"H:i" }}
<br/>
{{ object.access_at|date:"d/m/Y" }}
</para>
</td>
</tr>
</blockTable>
<setNextTemplate name="Main"/>
<setNextFrame name="main"/>
<nextFrame/>
<h1><b>N{{ object.pk|stringformat:"05d" }}:</b> '{{ object.name }}'<small></small></h1>
<para style="style.event_description">
<b>{{object.start_date|date:"D jS N Y"}}</b>
</para>
<keepInFrame maxHeight="30">
<para style="style.event_description">
{{ object.description|default_if_none:""|linebreaks }}
</para>
</keepInFrame>
<spacer length="15"/>
<blockTable style="eventSpecifics" colWidths="165,165,165">
<tr>
<td leftPadding="0">
<h2>Hirer</h2>
<h3>{{ object.person.name }}</h3>
<h3>{{ object.organisation.name|default_if_none:"" }}</h3>
<keepInFrame>
{% if object.person.phone %}
<para style="specific_description">{{ object.person.phone }}</para>
{% elif object.organisation.phone %}
<para style="specific_description">{{ object.organisation.phone }}</para>
{% endif %}
</keepInFrame>
<keepInFrame>
{% if object.person.email %}
<para style="specific_description">{{ object.person.email }}</para>
{% elif object.organisation.email %}
<para style="specific_description">{{ object.organisation.email }}</para>
{% endif %}
</keepInFrame>
</td>
<td>
<h2>Venue</h2>
<h3>{{ object.venue.name }}</h3>
<keepInFrame>
<para style="specific_description">{{ object.venue.address|default_if_none:""|linebreaks }}</para>
</keepInFrame>
</td>
<td rightPadding="0">
<h2>Timings</h2>
<blockTable style="eventDetails" colWidths="55,75">
<tr>
<td leftPadding="0" topPadding="0"><h3>Start</h3></td>
<td>
<para style="times">{{ object.start_time|time:"H:i" }}
{{ object.start_date|date:"d/m/Y" }}
</para>
</td>
</tr>
<tr>
<td leftPadding="0"><h3>End</h3></td>
<td>
<para style="times">{{ object.end_time|default_if_none:""|time:"H:i" }}
{{ object.end_date|date:"d/m/Y" }}
</para>
</td>
</tr>
{% if object.access_at %}
<tr>
<td leftPadding="0"><h3>Access</h3></td>
<td>
<para style="times">{{ object.access_at|time:"H:i" }}
{{ object.access_at|date:"d/m/Y" }}
</para>
</td>
</tr>
{% endif %}
</blockTable>
</td>
</tr>
</blockTable>
<spacer length="15"/>
<setNextTemplate name="Main"/>
<blockTable style="itemTable" colWidths="300,80,35,80">
<tr>
{# Bold tags need to be in a para in order to render in reportlab #}
<td>
<para>
<b>Equipment Details</b>
<b>Item</b>
</para>
</td>
<td>
@@ -103,8 +111,11 @@
<td>
<para>{{ item.name }}
{% if item.description %}
<br/>
</para>
<para style="item_description">
<em>{{ item.description|linebreaks }}</em>
</para>
<para>
{% endif %}
</para>
</td>
@@ -114,36 +125,38 @@
</tr>
{% endfor %}
</blockTable>
<blockTable style="totalTable" colWidths="300,115,80">
<tr>
<td>VAT may be charged at the current rate date of event ({{ object.vat_rate.as_percent|floatformat:2 }}%)</td>
<td>Sum-total</td>
<td>£ {{ object.sum_total|floatformat:2 }}</td>
</tr>
<tr>
<td>VAT Registration Number: 116252989</td>
<td>VAT @ {{ object.vat_rate.as_percent|floatformat:2 }}%</td>
<td>£ {{ object.vat|floatformat:2 }}</td>
</tr>
<tr>
<td>
<para>
<b>The full hire fee is payable at least 10 days before the event.</b>
</para>
</td>
<td>
<para>
<b>Total</b>
</para>
</td>
<td>
<para>
<b>£ {{ object.total|floatformat:2 }}</b>
</para>
</td>
</tr>
</blockTable>
<keepTogether>
<blockTable style="totalTable" colWidths="300,115,80">
<tr>
<td>VAT may be charged at the current rate date of event ({{ object.vat_rate.as_percent|floatformat:2 }}%)</td>
<td>Total (ex. VAT)</td>
<td>£ {{ object.sum_total|floatformat:2 }}</td>
</tr>
<tr>
<td>VAT Registration Number: 116252989</td>
<td>VAT @ {{ object.vat_rate.as_percent|floatformat:2 }}%</td>
<td>£ {{ object.vat|floatformat:2 }}</td>
</tr>
<tr>
<td>
<para>
<b>The full hire fee is payable at least 10 days before the event.</b>
</para>
</td>
<td>
<para>
<b>Total</b>
</para>
</td>
<td>
<para>
<b>£ {{ object.total|floatformat:2 }}</b>
</para>
</td>
</tr>
</blockTable>
</keepTogether>
<keepTogether>
<blockTable style="infoTable">
<tr>
<td>
@@ -157,17 +170,9 @@
<td>24 Hour Emergency Contacts: 07825 065681 or 07825 065678</td>
</tr>
</blockTable>
<blockTable style="paymentTable" colWidths="100,146,93,154">
<tr></tr>
<tr>
<td>Payment Received:</td>
<td>{{ object.payment_received }}</td>
<td>Payment Method:</td>
<td>{{ object.payment_method }}</td>
</tr>
<tr></tr>
</blockTable>
</keepTogether>
<spacer length="15"/>
<keepTogether>
<para style="blockPara">
<b>To be signed on booking:</b>
@@ -221,7 +226,7 @@
</para>
{% include "RIGS/event_print_signature.xml" %}
<spacer length="10"/>
<para style="blockPara">
<b>To be signed on the day of the event/hire:</b>
</para>
@@ -233,4 +238,6 @@
</para>
{% endif %}
{% include "RIGS/event_print_signature.xml" %}
{% include "RIGS/event_print_signature.xml" %}
</keepTogether>
<namedString id="lastPage"><pageNumber/></namedString>